Re: S12: can(), signatures and casting

2007-04-30 Thread Jonathan Lang
Larry Wall wrote: Maybe we need to allow the & indirection on method names too: if $obj.&fribble:(Str --> BadPoet) { -snip- Note that we already define &foo:(Int, Str) to return a list of candidates if there's more than one, so extending this from the multi dispatcher to the single dispa

Re: S12: can(), signatures and casting

2007-04-30 Thread Jonathan Lang
Larry Wall wrote: The fundamental problem here is that we're forcing a method name to be represented as a string. We're basically missing the &foo equivalent for methods. Maybe we need to allow the & indirection on method names too: if $obj.&fribble:(Str --> BadPoet) { Takes a little get

Re: S12: can(), signatures and casting

2007-04-30 Thread Larry Wall
On Sun, Apr 29, 2007 at 03:42:31AM -0700, Jonathan Lang wrote: : Ovid wrote: : >My apologies if these have been answered. I've been chatting with : >Jonathan Worthington about some of this and any misconceptions are : >mine, not his. : > : >In reading through S12, I see that .can() returns an iter

Re: S12: can(), signatures and casting

2007-04-29 Thread Brandon S. Allbery KF8NH
On Apr 29, 2007, at 6:42 , Jonathan Lang wrote: In effect, the signature gets attached as a property of the string, and 'can()' checks for the signature property. The only problem that I have with this idea is that I can't think of any uses for a "signatory string" outside of '.can()'. Maybe

Re: S12: can(), signatures and casting

2007-04-29 Thread Jonathan Lang
Ovid wrote: My apologies if these have been answered. I've been chatting with Jonathan Worthington about some of this and any misconceptions are mine, not his. In reading through S12, I see that .can() returns an iterator for the methods matched. What I'm curious about is this: if $obj.can(

S12: can(), signatures and casting

2007-04-28 Thread Ovid
My apologies if these have been answered. I've been chatting with Jonathan Worthington about some of this and any misconceptions are mine, not his. In reading through S12, I see that .can() returns an iterator for the methods matched. What I'm curious about is this: if $obj.can('fribble') {