all repos — min @ ad6a3ea0c3270ca7f39169d8703d82e5f55bef4b

A small but practical concatenative programming language.

Improved management of data types.
h3rald h3rald@h3rald.com
Wed, 17 Jun 2020 11:11:23 +0200
commit

ad6a3ea0c3270ca7f39169d8703d82e5f55bef4b

parent

3bec33c4d30ad8329f44972afac0bb342a314866

3 files changed, 8 insertions(+), 1 deletions(-)

jump to
M lib/min_lang.nimlib/min_lang.nim

@@ -149,6 +149,10 @@ dict.filename = i.filename

dict.scope = i.scope i.push dict + def.symbol("type") do (i: In): + let vals = i.expect("a") + i.push vals[0].typeName.newVal + def.symbol("import") do (i: In): var vals = i.expect("'sym") let rawName = vals[0]
M lib/min_logic.nimlib/min_logic.nim

@@ -220,6 +220,6 @@ let vals = i.expect("'sym", "a")

if vals[1].isTypedDictionary(vals[0].getString): i.push true.newVal else: - i.push false.newVal + i.push (vals[1].typename == vals[0].getString).newVal def.finalize("logic")
M site/contents/reference-io.mdsite/contents/reference-io.md

@@ -73,6 +73,9 @@

{#op||puts!||{{any}}||{{null}}|| Prints {{any}} and a new line to STDOUT, removing {{any}} from the stack.#} +{#op||type||{{any}}||{{s}}|| +Puts the data type of {{any}} on the stack. In cased of typed dictionaries, the type name is prefixed by `dict:`, e.g. `dict:module`, `dict:socket`, etc.#} + {#op||warning||{{any}}||{{any}}|| Prints {{any}} and a new line to STDERR, if logging level is set to [warning](class:kwd) or lower.#}