No subject

Cameron Purdy cameron.purdy at gmail.com
Wed Apr 11 18:29:35 UTC 2018


(Apologies for not being able to respond to an existing thread without
reverse engineering the mailing list daemon.)

Suggestions:

1) Keep the design simple.

2) When you are creating something new and are in doubt as to whether to
validate bad design decisions from 40 years ago, do not keep old stuff just
for the sake of keeping old stuff.

3) With lambdas, any arbitrarily complex amount of code can be placed into
a lambda, so a switch expression does not need to support directly embedded
statements (assuming a lambda expression can be invoked as part of the
expression).

(And apologies in advance for the HTML below which may cause horrible side
effects for the text mode mailing list daemon.)

// suggestions for Java Amber "switch expression" project
// building on constructs from the JLS 8 section 14.11: "The switch Statement"

SwitchExpression:
    switch ( Expression ) SwitchExpressionBlock

SwitchExpressionBlock:
    { {SwitchExpressionBlockGroup} {SwitchLabel} }

SwitchExpressionBlockGroup:
    SwitchLabels Expression ;


More information about the amber-spec-observers mailing list