Re: Quick question on subroutine declaration syntax

2001-11-07 Thread Larry Wall
Brent Dax writes: : Larry Wall: : # Note that the "sub" is standing in for &, so it'd have to be : # : # my Dog sub hot {...} : # : # or : # : # my Dog &hot {...} : : What about package subs? : : our Dog sub hot {...} : : seems just a bit verbose... Seems to me that discouraging

RE: Quick question on subroutine declaration syntax

2001-11-07 Thread Brent Dax
Larry Wall: # Note that the "sub" is standing in for &, so it'd have to be # # my Dog sub hot {...} # # or # # my Dog &hot {...} What about package subs? our Dog sub hot {...} seems just a bit verbose... --Brent Dax [EMAIL PROTECTED] Configure pumpking for Perl 6 When I take a

Re: Quick question on subroutine declaration syntax

2001-11-07 Thread Larry Wall
: Personally I suspect he may prefer to stick with "type-before-name": : : my Dog $spot; : : sub Dog hot {...} Note that the "sub" is standing in for &, so it'd have to be my Dog sub hot {...} or my Dog &hot {...} To get a dollarless variant of Perl it may suffice to

Re: Quick question on subroutine declaration syntax

2001-10-30 Thread Damian Conway
Aaron wrote: > > sub foo (@args) -> rettype > > Hmm... I would have expected "is" to come in here: > >sub foo (@args) is IO::Handle It would have to be: sub foo (@args) is type(IO::Handle) or something, I think. Unless Larry decides that every class/module name i

Re: Quick question on subroutine declaration syntax

2001-10-30 Thread Aaron Sherman
On Tue, Oct 30, 2001 at 03:59:30PM +1100, Damian Conway wrote: > (Though I *do* harbour a secret desire to resurrect -> as a type specifier: > > sub foo (@args) -> rettype Hmm... I would have expected "is" to come in here: sub foo (@args) is IO::Handle > my $bar -> int; H

Re: Quick question on subroutine declaration syntax

2001-10-29 Thread Damian Conway
> For a typed subroutine with named parameters, is the declaration syntax > (sans property declaration) going to be: > >'sub' type ident '(' paramlist ')' block > > (in, say, Parse::RecDescent)? I'm thinking about how to add subroutines > to BabyPerl*, and I need to k

Quick question on subroutine declaration syntax

2001-10-29 Thread Brent Dax
For a typed subroutine with named parameters, is the declaration syntax (sans property declaration) going to be: 'sub' type ident '(' paramlist ')' block (in, say, Parse::RecDescent)? I'm thinking about how to add subroutines to BabyPerl*, and I need to know if I'm at least right about