Added dsinit! sealed? sealed-sigil?
h3rald h3rald@h3rald.com
Tue, 12 Jan 2021 04:20:19 +0100
7 files changed,
26 insertions(+),
13 deletions(-)
M
minpkg/lib/min_dstore.nim
→
minpkg/lib/min_dstore.nim
@@ -21,6 +21,10 @@ i.dset(d, "path", p.newVal)
d.objType = "datastore" i.push d + def.symbol("dsinit!") do (i: In): + i.pushSym "dsinit" + i.pushSym "pop" + def.symbol("dsread") do (i: In): let vals = i.expect("'sym") let p = vals[0].getString
M
minpkg/lib/min_lang.nim
→
minpkg/lib/min_lang.nim
@@ -321,6 +321,14 @@ def.symbol("defined-sigil?") do (i: In):
let vals = i.expect("'sym") i.push(i.scope.hasSigil(vals[0].getString).newVal) + def.symbol("sealed?") do (i: In): + let vals = i.expect("'sym") + i.push i.scope.getSymbol(vals[0].getString).sealed.newVal + + def.symbol("sealed-sigil?") do (i: In): + let vals = i.expect("'sym") + i.push i.scope.getSigil(vals[0].getString).sealed.newVal + def.symbol("sigils") do (i: In): var q = newSeq[MinValue](0) var scope = i.scope
M
next-release.md
→
next-release.md
@@ -1,10 +1,2 @@
-* Improved diagnostics for native symbols calling other symbols. -* Refactored **crypto** module to use Nim StdLib's md5 and sha1 module when OpenSSL support is not enabled. -* Fixed detection of musl executables when running build task. -* Added **union**, **intersection**, **difference**, **symmetric-difference**, **one?** symbols to **seq** module. -* Fixed compilation for loaded files and assets. -* Refacored code to satisfy nimble package structure. -* Now caching required modules so that their code is executed only once. -* Added **line-info** symbol returning a dictionary containing the current filename, line and column numbers. -* Added **dsdelete!**, **dspost!**, **dsput!**, **dswrite!**. -* **REMOVED** the following symbols because redundant or pointless: **dequote-and**, **dequote-or**, **reverse-expect-dequote** (and **--**), **read**. Also, **apply** no longer works on dictionaries, only quotations.+* Added **dsinit!** symbol. +* Added **sealed?** and **sealed-sigil?** symbols.
M
site/contents/reference-dstore.md
→
site/contents/reference-dstore.md
@@ -18,6 +18,9 @@
{#op||dsinit||{{sl}}||{{dstore}}|| Initializes a bew datastore by creating the {{sl}} JSON file. Puts the datastore instance on the stack. #} +{#op||dsinit!||{{sl}} {{d}}||{{none}}|| +Same as `dsinit`, but doesn't leave anything on the stack. #} + {#op||dspost||{{dstore}} {{sl}} {{d}}||{{dstore}}|| Adds the dictionary {{d}} to the datastore {{dstore}} inside collection {{sl}}, generating and adding a unique **id** field to {{d}}. If the collection {{sl}} does not exist it is created. Puts the reference to the modified datastore back on tbe stack. #}
M
site/contents/reference-lang.md
→
site/contents/reference-lang.md
@@ -427,6 +427,12 @@
{#op||seal-sigil||{{sl}}||{{none}}|| Seals the user-defined sigil {{sl}}, so that it cannot be re-defined. #} +{#op||sealed?||{{sl}}||{{b}}|| +Returns {{t}} if the symbol {{sl}} is sealed, {{f}} otherwise.#} + +{#op||sealed-sigil?||{{sl}}||{{b}}|| +Returns {{t}} if the sigil {{sl}} is sealed, {{f}} otherwise.#} + {#op||set-type||{{d}} {{sl}}||{{d}}|| Sets the type for dictionary {{d}} to {{sl}}.#}
M
site/settings.json
→
site/settings.json
@@ -6,5 +6,5 @@ "rules": "rules.min",
"temp": "temp", "templates": "templates", "title": "min language", - "version": "0.28.0" + "version": "0.29.0" }