summaryrefslogtreecommitdiffstats
path: root/generic/tclCompile.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2012-10-30 22:16:35 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2012-10-30 22:16:35 (GMT)
commitaafa72469da7da2db317ded2198ef6cfa52b50fa (patch)
treeb17e5dfef8dc6c254530aa39fd546732f4a47c41 /generic/tclCompile.c
parent7a5c743e0954c68b53eba4f1425743f83f83fc45 (diff)
downloadtcl-aafa72469da7da2db317ded2198ef6cfa52b50fa.zip
tcl-aafa72469da7da2db317ded2198ef6cfa52b50fa.tar.gz
tcl-aafa72469da7da2db317ded2198ef6cfa52b50fa.tar.bz2
Added [dict exists] compilation; implementation is 95% shared with [dict get].
Diffstat (limited to 'generic/tclCompile.c')
-rw-r--r--generic/tclCompile.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index 6e2cfae..128273b 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.c
@@ -434,6 +434,12 @@ InstructionDesc const tclInstructionTable[] = {
/* Map variable contents back into a dictionary in the local variable
* indicated by the LVT index. Part of [dict with].
* Stack: ... path keyList => ... */
+ {"dictExists", 5, INT_MIN, 1, {OPERAND_UINT4}},
+ /* The top op4 words (min 1) are a key path into the dictionary just
+ * below the keys on the stack, and all those values are replaced by a
+ * boolean indicating whether it is possible to read out a value from
+ * that key-path (like [dict exists]).
+ * Stack: ... dict key1 ... keyN => ... boolean */
{"strmap", 1, -2, 0, {OPERAND_NONE}},
/* Simplified version of [string map] that only applies one change