RE: arrays, hashes unified indexing syntax impact on future varia tion s on other collection types

2003-02-02 Thread John Williams
Because some things have both, and do different things with each. Ok $0 is special. But isn't it _the_ special case? And strictly speaking, its an ordered associative array right? It doesn't really need the full range of expression offered by $0{...} and $0[...]. All it needs is $0[1] for

Re: summarizing the obvious (was: arrays, hashes unified ...)

2003-02-02 Thread Sam Vilain
On Sat, 01 Feb 2003 06:40, Garrett Goebel wrote: Or for the extremely thick: GOOD: Separate syntax for indexed vs. named lookups BAD: Same syntax with = 2 contextual meanings Or, another way to look at it; GOOD: flexible, re-usable code that doesn't care if you change the key type

Re: arrays, hashes unified indexing syntax impact on future varia tion s on other collection types

2003-02-02 Thread Richard J Cox
On Thursday, January 30, 2003, 7:44:42 PM, you (mailto:[EMAIL PROTECTED]) wrote: On Thu, 2003-01-30 at 13:13, Garrett Goebel wrote: Let me switch that one around for you: class MyContainer { method index($object) { ... } # index by any scalar object method

Re: Arrays: is computed

2003-02-02 Thread Jim Cromie
[EMAIL PROTECTED] wrote: Shouldn't access to 'is computed' arrays be read-only? If you want to be able to consume the elements by shifting, you can always create a tied object that kees a cursor and a reference to the underlying array and gives you that access (and it could die for splicing,

Shortcut: ?=

2003-02-02 Thread Miko O'Sullivan
SUMMARY C$var ?= $x : $y as a shortcut for C$var = $var ? $x : $y. DETAILS We have ||=, +=, -=, etc. These shortcuts (I'm sure there's some fancy linguistic term for them) save us a few keystrokes and clean up the code. So, concerning C? :, I find myself doing this type of thing a lot:

Re: Shortcut: ?=

2003-02-02 Thread Mr. Nobody
--- Miko O'Sullivan [EMAIL PROTECTED] wrote: SUMMARY C$var ?= $x : $y as a shortcut for C$var = $var ? $x : $y. DETAILS We have ||=, +=, -=, etc. These shortcuts (I'm sure there's some fancy linguistic term for them) save us a few keystrokes and clean up the code. So, concerning

Re: Shortcut: ?=

2003-02-02 Thread Deborah Ariel Pickett
SUMMARY C$var ?= $x : $y as a shortcut for C$var = $var ? $x : $y. DETAILS We have ||=, +=, -=, etc. These shortcuts (I'm sure there's some fancy linguistic term for them) save us a few keystrokes and clean up the code. So, concerning C? :, I find myself doing this type of thing a

Re: Shortcut: ?=

2003-02-02 Thread Joseph F. Ryan
Miko O'Sullivan wrote: SUMMARY C$var ?= $x : $y as a shortcut for C$var = $var ? $x : $y. DETAILS We have ||=, +=, -=, etc. These shortcuts (I'm sure there's some fancy linguistic term for them) save us a few keystrokes and clean up the code. So, concerning C? :, I find myself doing this