diff --git a/src/examples/forbble.pbl b/src/examples/forbble.pbl index 6a20c8b..85792b3 100755 --- a/src/examples/forbble.pbl +++ b/src/examples/forbble.pbl @@ -88,11 +88,13 @@ ; Defines a given symbol using a given list of Forth inputs (def compile (fn (func sym) ( + ; Get next symbol (def _x (at 0 func)) - (if (= _x "$") (rest func) + (if (iserr _x) _x + (if (= _x "$") (rest func) (at 1 ( (defe sym (ap (eval sym) _x)) - (compile (rest func) sym)) + (compile (rest func) sym))) ))))) ; Evaluate a list of Forth inputs @@ -143,9 +145,10 @@ ; Basic imperial distances (feval (: "ft" 12 * $)) (feval (: "yd" ft 3 * $)) +(feval (: "yds" yd $)) (feval (: "in" $)) -(feval (: "i>f" 1 ft / $)) -(feval (: "i>y" 1 yd / $)) +(feval (: ">ft" 1 ft / $)) +(feval (: ">yds" 1 yd / $)) ; Convert between Farenheit and Celcius (feval (: "f>c" 32 - 5 * 9 /$))