This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GSOC | Extending Common Lisp support


On 04/24/2012 03:09 PM, Charles Turner wrote:
Here's my latest approach in processTypeDeclArgs along with what I
think each line is doing:

for each declaration:

         letStart(); // create a new lexical environment
         ReferenceExp ref = new ReferenceExp(decl); // decl the x in a
(declare (integer x))
         letVariable(decl, ref); // push x into this new lexical environment
         this.lexical.push(decl); // not sure why this is necessary,
Jamison's advice (I think!)
         letEnter(); // push this let expr in the lexical environment
         decl.setType(this.exp2Type((Pair) typeList)); // set the type
of x in this lexical environment
         decl.setFlag(Declaration.TYPE_SPECIFIED);
         letexp = letDone(rewrite_body(body)); // this is dodgy, seems
necessary to finish up a LET

I'm aware that I'm handling the case where decl might already be in
the scope and I'll shadow it, but I'm trying to sort out the simpler
case first.

It's worse than that - you're reusing the *same* Declaration in both the outer scope and the new LetExp. No wonder the compiler is getting confused ...

You need to create a new Declaration. For example:

  letVariable(decl.getSymbol(), ref);
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]