[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Multiple assignments?



>>>>> On Fri, 14 May 1993 20:46:02 -0400, peter@robots.ox.ac.uk said:

Pete> Being able to do
Pete> 	while <={line >>> var} { echo $var }
Pete> would be brilliant.

Well, looks like that idea was shot down.  It just occured to me that
another perl-ism might also solve this nicely, namely if multiple
assignments were added to the language:  Something ala

  while <={ (status var)=%Backquote{line}; result $status } { echo $var }

In general, (a b c)=something would assign the first element to a,
the second to b, and the rest of them to c.  This syntax should not be
too hard to add and might save people from some convoluted scripting.
Heck, a useful idiom might be (x list)=$list to assign the first
element and shift the list.

Well, there it is.  Now shoot it down.  I'll enjoy the fireworks.  8-)

- Harald