Re:Schrödinger’s Tcl – Values that differ if you look at them
by jamesdutc on Sunday September 17, 2017 @02:16AM
(#15268453)
I can do this in Python with my `rwatch` module.
[ Parent
| on HN ]
Re:Schrödinger’s Tcl – Values that differ if you look at them
by aidanhs on Sunday September 17, 2017 @06:58AM
(#15269078)
One thing that may be non-obvious to people unfamiliar with Tcl is that it's syntactically a shell-like language, i.e. functions are invoked with a space-separated list of arguments and no parens. So `schro` on a line by itself executes the function and `[schro]` is equivalent to `$(schro)` in shell.
Re:Schrödinger’s Tcl – Values that differ if you look at them
by tyingq on Sunday September 17, 2017 @12:33PM
(#15270381)
Only when you're using the REPL. They call it "interactive mode". [ls], for example, will generate an error if you put that in a tcl script run non-interactively.
Another common cause can be the difference between interactive and command modes for Tcl. When you start up a Tcl interpreter, get a prompt, and type in commands to Tcl, this is called interactive mode. In this mode, Tcl does a few extra things for you. For instance, if you type ls, and you have no proc called ls defined, Tcl will try to exec a command called ls. This sometimes misleads a new Tcl user into thinking that Tcl has ls defined." [1]
Re:Schrödinger’s Tcl – Values that differ if you look at them
by zwischenzug on Sunday September 17, 2017 @02:54AM
(#15268548)
I'm not sure how that is 'the same'?