Slint 1.8: Math gains postfix support
Slint 1.8: Math gains postfix support
Slint is a GUI toolkit, and is largely not relevant to concatenative programming. But the latest release adds a touch of postfix to the mix, which is nice to see.
From the blog post:
Math Gains Postfix Support
A subtle but profound change to the language. Traditional syntax:
Math.max(20, Math.abs(value.x))
New postfix syntax:
value.x.abs().max(20)
The new syntax improves readability by making the transformation steps more explicit. It works well for many operations but has limitations:
Effective for simple transformations (e.g., abs, max) Less intuitive for operations like clamp or atan2.
pos.y.atan2(pos.x) // Less clear than atan2(pos.y, pos.x)
So for now you cannot use postfix for all functions in the Math namespace. We may revisit these cases later, so give them a try and let us know your thoughts.
0
comments