Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2016-03-17
13:26 • Closed ticket [0b8c387cf7]: Stop using deprecated Tcl_VarEval() plus 5 other... artifact: 65dd2a1a32 user: dgp
13:26 • Ticket [0b8c387cf7]: 4 changes artifact: 659cdbb80f user: dgp
13:25
[0b8c387cf7] Replace deprecated Tcl_VarEval(). socket accept callbacks now always evaluate in global... check-in: 632f70c01d user: dgp tags: trunk, potential incompatibility
2016-03-16
14:52
Merge trunk. Add TCL_EVAL_GLOBAL flag to Tcl_EvalObjEx(), for reason mentioned in [0b8c387cf7]. closed check-in: 727564218e user: jan.nijtmans tags: bug-0b8c387cf7
2016-03-08
18:17 • Ticket [0b8c387cf7] Stop using deprecated Tcl_VarEval() status still Open wi... artifact: f421606c35 user: dgp
18:07 • Ticket [0b8c387cf7]: 3 changes artifact: 1568a158ae user: dgp
18:06
[0b8c387cf7] Replace deprecated Tcl_VarEval() call with reworked callback system that uses Tcl_Obj s... check-in: 573945a448 user: dgp tags: bug-0b8c387cf7
18:03 • New ticket [0b8c387cf7] Stop using deprecated Tcl_VarEval(). artifact: b810b61f67 user: dgp

Stop using deprecated Tcl_VarEval()

Closed / Accepted0b8c387cf7c00a93796ad267891bc3d691c07b78Created 11 years agoUpdated 11 years ago
Descriptionplain2016-03-08 18:03:12
Tcl_VarEval() is a deprecated routine.

To move toward its elimination, we at least must
stop using it ourselves.

It is used in the server socket accept callback evaluation.
Referenced by3
  • 632f70c01d[0b8c387cf7] Replace deprecated Tcl_VarEval(). socket accept callbacks now always evaluate in global context. *** POTENTIAL INCOMPATIBILITY *** check-in2016-03-17 13:25:11
  • 727564218eMerge trunk. Add TCL_EVAL_GLOBAL flag to Tcl_EvalObjEx(), for reason mentioned in [0b8c387cf7]. check-in2016-03-16 14:52:46
  • 573945a448[0b8c387cf7] Replace deprecated Tcl_VarEval() call with reworked callback system that uses Tcl_Obj scripts. check-in2016-03-08 18:06:06
dgpplain2016-03-08 18:07:47
Branch bug-0b8c387cf7 has a proposed revision to
do away with the Tcl_VarEval() call.
dgpplain2016-03-08 18:17:41
The proposed revision has been written to
reproduce the behavior of the Tcl_VarEval()
call, which in the long run may not be the
best idea.

The Tcl_VarEval() routine builds and evaluates
a script, not a command.  Although for some time
we've been documenting that server socket accept
callbacks are single commands, the implementation
has never agreed.  See

http://core.tcl.tk/tcl/info/2957688

Possibly much worse, there is no control in place
to determine the context of the callback script
evaluation.  It is evaluated in whatever context
is current in the interp, whether that be a namespace,
or the body context of some invocation of some proc.
Most callbacks in Tcl are forced to evaluate in global
context for predictable behavior.  It's surprising to me
that's not been done with server socket accept callbacks,
but Tcl_VarEval() just evaluates where it is.

It would be easy to change this in the revised implementation
by just adding the TCL_EVAL_GLOBAL flag to the
Tcl_EvalObjEx() call.  I can't think of a good reason not
to make this change now that it's easy.

Review and comment invited.
dgpplain2016-03-17 13:26:34
Thanks for confirming TCL_EVAL_GLOBAL
is the right thing.  Merged to trunk.
dgp Closed ticket [0b8c387cf7]. [History diff]2016-03-17 13:26:50
Log in (anonymous is fine) to add a comment.