develooper Front page | perl.perl6.language | Postings from June 2008

possible clarification of item(), list(), etc.

From:
Patrick R. Michaud
Date:
June 21, 2008 13:56
Subject:
possible clarification of item(), list(), etc.
I think we need a slight wording improvement in S03.  Currently S03:1772
says that the C<list> contextualizer is equivalent to C<@()>.  
However, S05:2328 also says that C<@()> is a shorthand for C<@($/)>.

Taken together, these would seem to imply that C<list()> is equivalent
to C<@($/)>, which I suspect is not the case.  (I would expect
C<list()> to return an empty List.)

I'm guessing that S03 should be clarified to say something like the
list contextualizer is equivalent to C<@(...)>, to make it clearer(?)
that it's the form that expects an argument.

If the above is correct for C<list>, then similar arguments can
likely be made for C<item> / C<$()> and C<hash> / C<%()>.

On a similar vein, is C<item> a named unary?  In other words, is
C< item $a, $b >  equivalent to C< item($a), $b >  or 
C< item($a,$b) > ?

Thanks!

Pm



Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About