Re: routine arrow syntax and return/of types

2009-03-22 Thread Jon Lang
Darren Duncan wrote: > Jon Lang wrote: >> Spitballing here: you drew an analogy to the feed operators.  I wonder >> if that analogy could be taken further: use --> and <-- outside of >> signatures as feed operators - but instead of feeding arrays back and >> forth, have them feed capture objects an

Re: routine arrow syntax and return/of types

2009-03-20 Thread Darren Duncan
Jon Lang wrote: And AFAIK the token --> is used in exactly one place in perl 6: within signature syntax, to mark the transition from the parameter signature to the "return type" signature. As with Darren, I don't see why this would be a big problem. The biggest stumbling block that I can think

Re: routine arrow syntax and return/of types

2009-03-19 Thread Jon Lang
Darren Duncan wrote: > Maybe the problem is a technicality with the parser because ... > > I'm guessing that the problem is that until you see the <-- then what you've > read so far on its left is ambiguous as to whether it is a result type or a > parameter.  I can understand that but I don't know

Re: routine arrow syntax and return/of types

2009-03-19 Thread Darren Duncan
Larry Wall wrote: On Thu, Mar 19, 2009 at 02:18:35PM -0700, Darren Duncan wrote: Yes, --> is the "of" type, not the "as" type, as S02 I think says. Good to know. Second, since the "sub NAME (PARAMS --> RETTYPE) {...}" form looks nice visually, I would like to request a variant of that form,

Re: routine arrow syntax and return/of types

2009-03-19 Thread Larry Wall
On Thu, Mar 19, 2009 at 02:18:35PM -0700, Darren Duncan wrote: > I have a question and a request. > > In http://perlcabal.org/syn/S06.html#Named_subroutines it says: > > The general syntax for named subroutines is any of: > > my RETTYPE sub NAME ( PARAMS ) TRAITS {...}# lexical only >

routine arrow syntax and return/of types

2009-03-19 Thread Darren Duncan
I have a question and a request. In http://perlcabal.org/syn/S06.html#Named_subroutines it says: The general syntax for named subroutines is any of: my RETTYPE sub NAME ( PARAMS ) TRAITS {...}# lexical only our RETTYPE sub NAME ( PARAMS ) TRAITS {...}# also package-scoped