> -----Original Message----- > From: Juerd [mailto:[EMAIL PROTECTED] > Sent: Thursday, 15 April, 2004 05:09 PM > To: Dave Mitchell > Cc: [EMAIL PROTECTED] > Subject: Re: backticks > > > Dave Mitchell skribis 2004-04-15 21:56 (+0100): > > If hypothetically we *are* going to have a simplfied constant-index hash > > access syntax, is there any reason why we can't use a single quote (') > > rather than backtick ('), akin to the Perl4-ish package separator, > > ie %foo'bar rather than %foo`bar? > > Yes, there is one. It is a problem that the Perl4-ish package separator > causes in Perl 5 already. One that bites many coders: > > "Eat at $joe's" > > means in Perl 5: > > "Eat at $joe::s" > > would mean in Perl 6 if we used the ' for hash subscripts: > > "Eat at $joe{'s'}" > > Apostrophes are needed in text. Many languages use them to mark the > absence of some letters. I don't know of any such use of the backtick, > except by people new to computers who use them as if they are > apostrophes :) > > I dislike the attempt at getting balanced quotes in ASCII that involves > ` and ', but it shouldn't be a problem as that in normal use always > follows whitespace or at least interpunction.
If we're going to entertain alternatives, why not use % as the hash subscriptor? To borrow from another thread: %foo%monday%food = 10; %foo%monday%travel = 100; %foo%tuesday%food = 10; %foo%tuesday%travel = 150; This has the advantage of ensuring that the hash-marker [1] appears in every hash reference, and doubles up on the "path weight" of a single character, for really good Huffman. I'm not so much of a user of the modulus operation that I'm unwilling to exchange it for, e.g. C<mod> or C<+%>. I don't know about other conflicting uses of %, especially involving special no-comma-required rules, but I'll bet that if there was one such, a whitespace rule would disambiguate it. (E.g., %functions{'print'} %handles{'stderr'}, ...) I doubt if this would work quite as well in p5, though, since the presumption of % isn't so high. =Austin [1] The "hash marker", for allegorical reasons, really should be either '#' (Unix) or '-' (American Football). I wonder if it's too late to reclaim '#'. Perhaps % could indicate comments... :-) :-) :-)