The prefix symbol
Reinier Zwitserloot
reinier at zwitserloot.com
Tue Jun 21 02:25:51 PDT 2011
That US-International style keyboard mode is something I believe we should
ignore. Programming with that feature on is impossible anyway, i.e. "e"
actually turns into ë", because the single quote means the same thing as ^
in your example, except for umlauts.
--Reinier Zwitserloot
On Mon, Jun 20, 2011 at 11:10 PM, John Nilsson <john at milsson.nu> wrote:
> Actually. On a Swedish keyboard this is harder still to type. It is the
> same
> key sequence that would produce } on a US layout. BUT it is not standalone
> so it won't show until you combine it with another letter or a space.
>
> Examples
>
> Shift+^ and then a = â
>
> Shift+^ and then space = ^
>
> You can't do Shift+^ and then ( either, not on Ubuntu at least, because
> that
> results in super script. ⁽
>
>
> BR,
>
> John
> Den 20 jun 2011 22:26 skrev "Yuval Shavit" <yshavit at akiban.com>:
> > Not a huge deal, but for those of us with not-very-big hands, # is easier
> to
> > type than ^.
> >
> > On Mon, Jun 20, 2011 at 4:19 PM, Pavel Minaev <int19h at gmail.com> wrote:
> >
> >> I would prefer to see "^" instead:
> >>
> >> ^x -> x + 1
> >>
> >> ^(x) { return x + 1; }
> >>
> >> ^{ x -> x + 1 }
> >>
> >> The main reason is actually purely subjective preference for the look: I
> >> feel that it is less visually noisy than "#", where the latter gives
> undue
> >> weight to the start marker of the lambda, and not to the important parts
> of
> >> it (i.e. argument list and body). At the same time, "^" sits rather
> above
> >> the baseline of the text, making it easy to distinguish when you are
> >> actually scanning for the beginning of the lambda.
> >>
> >> The secondary reason is that "^" remotely resembles the lambda
> character,
> >> so
> >> it is somewhat mnemonic.
> >>
> >> To the best of my knowledge, there are no parse problems here - while
> "^"
> >> is
> >> an existing binary operator, there are no contexts in which it could be
> >> confused for the above syntax.
> >>
> >> A potential disadvantage is that "^" already means xor, and is being
> reused
> >> here for a completely unrelated thing. But I think that xor is very
> >> infrequent in typical Java code, and so there is little potential for
> >> confusion here.
> >>
> >> On Mon, Jun 20, 2011 at 10:54 AM, Stephen Colebourne
> >> <scolebourne at joda.org>wrote:
> >>
> >> > The four syntax families split into two types, those with a prefix
> >> > symbol and those without.
> >> >
> >> > The prefix symbol is commonly mentioned as #:
> >> >
> >> > #(x) { return x + 1; }
> >> > #{x -> x + 1}
> >> >
> >> >
> >> > *** If you have a strong desire to see any symbol other than #
> >> > considered then please respond to this thread. ***
> >> >
> >> > - Your reply MUST specify the symbol
> >> > - Your reply MUST give a brief justification
> >> > - Your reply MUST repeat the two examples above using your preferred
> >> symbol
> >> > - You SHOULD try to ensure that your alternate symbol choice would
> >> > parse acceptably
> >> > - You MAY reply to suggest a keyword, however you should expect that
> >> > to be rejected
> >> >
> >> > Thread rules:
> >> > - Only reply if you prefer your alternate symbol to #
> >> > - To discuss something, change the thread title
> >> > - Don't reply just to say "I don't want a prefix symbol"
> >> > - Responding with a symbol suggestion doesn't preclude your first
> >> > choice actually being "no prefix symbol"
> >> >
> >> > For example, my preferred choice of prefix symbol is #, thus I should
> >> > not respond to this thread!
> >> >
> >> > Stephen
> >> > (this is an experiment to see if we can focus on one particular
> >> > discussion element at a time)
> >> >
> >> >
> >>
> >>
> >
>
>
More information about the lambda-dev
mailing list