Menu

#3777 array search of env

obsolete: 8.5a7
open
6
2009-05-01
2007-09-04
Don Porter
No

Noted on the chat:

% set a [array startsearch env]
s-1-env
% array anymore env $a
couldn't find search "s-1-env"

Discussion

  • miguel sofer

    miguel sofer - 2007-09-04

    Logged In: YES
    user_id=148712
    Originator: NO

    Same result on 8.34, 8.4.14, 8.5a6 (pre varReform), HEAD.

     
  • miguel sofer

    miguel sofer - 2007-10-27

    Logged In: YES
    user_id=148712
    Originator: NO

    The problem is with the way EnvTraceProc works: for array traces it calls TclSetupEnv, which in turns first deletes the env variable and then recreates it. The deletion cancels all searches.

    What this means is that the env array cannot be searched at all. This should be either fixed or documented.

    Wary to muck with this stuff, especially since:
    (a) the bug is prehistoric, raised few complaints, no tests available
    (b) the bug combines two touchy issues (array searches and env), a fix may introduce subtle new bugs

    Requesting comments.

     
  • miguel sofer

    miguel sofer - 2009-05-01
    • priority: 5 --> 6