Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2008-07-30
06:30 • Ticket [1812624fff] overeager compilation status still Open with 5 other cha... artifact: 76937e376a user: msofer
2007-10-14
02:14 • Ticket [1812624fff]: 5 changes artifact: 7e9c76935e user: dkf
2007-10-13
07:57 • Ticket [1812624fff]: 4 changes artifact: fb03439d72 user: msofer
00:23 • New ticket [1812624fff]. artifact: b5b9002ca8 user: msofer

overeager compilation

Open1812624fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 18 years ago
Descriptionplain2007-10-13 00:23:11
In 8.4 and 8.5:
 % set x 1; set x [proc set args "return $x"]
 % puts $x

 % set x
 1

What it should be by rule #2 in Tcl.n:
 % set x 1; set x [proc set args "return $x"]
 % puts $x ;# [set] modified before being called
 1
 % set x
 1
msoferplain2007-10-13 07:57:32
Logged In: YES 
user_id=148712
Originator: YES

This is a tough one to fix. One way out is by subtly changing Tcl.n's Rule #2 to ignore the redefinition of a command during the substitution of its arguments, ie
Rule 2': A command is evaluated in three steps. 
 1. the interpreter substitutes the first word, determines the corresponding command
 2. the interpreter substitutes the other words
 3. the command is invoked
dkfplain2007-10-14 02:14:53
Logged In: YES 
user_id=79902
Originator: NO

Quite apart from the fact that your example confuses me anyway, it's an example of something that's deeply horrific anyway. And it's impossible to fix without ridiculous contortions; saying that the command to be invoked is looked up before substitution of the arguments is probably sanest. (On the other hand, that gets horrible when commands are autoloaded, as there the substitution order relative to the autoload step is different, with the compiled command being changed as a side-effect. Ugh.)

Since in practice only insane code does this (yes, that makes test suite writers very strange people) I can't see that this is release-critical. It's just one of the Crazy Aunts in Tcl's Attic.
msoferplain2008-07-30 06:30:04
Logged In: YES 
user_id=148712
Originator: YES

Lowering prio: can't be fixed without a change in Tcl.n (or a huge slowdown), we'll live with this one for a while.
Log in (anonymous is fine) to add a comment.