You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While reading the issue discussion it made me think about how Oxpecker solve a similar problem. Instead of using members after the CE, it use properties to set information inside of the "CE constructor".
This is a really interesting approach - I hadn’t realized you could extend a type with properties and still use the object initialization syntax. That would indeed eliminate the issue with the extra parentheses.
That said, our current approach has a few advantages that I don’t think the properties approach can replicate.
One major benefit is that each extension member returns a new copy of the widget with the added modification. This makes it possible to have shared widgets that can be customized differently in various contexts. It’s particularly useful for "attached properties" (which affect parent layout), such as the grid example below.
One major benefit is that each extension member returns a new copy of the widget with the added modification.
Indeed, another advantage that I though about when writing this issue is that you can also support method overload when properties don't allow that. Could be emulated using constructor overload but the code would not be as ergonomic.
Hello,
While looking online about Fabulous I stumbled on this fslang-suggestions - Allow dot notation after body of computation expression without need for parenthesis.
While reading the issue discussion it made me think about how Oxpecker solve a similar problem. Instead of using
members
after the CE, it use properties to set information inside of the "CE constructor".This code
could be something like
I didn't test my code out as I just wanted to mention the idea
You can see some example of working code in Oxpecker repository:
The text was updated successfully, but these errors were encountered: