technoblogy / ulisp-esp

A version of the Lisp programming language for ESP32-based boards.
MIT License
110 stars 37 forks source link

sticky Context where it shouldn't #61

Closed dragoncoder047 closed 1 year ago

dragoncoder047 commented 1 year ago
9043> (progn (terpri) (foo))

Error: 'terpri' undefined: foo
9043>

Fix (in eval()):


   if (symbolp(form)) {
        symbol_t name = form->name;
        object* pair = value(name, env);
        if (pair != NULL) return cdr(pair);
        pair = value(name, GlobalEnv);
        if (pair != NULL) return cdr(pair);
        else if (builtinp(name)) return form;
+       Context = NIL;
        error(PSTR("undefined"), form);
    }
technoblogy commented 1 year ago

Good catch - thanks. Will be fixed next release.

technoblogy commented 1 year ago

Fixed in 4.4b - thanks!