in reply to Re: Bug with lists?
in thread Bug with lists?
I guess it makes sense, but I have to say that this hardly seems like DWIM behaviour...
Oh well, can't win em all can you?
UPDATE:
Ive now had a look at the section on the comma operator, but frankly I can't tell which part of the docs suggest that this behaviour is correct.
- Binary ``,'' is the comma operator. In scalar context it evaluates its left argument, throws that value away, then evaluates its right argument and returns that value. This is just like C's comma operator.
- In list context, it's just the list argument separator, and inserts both its arguments into the list.
- The => digraph is mostly just a synonym for the comma operator. It's useful for documenting arguments that come in pairs. As of release 5.001, it also forces any word to the left of it to be interpreted as a string.
This seems to suggest, given that inside of an annon array the comma's are in list context, that it should insert both of its arguments (empty agreed, so it should be undef no?) into the list. So I am still confused about this behaviour, and unconvinced that its not a bug.
I welcome further info.
Yves / DeMerphq
--
When to use Prototypes?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Bug with lists?
by merlyn (Sage) on Feb 18, 2002 at 13:48 UTC | |
by demerphq (Chancellor) on Feb 18, 2002 at 14:02 UTC | |
by tilly (Archbishop) on Feb 18, 2002 at 17:54 UTC | |
by demerphq (Chancellor) on Feb 19, 2002 at 09:11 UTC |