Steffen Schwigon skribis 2007-05-21  1:28 (+0200):
> 1. Should assigning an arrayref to an array dereference?

No, an array in list context only flattens when it has the @ sigil, or
when it is explicitly flattened with the [] postcircumfix operator, or
the | prefix operator.

>    Which Synopses describes this?

S03

> 2. Shouldn't .perl generally use parens for outputting arrays (at
>    least on the most outer level)?

No, because parens are just for grouping and controlling precedence.
They are not constructors.

Note that in this assignment,

    my @foo = @bar;

@bar is in list context. The syntax is ARRAY = LIST; and not
ARRAY = ARRAY.

Assigning an array to an array seems kind of useless to me. Binding
probably makes a bit more sense:

    my @foo := @bar;

That's ARRAY := ARRAY there, so the following should dwym:

    my @foo := [ 1, 2, 3 ];

However, this does not work with pugs, so I don't know if I am wrong, or
pugs is wrong.
-- 
korajn salutojn,

  juerd waalboer:  perl hacker  <[EMAIL PROTECTED]>  <http://juerd.nl/sig>
  convolution:     ict solutions and consultancy <[EMAIL PROTECTED]>

Reply via email to