Hacker News new | ask | show | jobs
by isr 1950 days ago
Hmm, I would disagree with this (quite strongly). Not that tcl doesn't have misfeatures (of course it does), but that `upvar` or `uplevel` are one of them.

Those commands effectively make any tcl function be able to operate as an f-expr (in old lisp parlance). Effectively (this is a simplification), an fexpr is a runtime macro, as opposed to the more traditional lispy compiletime macro.

Its what makes tcl feel more like a lisp-for-strings. Much of the truly horrible tcl code out there in the wild is from folks who try to use tcl as just another c-style scripting language.

Treat it more as a lisp, and it some of its inherent elegance shines through.

My $0.02 anyway ...

2 comments

Fexprs are misfeature, which is why we have to digging into sixty-year-old Lisp literature to learn about them.

Lisp people had bad ideas along the way. They recognized that this is the case and got rid of those ideas, in some cases documenting some of those choices.

I sort of agree with this. I'm not a lisp fan, I don't think lisp is bad, it's just not how my brain works so I struggle. But I understand lisp enough to agree with you and I think that is what John was trying to do.