[bitc-dev] Opinions wanted: Infix shift operators

Jonathan S. Shapiro shap at eros-os.org
Wed Jul 28 11:51:26 PDT 2010


On Tue, Jul 27, 2010 at 11:18 PM, Christopher Gilbreth
<cngilbreth at gmail.com> wrote:
> Hi,
> I would suggest using double square brackets [[ and ]]:
>
> int f[['a, 'b]](arg1, arg2) { ... }

Unfortunately, doubling up the brackets doesn't eliminate the
ambiguity with array indexing. You can have nested array references
too:

    a[b[i]]

I have to say that I agree with you that this is more readable.
Further, it's something we could experiment with.

At the moment, I'm still leaning toward <> because they will be
familiar to existing programmers, but this is a good idea.

> Actually, I would like to take this one step further and suggest that [[ and
> ]] be ASCII synonyms for the Unicode characters U+27E6 and U+27E7:
>
> http://www.decodeunicode.org/en/u+27e6
> http://www.decodeunicode.org/en/u+27e7

Now *that* would solve the ambiguity. But quick: where is the u+27e6
key on your keyboard?

Using this sort of thing for pretty printing and accepting it as input
is fine, but the ascii version needs to work too.

shap


More information about the bitc-dev mailing list