Closed toth-istvan-zoltan closed 2 weeks ago
Plan function variants and/or syntactic sugar.
Syntactic sugar:
The fragment should have only a String in the state and the compiler should use the body of the function to set the value, the anonymous function should be removed.
This would require some checks, such as no function references allowed.
@Adaptive fun someFun(@AdaptiveSugar valueFun : () -> String) { // ... }
Variants:
@AdaptiveVariant fun someFun(i1 : Int, i2: Int) = someFun(i1 + i2) @AdaptiveVariant fun someFun(i : Int) = someFun(i, "Hello World!") @Adaptive fun someFun(i : Int, s : String) { // ... }
Moving the classes inside the functions solved the variant question.
I'll put the syntactic sugar on the shelve for now.
Plan function variants and/or syntactic sugar.
Syntactic sugar:
The fragment should have only a String in the state and the compiler should use the body of the function to set the value, the anonymous function should be removed.
This would require some checks, such as no function references allowed.
Variants: