From d60b0772098f0907850b7cc520224a1bfb093e44 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Sun, 11 Dec 2011 18:02:11 +0000 Subject: * interp/compiler.boot (compColon): Give initial %undefined value to local variable declarations which are not definitions. * interp/lisp-backend.boot (expandToVMForm): Translate %undefined. --- src/ChangeLog | 6 ++++++ src/interp/compiler.boot | 5 ++++- src/interp/lisp-backend.boot | 3 ++- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 386c55af..dcefe777 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2011-12-11 Gabriel Dos Reis + + * interp/compiler.boot (compColon): Give initial %undefined value + to local variable declarations which are not definitions. + * interp/lisp-backend.boot (expandToVMForm): Translate %undefined. + 2011-12-10 Gabriel Dos Reis * interp/g-opt.boot (optSeq): Remove splicePROGN as redundant. diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot index 959d3b84..434f3c93 100644 --- a/src/interp/compiler.boot +++ b/src/interp/compiler.boot @@ -1715,7 +1715,10 @@ compColon([":",f,t],m,e) == if not $bootStrapMode and $insideFunctorIfTrue and makeCategoryForm(t,e) is [catform,e] then e := giveVariableSomeValue(f,t,e) - ["/throwAway",getmode(f,e),e] + val := + $insideCapsuleFunctionIfTrue => ['%LET,f,'%undefined] + "/throwAway" + [val,getmode(f,e),e] unknownTypeError name == name:= diff --git a/src/interp/lisp-backend.boot b/src/interp/lisp-backend.boot index 8e382180..3ab11a8a 100644 --- a/src/interp/lisp-backend.boot +++ b/src/interp/lisp-backend.boot @@ -749,7 +749,8 @@ getOpcodeExpander op == ++ Expand all opcodes contained in the form `x' into a form ++ suitable for evaluation by the VM. expandToVMForm x == - x = '%false or x = '%nil => 'NIL + x is '%false or x is '%nil => 'NIL + x is '%undefined => 'NIL -- for the time being. FIXME. ident? x and (x' := x has %Rename) => x' atomic? x => x [op,:args] := x -- cgit v1.2.3