Skip to content

Commit e21f43e

Browse files
authored
Version 4.0a - 9th July 2021
Couple of minor bug fixes.
1 parent 9e33c01 commit e21f43e

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

ulisp-esp.ino

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/* uLisp ESP Version 4.0 - www.ulisp.com
2-
David Johnson-Davies - www.technoblogy.com - 7th July 2021
1+
/* uLisp ESP Version 4.0a - www.ulisp.com
2+
David Johnson-Davies - www.technoblogy.com - 9th July 2021
33
44
Licensed under the MIT license: https://opensource.org/licenses/MIT
55
*/
@@ -1223,7 +1223,7 @@ object *closure (int tc, symbol_t name, object *function, object *args, object *
12231223
return tf_progn(function, *env);
12241224
}
12251225

1226-
object *apply (symbol_t name, object *function, object *args, object *env) {
1226+
object *apply (builtin_t name, object *function, object *args, object *env) {
12271227
if (symbolp(function)) {
12281228
builtin_t fname = builtin(function->name);
12291229
if ((fname > FUNCTIONS) && (fname < KEYWORDS)) {
@@ -1232,15 +1232,15 @@ object *apply (symbol_t name, object *function, object *args, object *env) {
12321232
} else function = eval(function, env);
12331233
}
12341234
if (consp(function) && isbuiltin(car(function), LAMBDA)) {
1235-
object *result = closure(0, name, function, args, &env);
1235+
object *result = closure(0, sym(name), function, args, &env);
12361236
return eval(result, env);
12371237
}
12381238
if (consp(function) && isbuiltin(car(function), CLOSURE)) {
12391239
function = cdr(function);
1240-
object *result = closure(0, name, function, args, &env);
1240+
object *result = closure(0, sym(name), function, args, &env);
12411241
return eval(result, env);
12421242
}
1243-
errorsym(name, PSTR("illegal function"), function);
1243+
error(name, PSTR("illegal function"), function);
12441244
return NULL;
12451245
}
12461246

@@ -4658,8 +4658,9 @@ void pradix40 (symbol_t name, pfun_t pfun) {
46584658
uint32_t x = untwist(name);
46594659
for (int d=102400000; d>0; d = d/40) {
46604660
uint32_t j = x/d;
4661-
pfun(fromradix40(j));
4662-
x = x - j*d;
4661+
char c = fromradix40(j);
4662+
if (c == 0) return;
4663+
pfun(c); x = x - j*d;
46634664
}
46644665
}
46654666

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy