Another problem with the defmacro

From: Asuka (asukahot_at_hotmail.com)
Date: 02/23/05


Date: Wed, 23 Feb 2005 14:37:55 +0100

Hi, I've got another problem. The fact is that what I want to do with
defmacro's declarations is to be able to compute the next type of
declaration:

(my-macro (1 2 3 4) (1 2 3 4) ... (5 6 7 2))

For example, to compute each list that conforms the arg-list.

But I don't know how to define the macro to get the list of args without
being evaluated.

One example I've tried to is:

(defmacro my-macro (&rest args)
 `(car ,args)
)

And the result for the call:

(my-macro (1 2) (1 4) (3 1 4))

is that (1 2) is not a function name.

What do I do?

Thanx



Relevant Pages

  • Re: Another problem with the defmacro
    ... >> defmacro's declarations is to be able to compute the next type of ... > behind Lisp macros. ... (defmacro my-macro (&rest args) ...
    (comp.lang.lisp)
  • Re: Another problem with the defmacro
    ... > defmacro's declarations is to be able to compute the next type of ... > But I don't know how to define the macro to get the list of args without ... (defmacro my-macro (&rest args) ...
    (comp.lang.lisp)
  • Re: Another problem with the defmacro
    ... Asuka wrote: ... > defmacro's declarations is to be able to compute the next type of ... (defmacro my-macro (&rest args) ... Cells-Gtk?: http://www.common-lisp.net/project/cells/ ...
    (comp.lang.lisp)
  • Re: Different syntax for declarations.
    ... the docstring is placed after declarations. ... decl-defun would still end up as a macro having the signature ... in spite of the wrapping progn and declaim material. ...
    (comp.lang.lisp)
  • Re: Noob to C++, trying to get syntax, etc.
    ... Declarations and definitions aren't too much different from what they ... > WorldGreeter ... > The console stream object, cout, passes into greetby reference. ... Here's a macro, using some of those stream things: ...
    (comp.lang.cpp)