No longer importing dstore module.
h3rald h3rald@h3rald.com
Sun, 29 Sep 2024 10:48:58 +0200
5 files changed,
29 insertions(+),
22 deletions(-)
M
minpkg/lib/min_dstore.nim
→
minpkg/lib/min_dstore.nim
@@ -11,7 +11,7 @@
proc dstore_module*(i: In) = let def = i.define() - def.symbol("dsinit") do (i: In): + def.symbol("init") do (i: In): let vals = i.expect("'sym") let p = vals[0].getString p.writeFile("{}")@@ -21,7 +21,7 @@ i.dset(d, "path", p.newVal)
d.objType = "datastore" i.push d - def.symbol("dsread") do (i: In): + def.symbol("read") do (i: In): let vals = i.expect("'sym") let p = vals[0].getString var j = p.readFile.parseJson@@ -31,7 +31,7 @@ i.dset(d, "path", p.newVal)
d.objType = "datastore" i.push d - def.symbol("dswrite") do (i: In): + def.symbol("write") do (i: In): let vals = i.expect("dict:datastore") let ds = vals[0] let p = i.dget(ds, "path".newVal).getString@@ -39,7 +39,7 @@ let data = i%(i.dget(ds, "data".newVal))
p.writeFile(data.pretty) i.push ds - def.symbol("dshas?") do (i: In): + def.symbol("has?") do (i: In): let vals = i.expect("'sym", "dict:datastore") let s = vals[0].getString let ds = vals[1]@@ -56,7 +56,7 @@ i.push true.newVal
else: i.push false.newVal - def.symbol("dsget") do (i: In): + def.symbol("get") do (i: In): let vals = i.expect("'sym", "dict:datastore") let s = vals[0].getString let ds = vals[1]@@ -69,7 +69,7 @@ raiseInvalid("Collection '$#' does not exist" % collection)
let cll = i.dget(data, collection) i.push i.dget(cll, id.newVal) - def.symbol("dsquery") do (i: In): + def.symbol("query") do (i: In): let vals = i.expect("quot", "'sym", "dict:datastore") var filter = vals[0] let collection = vals[1]@@ -91,7 +91,7 @@ except CatchableError:
discard i.push res.newVal - def.symbol("dspost") do (i: In): + def.symbol("post") do (i: In): let vals = i.expect("dict", "'sym", "dict:datastore") var d = vals[0] let collection = vals[1]@@ -105,7 +105,7 @@ var cll = i.dget(data, collection)
i.dset(cll, id, d) i.push ds - def.symbol("dsput") do (i: In): + def.symbol("put") do (i: In): let vals = i.expect("dict", "'sym", "dict:datastore") var d = vals[0] let s = vals[1].getString@@ -122,7 +122,7 @@ var cll = i.dget(data, collection)
i.dset(cll, id, d) i.push ds - def.symbol("dsdelete") do (i: In): + def.symbol("delete") do (i: In): let vals = i.expect("'sym", "dict:datastore") let s = vals[0].getString let ds = vals[1]
M
next-release.md
→
next-release.md
@@ -42,6 +42,16 @@ - **dict** module: renamed **ddup** to **dict.dup**
- **dict** module: renamed **dpick** to **dict.pick** - **dict** module: renamed **dtype** to **dict.type** - The **sys** module is no longer imported. +- The **dstore** module is no longer imported. +- **dstore** mdule: renamed **dsinit** to **dstore.init** +- **dstore** mdule: renamed **dsget** to **dstore.get** +- **dstore** mdule: renamed **dshas?** to **dstore.has?** +- **dstore** mdule: renamed **dsput** to **dstore.put** +- **dstore** mdule: renamed **dspost** to **dstore.post** +- **dstore** mdule: renamed **dsdelete** to **dstore.delete** +- **dstore** mdule: renamed **dsquery** to **dstore.query** +- **dstore** mdule: renamed **dswrite** to **dstore.write** +- **dstore** mdule: renamed **dsread** to **dstore.read**
M
prelude.min
→
prelude.min
@@ -1,5 +1,4 @@
; Imports -'dstore import 'crypto import 'math import 'net import
M
tests/dstore.min
→
tests/dstore.min
@@ -3,32 +3,32 @@ ;;;
"dstore" test.describe - ("dstore.json" dsinit type "dict:datastore" ==) test.assert + ("dstore.json" dstore.init type "dict:datastore" ==) test.assert ( - "dstore.json" dsread :ds + "dstore.json" dstore.read :ds ds "tests" {} 1 "test1" dict.set 2 "test2" dict.set - dspost dswrite - "tests" (stack.pop true) dsquery size 1 == + dstore.post dstore.write + "tests" (stack.pop true) dstore.query size 1 == ) test.assert ( - "dstore.json" dsread :ds + "dstore.json" dstore.read :ds ds "tests/aaa" {} 1 "test1" dict.set 3 "test3" dict.set - dsput dswrite - "tests" ("test1" dict.get 1 ==) dsquery size 2 == + dstore.put dstore.write + "tests" ("test1" dict.get 1 ==) dstore.query size 2 == ) test.assert ( - "dstore.json" dsread :ds - ds "tests/aaa" dsdelete - "tests" ("id" dict.get "aaa" ==) dsquery size 0 == + "dstore.json" dstore.read :ds + ds "tests/aaa" dstore.delete + "tests" ("id" dict.get "aaa" ==) dstore.query size 0 == ) test.assert "dstore.json" sys.rm
M
tests/global.min
→
tests/global.min
@@ -73,8 +73,6 @@ ('error dict.get)
("finally") ) try stack.get ("MinEmptyStackError" "finally") ==) test.assert - ('sys.cd ^cd "aaaa" :cd cd "aaaa" ==) test.assert ;;It is possible to shadow sealed symbols in child scopes - (((2 :a1 'a1 seal-symbol 3 :a1) ("failed")) try "failed" ==) test.assert (