Open tronical opened 1 year ago
Local variables might make some sense. But i would be hesitant to implement for
loop.
Our strategy had been to keep the language intentionally simple because the actual logic should be written in native code.
We would need to decide a syntax for it.
I'd go with let
as this is the same syntax as rust and typescript.
let foo : string = "123";
(type annotation optional)
I agree with this. Having variables is useful sometimes, but Slint shouldn't really go deeper than that, and let the backend language handle that.
Maybe variable <string> foo: "bar";
? That would align with the property syntax a bit more closely.
Or var <string> foo: "bar";
?
The code for the timer picker #5087 would also profit from local variables.
Discussed in https://github.com/slint-ui/slint/discussions/2751