5 ms·
I really like Tcl the language and some of the tooling, but certainly not all of it. I kind of wish there was a single reputable website that I could go to for
by 7thaccount 5y ago
I really like Tcl the language and some of the tooling, but certainly not all of it.
I kind of wish there was a single reputable website that I could go to for all versions. I don't want something from Source Forge or ActiveState or some random person's website. I'm sure they're all fine, but I'm a lot less sketched out with running Anaconda Python or Java than Tcl. Funny enough, some Python systems include Tcl for the Tk GUI, but I haven't been able to get some of the libraries I'm interested in to work with that version.
- hota_mazi 5y agoTCL has a feature which to me qualifies as a total "What the hell were they thinking?", not unlike the COME FROM command from Brainfuck, except, in a real language. That statement is upvar [1]. Read its description and despair. [1] https://www.tcl.tk/man/tcl/TclCmd/upvar.html https://www.tcl.tk/man/tcl/TclCmd/upvar.html
- macintux 5y agoAs a fan of immutability (edit: I suppose I should say rather referential transparency is more relevant here), that horrifies me, but at the same time I have to commend the ingenuity.
- sokoloff 5y agoAs the decr example at the very bottom suggests, it’s to allow the equivalent of passing a mutable reference into a function in other languages. upvar and uplevel seem scary/strange when you read about them, but once you start using them in code, they feel perfectly suited for the task.
- zvr 5y agoThe upvar (and uplevel) mechanism is essential for the extensibility of the language and tremendously useful for creating new control constructs. Think of it as similar to "passing value by reference", for example when you pass the address of a variable in C/C++.
- cafard 5y agoI love upvar and uplevel. I once did a web search to see whether there was an equivalent in PHP. I found a thread in at PHP forum, which told a poster that he was a bad person for wanting such a thing. (This was a long time ago, so perhaps I exaggerate. But they did say that PHP was just fine without it.)