all repos — min @ 7d9bd073a1ce4aceabce8d321b9e210675d18b68

A small but practical concatenative programming language.

Started documenting stack module.
h3rald h3rald@h3rald.com
Sun, 26 Mar 2017 18:47:12 +0200
commit

7d9bd073a1ce4aceabce8d321b9e210675d18b68

parent

f7bff82a771fdd3b2ef20f94203900a33731b88a

M lib/min_stack.nimlib/min_stack.nim

@@ -51,14 +51,14 @@ i.push "unquote".newSym

.symbol("dup") do (i: In): i.push i.peek - + # (dup) dip .symbol("dupd") do (i: In): i.push newVal(@["dup".newSym], i.scope) i.push "dip".newSym #((dup) dip unquote) - .symbol("q") do (i: In): + .symbol("w") do (i: In): i.push newVal(@["dup".newSym], i.scope) i.push "dip".newSym i.push "unquote".newSym
M site/contents/_includes/_defs_.mdsite/contents/_includes/_defs_.md

@@ -30,6 +30,8 @@

{# link-module => [`$1` Module](/reference-$1/) #} {{q => [(\*)](class:kwd)}} +{{1e => [1](class:kwd)}} +{{2e => [2](class:kwd)}} {{1 => [(1)](class:kwd)}} {{2 => [(2)](class:kwd)}} {{3 => [(3)](class:kwd)}}
M site/contents/_includes/_reference-stack_.mdsite/contents/_includes/_reference-stack_.md

@@ -1,1 +1,38 @@

-... +{@ _defs_.md || 0 @} + +{#op||dip||2 (1)||1 2|| +Removes the first and second element from the stack, unquotes the first element, and restores the second element.#} + +{#op||dup||1||1 1|| +Duplicates the first element on the stack.#} + +{#op||dupd||2 1||2 2 1|| +Duplicates the second element on the stack.#} + +{#op||id||{{null}}||{{null}}|| +Does nothing.#} + +{#op||k||(2) (1)||1|| +K combinator; removes the second element from the stack and unquotes the first element on the stack.#} + +{#op||newstack||{{null}}||{{null}}|| +Empties the stack.#} + +{#op||pop||\*||{{null}}|| +Removes the first element from the stack.#} + +{#op||popd||2 1||1|| +Removes the second element from the stack.#} + +{#op||popop||2 1||{{null}}|| +Removes the first two elements from the stack.#} + +{#op||stack||{{null}}||(\*)|| +Returns a quotation containing the contents of the stack.#} + +{#op||unstack||(\*)||\*?|| +Substitute the existing stack with the contents of {{q}}.#} + +{#op||w||(2) (1)||(2) (2) 1|| +W combinator; duplicates the second element from the stack and unquotes the first element on the stack.#} +
M site/contents/_includes/_reference_.mdsite/contents/_includes/_reference_.md

@@ -35,6 +35,10 @@ B

: A boolean value. {{q}} : A quotation. +{{1e}} +: The first element on the stack. +{{2e}} +: The second element on the stack. {{1}} : The first quotation on the stack. {{2}}