all repos — min @ a6f96659a51fabc205ab421ddee9b05a0519e844

A small but practical concatenative programming language.

Updating documentation.
h3rald h3rald@h3rald.com
Sat, 07 Oct 2023 21:43:26 +0200
commit

a6f96659a51fabc205ab421ddee9b05a0519e844

parent

863edd398ed8bbde3469eb8cfb3f9cd1a619110e

M min.vimmin.vim

@@ -1,8 +1,8 @@

" Vim syntax file " Language: min " Maintainer: Fabio Cevasco -" Last Change: 31 Jul 2023 -" Version: 0.39.0 +" Last Change: 07 Oct 2023 +" Version: 0.40.0 if exists("b:current_syntax") finish

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

setl iskeyword=@,36-39,+,-,*,.,/,:,~,!,48-57,60-65,94-95,192-255 setl iskeyword+=^ -syntax keyword minDefaultSymbol ! != $ % & && ' * + - -> -inf . .. / : :: < <= =% =-= == ==> => =~ > >< >= >> ? @ ROOT ^ abs absolute-path absolute-path? accept acos admin? aes all? and any? append apply apply-interpolate args asin ask atan atime avg bind bitand bitnot bitor bitxor boolean boolean? capitalize case cd ceil chmod choose chr clear clear-stack cleave close column-print compiled? concat confirm connect cons cos cosh cp cpu crypto ctime d2r datetime ddel ddup debug decode decode-url define defined-sigil? defined-symbol? delete-sigil delete-symbol dequote dev? dget dget-raw dhas? dict dictionary? difference dip dir? dirname div dkeys download dpairs dpick drop dsdelete dset dset-sym dsget dshas? dsinit dspost dsput dsquery dsread dstore dswrite dtype dup dvalues e encode encode-url env? error escape eval even? exists? exit expand-filename expand-symlink expect expect-all expect-any expect-empty-stack fappend fatal file? filename filter find first flatten float float? floor foreach format-error fperms fread from-json from-semver from-yaml fs fsize fstats ftype fwrite get get-content get-env get-raw get-stack getchr gets hardlink harvest help hidden? http id if import in? indent indexof inf infix-dequote info insert integer integer? interpolate intersection invoke io join join-path keep lambda lambda-bind last length line-info linrec listen ln load load-symbol log10 log2 logic loglevel loglevel? lowercase ls ls-r map map-reduce mapkey match? math md4 md5 med mkdir mod mtime mv nan net newline nip normalized-path not notice now null? num number? odd? one? operator opts or ord os over parent-scope parse parse-url partition password pi pick pop pow pred prefix prefix-dequote prepend print product prompt publish put-env putchr puts quit quotation? quote quote-map quoted-symbol? quotesym r2g raise random randomize range raw-args recv recv-line reduce reject relative-path remove remove-symbol repeat replace replace-apply request require rest return reverse rm rmdir rolldown rollup round run save-symbol saved-symbols scope scope-sigils scope-symbols seal-sigil seal-symbol sealed-sigil? sealed-symbol? search search-all semver-inc-major semver-inc-minor semver-inc-patch semver? send seq set set-stack set-sym sha1 sha224 sha256 sha384 sha512 shl shorten shr sigil-help sigils sin sinh sip size sleep slice socket sort source split spread sqrt stack start-server stop-server str string string? stringlike? strip substr succ suffix sum swap swons symbol-help symbols symlink symlink? symmetric-difference sys system take tan tanh tap tau tformat time timeinfo times timestamp titleize to-json to-semver to-timestamp to-yaml trunc try type type? typealias union unix-path unless unmapkey unseal-sigil unseal-symbol unzip uppercase version warn when which while windows-path with xor zip ~ +syntax keyword minDefaultSymbol ! != $ % & && ' * + - -> -inf . .. / : :: < <= =% =-= == ==> => > >< >= >> ? @ ROOT ^ abs absolute-path absolute-path? accept acos admin? aes all? and any? append apply apply-interpolate args asin ask atan atime avg bind bitand bitnot bitor bitxor boolean boolean? capitalize case cd ceil chmod choose chr clear clear-stack cleave close column-print compiled? concat confirm connect cons cos cosh cp cpu crypto ctime d2r datetime ddel ddup debug decode decode-url define defined-sigil? defined-symbol? delete-sigil delete-symbol dequote dev? dget dget-raw dhas? dict dictionary? difference dip dir? dirname div dkeys download dpairs dpick drop dsdelete dset dset-sym dsget dshas? dsinit dspost dsput dsquery dsread dstore dswrite dtype dup dvalues e encode encode-url env? error escape eval even? exists? exit expand-filename expand-symlink expect expect-all expect-any expect-empty-stack fappend fatal file? filename filter find first flatten float float? floor foreach format-error fperms fread from-json from-semver from-xml from-yaml fs fsize fstats ftype fwrite get get-content get-env get-raw get-stack getchr gets getstack hardlink harvest help hidden? http id if import in? indent indexof inf infix-dequote info insert integer integer? interpolate intersection invoke io join join-path keep lambda lambda-bind lambdabind last length line-info linrec listen ln load load-symbol log10 log2 logic loglevel loglevel? lowercase ls ls-r map map-reduce mapkey match? math md4 md5 med mkdir mod mtime mv nan net newline nip normalized-path not notice now null? num number? odd? one? operator opts or ord os over parent-scope parse parse-url partition password pi pick pop pow pred prefix prefix-dequote prepend print product prompt publish put-env putchr puts quit quotation? quote quote-map quotecmd quoted-symbol? quotesym r2g raise random randomize range raw-args read recv recv-line reduce reject relative-path remove remove-symbol repeat replace replace-apply request require rest return reverse rm rmdir rolldown rollup round run save-symbol saved-symbols scope scope-sigils scope-symbols seal-sigil seal-symbol sealed-sigil? sealed-symbol? search search-all semver-inc-major semver-inc-minor semver-inc-patch semver? send seq set set-stack set-sym setstack sha1 sha224 sha256 sha384 sha512 shl shorten shr sigil-help sigils sin sinh sip size sleep slice socket sort source split spread sqrt stack start-server stop-server str string string? stringlike? strip substr succ suffix sum swap swons symbol-help symbols symlink symlink? symmetric-difference sys system take tan tanh tap tau tformat time timeinfo times timestamp titleize to-json to-semver to-timestamp to-xml to-yaml trunc try type type? typealias typealias:xml-node union unix-path unless unmapkey unseal-sigil unseal-symbol unzip uppercase version warn when which while windows-path with write xcdata xcomment xelement xentity xml xor xquery xqueryall xtext zip ~ syntax match minDefaultSymbol ;||; syntax keyword minCommentTodo TODO FIXME XXX TBD contained
M minpkg/lib/min_num.nimminpkg/lib/min_num.nim

@@ -121,28 +121,10 @@ let vals = i.expect("int")

let n = vals[0] i.push newVal(n.intVal mod 2 != 0) - def.symbol("bitand") do (i: In): - let vals = i.expect("int", "int") - let b = vals[0] - let a = vals[1] - i.push newVal(a.intVal and b.intVal) - def.symbol("bitnot") do (i: In): let vals = i.expect("int") let a = vals[0] i.push newVal(not a.intVal) - - def.symbol("bitor") do (i: In): - let vals = i.expect("int", "int") - let b = vals[0] - let a = vals[1] - i.push newVal(a.intVal or b.intVal) - - def.symbol("bitxor") do (i: In): - let vals = i.expect("int", "int") - let b = vals[0] - let a = vals[1] - i.push newVal(a.intVal xor b.intVal) def.symbol("shl") do (i: In): let vals = i.expect("int", "int")
M next-release.mdnext-release.md

@@ -7,7 +7,7 @@ ### New Features

* Added support for binary (0b) octal (0o), and hexadecimal (0x) integers in parser. * Added `base` and `base?` symbols to set and get the current number base (dec, hex, bin or oct). -* Added `bitand`, `bitor`, `bitxor`, `bitparity`, `bitclear`, `bitflip`, `bitset`, `bitmask` symbols for biwise operations. +* Added `bitparity`, `bitclear`, `bitflip`, `bitset`, `bitmask` symbols for biwise operations. * Added `to-(hex|bin|dec|oct)` and `from-(hex|bin|dec|oct)` symbols to convert integers to and from different string representations. * Added `help`, `compile` and `eval` commands to the min executable.
M site/contents/get-started.mdsite/contents/get-started.md

@@ -144,7 +144,7 @@ min programs can be compiled to a single executable simply by using the built-in `compile` command:

> %min-terminal% > -> [$](class:prompt) min cimpile myfile.min +> [$](class:prompt) min compile myfile.min Essentially, this will:

@@ -155,7 +155,7 @@ If you want to pass any options to the Nim compiler (like `-d:release` for example) you can do so by using the `-n` (or `--passN`) option:

> %min-terminal% > -> [$](class:prompt) min compile myfile.min -n:"-d:release --threadAnalysis:off --mm:refc" +> [$](class:prompt) min compile myfile.min -n:&quot;-d:release --threadAnalysis:off --mm:refc&quot; Additionally, you can also use `-m:<path>` (or `--module-path`) to specify one path containing [.min](class:ext) files which will be compiled as well (but not executed) along with the specified file. Whenever a {#link-operator||lang||load#} or a {#link-operator||lang||require#} symbol is used to load/require an external [.min](class:ext) file, it will attempt to retrieve its contents from the pre-loaded files first before searching the filesystem.
M site/contents/reference-num.mdsite/contents/reference-num.md

@@ -23,16 +23,16 @@ {#op||avg||{{q}}||{{n}}||

Returns the average of the items of {{q}}. #} {#op||bitand||{{i1}} {{i2}}||{{i3}}|| -Computes the bitwise *and* of numbers {{i1}} and {{i2}}.#} +Computes the bitwise *and* of integer {{i1}} and {{i2}}.#} {#op||bitnot||{{i1}}||{{i2}}|| Computes the bitwise *complement* of {{i1}}.#} {#op||bitor||{{i1}} {{i2}}||{{i3}}|| -Computes the bitwise *or* of numbers {{i1}} and {{i2}}.#} +Computes the bitwise *or* of integers {{i1}} and {{i2}}.#} {#op||bitxor||{{i1}} {{i2}}||{{i3}}|| -Computes the bitwise *xor* of numbers {{i1}} and {{i2}}.#} +Computes the bitwise *xor* of integers {{i1}} and {{i2}}.#} {#op||even?||{{i}}||{{b}}|| Returns {{t}} if {{i}} is even, {{f}} otherwise. #}