4 ms·
In pure functional programming, = = = (bindings are unmodifiable, and it's easier to substitute equals for equals). The assignment operator should have been <
by danidiaz 11y ago
In pure functional programming, = = = (bindings are unmodifiable, and it's easier to substitute equals for equals).
The assignment operator should have been <- or something other than = from the beginning. I wonder if there was some discussion about that, back in the day?
- talaketu 11y agoas it was in algol day. :=
- gaius 11y agoOr in many functional languages you might say something like a <- 5 Which is quite intuitive.
- jsnell 11y agoBack in the day a large proportion of languages used = for equality and something else for assignment. That something else might have been e.g. * := (Algol-style :=, not Go-style). * A non-ASCII arrow character (surprisingly not always a <- 1, but sometimes 1 -> a) * A keyword (SET a TO 1) So yes, there was certainly a lot of discussion about it, but in the end this is also just a minor design detail. It's just an accident of history that we ended up with =- as-assignment being the norm.