On Thu, Sep 02, 2004 at 08:34:22PM -0400, Joe Gottman wrote:
: Is there similar shorthand to set @foo = (5, 3, 3, 2, 1) ?  I know you can
: go
: 
:             @foo = reverse (1 ..5);
: 
: but this has the major disadvantage that it cannot be evaluated lazily;
: reverse has to see the entire list before it can emit the first element of
: the reversed list.

I don't see any reason why it can't be evaluated lazily.  The .. produces
a range object that gets shoved into the lazy list that gets bound to
the slurp array of reverse().  If you pop that, there's no reason it
couldn't go out and ask the end of the lazy list for its last element.
Just have to make .. objects smart enough to deal off either end of
the deck.

Larry

Reply via email to