Re: Named Subroutine return values

2006-02-24 Thread Larry Wall
On Fri, Feb 24, 2006 at 04:56:40AM +, Luke Palmer wrote: : Come to think of it, that seems backwards. After all, aren't: : : my Foo $x; : my $x of Foo; : : Equivalent? Didn't answer this part... If --> and returns are different, than "of" probably sets the --> type rather than the

Re: Named Subroutine return values

2006-02-24 Thread Larry Wall
On Fri, Feb 24, 2006 at 04:56:40AM +, Luke Palmer wrote: : On 2/24/06, Damian Conway <[EMAIL PROTECTED]> wrote: : > No. One of the available TRAITS is C. So you can always : > specify a "postfix" return type, even without a declarator: : > : > sub data() returns Str {...} : > : > The de

Re: Named Subroutine return values

2006-02-23 Thread Luke Palmer
On 2/24/06, Damian Conway <[EMAIL PROTECTED]> wrote: > No. One of the available TRAITS is C. So you can always > specify a "postfix" return type, even without a declarator: > > sub data() returns Str {...} > > The declarator is only needed if you want to "prefix" your return type > (presuma

Re: Named Subroutine return values

2006-02-23 Thread Damian Conway
Joe Gottman asked: my RETTYPE sub NAME ( PARAMS ) TRAITS {...}# lexical only our RETTYPE sub NAME ( PARAMS ) TRAITS {...}# also package-scoped sub NAME ( PARAMS ) TRAITS {...}# same as "our" Note that the third possibility here does not include a return type. Doe

Named Subroutine return values

2006-02-23 Thread Joe Gottman
According to the revised Synopsis 6, named subroutines can have one of three forms: my RETTYPE sub NAME ( PARAMS ) TRAITS {...}# lexical only our RETTYPE sub NAME ( PARAMS ) TRAITS {...}# also package-scoped sub NAME ( PARAMS ) TRAITS {...}# same as "