Version 4.0a - 9th July 2021

Couple of minor bug fixes.
This commit is contained in:
David Johnson-Davies 2021-07-09 12:22:31 +01:00 committed by GitHub
parent 57753ef941
commit fdb6d877b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 8 deletions

View File

@ -1,5 +1,5 @@
/* uLisp ARM Version 4.0 - www.ulisp.com
David Johnson-Davies - www.technoblogy.com - 7th July 2021
/* uLisp ARM Version 4.0a - www.ulisp.com
David Johnson-Davies - www.technoblogy.com - 9th July 2021
Licensed under the MIT license: https://opensource.org/licenses/MIT
*/
@ -1585,7 +1585,7 @@ object *closure (int tc, symbol_t name, object *function, object *args, object *
return tf_progn(function, *env);
}
object *apply (symbol_t name, object *function, object *args, object *env) {
object *apply (builtin_t name, object *function, object *args, object *env) {
if (symbolp(function)) {
builtin_t fname = builtin(function->name);
if ((fname > FUNCTIONS) && (fname < KEYWORDS)) {
@ -1594,15 +1594,15 @@ object *apply (symbol_t name, object *function, object *args, object *env) {
} else function = eval(function, env);
}
if (consp(function) && isbuiltin(car(function), LAMBDA)) {
object *result = closure(0, name, function, args, &env);
object *result = closure(0, sym(name), function, args, &env);
return eval(result, env);
}
if (consp(function) && isbuiltin(car(function), CLOSURE)) {
function = cdr(function);
object *result = closure(0, name, function, args, &env);
object *result = closure(0, sym(name), function, args, &env);
return eval(result, env);
}
errorsym(name, PSTR("illegal function"), function);
error(name, PSTR("illegal function"), function);
return NULL;
}
@ -5477,8 +5477,9 @@ void pradix40 (symbol_t name, pfun_t pfun) {
uint32_t x = untwist(name);
for (int d=102400000; d>0; d = d/40) {
uint32_t j = x/d;
pfun(fromradix40(j));
x = x - j*d;
char c = fromradix40(j);
if (c == 0) return;
pfun(c); x = x - j*d;
}
}