4 ms·
> why the hell would you design a language and not use "=" as an assignment operator That's one of my favorite things about Tcl. It just makes so much sense.
by ken 8y ago
> why the hell would you design a language and not use "=" as an assignment operator
That's one of my favorite things about Tcl. It just makes so much sense. Testing equality is analogous to testing inequality. It's a complex and context-dependent operation. Binding a value to a symbol is a completely different type of operation, and there's no reason for it to look similar. Keeping arithmetic in its own little space makes everything else so much simpler.
Many of the most interesting new languages I've seen which don't come from the C/Unix school use something different for assignment, e.g., Factor (Forth), Clojure (Lisp), etc.
- tragomaskhalos 8y agoNor is it just the new kids - ":=" for assignment goes back to Pascal and Smalltalk (IIRC Smalltalk used a funky left arrow, like R but a single char, but also allowed := because who has a funky left arrow on their keyboard?)