Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion hash subscriptor
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
John Williams  
View profile  
 More options Mar 15 2004, 2:48 pm
Newsgroups: perl.perl6.language
From: willi...@tni.com (John Williams)
Date: Mon, 15 Mar 2004 11:56:26 -0700 (MST)
Local: Mon, Mar 15 2004 1:56 pm
Subject: hash subscriptor

On Wed, 10 Mar 2004, Larry Wall wrote:
> You subscript hashes with {...} historically, or these days, «...»,
> when you want constant subscripts.  So what you're looking for is
> something like:

>     if / <?foo> ... <?baz> ... { $?foo{'baz'} ... $?baz } .../
> or
>     if / <?foo> ... <?baz> ... { $?foo«baz» ... $?baz } .../

I'm probably a bit behind on current thinking, but did %hash{bareword}
lose the ability to assume the bareword is a constant string?

And why «»?  Last I heard, that was the unicode version of qw(), which
returns an array.  Using an array constructor as a hash subscriptor is
not a "least surprise" to me.

~ John Williams


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.