On Mon, Aug 07, 2000 at 02:35:50PM -0000, Perl6 RFC Librarian wrote:
> sub foo ($x, $y) {
> ...
> }
>
> This would be equivalent to the Perl 5 construct:
>
> sub foo ($$) {
> my ($x, $y) = @_;
> }
This and
> Default values could also be provided in subroutine prototypes.
>
> sub wiz ($first, $second, $third = 5, $fourth = 7) {
> ...
> }
this, yes.
The rest, I'm not so sure about.
> or instead with named parameters. But how exactly? One candidate for
> the calling convention would be:
>
> # common Perl 5 form, '=>' implies LHS is quoted
> foo(x => 10, y => 20);
Just thinking out loud ...
foo( $x:10, $y:20 );
foo( [ x => 10 ], [ y => 20 ] );
foo( { x => 10, y => 20 } );
foo( $x'10, $y'20 ); # Gone are the days of perl4
foo( $x|10, $y|20 );
-Scott
--
Jonathan Scott Duff
[EMAIL PROTECTED]
- RFC 57 (v1) Subroutine prototypes and parameters Perl6 RFC Librarian
- Re: RFC 57 (v1) Subroutine prototypes and paramet... Jonathan Scott Duff
- Re: RFC 57 (v1) Subroutine prototypes and par... Jacob Davies
- Re: RFC 57 (v1) Subroutine prototypes and... Bart Lateur
- Re: RFC 57 (v1) Subroutine prototypes and paramet... Bart Lateur
- Re: RFC 57 (v1) Subroutine prototypes and par... Chaim Frenkel
- Re: RFC 57 (v1) Subroutine prototypes and paramet... Chaim Frenkel
- Re: RFC 57 (v1) Subroutine prototypes and paramet... Piers Cawley
- Re: RFC 57 (v1) Subroutine prototypes and par... Piers Cawley
- Re: RFC 57 (v1) Subroutine prototypes and paramet... Damian Conway
- Re: RFC 57 (v1) Subroutine prototypes and par... Bart Lateur
- Re: RFC 57 (v1) Subroutine prototypes and... Jacob Davies
