Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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-...

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 -- in Tcl, you can't look at an arbitrary piece of Tcl code and know anything about what's going to happen.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: