Deborah Ariel Pickett wrote:

I'm trying, and failing, to accurately and definitively answer the question "what's the difference between an array and a list in Perl6?"
If someone can come up with a simple but accurate definition, it would be helpful.

While I like the glib "Arrays are variables that hold lists" explanation
that worked so well in Perl5, I think that Perl6 is introducing some
changes to this that make this less true.

Like what?

For instance, the switch
statement has different rules for lists and arrays.  So these don't
necessarily do exactly the same thing in Perl6:

 # Please excuse syntax errors here, but you know what I mean
 given (1,2,3)
 {
 when $x: ....

and

 @a = (1, 2, 3);
 given @a
 {
 when $x: ...

I don't understand the difference here.  Could you elaborate?

Would there be any truth in this distinction:
- lists are ordered sets/bags/etc seen by the Perl parser
- arrays are ordered sets/bags/etc seen by the Perl interpreter
?

Where s/parser/compiler/, and s/interpretter/runtime engine/?  I
do believe that's accurate.


Joseph F. Ryan
[EMAIL PROTECTED]

Reply via email to