Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#3983 Writes to stdout within an after event confuse tclsh

obsolete: 8.5.1
closed-invalid
5
2008-04-24
2008-04-24
Anonymous
No

In tclsh (interactive) following command leads to strange behavior:

after 1 "puts a\nb\nc"; after 1; update

Tclsh prints the error message:

ambiguous command name "b": binary break
while executing
"b"
("after" script)

It seems that tclsh fills the output of the script "puts a\nb\nc" into its input buffer.

Discussion

  • Logged In: YES
    user_id=79902
    Originator: NO

    Not a bug. Script is equivalent to:

    after 1 "puts a
    b
    c"

    i.e. you've got a script with three commands. Use braces around the script instead, or generate it using [list] which will quote the words correctly. (If things get complex, use [list] to generate an invocation of a helper procedure: that's best practice and saves hair too!)

     
    • status: open --> closed-invalid
     
  • Logged In: NO

    Sorry, you're right. I tried to find a simple example for my problem but made it a bit too simple...
    I guess I have to investigate a bit more to find the real issue...