all repos — min @ 64124466a7c5b31a4c4f433580314303c987180d

A small but practical concatenative programming language.

Merge pull request #189 from cHItiVer/master

Fabio Cevasco h3rald@h3rald.com
Sun, 15 Jan 2023 11:42:47 +0100
commit

64124466a7c5b31a4c4f433580314303c987180d

parent

499621ee59f09d4d57fcf5b20e3fa3b8af411427

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

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

@@ -21,7 +21,7 @@ 1. The `.` symbol is pushed on the stack, and it is immediately evaluated to the full path to the current directory.

2. The `ls` symbol is pushed on the stack, it consumes the string already on the stack and returns a quotation containing all files and directories within the current directory. 3. The quotation `(ftype 'file ==)` is pushed on the stack. It is treated exactly like a list of data and it is not evaluated. 4. The `filter` symbol is pushed on the stack. This symbol takes two quotations as input, and applies the result of the first quotation on the stack (`(ftype "file" ==)`) to all elements of the second quotation of the stack (the list of files and directories), returning a new quotation containing only those elements of the second quotation on the stack that satisfy the result of the first quotation. In this case, it returns a new quotation containing only files. -5. `'>` is pushed on the stack. The `'` sigil can be used instead of the `quote` symbol to quote a single symbol, `<` in this case. In other words, it is instantly evaluated to the quotation `(>)`. +5. `'>` is pushed on the stack. The `'` sigil can be used instead of the `quote` symbol to quote a single symbol, `>` in this case. In other words, it is instantly evaluated to the quotation `(>)`. 6. The symbol `sort` is pushed on the stack. This symbol, like `filter`, takes two quotations as input, and applies the first quotation to each element of the second quotation, effectively sorting each element of the second quotation using the predicate expressed by the first quotation. In this case, all files are sorted by name in ascending order. > %tip%