Re: empty parameterized macro



aegis writes:
Hallvard B Furuseth wrote:
John Goche writes:
I would like to know whether there is any difference between
the macro
#define FOO
and the parameterized macro taking no parameters
#define FOO()

Is that even allowed under c89?
If so, chapter and verse please.

Huh? Why not? Ever head of systems where getchar() is a macro?

Look up chapter and verse yourself if you think it's not allowed.
The grammar is something like
# define identifier(identifier-list<opt>) replacement-list new-line
Note the <opt> (optional).

--
Hallvard
.



Relevant Pages

  • Re: Sacla loop: a new loop implementation
    ... >> Finally, once the foo macro receives its argument, then based on what ... >> depending on how the macro is defined. ... transformations and optimizations deep in the bowels of the compiler, ... > available at macroexpansion time. ...
    (comp.lang.lisp)
  • Re: What should (ignore-errors (function foo)) do
    ... FUNCTION can't be used to reference lexically visible macro FOO. ... "It is an error to use function on a function name that does not denote a function in the lexical environment in which the function form appears. ... to catch a compiler error at macro expansion time? ...
    (comp.lang.lisp)
  • Re: Sacla loop: a new loop implementation
    ... > Let's consider my previous for-each macro and let's also consider the ... > macro without knowing the type of arg? ... > that the compiler must know that type in order to expand the macro. ... (declaim (inline foo)) ...
    (comp.lang.lisp)
  • Re: Tool for inserting code for keybindings. (elisp)
    ... print-level locally instead of using setf. ... if you have a function call (foo (bar baz)), first is evaluated, ... and the result is passed to the function foo. ... it is passed literally to the macro foo. ...
    (comp.emacs)
  • Re: Separating evaluation and compilation environments.
    ... compilation and evaluation environments long before that. ... a baz definition and expanding out the foo macro forces you to recompile ... that definition if you redefine foo but intend to use baz again. ...
    (comp.lang.lisp)