fuzion icon indicating copy to clipboard operation
fuzion copied to clipboard

Re-visit syntax sugar for enum-like choice declarations? Replace or remove full-stop syntax.

Open michaellilltokiwa opened this issue 1 year ago • 1 comments

Currently it is possible to declare a choice like:

c : choice a b.

a and b are unit features that are declared automagically.

This works well if the source code is not broken but e.g. in the language server we mostly deal with broken code and want to trigger completion suggestions when user presses dot. Now we would have to figure out if this dot is a full stop or marks a call target.

michaellilltokiwa avatar Jul 11 '24 12:07 michaellilltokiwa

I think you meant

c : choice of a, b.

I am not happy about the syntax using a dot here. Maybe just requiring a verbose

a is
b is
c : choice a b is

should do

fridis avatar Jul 22 '24 08:07 fridis