Re:Bosque Programming Language
by sachinjoseph on Thursday May 14, 2020 @04:00AM
(#23176734)
The use use of '=' here scares me:
The language already supports '=' operator for assignment of variables in the current scope, so should you use the same operator for denoting value assignment formal parameters in a function call? This can lead to a lot of confusion between variables in the scope and formal parameter names in a function that is called from the current scope.
[ Parent
| on HN ]
Python, one of the most popular languages, uses this syntax, so I'm guessing the vast majority of people don't find it scary (I certainly don't).
This seems like a non issue to me and as tomp said, is already done in popular languages without problems. The third example (keyword arguments before positional) does seem a bit odd though, as interleaving positional and keyword arguments seems like a recipe for confusion, but using = for keyword arguments doesn’t seem like a problem to me.
This and a few other parts seem to be inspired by StandardML / Ocaml
Re:Bosque Programming Language
by garyclarke27 on Thursday May 14, 2020 @11:17AM
(#23180546)
I love this feature - calling named parameters is (for me) a glaring omission from Javascript (and surprisingly Typescript), I know you can define an object argument, but not many do and that’s not very elegant.