diff --git a/BUGS b/BUGS index f59a715..6dea7af 100644 --- a/BUGS +++ b/BUGS @@ -36,7 +36,4 @@ Generational/Incremental Garbage Collector o The percentage displayed at the end of a GC run is sometimes wrong. - o The scope of the name of a named let is wrong, as explained in - http://groups.google.com/groups?selm=871zemtmd4.fsf%40app.dial.idiom.com - o Almost no Unix commands work under Win32, and they are badly disabled. diff --git a/src/special.c b/src/special.c index b90f192..c40c5ce 100644 --- a/src/special.c +++ b/src/special.c @@ -456,6 +456,7 @@ Object Named_Let (Object argl) { (void)P_Set_Cdr (vtail, cell); vtail = cell; } + /* Create a new environment to protect our named let variable */ Push_Frame (Add_Binding (Null, Car (argl), Null)); tail = Cons (vlist, Cdr (Cdr (argl))); if (Nullp (Cdr (tail))) @@ -466,8 +467,12 @@ Object Named_Let (Object argl) { Cdr (b) = tail; SYMBOL(Car (argl))->value = tail; TC_Enable; - tail = Funcall (tail, flist, 1); + /* Restore environment before calling the function */ Pop_Frame (); + /* vlist: list of variables + * flist: list of initial values + * tail: our new lambda function */ + tail = Funcall (tail, flist, 1); GC_Unlink; return tail; }