Skip to content

Commit 0889d64

Browse files
authored
Version 2.7c - 20th June 2019
Fixes technoblogy#19
1 parent 2a84600 commit 0889d64

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

ulisp-esp.ino

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/* uLisp ESP Version 2.7b - www.ulisp.com
2-
David Johnson-Davies - www.technoblogy.com - 9th June 2019
1+
/* uLisp ESP Version 2.7c - www.ulisp.com
2+
David Johnson-Davies - www.technoblogy.com - 20th June 2019
33
44
Licensed under the MIT license: https://opensource.org/licenses/MIT
55
*/
@@ -877,8 +877,11 @@ object *closure (int tc, object *fname, object *state, object *function, object
877877
function = cdr(function);
878878
// Dropframe
879879
if (tc) {
880-
while (*env != NULL && car(*env) != NULL) pop(*env);
881-
} else push(nil, *env);
880+
if (*env != NULL && car(*env) == NULL) {
881+
pop(*env);
882+
while (*env != NULL && car(*env) != NULL) pop(*env);
883+
} else push(nil, *env);
884+
}
882885
// Push state
883886
while (state != NULL) {
884887
object *pair = first(state);
@@ -919,6 +922,7 @@ object *closure (int tc, object *fname, object *state, object *function, object
919922
if (args != NULL) error2(fname, PSTR("has too many arguments"));
920923
if (trace) { pserial(')'); pln(pserial); }
921924
// Do an implicit progn
925+
if (tc) push(nil, *env);
922926
return tf_progn(function, *env);
923927
}
924928

0 commit comments

Comments
 (0)