chromatic wrote: > Jon Lang wrote: > > Ah; that clears things up considerably. If I understand you > > correctly, John is using '£' to mean "use Duck Typing here". _That_, > > I can definitely see uses for. As well, spelling it as 'like' instead > > of '£' is _much_ more readable. With this in mind, the above > > signature reads as "$p1 must be like a Point, but it needn't actually > > be a Point. Both $p2 and the return value must be the same type of > > thing that $p1 is." > > That was always my goal for roles in the first place. I'll be a little sad > if > Perl 6 requires an explicit notation to behave correctly here -- that is, if > the default check is for subtyping, not polymorphic equivalence.
By my reading, the default behavior is currently nominal typing, not duck-typing. That said, my concern isn't so much about which one is the default as it is about ensuring that the programmer isn't stuck with the default. Once it's decided that Perl 6 should support both duck-typing and nominal typing, _then_ we can argue over which approach should be the default, and how to represent the other approach. -- Jonathan "Dataweaver" Lang