Skip to content
Tcl Source Code Artifact [70e9b7b80d]
Login

Artifact [70e9b7b80d]

Artifact 70e9b7b80d979b59f90538ce023b7d6254d9fabe:

Ticket change [70e9b7b80d] - Ticket [229fa655638ab16d|229fa65563] <i>tailcall inside apply inside namespace</i> status still Open with 3 other changes by aspect on 2016-06-25 08:02:20.
D 2016-06-25T08:02:20.621
J icomment Isn't\sthis\sexpected?\r\n\r\n%\snamespace\seval\sn0\s{\r\n\s\s\s\sproc\sp0\s{}\s{\r\n\s\s\s\s\s\s\s\suplevel\s1\s{namespace\scurrent}\r\n\s\s\s\s}\r\n}\r\n%\snamespace\seval\sn1\s{\r\n\s\s\s\sputs\s[apply\s{{}\s{tailcall\sp0}\s::n0}]\r\n}\r\n::n1\r\n\r\nThe\slambda\sbody\sevaluates\sin\sa\slevel\sin\s::n0.\s\s[tailcall]\slooks\sup\sp0\sin\sthat\scontext,\sfinding\s::n0::p0).\s\sThen\sthe\sapply's\sframe\sis\sdiscarded\sand\sreplaced\swith\sa\snew\scall.\r\n\r\nThus\s{uplevel\s1}\sdoesn't\sfind\s::n0\sbecause\sthat\slevel\sno\slonger\sexists\s-\slevel\s-1\sis\swhere\s[apply]\swas\sinvoked.\r\n\r\nIt's\sunfortunate\sthat:\r\n\r\n\s\s[uplevel\s1\s[list\s::namespace\sorigin\s[lindex\s[info\slevel\s0]\s0]]]\r\n\r\ncan\sfail\sto\sfind\sa\squalified\sname\swhen\sused\sin\sa\sprocedure\sthat\shas\sbeen\stailcalled.\s\sPrior\sto\s[tailcall],\sI\sbelieve\sthis\sidiom\swas\s100%\sreliable\s(?).\r\n\r\nIf\sthat\sis\sa\ssignificant\sloss,\sthe\sonly\sway\sI\scan\ssee\sto\srestore\sit\sis\sif\s[tailcall]\sputs\sthe\sfully-qualified\sname\sof\sthe\scommand\son\sthe\sstack\s..\sbut\sthat\smight\shave\sother\simplications\sthat\sbreak\sthe\sutility\sof\s[lindex\s[info\slevel\s0]\s0].\s\sMeanwhile,\sI\ssuspect\s[tailcall]\salready\smixes\sbadly\swith\shighly\sintrospective\sprocedures\slike\sthis.
J login aspect
J mimetype text/plain
K 229fa655638ab16d794ea819296cf9f3a9088619
U aspect
Z 38d85379c4a1c1c01e2e18b769f7f620