all repos — min @ bac5e3ea12166f9025910172150182754519f181

A small but practical concatenative programming language.

Minor fixes
Yanis Zafirópulos 1265028+drkameleon@users.noreply.github.com
Mon, 02 Nov 2020 11:06:21 +0100
commit

bac5e3ea12166f9025910172150182754519f181

parent

e48453d0d08504884a6c51da799a75fa0234e95a

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

jump to
M site/contents/learn-definitions.mdsite/contents/learn-definitions.md

@@ -45,7 +45,7 @@ ) dequote

...What is the value of the symbol `a` after executing it? -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). +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 program becomes the following:

@@ -74,9 +74,9 @@ - expected: {top} quot quot {bottom}

- got: {top} quot int {bottom} <repl>(1,19) in symbol: map -This error says that when the {#link-operator||lang||map#} operator was evaluated, there were incorrect values on the stack. Two quotations were expected, but instead a quotation and an integer were found. How did this happen? +This error says that when the {#link-operator||lang||map#} operator was evaluated, there were incorrect values on the stack. Two quotations were expected, but instead, a quotation and an integer were found. How did this happen? -Basically, when `my-list` was pushed on the stack, it pushed all its item on top of the stack. If you run {#link-operator||stack||get-stack#}, it will return the following list: +Basically, when `my-list` was pushed on the stack, it pushed all its items on top of the stack. If you run {#link-operator||stack||get-stack#}, it will return the following list: (1 2 3 4 5 (dup *))