From d22222e1801d998b0ab25ae32de7462faf036656 Mon Sep 17 00:00:00 2001 From: Attila Magyar Date: Sat, 19 Jun 2021 22:02:49 +0200 Subject: [PATCH] Update README.md --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index cfe5431..4aa2694 100644 --- a/README.md +++ b/README.md @@ -153,10 +153,31 @@ The `->` and `=>` words can be used anywhere within a word, including loop bodie count @ ; ``` +### Implementation notes + +Local variable support is implemented in FCL itself. Locals are stored in a parameter stack. Both `->` and `=>` are immediate parsing words. They have both runtime and compilation semantics. They compile an inline *lookup word* within the enclosing word. At runtime they load the top of the stack into the proper location of the parameter stack. The *lookup word* gets the value or the reference from the parameter stack and pushes it onto the data stack. + ## List + +`` \ creates a new empty list + +` dup 1 add` \ creates an empty list and adds *1* to it. + +`[ 1 2 3 ]` \ creates a list with 3 elements. + + ## Maps + +`` \ creates a new empty map + +` dup 'key1' 'value1' put` \ creates an empty map and puts *'key1' => 'value1'* into it. + +`#[ 'key1' 'value1' ]#` \ same as above + ## Quotations +`{ dup * }` \ creates a quotation + ## HTTP