all repos — min @ 5b903bba5586208551fdf064e38b551aa2dc1cf7

A small but practical concatenative programming language.

Restructuring docs.
h3rald h3rald@h3rald.com
Sun, 19 Mar 2017 21:30:10 +0100
commit

5b903bba5586208551fdf064e38b551aa2dc1cf7

parent

8e7b4e84fa0ec4588d601adfe0d1704ea4414435

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

@@ -64,3 +64,144 @@

dl { margin-left: 1em; } + +.note { + -moz-background-clip: padding; + -webkit-background-clip: padding-box; + background-clip: padding-box; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + margin: 10px auto; + padding: 2px 4px 0 4px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); + color: #264c72; + background-color: #d8ebf8; + border: 1px solid #A4D1EF; + font-size: 90%; +} +.note a { + color: #264c72; +} +.note p:first-child { + font-weight: bold; + color: #264c72; +} +.note p:first-child:before { + font-family: "themify"; + font-style: normal; + font-weight: normal; + font-size: 100%; + color: #264c72; + content: "\e717" " "; +} +.note a { + color: #132639; +} +.tip { + -moz-background-clip: padding; + -webkit-background-clip: padding-box; + background-clip: padding-box; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + margin: 10px auto; + padding: 2px 4px 0 4px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); + color: #009926; + background-color: #d8f5cd; + border: 1px solid #B0EB99; + font-size: 90%; +} +.tip a { + color: #264c72; +} +.tip p:first-child { + font-weight: bold; + color: #009926; +} +.tip p:first-child:before { + font-family: "themify"; + font-style: normal; + font-weight: normal; + font-size: 100%; + color: #009926; + content: "\e64d" " "; +} +.tip a { + color: #004d13; +} +.warning { + -moz-background-clip: padding; + -webkit-background-clip: padding-box; + background-clip: padding-box; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + margin: 10px auto; + padding: 2px 4px 0 4px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); + color: #705400; + background-color: #FFEBAD; + border: 1px solid #FFDB70; + font-size: 90%; +} +.warning a { + color: #264c72; +} +.warning p:first-child { + font-weight: bold; + color: #705400; +} +.warning p:first-child:before { + font-family: "themify"; + font-style: normal; + font-weight: normal; + font-size: 100%; + color: #705400; + content: "\e6c5" " "; +} +.warning a { + color: #241b00; +} +.sidebar { + -moz-background-clip: padding; + -webkit-background-clip: padding-box; + background-clip: padding-box; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + margin: 10px auto; + padding: 2px 4px 0 4px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8); + color: #555; + background-color: #f8f8f8; + border: 1px solid #f8f8f8; + font-size: 90%; +} +.sidebar a { + color: #264c72; +} +.sidebar p:first-child { + font-weight: bold; + color: #555; +} +.sidebar p:first-child:before { + font-family: "themify"; + font-style: normal; + font-weight: normal; + font-size: 100%; + color: #555; + content: "\e717" " "; +} +.sidebar a { + color: #2f2f2f; +} +.tip p, .warning p, .note p, .sidebar p { + margin: 0 auto; + line-height: 1.7em; +}
M site/contents/_defs_.mdsite/contents/_includes/_defs_.md

@@ -6,7 +6,6 @@ > %operator%

> _Signature:_ [ $2 **⇒** $3](class:kwd) > > $4 - #} {# link-module => [`$1` Module](/reference-$1/) #}
A site/contents/_includes/_learn-data-types_.md

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

+----- +content-type: page +title: Learn +----- +Coming soon...
A site/contents/_includes/_learn-modules_.md

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

+----- +content-type: page +title: Learn +----- +Coming soon...
A site/contents/_includes/_learn-operators_.md

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

+----- +content-type: page +title: Learn +----- +Coming soon...
A site/contents/_includes/_learn-quotations_.md

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

+----- +content-type: page +title: Learn +----- +Coming soon...
A site/contents/_includes/_learn-shell_.md

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

+----- +content-type: page +title: Learn +----- +Coming soon...
A site/contents/_includes/_learn-syntax_.md

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

+----- +content-type: page +title: Learn +----- +Coming soon...
A site/contents/_includes/_learn-variables_.md

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

+----- +content-type: page +title: Learn +----- +Coming soon...
A site/contents/_includes/_learn_.md

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

+TBD.
M site/contents/_reference-lang_.mdsite/contents/_includes/_reference-lang_.md

@@ -34,11 +34,10 @@ > The following:

> > `((error "MyError") (message "This is a test error")) format-error` > -> produces: `"This is a test error"` -} +> produces: `"This is a test error"`#} {#op||from-json||S||\*|| -Converts a JSON string into {{M -> MiNiM}} data.#} +Converts a JSON string into {{M -> min}} data.#} {#op||import||§||{{null}}|| Imports the a previously-loaded module {{sl}}, defining all its symbols in the current scope. #}

@@ -49,23 +48,36 @@

{#op||load||S||\*?|| Parses and interprets the specified {{M}} file {{s}}, adding [.min](class:ext) if not specified. #} +{#op||loglevel||§||{{null}}|| +Sets the current logging level to {{sl}}. {{sl}} must be one of the following strings or quoted symbols: + + * debug + * info + * notice + * warn + * error + * fatal + +> %note% +> Note +> +> The default logging level is _notice_. + #} + {#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 -> +> +> > %sidebar% +> > Example +> > > Publish symbol [my-local-symbol](class:kwd) to [ROOT](class:kwd) scope: -> `'my-local-symbol ROOT publish` - - #} +> > `'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.#}

@@ -79,6 +91,27 @@

{#op||to-json||(\*)||S|| Converts a quotation into a JSON string {{s}}.#} + +{#op||try||(\*)||\*?|| +Evaluates quotation {{q}} as a try/catch/finally block. +> +> {{q}} must contain the following elements: +> +> 1. A quotation containing the code to be evaluated (_try_ block). +> 1. _(optional)_ A quotation containing the code to execute in case of error (_catch_ block). +> 1. _(optional)_ A quotation containing the code to execute after the code has been evaluated, whether an error occurred or not (_finally_ block). +> +>> %sidebar% +>> Example +>> +>> The following program executed on an empty stack prints the message "Insufficient items on the stack" and pushes 0 on the stack: +>> +>> ( +>> (pop) +>> (format-error puts) +>> (0) +>> ) try #} + {#op||with||(2) (1)||\*?|| -Applies quotation [(2)](class:kwd) within the scope of [(1)](class:kwd). #} +Applies quotation {{2}} within the scope of {{1}}. #}
M site/contents/learn.mdsite/contents/learn.md

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

content-type: page title: Learn ----- -Coming soon... +{@ _includes/_learn_.md || 0 @}
M site/contents/reference-crypto.mdsite/contents/reference-crypto.md

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

@@ -3,4 +3,4 @@ content-type: page

title: Reference ----- -{@ _reference_.md || 0 @} +{@ _includes/_reference_.md || 0 @}
M site/rules.minsite/rules.min

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

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