Phoenix.pm: ` as hash subscript patch
Scott Walters
scott at illogics.org
Sat Apr 17 16:43:49 CDT 2004
For your perverse pleasure/pediantic pain:
----- Forwarded message from Matthijs van Duin <p6 at nubz.org> -----
List: contact perl6-language-help at perl.org; run by ezmlm
Subject: Re: backticks
Date: Wed, 14 Apr 2004 20:57:57 +0200
From: Matthijs van Duin <p6 at nubz.org>
On Wed, Apr 14, 2004 at 02:18:48PM +0200, 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.
>
> %hash`key
> $hashref`foo`bar`baz`quux
> %hash`$key
> $object.method`key
I absolutely love it. Since hashes are used so much, I think it deserves
this short syntax. Note btw that it's not even mutually exclusive with qx's
use of backticks. To illustrate that, see:
http://www.math.leidenuniv.nl/~xmath/perl/5.8.3-patches/tick-deref.patch
It's a quick patch I made that adds the `-operator to perl 5.8.3, so you
can try it how it "feels".
>With some imagination, this can also be used for arrays.
I like that too. (though not (yet) implemented in my patch)
--
Matthijs van Duin -- May the Forth be with you!
----- End forwarded message -----
More information about the Phoenix-pm
mailing list