develooper Front page | perl.perl6.language | Postings from March 2005

Re: Parameter and trait questions - just how 'only' _is_ 'read-only'?

Thread Previous | Thread Next
From:
Rod Adams
Date:
March 26, 2005 11:45
Subject:
Re: Parameter and trait questions - just how 'only' _is_ 'read-only'?
Message ID:
4245BBE9.1050908@rodadams.net
Chip Salzenberg wrote:

> * As far as I can tell, the choice of spelling an array parameter
>   C<Array @a> or C<Array $a> is entirely cosmetic: both @a and
>   $a are capable of holding an Array reference.  Is there actually
>   a difference, e.g. in how they handle an undefined value?
>  
>
Uhm... It was my impression that one of those creates an Array of 
Arrays, and the other just an Array. In other words, using @ instead of 
$ puts a "Array of" in front of the supplied type.

This makes sense when one considers orthogonality with C<Int @a> and 
C<Int $a>. But it's easy to get tripped up it.

-- Rod Adams

(Who needs more days in the week, so he can continue work on S29).

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About