all repos — min @ 3f18071b873197fa835c341a4c2981865724a1bc

A small but practical concatenative programming language.

Renamed lang/ROOT into global.
h3rald h3rald@h3rald.com
Mon, 29 Jan 2024 11:14:27 +0100
commit

3f18071b873197fa835c341a4c2981865724a1bc

parent

d65a5796e5f71931f9ab1541b688b3c2be05d52c

6 files changed, 15 insertions(+), 9 deletions(-)

jump to
M help.jsonhelp.json

@@ -571,6 +571,12 @@ "kind": "symbol",

"name": "dequote", "signature": "quot ==> a*" }, + "dev": { + "description": "Toggles development mode.", + "kind": "symbol", + "name": "dev", + "signature": " ==> " + }, "dev?": { "description": "Returns true if the current program is being executed in development mode.", "kind": "symbol",

@@ -1715,7 +1721,7 @@ "name": "request",

"signature": "dict ==> dict:http-response" }, "require": { - "description": "Parses and interprets (in a separater interpreter) the specified min file 'sym, adding [.min](class:ext) if not specified, and returns a module dictionary dict containing all the symbols defined in 'sym.", + "description": "Parses and interprets (in a separated interpreter) the specified min module, and returns a module dictionary dict containing all the symbols defined in 'sym. \r\n\r\nThis symbol will attempt to locate the specified module in this way. Given the following min program:\r\n\r\n 'my-module require :my-module\r\n\r\n1. Check for a file named my-module in the same folder as the current file (with our without a .min extension).\r\n2. Check for a file named index.min in the mmm/my-module/*/index.min folder relative to the current file (locally-installed [managed-module](/learn-mmm)).\r\n3. Check for a file named index.min in the $HOME/mmm/my-module/*/index.min folder (globally-installed [managed-module](/learn-mmm)). If multiple versions of the same module are present, the first one will be loaded.", "kind": "symbol", "name": "require", "signature": "'sym ==> dict"
M minpkg/core/stdlib.nimminpkg/core/stdlib.nim

@@ -11,7 +11,7 @@ parser,

interpreter import - ../lib/[min_lang, + ../lib/[min_global, min_stack, min_seq, min_dict,

@@ -41,7 +41,7 @@ if not MINHISTORY.fileExists:

MINHISTORY.writeFile("") if not MINRC.fileExists: MINRC.writeFile("") - i.lang_module + i.global_module i.stack_module i.seq_module i.dict_module
M minpkg/lib/min_lang.nimminpkg/lib/min_global.nim

@@ -22,7 +22,7 @@ ../core/interpreter,

../core/utils, ../core/scope -proc lang_module*(i: In) = +proc global_module*(i: In) = let def = i.scope const HELPFILE = "../../help.json".slurp

@@ -1223,4 +1223,4 @@

def.symbol("lambdabind") do (i: In): i.pushSym("lambda-bind") - def.finalize("ROOT") + def.finalize("global")
M tests/all.mintests/all.min

@@ -13,7 +13,7 @@ 'dict load

'dstore load 'fs load 'io load -'lang load +'global load 'logic load 'math load 'num load
M tests/fs.mintests/fs.min

@@ -31,9 +31,9 @@ ("tests/sys.min" expand-filename unix-path . "/tests/sys.min" suffix unix-path ==) *test/assert

("./../tests" normalized-path unix-path "../tests" ==) *test/assert - ((. "tests/lang.min") => join-path . relative-path unix-path "tests/lang.min" ==) *test/assert + ((. "tests/global.min") => join-path . relative-path unix-path "tests/global.min" ==) *test/assert - ("tests/lang.min" absolute-path unix-path (. "tests/lang.min") => join-path unix-path ==) *test/assert + ("tests/global.min" absolute-path unix-path (. "tests/global.min") => join-path unix-path ==) *test/assert ("./test" absolute-path? not) *test/assert
M tests/lang.mintests/global.min

@@ -1,7 +1,7 @@

'min-test require :test ;;; -"lang" *test/describe +"global" *test/describe (2 'a define (3 a + (5 'a define a) -> +) -> a + 12 ==) *test/assert