dset and ddel no longer return the modified dictionary.
h3rald h3rald@h3rald.com
Tue, 01 Nov 2016 07:47:36 +0100
2 files changed,
5 insertions(+),
5 deletions(-)
M
lib/min_lang.nim
→
lib/min_lang.nim
@@ -31,7 +31,7 @@ if v.qVal[0].getString == s.getString:
return true return false -proc ddel*(q: var MinValue, s: MinValue): MinValue = +proc ddel*(q: var MinValue, s: MinValue): MinValue {.discardable.} = # Assumes q is a dictionary var found = false var c = -1@@ -646,13 +646,13 @@ var d, k: MinValue
let m = i.pop i.reqStringLike k i.reqDictionary d - i.push i.dset(d, k, m) + i.dset(d, k, m) .symbol("ddel") do (i: In): var d, k: MinValue i.reqStringLike k i.reqDictionary d - i.push d.ddel(k) + d.ddel(k) .symbol("dprint") do (i: In): var d: MinValue
M
tests/lang.min
→
tests/lang.min
@@ -157,9 +157,9 @@ (((a 1)(b 2)(c 3)) dictionary?) assert
(((a 1)(b 2)(c 3)) 'b dget 2 ==) assert - (((a 1)(b 2)(c 3)) 'b 5 dset ((a 1)(b 5)(c 3)) ==) assert + (((a 1)(b 2)(c 3)) ' :dict dict 'b 5 dset dict ((a 1)(b 5)(c 3)) ==) assert - (((a 1)(b 2)(c 3)) 'b ddel ((a 1)(c 3)) ==) assert + (((a 1)(b 2)(c 3)) ' :dict dict 'b ddel dict ((a 1)(c 3)) ==) assert (((a 1)(b 2)(c 3)) keys (a b c) ==) assert