Newsgroups: perl.perl6.internals Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!nntp.perl.org Return-Path: Mailing-List: contact perl6-internals-h...@perl.org; run by ezmlm Delivered-To: mailing list perl6-intern...@perl.org Delivered-To: perl6-intern...@perl.org In-Reply-To: <20040106213137.GA4248@alibi.simon-cozens.org> References: <20040106170516.GA2013@alibi.simon-cozens.org> <2885C7C6-4081-11D8-9A58-000393A6B9DA@mac.com> <20040106195051.GA6914@alibi.simon-cozens.org> <3E36D3A8-408F-11D8-ACA8-000393A6B9DA@mac.com> <20040106213137.GA4248@alibi.simon-cozens.org> Mime-Version: 1.0 (Apple Message framework v606) Content-Type: text/plain; charset=US-ASCII; format=flowed Message-ID: Content-Transfer-Encoding: 7bit Cc: perl6-intern...@perl.org, ponie-...@perl.org Subject: Re: References to hash elements? Date: Tue, 6 Jan 2004 14:15:27 -0800 To: Simon Cozens X-Mailer: Apple Mail (2.606) X-Spam-Check-By: one.develooper.com X-Spam-Status: No, hits=-3.1 required=7.0 tests=CARRIAGE_RETURNS,IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,SPAM_PHRASE_01_02,USER_AGENT_APPLEMAIL version=2.44 X-SMTPD: qpsmtpd/0.26, http://develooper.com/code/qpsmtpd/ Approved: n...@nntp.perl.org From: jcli...@mac.com (Jeff Clites) Lines: 32 On Jan 6, 2004, at 1:31 PM, Simon Cozens wrote: > Jeff Clites: >> But here what I'm copying is the _contents_ of the hash slot. > > True, but irrelevant. :) > >> And here I'm not making a copy, but also the thing I'm taking a >> reference to is not the same thing I copied above. Here, it's a >> reference to a hash slot. > > No, it isn't. It's a reference to a PMC. The fact that that PMC happens > to be pointed to by a hash key is incidental. It's still just another > PMC. > No special case at all. Oh, I see what you are saying. I was misinterpreting what \$hash{bar} is supposed to do. (I was thinking there was supposed to be some new way to reference a hash slot, such that assigning to the reference [or dereferencing and assigning] would be equivalent to using $hash{bar} as an l-value.) (But saying something is a PMC doesn't clarify anything--basically everything ends up being a PMC. PerlStrings are PMCs, hashes are PMCs; we have reference PMCs.... If we had a reference-to-a-hash-slot, that would be a PMC also probably. So your original post threw me off track when you referred to "a PMC rather than an immediate value".) But I get it now--thanks! JEff