[Top][All Lists]

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

Re: Declarations in macro definitions

From: Gerd Moellmann
Subject: Re: Declarations in macro definitions
Date: 21 Mar 2002 12:12:52 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50

Richard Stallman <address@hidden> writes:

>     > I like the the idea of putting this info in a macro definition, but I
>     > don't think `declare' is a good name for it.  That name is too general
>     > to fit this rather specific meaning.
>     (But it's familiar to Lisp programmers for a long time...)
> My memory of `declare' is different (and probably comes from Maclisp
> in the 70s).  Could you tell me how you have seen it used?

This is an excerpt from some actual CL code:

  (defmacro mlet (vars value &body body)
    #+lispm(declare (compiler:do-not-record-macroexpansions)
                    (zwei:indentation 1 3 2 1))
    `(multiple-value-bind ,vars ,value ,@body))

I haven't seen anything for the debugger yet.

[What I meant by ``familiar'' is not that (contemporary Common:-) Lisp
programmers are specifically used to using `declare' for specifying
indentation (I'm not aware that/if they are), but that CL programmers
are used to `declare' in general, and to implementation-defined
declaration specifiers in particular.]

>     > (ISTR that someone was implementing this for edebug a few months
>     > ago--in fact, I thought it had been installed already.
>     In that case I guess my patch won't be needed.
> That code has not been installed--I checked that after I saw your
> message.  I think we never got papers for it.
> That code is more elegant in some ways, because the edebug form spec
> is stored in the macro definition itself and never goes in any other
> data base.  However, your code is much simpler.  Given that anonymous
> macros are not useful, perhaps your simple approach is better.

I haven't seen the other code, so I cannot compare the two.  The
simplicity of the declare approach you mentioned yourself, which made
it easy to handle both Edebug specs and indentation without touching
Edebug or the Lisp indentation code.

I like that simplicity, but on the other hand, I don't have strong
feelings about this.  Just tell me if you want it installed at some

reply via email to

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