@@ -6017,6 +6017,9 @@ public Expr parse(C context, Object frm) {
6017
6017
method .locals = backupMethodLocals ;
6018
6018
method .indexlocals = backupMethodIndexLocals ;
6019
6019
6020
+ PathNode looproot = new PathNode (PATHTYPE .PATH , (PathNode ) CLEAR_PATH .get ());
6021
+ PathNode clearroot = new PathNode (PATHTYPE .PATH ,looproot );
6022
+ PathNode clearpath = new PathNode (PATHTYPE .PATH ,looproot );
6020
6023
if (isLoop )
6021
6024
dynamicBindings = dynamicBindings .assoc (LOOP_LOCALS , null );
6022
6025
@@ -6049,12 +6052,27 @@ else if(maybePrimitiveType(init) == float.class)
6049
6052
init = new StaticMethodExpr ("" , 0 , 0 , null , RT .class , "doubleCast" , RT .vector (init ));
6050
6053
}
6051
6054
//sequential enhancement of env (like Lisp let*)
6052
- LocalBinding lb = registerLocal (sym , tagOf (sym ), init ,false );
6053
- BindingInit bi = new BindingInit (lb , init );
6054
- bindingInits = bindingInits .cons (bi );
6055
+ try
6056
+ {
6057
+ if (isLoop )
6058
+ {
6059
+ Var .pushThreadBindings (
6060
+ RT .map (CLEAR_PATH , clearpath ,
6061
+ CLEAR_ROOT , clearroot ,
6062
+ NO_RECUR , null ));
6055
6063
6056
- if (isLoop )
6057
- loopLocals = loopLocals .cons (lb );
6064
+ }
6065
+ LocalBinding lb = registerLocal (sym , tagOf (sym ), init ,false );
6066
+ BindingInit bi = new BindingInit (lb , init );
6067
+ bindingInits = bindingInits .cons (bi );
6068
+ if (isLoop )
6069
+ loopLocals = loopLocals .cons (lb );
6070
+ }
6071
+ finally
6072
+ {
6073
+ if (isLoop )
6074
+ Var .popThreadBindings ();
6075
+ }
6058
6076
}
6059
6077
if (isLoop )
6060
6078
LOOP_LOCALS .set (loopLocals );
@@ -6063,11 +6081,10 @@ else if(maybePrimitiveType(init) == float.class)
6063
6081
try {
6064
6082
if (isLoop )
6065
6083
{
6066
- PathNode root = new PathNode (PATHTYPE .PATH , (PathNode ) CLEAR_PATH .get ());
6067
- Var .pushThreadBindings (
6068
- RT .map (CLEAR_PATH , new PathNode (PATHTYPE .PATH ,root ),
6069
- CLEAR_ROOT , new PathNode (PATHTYPE .PATH ,root ),
6070
- NO_RECUR , null ));
6084
+ Var .pushThreadBindings (
6085
+ RT .map (CLEAR_PATH , clearpath ,
6086
+ CLEAR_ROOT , clearroot ,
6087
+ NO_RECUR , null ));
6071
6088
6072
6089
}
6073
6090
bodyExpr = (new BodyExpr .Parser ()).parse (isLoop ? C .RETURN : context , body );
0 commit comments