Re: Using lists containing arrays as lvalues

2005-08-29 Thread TSa
HaloO, Ingo Blechschmidt wrote: But there is a problem with the ordinary assignment form: ($head, @tail) = foo(); If the LHS is an ordinary list (i.e., if we don't use help from the grammar/macros), What is a 'ordinary List' to you? I thought (,) constructs a Lazy list? then the

Re: Using lists containing arrays as lvalues

2005-08-29 Thread Larry Wall
On Sat, Aug 27, 2005 at 08:19:00PM +0200, Ingo Blechschmidt wrote: : But there is a problem with the ordinary assignment form: : : ($head, @tail) = foo(); : : If the LHS is an ordinary list (i.e., if we don't use help from the : grammar/macros), then the @tail would get flattened before it

Using lists containing arrays as lvalues

2005-08-27 Thread Ingo Blechschmidt
about the LHS being a list of scalars (e.g. ($a, $b, $c) = foo()), this post only speaks about using lists containing @arrays as lvalues). If we generally recommend this solution especially to newbies, it has got the additional property that my ($foo, $bar) := foo

Re: Using lists containing arrays as lvalues

2005-08-27 Thread Yuval Kogman
()), this post only speaks about using lists containing @arrays as lvalues). BTW, for simplicities sake perhaps there is an MMD on infix:,, one for lvalue context, the other for read only context? discarding any additional arguments, i.e. assuming my ($foo, $bar, [EMAIL PROTECTED

Re: Using lists containing arrays as lvalues

2005-08-27 Thread Ingo Blechschmidt
Hi, Yuval Kogman wrote: On Sat, Aug 27, 2005 at 19:16:55 +0200, Ingo Blechschmidt wrote: my ($head, [EMAIL PROTECTED]) := foo(); if foo returns a list of scalars =2 this is like parameter unpacking: my ($head, [EMAIL PROTECTED]) = *foo(); [...] Right, but I wanted to drive at

Lazy Lists + Mutable Arrays + Garbage Collection

2005-04-24 Thread Brad Bowman
Hi, I've been wondering how to lazy lists will work. The answer Correctly, don't worry about it, is entirely acceptable... The intent of this example in S06 seems clear, make @oddsquares a lazily filled array of squares of odd @nums: S06/Pipe operators It [==] binds the (potentially lazy)

Re: Lazy Lists + Mutable Arrays + Garbage Collection

2005-04-24 Thread Brad Bowman
With cons based lists, past stream values are no longer referred to so can be reclaimed, but we have random access arrays. That's about where my wondering stopped. It started again. @primesquares.shift would do it Brad

Re: lists and arrays

2004-04-10 Thread Scott Walters
are essentially references. This is consistent with other languages where two things are true at the same time: 1. Arrays and such are passed by reference 1. You don't have to dereference arrays and such before using them Heh, there's that thread: It's subject was Re: Arrays, lists, referencing

lists and arrays

2004-04-09 Thread Juerd
Hi, I'm lost. I read some Perl 6 related things and think I missed an important announcement. What is a list reference? It is as if lists and arrays are the same thing in Perl 6, but other documents use the words as they are used in Perl 5. So I guess my actual questions are: What is an array