3 ms·
It's a bit idiosyncratic for sure. For one I always thought why the hell would you design a language and not use "=" as an assignment operator. On the other han
by ofrzeta 8y ago
It's a bit idiosyncratic for sure. For one I always thought why the hell would you design a language and not use "=" as an assignment operator. On the other hand it's not a good reason to reject a programming language when it has a lot of other good features.
- sshine 8y ago> why the hell would you design a language and not use "=" as an assignment operator That never bothered me. One thing that bothered me was how hard it is to write Tcl code without errors. After the introduction of the special syntax {∗} in Tcl 8.5, correct list concatenation went from: set concatenation [eval [linsert $list1 0 list] [lrange $list2 0 end]] to: set concatenation [list {*}$list1 {*}$list2] Mind you, Tcl 8.5 is quite late in the history of the language, and the special syntax is still not super obvious. This example was taken from: https://stackoverflow.com/questions/5124185/what-does-do-in-tcl https://stackoverflow.com/questions/5124185/what-does-do-in-... Another thing that bothered me was the use of upvar/uplevel as a substitute for pass-by-reference: While upvar/uplevel is incredibly powerful (allowing you to evaluate code in any parent scope), this opens up for macros. The upside is super powerful macros. The downside is readers of your code will not know what's going on unless you stick to a set of conventions. I've experienced the same problem in syntactically saturated dialects of Lisp. Compare this to Scheme's 'hygienic macros': https://en.wikipedia.org/wiki/Hygienic_macro https://en.wikipedia.org/wiki/Hygienic_macro -- in Tcl, you can't look at an arbitrary piece of Tcl code and know anything about what's going to happen.
- 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?)
- emmelaich 8y agoLike Lisp, one of the oldest languages ever?