Re:DBase: 1979-2026
by selcuka on Tuesday May 12, 2026 @09:57PM
(#48116950)
Splitting = and := is intentional, but not for the reason you stated. We could have used := for all assignments from the beginning:
or
I agree that this would require blurring the statement/expression distinction. You can still do that in a weird way, by disguising your assignment as an expression. This is valid:
The reason it was done that way because := was an afterthought, and making it the assignment operator would have introduced a breaking incompatibility. That lead to having 3 different symbols for 2 use cases (assignment and comparison).
[ Parent
| on HN ]
except if := was the default then accidentally typing ":=" instead of "==" would be the easy bug to make.
:= was bolted on after of course, and I think that was a mistake, but no one asked me, nor do I expect anyone to ;P