Skip to content
Tcl Source Code Artifact [98cd95a539]
Login

Artifact [98cd95a539]

Artifact 98cd95a5395ede5b2390cea22cc9b99249716da5:

Ticket change [98cd95a539] - Ticket [1590483fffffffff|1590483fff] <i>alias can break [uplevel 1 [info level 0]] idiom</i> status still Open with 8 other changes by dkf on 2016-07-24 18:12:01.
D 2016-07-24T18:12:01.253
J assignee dgp
J closer nobody
J comment The\sidiom\s\r\n\s\suplevel\s1\s[info\slevel\s0]\r\nto\scause\sa\srenewed\scall\sto\sthe\ssame\sproc\scan\sbe\sbroken\r\nby\sinterp\saliases:\r\n\r\n\smig@ice:/tmp$\scat\s/tmp/test\r\n\sset\sres\s{}\r\n\sproc\sx\s{}\s{\r\n\s\s\s\sif\s{![llength\s$::res]}\s{\r\n\s\s\s\s\s\s\s\sset\s::res\s[list\s[info\slevel\s0]\s::\s[uplevel\s1\r\n[info\slevel\s0]]]\r\n\s\s\s\s}\selse\s{\r\n\s\s\s\s\s\s\s\sreturn\s::\r\n\s\s\s\s}\r\n\s}\r\n\snamespace\seval\sa\s{\r\n\s\s\s\sproc\sx\s{}\s{return\s::a}\r\n\s}\r\n\sinterp\salias\s{}\sy\s{}\sx\r\n\snamespace\seval\sa\sy\r\n\sputs\s$res\r\n\r\n\smig@ice:/tmp$\s/home/CVS/tcl8.3.4/unix/tclsh\stest\r\n\sx\s::\s::a\r\n\r\nIn\sorder\sfor\sit\sto\sbreak\r\n\s1.\sthe\salias\starget\sis\snot\sfully\squalified\r\n\s2.\sthe\salias\starget\sis\sshadowed\sin\sthe\snamespace\sfrom\r\nwhich\sthe\salias\sis\sinvoked\r\n\r\nIt\sis\srelatively\seasy\sto\sfix\sthis:\sas\sinterp\saliases\r\nare\salways\slooked\sup\sin\sthe\sglobal\snamespace\sanyway,\r\nthe\starget\scould\sbe\sfully\squalified\sat\salias\screation\r\ntime.\sThis\swould\salso\ssimplify\sTEOVI,\sallowing\sto\r\nremove\sall\sthe\snamespace\sgymnastics\sperformed\sby\r\nTCL_EVAL_INVOKE.\sThe\sonly\schange\sseen\sby\scurrent\r\nscripts\swould\sbe\sin\serror\straces,\sand\sin\sthe\sactual\r\nreturn\sof\s[info\slevel\sn]\s(now\sfully\squalified).
J icomment Do\swe\sreally\swant\sto\ssupport\sthis\ssort\sof\sthing\sby\spolicy?\sAnd\show\sdoes\sthis\sinteract\swith\sthe\srewrite\sstuff\sthat's\sbeen\sworked\son\srecently?
J login dkf
J mimetype text/x-fossil-wiki
J severity Minor
J username dkf
K 1590483fffffffffffffffffffffffffffffffff
U dkf
Z 123dbb2b317f5e977c009e1fdfd3ddeb