all repos — min @ 3e04b54f172f7578ad62776a7441346c4f2f5a6c

A small but practical concatenative programming language.

Migrating reference docs.
h3rald h3rald@h3rald.com
Sun, 12 Mar 2017 13:21:05 +0100
commit

3e04b54f172f7578ad62776a7441346c4f2f5a6c

parent

d6a6817c7ae538605dc9d27b1095586a451bc240

M site/assets/styles/min-lang.csssite/assets/styles/min-lang.css

@@ -41,8 +41,12 @@ b, strong {

font-weight: 400; } -code, pre { +code, pre, .kwd { font-family: 'Inconsolata', monospace; +} + +.kwd { + font-weight: bold; } h1, h2, h3, h4, h5, h6 {

@@ -52,3 +56,11 @@

.pitch { font-size: 1.2em; } + +.operator { + margin-left: 2em; +} + +dl { + margin-left: 1em; +}
A site/contents/_defs_.md

@@ -0,0 +1,20 @@

+ +{#op => +## $1 + +> %operator% +> _Signature:_ [ $2 **⇒** $3](class:kwd) +> +> $4 + + #} + +{{q => [(\*)](class:kwd)}} +{{1 => [(1)](class:kwd)}} +{{2 => [(2)](class:kwd)}} +{{e => [(E)](class:kwd)}} +{{s => [S](class:kwd)}} +{{sl => [§](class:kwd)}} +{{f => [false](class:kwd)}} +{{t => [true](class:kwd)}} +{{null => ∅}}
A site/contents/_reference-crypto_.md

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

+...
A site/contents/_reference-fs_.md

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

+...
A site/contents/_reference-io_.md

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

+...
A site/contents/_reference-lang_.md

@@ -0,0 +1,84 @@

+{@ _defs_.md || 0 @} + +{#op||bind||\* §||{{null}}|| +Binds the specified value (auto-quoted) to an existing symbol {{sl}}.#} + +{#op||call||(\*) §||\*?|| +Calls operator {{sl}} defined in scope {{q}}. #} + +{#op||debug||{{null}}||{{null}}|| +Toggles debug mode. #} + +{#op||debug?||{{null}}||B|| +Returns {{t}} if debug mode is on, {{f}} otherwise. #} + +{#op||define||\* §||{{null}}|| +Defines a new symbol {{sl}}, containing the specified value (auto-quoted).#} + +{#op||delete||§||{{null}}|| +Deletes the specified symbol {{sl}}.#} + +{#op||eval||S||\*?|| +Parses and interprets {{s}}. #} + +{#op||exit||{{null}}||{{null}}|| +Exits the program or shell. #} + +{#op||format-error||(E)||S|| +Formats the error {{e}} as a string. + +> %sidebar% +> Example +> +> The following: +> +> `((error "MyError") (message "This is a test error")) format-error` +> +> produces: `"This is a test error"` +} + +{#op||from-json||S||\*|| +Converts a JSON string into {{M -> MiNiM}} data.#} + +{#op||import||§||{{null}}|| +Imports the a previously-loaded module {{sl}}, defining all its symbols in the current scope. #} + +{#op||inspect||(\*)||(S+)|| +Returns a list of symbols published on {{q}}'s scope. #} + +{#op||load||S||\*?|| +Parses and interprets the specified {{M}} file {{s}}, adding [.min](class:ext) if not specified. #} + +{#op||module||(\*) §||{{null}}|| +Creates a new module {{sl}} based on quotation {{q}}. #} + +{#op||publish||§ (*)||{{null}}|| +Publishes symbol {{sl}} to the scope of [(\*)](class:kwd). + +> %sidebar% +> Example +> +> Publish symbol [my-local-symbol](class:kwd) to [ROOT](class:kwd) scope: +> `'my-local-symbol ROOT publish` + + #} + +{#op||raise||(E)||{{null}}|| +Raises the error specified via the dictionary {{e}}.#} + + +{#op||sigils||{{null}}||(S+)|| +Returns a list of all sigils defined in the [ROOT](class:kwd) scope.#} + +{#op||source||§||(\*)|| +Display the source code of symbol {{sl}} (if it has been implemented a {{M}} quotation). #} + +{#op||symbols||{{null}}||(S+)|| +Returns a list of all symbols defined in the [ROOT](class:kwd) scope.#} + +{#op||to-json||(\*)||S|| +Converts a quotation into a JSON string {{s}}.#} + +{#op||with||(2) (1)||\*?|| +Applies quotation [(2)](class:kwd) within the scope of [(1)](class:kwd). #} +
A site/contents/_reference-logic_.md

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

+...
A site/contents/_reference-num_.md

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

+...
A site/contents/_reference-str_.md

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

+...
A site/contents/_reference-sys_.md

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

+...
A site/contents/_reference-time_.md

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

+...
A site/contents/_reference_.md

@@ -0,0 +1,37 @@

+# Notation + +{@ _defs_.md || 0 @} + +\* +: Any value. +B +: A boolean value. +{{q}} +: A quotation. +{{1}} +: The first quotation on the stack. +{{2}} +: The second quotation on the stack. +{{e}} +: An error dictionary: + <pre><code>( + (error "MyError") + (message "An error occurred") + (symbol "symbol1") ;Optional + (filename "dir1/file1.min") ;Optional + (line 3) ;Optional + (column 13) ;Optional + ) + </code></pre> +{{s}} +: A string value. +S+ +: One or more string values. +{{sl}} +: String-like (a string or quoted sumbol). +{{f}} +: false (boolean type). +{{t}} +: true (boolean type). +{{null}} +: No value.
A site/contents/reference-crypto.md

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

+----- +content-type: page +title: crypto Module +----- +{@ _reference-crypto_.md || 1 @}
A site/contents/reference-fs.md

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

+----- +content-type: page +title: fs Module +----- +{@ _reference-fs_.md || 1 @}
A site/contents/reference-io.md

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

+----- +content-type: page +title: io Module +----- +{@ _reference-io_.md || 1 @}
A site/contents/reference-lang.md

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

+----- +content-type: page +title: lang Module +----- +{@ _reference-lang_.md || 1 @}
A site/contents/reference-logic.md

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

+----- +content-type: page +title: logic Module +----- +{@ _reference-logic_.md || 1 @}
A site/contents/reference-num.md

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

+----- +content-type: page +title: num Module +----- +{@ _reference-num_.md || 1 @}
A site/contents/reference-str.md

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

+----- +content-type: page +title: str Module +----- +{@ _reference-str_.md || 1 @}
A site/contents/reference-sys.md

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

+----- +content-type: page +title: sys Module +----- +{@ _reference-sys_.md || 1 @}
A site/contents/reference-time.md

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

+----- +content-type: page +title: time Module +----- +{@ _reference-time_.md || 1 @}
M site/contents/reference.mdsite/contents/reference.md

@@ -2,4 +2,26 @@ -----

content-type: page title: Reference ----- -Coming soon... + +# Modules + +[lang](/reference-lang/) +: ... +[io](/reference-io/) +: ... +[fs](/reference-fs/) +: ... +[logic](/reference-logic/) +: ... +[str](/reference-str/) +: ... +[sys](/reference-sys/) +: ... +[num](/reference-num/) +: ... +[time](/reference-time/) +: ... +[crypto](/reference-crypto/) +: ... + +{@ _reference_.md || 1 @}
M site/rules.minsite/rules.min

@@ -51,6 +51,7 @@ ;Main

modified ( dup ( + ((/id "^_" match) ()) ;Ignore files starting with underscore. ((asset?) (copy2output)) ((content?) (process-content set-destination output-fwrite)) ) case