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
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
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
[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,
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:
--- 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
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
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