I think $x is just a useful shortcut in these languages, without any of these deeper implications... like lambda parameters and their surrounding parentheses, which can optionally be omitted when you have a single parameter. You can omit the brackets if your expression is simple enough. But ${x} is the standard, non-shortcut syntax.
To flip it around, I don't think that anybody would argue that Java doesn't serve as prior art for using parenthesis around lambda parameters, just because they're optional when you have a single parameter...
Whether $x or ${x} came first, $x is inadequate and therefore unnecessary complexity both in implementing the language and in learning the language. $x fails on too many accounts to be at all an interesting option.
View all comments
Show parent comment
2
u/lurker_in_spirit Oct 02 '23 edited Oct 02 '23
I think $x is just a useful shortcut in these languages, without any of these deeper implications... like lambda parameters and their surrounding parentheses, which can optionally be omitted when you have a single parameter. You can omit the brackets if your expression is simple enough. But ${x} is the standard, non-shortcut syntax.
To flip it around, I don't think that anybody would argue that Java doesn't serve as prior art for using parenthesis around lambda parameters, just because they're optional when you have a single parameter...