From cc199b0e579b8c8a0b2db8d0eabc407432287d9a Mon Sep 17 00:00:00 2001 From: Sage Vaillancourt Date: Sun, 8 Nov 2020 16:44:53 -0500 Subject: [PATCH] Add Forbble comment --- src/examples/forbble.pbl | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/examples/forbble.pbl b/src/examples/forbble.pbl index 6b90703..6a20c8b 100755 --- a/src/examples/forbble.pbl +++ b/src/examples/forbble.pbl @@ -111,14 +111,16 @@ (if (= "over" _x) (_over 0) (if (= "^" _x) (pch (bop 0)) (if (= ":" _x) ( ; Compile a phrase into the next symbol - (def var (at 1 list)) - (defe var (+ "_" var)) - (defe (+ "_" var) ()) - (def list (compile (rest (rest list)) (+ "_" var)))) - ( ; If none of the above hit, try to interpret as a compiled symbol - (def _e (eval _x)) - (if (iserr (len _e)) () (feval _e)) - ) + (def var (at 1 list)) ; Collect the symbol to define, as a string + (defe var (+ "_" var)) ; Add an underscore for the internal storage + (defe (+ "_" var) ()) ; Define internally as an empty list + (def list (compile ; Overwrite list with output of (compile) + (rest (rest list)) ; Current list, not including ':' or the symbol + (+ "_" var)))) ; The internal variable name + ( ; If none of the above hit, try to interpret as a compiled symbol + (def _e (eval _x)) + (if (iserr (len _e)) () (feval _e)) + ) )))))))))))) ; A switch/case operator might be good, to avoid huge closing-paren chains