[gathering-options] Arrow symbol
Rémi Forax
forax at univ-mlv.fr
Fri Jun 24 01:28:24 PDT 2011
On 06/24/2011 04:20 AM, Ola Bini wrote:
> Stephen
>
> I don't know if this is a valid thing to say based on your rules, but
> the pipe symbol is going to be quite hard to use for the first { }
> syntax, since it is ambiguous with the binary or operator. That
> ambiguity should be possible to resolve from a semantic perspective,
> since a lambda taking one argument will always be assigned to a SAM with
> one argument type, but I assume that such semantic resolution will
> happen way after parsing time.
>
> Cheers
Hi Ola,
you are right, there is an ambiguity if there is no prefix symbol like '#'
in front of the curly braces.
And mixing the parsing and the semantics resolution is not in Java gene.
Rémi
> On 2011-06-23 14.55, Stephen Colebourne wrote:
>> Summary after 1 day of "gathering options":
>>
>> (I've added more examples, using what I believe to be reasonable
>> variants of two syntax families, please don't argue too much based on
>> the rest of the syntax I used, just focus on the "arrow")
>> ----------------------------------------
>> Standard single line examples:
>> Use ->
>> {x -> x + 1}
>> (x) -> {x + 1}
>>
>> Use =>
>> {x => x + 1}
>> (x) => {x + 1}
>>
>> Use :
>> {x : x + 1}
>> (x) : {x + 1}
>>
>> Use |
>> {x | x + 1}
>> (x) | {x + 1}
>>
>> ----------------------------------------
>> Alternate single line examples:
>> Use ->
>> { -> 42}
>> {x -> {y -> x + y}}
>>
>> () -> {42}
>> x -> {y -> {x + y}}
>> x -> y -> x + y
>>
>> Use =>
>> { => 42}
>> {x => {y => x + y}}
>>
>> () => {42}
>> x => {y => {x + y}}
>> x => y => x + y
>>
>> Use :
>> { : 42}
>> {x : {y : x + y}}
>>
>> () : {42}
>> x : {y : {x + y}}
>> x : y : x + y
>>
>> Use |
>> { | 42}
>> {x | {y | x + y}}
>>
>> () | {42}
>> x | {y | {x + y}}
>> x | y | x + y
>>
>> ----------------------------------------
>> Multi-line examples:
>> Use ->
>> {x, y ->
>> if (x> y) {
>> return x;
>> }
>> return y;
>> }
>>
>> Use =>
>> {x, y =>
>> if (x> y) {
>> return x;
>> }
>> return y;
>> }
>>
>> Use :
>> {x, y :
>> if (x> y) {
>> return x;
>> }
>> return y;
>> }
>>
>> Use |
>> {x, y |
>> if (x> y) {
>> return x;
>> }
>> return y;
>> }
>>
>> ----------------------------------------
>> - This thread is for GATHERING OPTIONS, not voting or discussing.
>> - You should only suggest an option if you personally prefer it to the
>> -> or => symbol
>> - You MUST include the two (original) examples converted to use your
>> preferred symbol
>> - Suggesting a symbol does not imply that you want any syntax with an
>> arrow (ie. you can prefer strawman family, but suggest an arrow
>> symbol)
>> - Don't reply just to say "I don't want an arrow symbol"
>> - Don't reply to propose a syntax that is completely different to one
>> of the four syntax families
>>
>> This is the *final call* for arrow proposals.
>>
>> Stephen
>>
>>
>
More information about the lambda-dev
mailing list