summaryrefslogtreecommitdiffstats
path: root/generic/tclCompile.c
diff options
context:
space:
mode:
authordonal.k.fellows@manchester.ac.uk <dkf>2012-10-30 22:16:35 (GMT)
committerdonal.k.fellows@manchester.ac.uk <dkf>2012-10-30 22:16:35 (GMT)
commita1ee0c2449ab963c064a63f205719846b4fb8515 (patch)
treeb17e5dfef8dc6c254530aa39fd546732f4a47c41 /generic/tclCompile.c
parent137dac970c7203528a2ca4cdf7d305f02d0f60bb (diff)
downloadtcl-a1ee0c2449ab963c064a63f205719846b4fb8515.zip
tcl-a1ee0c2449ab963c064a63f205719846b4fb8515.tar.gz
tcl-a1ee0c2449ab963c064a63f205719846b4fb8515.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