Re:Functional programming languages should be better at muta...
by bjourne on Tuesday July 30, 2024 @07:47PM
(#41115205)
I think HN ate some characters because that code doesn't look valid. But yeah, that's how you do it. In my opinion it is not pretty (e.g., what if you have some mutable context?). I also don't see how OCaml could turn the cons operations into dynamic array appends.
[ Parent
| on HN ]
Re:Functional programming languages should be better at muta...
by deredede on Wednesday July 31, 2024 @01:28AM
(#41116596)
> I think HN ate some characters because that code doesn't look valid.
The OCaml compiler disagrees with you ;)
It also won't ever turn a cons operation into a dynamic array append.