From e2b07a5fd0bbaad232c717fb90a31d6c61d72bd4 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Thu, 14 Jul 2022 20:06:50 -0400 Subject: Try to include previous variable definitions in REPL links --- docs/doc/rebqn.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/doc/rebqn.html') diff --git a/docs/doc/rebqn.html b/docs/doc/rebqn.html index a3d0c97e..36c0439c 100644 --- a/docs/doc/rebqn.html +++ b/docs/doc/rebqn.html @@ -27,7 +27,7 @@ ⟨ 0 1 2 3 4 5 6 7 8 ⟩

Options can be used in any combination. Here's a calculator REPL:

-↗️
    calcRepl  •ReBQN {repl"strict", primitivescalcFns}
+↗️
    calcRepl  •ReBQN {repl"strict", primitivescalcFns}
 
     CalcRepl "b ← 1 - a←6"
 ¯5
@@ -37,19 +37,19 @@
 

REPL mode

The repl property can have the values "none", "strict", and "loose". If no value is given it's equivalent to "none", which means that the resulting function has no memory and each evaluation is independent from the others. But the values "strict" and "loose" make evaluations take place in a shared scope. Now a variable defined at the top level of one source string is visible when later ones are evaluated, and can be viewed and modified.

-↗️
    do  •ReBQN {repl"loose"}
+↗️
    do  •ReBQN {repl"loose"}
 
     Do¨ "a←4""⟨a,b←5⟩""{⟨a↩𝕩,b⟩}8"
 ⟨ 4 ⟨ 4 5 ⟩ ⟨ 8 5 ⟩ ⟩
 

A different •ReBQN result has its own scope and can't access these variables.

-↗️
    doNot  •ReBQN {repl"loose"}
+↗️
    doNot  •ReBQN {repl"loose"}
 
     DoNot "b" # surprised when this fails
 Error: Undefined identifier
 

The difference in "strict" and "loose" is that a loose REPL can define a variable again, which just changes its value (under the covers, the is treated as a ).

-↗️
    Do "a ← ¯1"
+↗️
    Do "a ← ¯1"
 ¯1
     Do "a ← b‿a"
 ⟨ 5 ¯1 ⟩
-- 
cgit v1.2.3