Re:Learn X in Y minutes – Tcl
by sebcat on Tuesday August 25, 2015 @11:45AM
(#10117263)
I'm sure it's possible to do it in a cleaner way without [set], but my Tcl is a bit rusty.
[ Parent
| on HN ]
I like the "with". Python has that construct. It's not annoying and easy to remember.
Re:Learn X in Y minutes – Tcl
by a8da6b0c91d on Tuesday August 25, 2015 @12:03PM
(#10117412)
Still leaks on an exception. That's also an annoying construct to be forced to use.
You could easily wrap the middle uplevel in a catch block to handle exceptions, and this sort of "with" construct is pretty common in a lot of very popular languages today.
While it would be nice if this were baked into the language, it's pretty astonishing how extensible Tcl is without even having to touch the realm of C extensions.