TSa Thomas.Sandlass-at-barco.com |Perl 6| wrote:

You are right and I didn't address this, sorry. Actually the
only solution I see is dropping the ::? twigil altogether and
specify that CLASS is lexically declared by the compiler.
Otherwise we have to make a special case exception out of
::? variables.

All twigiled variables. No longer special case: it only applies to non-qualified names with no twigil.




But doit is not a type. I think you were talking something like that earlier and I didn't follow.

It is an arrow type, like foo: Int --> Int and bar: Int --> Int.
These are structurally identical. The fun thing is that the Perl 6
type system is supposed to be nominal. Thus foo and bar are different
types. But contradictory to that you can use foo and bar wherever
an Int --> Int is expected. I love this self contradiction of Perl ;)
Well, and you can't neither use foo nor bar to denote the arrow type.

doit =has= a signature. Yes, I expect functions will be typechecked when you try and assign one to a variable that declares a function type. But the function is a value of that type, just like 5 is a value of type Int, not itself a type.

--John

Reply via email to