all repos — min @ 14e10792c672d8089124145796086dc7ca224d73

A small but practical concatenative programming language.

Fixed typos.
h3rald h3rald@h3rald.com
Sun, 30 Jul 2017 19:20:20 +0200
commit

14e10792c672d8089124145796086dc7ca224d73

parent

21ca7370236fa39f639befe40160a440a414fa20

2 files changed, 3 insertions(+), 3 deletions(-)

jump to
M site/contents/_includes/_learn-definitions.mdsite/contents/_includes/_learn-definitions.md

@@ -44,12 +44,12 @@ Simple: `4`. Every quotation defines its own scope, and in each scope a new variable called `a` is defined. In the innermost scope containing the quotation `(a dup * :a)` the value of `a` is set to `64`, but this value is not propagated to the outer scopes. Note also that the value of `a` in the innermost scope is first retrieved from the outer scope (8).

If we want to change the value of the original `a` symbol defined in the outermost scope, we have to use the {#link-operator||lang||bind#} or its shorthand sigil `@`, so that the programs becomes the following: - 4 :a ;First definition of the symbol a in the outermost scope + 4 :a ;First definition of the symbol a ( a 3 + @a ;The value of a is updated to 7. ( a 1 + @a ;The value of a is updated to 8 - (a dup * @a) dequote ;The value of a is updated to 64 + (a dup * @a) dequote ;The value of a is now 64 ) dequote ) dequote
M site/contents/_includes/_learn.mdsite/contents/_includes/_learn.md

@@ -16,7 +16,7 @@

Let's see how it works: 1. First a list containing the first five integer is pushed on the stack. -2. Then, another list containing two symbols (`dup` and `\*`) is pushed on the stack. This constitutes a quoted program which, when executed duplicates (`dup`) the first element on the stack and then multiplies (`*`) the two elements together. +2. Then, another list containing two symbols (`dup` and `*`) is pushed on the stack. This constitutes a quoted program which, when executed duplicates (`dup`) the first element on the stack and then multiplies (`*`) the two elements together. 3. Finally, the symbol `map` is pushed on the stack. Map takes a list of elements and a quoted program and applies the program to each element. Note that: