Hi,
TSa <Thomas.Sandlass <at> orthogon.com> writes:
> Ingo Blechschmidt wrote:
> > [EMAIL PROTECTED]; # Ref to array
> >
> > \(@array); # List of refs to @array's elements, i.e. same as
> > map { \$_ } @array;
> > # Weird (violating the "parens are only for grouping" rule), but
> > # consistent with Perl 5.
> >
> > Correct?
>
> I opt for 'no'. () should just group and \((((@array)))) is a sillily
> written arrayref. If you want @array to flatten lazily for enreferencing
> this should be \([EMAIL PROTECTED]) which works without parens as well:
> [EMAIL PROTECTED]
> ---and is one char shorter than \(@array). And of course there is eager
> flattening enreferencing: [EMAIL PROTECTED]
I like this very much! :)
> BTW, I like the ubiquitous interpretation of prefix * as infinite arity
> marker at call sites as above and in sig definitions.
I agree completely :).
I'd like to violate the "parens are only for grouping" rule only if
absolutely necessary, and make more use of prefix *.
So...:
[EMAIL PROTECTED]; # Reference to array, of course
\(@array); # same
\(((@array))); # same
\(1,2,3); # Reference to a list promoted to an array (!)
\(((1,2,3))); # same
[EMAIL PROTECTED]; # List of references to @array's elements
\*(((@array))); # same
\*(1,2,3); # List of references to @array's elements
\*(((1,2,3))); # same
Opinions?
--Ingo