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

The other comment mentions it in passing, but the ability to uplevel (operate within the scope of your caller instead of your own) means the difference between statements and function calls is blurred.

That, along with the ability to pass code block literals, lets you redefine the language into your own DSL with new control flow statements. You can define a “while loop” function, for example.

Before heavy use of closures and callbacks in dynamic languages (Array.forEach, for example) became the thing this was pretty huge, and it’s still nicer syntax sugar than you get defining control structures with that route.

I used TCL with Squish for Qt-based UI test automation for a couple of years. For stuff like that where you really do want a set of domain-specific imperatives you can string together, it was really cool to work with. Biggest downside was you could get too fancy and find yourself alone off in the weeds of your own DSL.



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

Search: