On Wed, 14 Apr 2004, Juerd wrote:
> I propose to use ` as a simple hash subscriptor, as an alternative to {}
> and <<>>. It would only be useable for \w+ keys or perhaps -?\w+. As
> with methods, a simple "atomic" (term exists only in perlreftut, afaix,
> but I don't know another word to describe a simple scalar variable)
> scalar should be usable too.
>
> can then also be written as:
>
> %hash`key
ugly.
> $hashref`foo`bar`baz`quux
ugly ugly ugly
> %hash`$key
oops, you contradicted yourself here. "only be useable for \w+ keys"
> With some imagination, this can also be used for arrays. That would need
> to allow the key to have /^-/ and it poses a problem with hybrids like
> $0. Normally []/{} decides whether it's a hash or array dereference, but
> for this easy-to-write thing a /^-?\d+$/ should be doable. After all, []
> and {} are still available if you need to be explicit.
>
> $0`15 # $0[15]
> $0`alpha # $0{'alpha'}
You are repeating the errors of javascript. $0[15] != $0{15}
> :key`value
> use Some::Module :foo :bar :baz`quux :xyzzy;
I think I would prefer something more intuitive, like :baz=quux
Any [^\w\s] character could be used there unambiguously, and = has the
already existing parallel with command-line args, but ` is just an unused
character.
> and ` is in an extremely easy to type place.
... on a us/english keyboard ...
> I think %hash`key makes sense. But I'd like to find out if more people
> like this idea.
one emphatic negative vote here.