On Fri, Apr 16, 2004 at 01:17:10PM -0700, Brent 'Dax' Royal-Gordon wrote: > I don't claim that they won't be used often. I claim that the *best* > solution is to fix the syntax we already have, not add more. Failing > that, we should make sure that the syntax we add is as globally useful > as possible. The form of backticks you're proposing are good for only > one thing: indexing hashes (and possibly arrays). Clever definition of > the colon operator, or creation of a bareword-quoting operator, would > allow you to use "barewords" anywhere you wanted to.
Hmm. Who's to say that ` isn't the bareword-quoting operator? (This is where Larry chimes in with "*I* say it isn't so" :-) I'm not sure what fixing the existing syntax would mean. A big advantage of %hash`foo for me is that the delimiters (all 4 of them) are gone. Can you "fix" the syntax and remove the delimiters? I think these things are irreconcilable in your universe (since you seem to want to keep the curlies) > The complications I see are in things like: > > To get an item out of a hash, you can write %varname{"key"}. > You can also write %varname<<key>> if there aren't any spaces in > the key. Finally, if the key doesn't have any characters in it > except for letters, numbers and underscores, you can write > %varname`key. Except that you've put things in this explanation that shouldn't be there IMHO. The %varname<<key>> is a special case, but not of "getting a single item from a hash", rather it's a special case of a one element list generated from << >> evaluating to the element. So, if you remove that bit, it's the same as the two below just with different syntax. > Compare that to (assuming barewords are allowed in hash indexers): > > To get an item out of a hash, you can write %varname{"key"}. If > the key doesn't have any characters in it except for letters, > numbers, and underscores, you can write %varname{key}. > > Or, with the colon proposal: > > To get an item out of a hash, you can write %varname{"key"}. If > the key doesn't have any characters in it except for letters, > numbers, and underscores, you can write %varname{:key}. > > Which explanation is shorter? Which is more logical? Which has the > fewest special cases? All of them! The last two seem to imply that %hash<<foo>> will be going away and it doesn't look like it will at all. To be fair each of those descriptions should mention %hash<<foo>> if the first one does. > I'm going to throw in one more argument at this point. It's based on a > game you all played as children: Which One Of These Doesn't Belong? > > &stuff(1) > @stuff[1] > %stuff{1} > %stuffï1ï > %stuff`1 I have nothing to say to this other than "so what?" Really, does it matter that much? Are delimiters really that important here? -Scott -- Jonathan Scott Duff [EMAIL PROTECTED]