Carl Franks skribis 2005-04-21 11:29 (+0100):
> I wish to convert these 2 subroutines to perl6:
> sub foo {
> my $self = shift;
> $self->{foo} = defined $_[0] ? shift : undef;
> }
> sub bar {
> my $self = shift;
> $self->{bar} = defined $_[0] ? shift : $DEFAULT;
> }
> Is this correct?
Thos
Are default values supported for attributive parameters in an argument list?
I wish to convert these 2 subroutines to perl6:
sub foo {
my $self = shift;
$self->{foo} = defined $_[0] ? shift : undef;
}
sub bar {
my $self = shift;
$self->{bar} = defined $_[0] ? shift : $DEFAULT;
}
Is th