Tcl_WrongNumArgs quotes too much
Closed / Fixed1583266fffffffffffffffffffffffffffffffffCreated 20 years agoUpdated 20 years ago
Descriptionplain2006-10-24 00:35:05
The new details in apply invocation hit a quoting bug
in Tcl_WrongNumArgs: see the test failures
==== apply-4.1 error in arguments to lambda expression
FAILED
==== Contents of test case:
set lambda [list x {set x 1}]
set res [catch {apply $lambda} msg]
list $res $msg
---- Result was:
1 {wrong # args: should be "apply {{x {set x 1}}} x"}
---- Result should have been (exact matching):
1 {wrong # args: should be "apply {x {set x 1}} x"}
==== apply-4.1 FAILED
==== apply-4.2 error in arguments to lambda expression
FAILED
==== Contents of test case:
set lambda [list x {set x 1}]
set res [catch {apply $lambda x y} msg]
list $res $msg
---- Result was:
1 {wrong # args: should be "apply {{x {set x 1}}} x"}
---- Result should have been (exact matching):
1 {wrong # args: should be "apply {x {set x 1}} x"}
==== apply-4.2 FAILED
dkfplain2006-10-24 16:05:32
Logged In: YES user_id=79902 Be careful. It's in this area that the Itcl quoting strangeness hangs out.
msoferplain2006-10-24 16:51:50
Logged In: YES
user_id=148712
Yes - and no. Itcl's strangeness is with the first word in
the command, this here is the second. Apply has a
strangeness of its own.
The problem seems to be that an extra level of quoting is
added when none is needed: the lambda-expr was already in
list form, no new {...} is necessary around it.
msoferplain2006-10-25 04:33:49
Logged In: YES user_id=148712 Looks like a problem in [apply] after all ...
msoferplain2006-10-25 05:06:03
Logged In: YES user_id=148712 AARGHH ... no bug when AVOID_HACKS_FOR_ITCL is defined. So, seem to need to find a hack to avoid the hack.
msofer Closed ticket [1583266fff].
[History diff]2006-10-25 05:31:19
Log in (anonymous is fine) to add a comment.