All the cool kids are thinking aloud these days.  Why not jump on the
bandwagon?

Larry Wall writes:
>     * We get the cute, clean and rather more typeable
> 
>       $var<key1><key2>[3]<key3>

It looks like if you shook that up and down a bit, it would break in
half.

I wonder what would happen if we made <> a little smarter, as in:

    * <foo ; bar> acts as a multidimensional subscript (* but what for
          @array = <foo ; bar>?)
          
    * <+42> returns a number instead of a string.

Then:

    $var<foo ; bar ; +3 ; baz>

Which is certainly less noisy than the kitkat above.  Problems:

    * -foo is common for options; don't want to force a number.  Then
          again, you don't see -6 as an option too often.

    * Doesn't solve anything in the practical scenario where some of
          your keys are not constant.  But we'd, of course, do the same
          thing to ÂÂ.

However, there's a problem with ÂÂ: it doesn't generalize to non-string
keys (since Â$foo can reasonably only stringify).  That is:

    $varÂfoo ; $bar ; +3Â

Doesn't work if $bar is something unstringly that happens to be the key
type of the second dimension.

Not to mention that if we allowed semicolon, ÂÂ would be the common one
again, and we'd be in for another switcheroo.

Anyway, I think there's something wrong with:

    $var<foo><bar>[3]<baz>

It doesn't hold together visually.

This might have some relation to the other problem on my mind: the
difference between $, @, and % these days.

The rest of the proposal is pretty snazzy, though.

Luke

Reply via email to