picolisp

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/picolisp.git/
Log | Files | Refs | README | LICENSE

commit b358404a816ea747ee3119bf6955dc23002e9724
parent 33d76ff80e17cbbaf9457f2e8223096029c8082b
Author: Alexander Burger <abu@software-lab.de>
Date:   Sun, 17 Mar 2013 16:34:09 +0100

Bug in 'made'. Fix from Guillermo R. Palavecino.
Diffstat:
Mersatz/fun.src | 6+++---
Mersatz/picolisp.jar | 0
Msrc/subr.c | 7+++++--
Mtest/src/subr.l | 9+++++----
4 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/ersatz/fun.src b/ersatz/fun.src @@ -1,4 +1,4 @@ -# 01mar13abu +# 17mar13abu # (c) Software Lab. Alexander Burger # Ersatz PicoLisp Functions @@ -2381,12 +2381,12 @@ make (x y z) return z; # (made ['lst1 ['lst2]]) -> lst -made (x) +made (x y) if ((x = ex.Cdr) instanceof Cell) { Env.Yoke = x.Car.eval(); x = x.Cdr; if (!((x = x.Car.eval()) instanceof Cell)) - for (x = Env.Yoke; (x = x.Cdr).Cdr instanceof Cell;); + for (x = Env.Yoke; (y = x.Cdr) instanceof Cell; x = y); Env.Make = x; } return Env.Yoke; diff --git a/ersatz/picolisp.jar b/ersatz/picolisp.jar Binary files differ. diff --git a/src/subr.c b/src/subr.c @@ -1,4 +1,4 @@ -/* 28dec12abu +/* 17mar13abu * (c) Software Lab. Alexander Burger */ @@ -434,8 +434,11 @@ any doMade(any x) { if (isCell(x = cdr(x))) { *Env.yoke = EVAL(car(x)); if (x = cdr(x), !isCell(x = EVAL(car(x)))) { + any y; + x = *Env.yoke; - while (isCell(cdr(x = cdr(x)))); + while (isCell(y = cdr(x))) + x = y; } Env.make = &cdr(x); } diff --git a/test/src/subr.l b/test/src/subr.l @@ -1,4 +1,4 @@ -# 28dec12abu +# 17mar13abu # (c) Software Lab. Alexander Burger ### c[ad]*r ### @@ -93,11 +93,12 @@ (make (link (for A '(x y z) (link A))) (link A) ) ) - (test (0 1 x 2 y 3 z i a) + (test (-1 0 1 x 2 y 3 z i a) (make + (made (cons 0 (box))) (for (I . A) '(x y z) (link I A)) - (test (1 x 2 y 3 z) (made)) - (made (cons 0 (made))) + (test (0 1 x 2 y 3 z) (made)) + (made (cons -1 (made))) (link I A) ) ) (test (1 2 3 4 5 6 7 8 9) (make (chain (1 2 3)) (chain (4 5 6) (7 8 9))) )