[racket] Macros as a first class objects?

From: Thomas Chust (chust at web.de)
Date: Fri Aug 13 08:41:58 EDT 2010

2010/8/13 The Configurator <configurator at gmail.com>:
> There must be great reasons why this would be horribly wrong, but why
> shouldn't macros and syntaxes be passed as first class objects, method
> parameters, return values etc.?
> [...]


somehow I must be misunderstanding this question — in my eyes macros
and syntax *are* first class objects in Racket: A macro is just a
procedure operating on syntax objects and a syntax object is just an
instance of a certain structure type.

The distinction between a "macro" and a "regular procedure" cannot be
made based on the type of the object but only based on whether it is
(potentially) executed during expansion or during runtime. If the
distinction between these phases was removed you would get a different
programming language, but I don't think it would make any sense at all
to talk about "macros" in that language.


When C++ is your hammer, every problem looks like your thumb.

Posted on the users mailing list.