Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2008-04-25
16:14 • Ticket [1950659fff] Writes to stdout within an after event confuse tclsh sta... artifact: e0a9848aab user: nobody
2008-04-24
20:04 • Closed ticket [1950659fff]. artifact: 9d84add875 user: dkf
12:29 • New ticket [1950659fff]. artifact: 66f314c4e3 user: nobody

Writes to stdout within an after event confuse tclsh

Closed / Invalid1950659fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2008-04-24 12:29:23
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.
dkfplain2008-04-24 20:04:55
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!)
[email protected]plain2008-04-25 16:14:02
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...
Log in (anonymous is fine) to add a comment.