all repos — min @ 139e79c92c2b0239f742d54ab131de1a56a7ba30

A small but practical concatenative programming language.

Fixed docs (ref: #49)
h3rald h3rald@h3rald.com
Tue, 16 Jun 2020 13:21:40 +0200
commit

139e79c92c2b0239f742d54ab131de1a56a7ba30

parent

2a2dd1461dfedfb07cc9c23f94098174841e0a00

M site/contents/learn-data-types.mdsite/contents/learn-data-types.md

@@ -10,9 +10,9 @@

boolean : **true** or **false**. integer -: An integer number like 1, 27 or -15. +: A 64-bit integer number like 1, 27 or -15. float -: A floating-point number like 3.14 or -56.9876. +: A 64-bit floating-point number like 3.14 or -56.9876. string : A series of characters wrapped in double quotes: "Hello, World!". quotation
M site/contents/learn-extending.mdsite/contents/learn-extending.md

@@ -19,14 +19,14 @@

The {#link-operator||lang||module#} (and the **+** sigil) allows you to create a new min module: ``` -( +{ (dup *) :pow2 (dup dup * *) :pow3 (dup dup dup * * *) :pow4 -) +quickpows +} +quickpows ```
M site/contents/reference-lang.mdsite/contents/reference-lang.md

@@ -44,7 +44,7 @@ {#op||apply||{{q}}|{{d}}||({{a0p}})|{{{a0p}}}||

> This operator can be used on a quotation or a dictionary: > > * If a quotation {{q}} is passed, it returns a new quotation obtained by evaluating each element of {{q}} in a separate stack. -> * If a dictionary {{d}} is passed, it returns a new dictionary obtained by evaluating each symbol of {{d}} in a separate stack.#} +> * If a dictionary {{d}} (with values and keys) is passed, it returns a new dictionary obtained by evaluating each value in the dict that is a symbol in a separate stack (values that aren't symbols stay as they are).#} {#op||args||{{null}}||{{q}}|| Returns a list of all arguments passed to the current program.#}

@@ -56,9 +56,9 @@ {#op||bool||{{any}}||{{b}}||

> Converts {{any}} to a boolean value based on the following rules: > > * If {{any}} is a boolean value, no conversion is performed. -> * If {{any}} is a non-zero numeric value, it is converted to {{t}}, otherwise it is converted to {{f}}. -> * If {{any}} is a non-empty quotation, it is converted to {{t}}, otherwise it is converted to {{f}}. -> * If {{any}} is a non-empty string or not `"false"`, it is converted to {{t}}, otherwise it is converted to {{f}}.#} +> * If {{any}} is a numeric value, zero is converted to {{f}}, otherwise it is converted to {{t}}. +> * If {{any}} is a quotation or a dictionary, the empty quotation or dictionary is converted to {{f}}, otherwise it is converted to {{t}}. +> * If {{any}} is a string, the empty string, and `"false"` are converted to {{f}}, otherwise it is converted to {{t}}.#} {#op||call||{{d}} {{sl}}||{{a0p}}|| Calls operator {{sl}} defined in dictionary {{d}}. #}

@@ -92,7 +92,9 @@ {#op||delete||{{sl}}||{{null}}||

Deletes the specified symbol {{sl}}.#} {#op||dequote||{{q}}||{{a0p}}|| -Pushes the contents of quotation {{q}} on the stack. #} +Pushes the contents of quotation {{q}} on the stack. + +Each element is pushed on the stack one by one. If any error occurs, {{q}} is restored on the stack.#} {#op||eval||{{s}}||{{a0p}}|| Parses and interprets {{s}}. #}
M site/contents/reference-stack.mdsite/contents/reference-stack.md

@@ -4,7 +4,7 @@ title: "stack Module"

----- {@ _defs_.md || 0 @} -{#op||clear-stack||{{null}}||{{null}}|| +{#op||clear-stack||{{any}}||{{null}}|| Empties the stack.#} {#op||cleave||{{a1}} ({{q}}{{0p}})||{{a0p}}||

@@ -26,7 +26,7 @@ {#op||dup||{{a1}}||{{a1}} {{a1}}||

Duplicates the first element on the stack.#} {#op||get-stack||{{null}}||({{a0p}})|| -Returns a quotation containing the contents of the stack.#} +Puts a quotation containing the contents of the stack on the stack.#} {#op||id||{{null}}||{{null}}|| Does nothing.#}