diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2012-10-30 22:16:35 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2012-10-30 22:16:35 (GMT) |
commit | aafa72469da7da2db317ded2198ef6cfa52b50fa (patch) | |
tree | b17e5dfef8dc6c254530aa39fd546732f4a47c41 /generic/tclDictObj.c | |
parent | 7a5c743e0954c68b53eba4f1425743f83f83fc45 (diff) | |
download | tcl-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/tclDictObj.c')
-rw-r--r-- | generic/tclDictObj.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/generic/tclDictObj.c b/generic/tclDictObj.c index ea9411c..2d6d209 100644 --- a/generic/tclDictObj.c +++ b/generic/tclDictObj.c @@ -87,16 +87,33 @@ static int DictMapLoopCallback(ClientData data[], * Table of dict subcommand names and implementations. */ +#define NORMAL(name, term) \ + {name, Dict##term##Cmd, NULL, NULL, NULL, 0} +#define COMPILED(name, term) \ + {name, Dict##term##Cmd, TclCompileDict##term##Cmd, NULL, NULL, 0} +#define NR(name, term) \ + {name, NULL, TclCompileDict##term##Cmd, Dict##term##NRCmd, NULL, 0} static const EnsembleImplMap implementationMap[] = { + COMPILED( "append", Append), + NORMAL( "create", Create), + COMPILED( "exists", Exists), + NORMAL( "filter", Filter), + NR( "for", For), + COMPILED( "get", Get), + COMPILED( "incr", Incr), + NORMAL( "info", Info), + NORMAL( "keys", Keys), + /* {"append", DictAppendCmd, TclCompileDictAppendCmd, NULL, NULL, 0 }, {"create", DictCreateCmd, NULL, NULL, NULL, 0 }, - {"exists", DictExistsCmd, NULL, NULL, NULL, 0 }, + {"exists", DictExistsCmd, TclCompileDictExistsCmd, NULL, NULL, 0 }, {"filter", DictFilterCmd, NULL, NULL, NULL, 0 }, {"for", NULL, TclCompileDictForCmd, DictForNRCmd, NULL, 0 }, {"get", DictGetCmd, TclCompileDictGetCmd, NULL, NULL, 0 }, {"incr", DictIncrCmd, TclCompileDictIncrCmd, NULL, NULL, 0 }, {"info", DictInfoCmd, NULL, NULL, NULL, 0 }, {"keys", DictKeysCmd, NULL, NULL, NULL, 0 }, + */ {"lappend", DictLappendCmd, TclCompileDictLappendCmd, NULL, NULL, 0 }, {"map", NULL, TclCompileDictMapCmd, DictMapNRCmd, NULL, 0 }, {"merge", DictMergeCmd, NULL, NULL, NULL, 0 }, |