Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f421606c35016551c9aa95e569e41fc14ba9836b
Ticket: 0b8c387cf7c00a93796ad267891bc3d691c07b78
Stop using deprecated Tcl_VarEval()
User & Date: dgp on 2016-03-08 18:17:41
Changes

  1. assignee changed to: "jan.nijtmans"
  2. icomment:
    
    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.
    
  3. login: "dgp"
  4. mimetype: "text/plain"