all repos — min @ de0ae13334c64695379d8a126f6cfb4aa269d037

A small but practical concatenative programming language.

Added dsinit! sealed? sealed-sigil?
Tue, 12 Jan 2021 04:20:19 +0100




M min.ymlmin.yml

@@ -1,5 +1,5 @@

author: Fabio Cevasco description: A tiny concatenative programming language and shell. -id: 35924740 +id: 36258339 name: min -version: 0.28.0+version: 0.29.0
M minpkg/lib/min_dstore.nimminpkg/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.nimminpkg/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

@@ -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.mdsite/contents/

@@ -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.mdsite/contents/

@@ -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.jsonsite/settings.json

@@ -6,5 +6,5 @@ "rules": "rules.min",

"temp": "temp", "templates": "templates", "title": "min language", - "version": "0.28.0" + "version": "0.29.0" }