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
Rod Adams
March 26, 2005 11:45
Re: Parameter and trait questions - just how 'only' _is_ 'read-only'?
Message ID:
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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About