all repos — min @ 8059da38dbcc91a2e2c1a992d2162309715f6889

A small but practical concatenative programming language.

dset and ddel no longer return the modified dictionary.
h3rald h3rald@h3rald.com
Tue, 01 Nov 2016 07:47:36 +0100
commit

8059da38dbcc91a2e2c1a992d2162309715f6889

parent

32ec12549461f1688ff6bc5685cc89e0309680a4

2 files changed, 5 insertions(+), 5 deletions(-)

jump to
M lib/min_lang.nimlib/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.mintests/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