3 ms·
Good lord, as an example of why it's something we should want? Each to their own of course, but..
by OJFord 6y ago
Good lord, as an example of why it's something we should want?
Each to their own of course, but..
- coldtea 6y agoFor example because it's kind of homoiconic. Since everything is a string you can define your own control flow constructs for example...
- adwn 6y agoIf you define your own, say, repeat-until loop, can you use the built-in break and continue commands? Could you define a break-with-value command for the built-in loops?
- dvdkhlng 6y agoUsing Tcl exceptions, I guess it would be pretty trivial to do that. Here [1] is an alternative do..while loop implementation provided by Tcllib, written in pure Tcl. [1] https://core.tcl-lang.org/tcllib/artifact/4f7e97706ff67a40 https://core.tcl-lang.org/tcllib/artifact/4f7e97706ff67a40
- ufo 6y agoI don't think this is the sort of code that people tend to write. But it does a good job of succinctly explaining how Tcl works.