kawa-commonlisp-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Kawa-commonlisp-dev] [PATCH] DECLARE processing.


From: Charles Turner
Subject: Re: [Kawa-commonlisp-dev] [PATCH] DECLARE processing.
Date: Tue, 14 Aug 2012 20:49:25 +0100

On 14 August 2012 19:30, Per Bothner <address@hidden> wrote:
> A minor style issue:  If local variable has a single assignment,
> you should normally combine the declaration and initialization.
> For example aliasedDecl - and others.

OK. I always thought it was more efficient to instead of

while (,,)
  Object o = ...

Have:

Object o;
while (,,,)
  o = ...

>From an experiment, I now think it makes no difference, apart from
being slightly harder to read!

> I think this could be avoided by making rewriteBody protected, and
> changing process processDeclare to something like:
>
>   @Override
>   protected void makeBody (LList forms)
>   {
>      ...
>      letexp = letDone(super.rewriteBbody(body));
>      formStack.add(letExp);
>   }
>
> Not sure if some variant will work, but it seems it might be
> worth a try.

I'm not sure if you made a typo above, I found it difficult to
understand what you meant. I've updated the patch to do something
similar, apologies in advance if I've botched it.

In a void-returning method like rewriteBody, what's the best way to
signal a syntax error? The methods I know about from Compilation push
the handling of error messages for later, are there any that just bail
out immediately? There's a FIXME: in the attached patch signaling an
area where I'd like this behavior.

Charles.

Attachment: declare.patch
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]