Subject: Re: Macros in Common Lisp, Scheme, and other languages
From: Erik Naggum <erik@naggum.no>
Date: 07 Sep 2002 18:57:11 +0000
Newsgroups: comp.lang.lisp,comp.lang.scheme,comp.lang.functional
Message-ID: <3240413831552310@naggum.no>

* Paul F. Dietz
| I understand this.

  Sorry, that not clear to me from what you wrote.

| The current scheme makes it hard for the user to do some things that the
| compiler can do.

  Precisely, but there are different ways to accomplish this.  If the compiler
  knows the type, you can let the macro expand to a `type-case´ form that the
  compiler should optimize away.  If the compiler cannot optimize it away, it
  will be a run-time decision, instead, which may bloat the code but should
  yield nearly the same performance benefits.

| I realize that macros can expand to arbitrary code.  My suggestion was to
| allow some way for the user to provide a hint to the system so it can
| propagate information through unexpanded macros.  Perhaps this could be
| limited to compiler macros, which should be written to reflect the semantics
| of the equivalently named functions anyway.

  I think macros are used where compiler-macros should be used mainly because
  the programmer does not know about compiler-macros.  For some reason, they
  are not covered in many Common Lisp texts.

-- 
Erik Naggum, Oslo, Norway

Act from reason, and failure makes you rethink and study harder.
Act from faith, and failure makes you blame someone and push harder.