On Thu, Sep 16, 2004 at 01:44:03PM -0500, Jonathan Scott Duff wrote: : On Thu, Sep 16, 2004 at 10:07:29AM -0700, Larry Wall wrote: : > I like $-, $+, and $? the best. Probably should save $- and $+ for something : > complimentary, which leaves $?. It's visually distinctive, and recently : > came available. :-) : : Speaking of which ... why is it that $?foo and <?foo> became $<<foo>> : and <<foo>> respectively?
Mostly because I got tired of seeing too many question marks meaning too many things in too many rules. And because the original notion was that the question mark in $?foo indicated a hypothetical variable, which turned out to be mostly orthogonal to whether a variable was stored in $0, so the C<?> ended up indicating nothing questionable. And because it's really kind of bogus to use variable notation for things that aren't really variables anyway. And because it worked out to be the same notation for the C<$0«foo»> syntax and the C<$«foo»> shorthand syntax on the lookup end of things. And because I didn't want the capturing form of rules to be longer than the non-capturing form (ignoring the issue of Texas quotes). And I wanted to make it so that any angle rule could turn into a capture rule. Even if we allowed C<?> to prefix any other assertion like C<!>, it's just more visual noise, unlike brackets which kind of cancel each other out visually and make a nice "pill". So just as [] turn into () to capture into an array, <> turn into «» to capture into a hash, where we already use «» notation for constant keys. Plus I figured we might have some other good use for $?foo some day. Other than that, no good reason, just a gut feeling. Larry