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


Sorry I didn't get back to you last night, was too tired when I got home.

On Apr 24, 2012, at 6:57 PM, Charles Turner wrote:

On 24 April 2012 23:50, Jamison Hope <jrh@theptrgroup.com> wrote:
If you're creating a new let via Compilation#letStart() and going the
letVariable()/letEnter()/letDone() route, then you don't need to explicitly
do the lexical.push(). I had just mentioned that in case you were going
to reuse an existing let for which letEnter() had already been called --
in that case, you'd need to call let.add(decl) as well as lexical.push(decl)
in order to simulate the letVariable()/letEnter() calls.

I did briefly consider reusing an existing LET, but wasn't sure how to get a handle on the most recent LetExp, in some case (like after a DEFUN), not such expression would exist IIUC.

I *think* that you don't necessarily need the most recent LetExp, just
the nearest enclosing ScopeExp, which should be current_scope (or maybe
current_scope.outer.. not sure how the "LetExp defs" stuff in rewrite_body
affects it). LambdaExp extends ScopeExp, too, so you should be OK there.


So my thought was to do something like this (in processDeclArgs):

Object var = x.get(1);
decl = this.lexical.get(var);
if (current_scope.decls does not contain decl) // must iterate over the decls linked list to determine this
{
// create a new Declaration(decl.getSymbol(), exp2Type(x)),
// set its value to be the same as decl's, and insert it into
// current_scope (and call lexical.push(), so that any subsequent
// this.lexical.get(var) would find the correct Declaration)
}
else // decl did in fact come from the surrounding ScopeExp, be it a lambda or let or whatever
{
// do what you originally had:
decl.setType()
decl.setFlag()
}


-Jamie

--
Jamison Hope
The PTR Group
www.theptrgroup.com




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