Steve Fink wrote:
> 
> It's already withered away some in perl5. Functions can return lists or
> scalars with no distinguishing marks, which was harmless until the
> advent of lvalue subs. Now you have $object->listmember = (1,2,3);
> $object->scalarmember = 42;. Anyone up for an RFC on allowing a leading
> @, $, or (?) % to set the context of a function call? ;-) (Maybe there's
> one already, I haven't been keeping track.)

        foo $= ( bar, quux );  # provide scalar context to both sides
        foo @= ( bar, quux );  # provide list context to both sides

        for ( foo @, bar $, quux ) {
                # iterates over foo and quux,
                # but evaluates bar before quux.
        }

This is very harmonious with the provision of two sets of operators
for numeric and string comparisons.


-- 
John Porter

        Aus tiefem Traum bin ich erwacht.

Reply via email to