all repos — min @ 358c9895fa78019998a3f96bfce24f2a95aa09f5

A small but practical concatenative programming language.

Updating docs.
h3rald h3rald@h3rald.com
Sun, 26 Mar 2017 10:50:20 +0200
commit

358c9895fa78019998a3f96bfce24f2a95aa09f5

parent

e8aa70f35ae2269b3583cd76ec98a223aa25a0ca

M site/contents/_includes/_defs_.mdsite/contents/_includes/_defs_.md

@@ -3,7 +3,7 @@ {#op =>

## $1 > %operator% -> _Signature:_ [ $2 **⇒** $3](class:kwd) +> [ $2 **⇒** $3](class:kwd) > > $4 #}

@@ -14,7 +14,12 @@ {{q => [(\*)](class:kwd)}}

{{1 => [(1)](class:kwd)}} {{2 => [(2)](class:kwd)}} {{e => [(E)](class:kwd)}} +{{i => [I](class:kwd)}} +{{n => [N](class:kwd)}} +{{any => [\*](class:kwd)}} {{s => [S](class:kwd)}} +{{s1 => [S1](class:kwd)}} +{{s2 => [S2](class:kwd)}} {{sp => [S+](class:kwd)}} {{sl => [§](class:kwd)}} {{f => [false](class:kwd)}}
M site/contents/_includes/_reference-lang_.mdsite/contents/_includes/_reference-lang_.md

@@ -1,10 +1,19 @@

{@ _defs_.md || 0 @} +{#op||append||\* (\*)||(\*)|| +Returns a new quotation containing the contents of {{q}} with [\*](class:kwd) appended. #} + +{#op||at||(\*) I||\*|| +Returns the {{i}}^th element of {{q}}.#} + {#op||bind||\* §||{{null}}|| Binds the specified value (auto-quoted) to an existing symbol {{sl}}.#} {#op||call||(\*) §||\*?|| Calls operator {{sl}} defined in scope {{q}}. #} + +{#op||concat||(2) (1)||(\*)|| +Concatenates {{2}} with {{1}}. #} {#op||debug||{{null}}||{{null}}|| Toggles debug mode. #}

@@ -23,6 +32,9 @@ Parses and interprets {{s}}. #}

{#op||exit||{{null}}||{{null}}|| Exits the program or shell. #} + +{#op||first||(\*)||\*|| +Returns the first element of {{q}}. #} {#op||format-error||(E)||S|| Formats the error {{e}} as a string.

@@ -67,6 +79,15 @@

{#op||module||(\*) §||{{null}}|| Creates a new module {{sl}} based on quotation {{q}}. #} +{#op||module-sigils||(\*)||(S+)|| +Returns a list of all sigils defined in module {{q}}.#} + +{#op||module-symbols||(\*)||(S+)|| +Returns a list of all symbols defined in module {{q}}.#} + +{#op||prepend||\* (\*)||(\*)|| +Returns a new quotation containing the contents of {{q}} with [\*](class:kwd) prepended. #} + {#op||publish||§ (*)||{{null}}|| Publishes symbol {{sl}} to the scope of [(\*)](class:kwd). >

@@ -76,8 +97,14 @@ > >

> Publish symbol [my-local-symbol](class:kwd) to [ROOT](class:kwd) scope: > > `'my-local-symbol ROOT publish` #} +{#op||quote||\*||(\*)|| +Wraps [\*](class:kwd) in a quotation. #} + {#op||raise||(E)||{{null}}|| Raises the error specified via the dictionary {{e}}.#} + +{#op||rest||(\*)||(\*)|| +Returns a new quotation containing all elements of the input quotation except for the first. #} {#op||sigils||{{null}}||(S+)|| Returns a list of all sigils defined in the [ROOT](class:kwd) scope.#}

@@ -111,6 +138,9 @@ >> (pop)

>> (format-error puts) >> (0) >> ) try #} + +{#op||unquote||(\*)||\*|| +Pushes the contents of quotation {{q}} on the stack. #} {#op||with||(2) (1)||\*?|| Applies quotation {{2}} within the scope of {{1}}. #}
M site/contents/_includes/_reference_.mdsite/contents/_includes/_reference_.md

@@ -4,6 +4,8 @@ min includes a small but powerful standard library organized into the following _modules_:

{#link-module||lang#} : Defines the basic language constructs, such as control flow, symbol definition and binding, exception handling, basic stack operators, etc. +{#link-module||stack#} +: Defines combinators and stack-shufflers like dip, dup, swap, cons, etc. {#link-module||io#} : Provides operators for reading and writing files as well as printing to STDOUT and reading from STDIN. {#link-module||fs#}

@@ -46,8 +48,16 @@ (line 3) ;Optional

(column 13) ;Optional ) </code></pre> +{{i}} +: An integer value. +{{n}} +: A numeric value. {{s}} : A string value. +{{s1}} +: The first string on the stack. +{{s2}} +: The second string on the stack. {{sp}} : One or more string values. {{sl}}
M site/contents/download.mdsite/contents/download.md

@@ -4,11 +4,11 @@ title: Download

----- You can download one of the following pre-built min binaries: -* {#release||0.4.0||osx||macOS||x64#} -* {#release||0.4.0||windows||Windows||x64#} -* {#release||0.4.0||linux||Linux||x64#} -* {#release||0.4.0||linux||Linux||x86#} -* {#release||0.4.0||linux||Linux||arm#} +* {#release||{{$version}}||osx||macOS||x64#} +* {#release||{{$version}}||windows||Windows||x64#} +* {#release||{{$version}}||linux||Linux||x64#} +* {#release||{{$version}}||linux||Linux||x86#} +* {#release||{{$version}}||linux||Linux||arm#} {#release -> [min v$1 for $3 ($4)](https://github.com/h3rald/min/releases/download/v$1/min\_v$1\_$2\_$4.zip) #}
M site/contents/home.mdsite/contents/home.md

@@ -9,7 +9,7 @@ with a minimalist syntax, a small but practical standard library, and an advanced

REPL. All packed in less than 1MB. </section> <section class="centered pure-u-1 pure-u-md-1-3"> - <a class="pure-button pure-button-primary" href="/download/"><i class="ti-download"></i> download min v0.4.0</a> + <a class="pure-button pure-button-primary" href="/download/"><i class="ti-download"></i> download min v{{$version}}</a> <br> <small> <a href="https://github.com/h3rald/min">Repository</a> |
A site/contents/reference-stack.md

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

+----- +content-type: page +title: stack Module +----- +{@ _includes/_reference-stack_.md || 1 @}
M site/rules.minsite/rules.min

@@ -1,4 +1,6 @@

'hastysite import +'stack import + ;Routing ( =meta

@@ -24,8 +26,9 @@ =meta

meta /path :path " - Processing $1: $2" (tpl path) % notice meta input-fread :contents + meta settings /title %site #meta + meta settings /version %version #meta contents meta markdown @contents - meta settings /title %site #meta meta contents %contents #meta tpl meta mustache :page meta page %contents #meta
M site/settings.jsonsite/settings.json

@@ -5,5 +5,6 @@ "templates": "templates",

"temp": "temp", "output": "output", "title": "min language", + "version": "0.5.0", "rules": "rules.min" }