From 682a48e0c01c5cc090858c8300857ef5d01d30ba Mon Sep 17 00:00:00 2001 From: dos-reis Date: Tue, 6 Dec 2011 19:36:20 +0000 Subject: * interp/compiler.boot (setqMultipleExplicit): Introduced temporary variables are local to the assignment. --- src/ChangeLog | 5 +++++ src/interp/compiler.boot | 19 +++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index dcbf4bc6..4c2466d0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-12-06 Gabriel Dos Reis + + * interp/compiler.boot (setqMultipleExplicit): Introduced + temporary variables are local to the assignment. + 2011-12-06 Gabriel Dos Reis * interp/compiler.boot (compResolveCall): Update description. diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot index d2dfd84b..59ea4e90 100644 --- a/src/interp/compiler.boot +++ b/src/interp/compiler.boot @@ -1022,17 +1022,16 @@ setqMultipleExplicit(nameList,valList,m,e) == #nameList~=#valList => stackMessage('"Multiple assignment error; # of items in: %1b must = # in: %2",[nameList,valList]) gensymList:= [genVariable() for name in nameList] - assignList:= - --should be fixed to declare genVar when possible - [[.,.,e]:= compSetq1(g,val,$EmptyMode,e) or return "failed" - for g in gensymList for val in valList] - assignList="failed" => nil - reAssignList:= - [[.,.,e]:= compSetq1(name,g,$EmptyMode,e) or return "failed" + bindings := --should be fixed to declare genVar when possible + [insn.args for g in gensymList for val in valList + | [insn,.,e] := compSetq1(g,val,$EmptyMode,e) or leave "failed" ] + bindings is "failed" => nil + reAssignList := + [[.,.,e] := compSetq1(name,g,$EmptyMode,e) or return "failed" for g in gensymList for name in nameList] - reAssignList="failed" => nil - [['%seq,:[T.expr for T in assignList],:[T.expr for T in reAssignList]], - $NoValueMode, last(reAssignList).env] + reAssignList is "failed" => nil + [['%bind,bindings,['%seq,:[T.expr for T in reAssignList]]], + $NoValueMode, last(reAssignList).env] --% Quasiquotation -- cgit v1.2.3