Re: RFC 57 (v1) Subroutine prototypes and parameters
[email protected] (Chaim Frenkel) 07 Aug 2000 11:35:57 -0400
| Newsgroups | perl.perl6.language.subs |
|---|---|
| Message-ID | <[email protected]> |
Think about the possiblity that flattening shouldn't be the default.
So that to get the flattening effect one would have to specify it
(or use @_ which would do the work.)
So perhaps an attribute
sub bar ($first, @rest :rest) { ... }
Then an introspective sub may be able to infer what was actually
sent on the stack.
It may be an overall win, by not flattening. It may make the work
for -internals easier. I can see it helping Damian's lazy evaluation
proposal.
<chaim>
>>>>> "PRL" == Perl6 RFC Librarian <[email protected]> writes:
PRL> Here are two more examples specifying a scalar followed by an
PRL> array/hash array to gobble up all remaining arguments.
PRL> sub bar ($first, @rest) {
PRL> ... # my ($first, @rest) = @_;
PRL> }
PRL> sub baz ($first, %rest) {
PRL> ... # my ($first, %rest) = @_;
PRL> }
--
Chaim Frenkel Nonlinear Knowledge, Inc.
[email protected] +1-718-236-0183