'Some people say a ... is a value.' => 'l'
'Some people say a ... is a variable.' => 'a'
Badly formed question (based on weak source text). Any answer is correct because the very fact of answering the question means at least one person says it.
'You put things into ... context.' => 'l'
s/put things into/evaluate expressions in/
Expressions are evaluated in a context, not put into a context. For example, the expression "@array" evaluates to something based on context. It doesn't evaluate to something that's put into scalar context. (What would that something be? Can't be a list, cause there's no such thing as a list in scalar context.)
perlsub uses the correct terminology.
'You initialize a ... with a list.' => 'a'
You can also initialize a list with a list.
'You initialize an array with a ... ' => 'l'
In theory, I find perfectly acceptable to read "@a=@b" as "initializing array @a with array @b", so both answers would be acceptable to me.
In practice, the implementation of aassign would determine whether you can assign an array to an array.
'You "foreach()" across a ... ' => 'l'
In theory, that is the view that's presented.
In practice, not necessarily. There are many different for loops. Some don't create a list (such as for (x..y) and for (@array)), and one iterates over an array (for (@array)).
Note that you used the practical answer earlier and the theoretical answer here, which just adds to the confusion.
'A ... in scalar context behaves like the number of elements in it.' => 'a'
s/behaves like/evaluates to/, like above.
In reply to Re: Lists and Arrays and Boredom
by ikegami
in thread Lists and Arrays and Boredom
by carol
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |