p8r <firstname.lastname@example.org> wrote:
| Barry Margolin <email@example.com> wrote:
| * (#+scheme set! #+common-lisp setq a b)
| * so that your assignment expression will work in both Scheme and CL.
| Oh, a pre-processor.
Exactly, a pre-processor buried in the reader [which is, by the way,
*aready* doing lots of other "pre-processing" (e.g., `x ==> (quasiquote x)
and so forth). The #+/#- syntax gets used in almost exactly the same ways
that the C syntax #if/#ifdef/#ifndef gets used, except with slightly different
forms available for the conditional expressions.
E.g., in C the usual simple "feature test" is "#ifdef FOO", which asks if
the symbol "FOO" has been "defined" with "#define FOO ..." (and with no
later "#undef FOO"). In Lisp (or those Schemes which support it) the usual
feature test would be "#+foo", which tests whether "foo" is an element of
the list stored in the global variable "*features*" (or the like).
And just as in C you can say:
#if defined(FOO) && !(defined(BAR) || defined(BAZ))
in Common Lisp [or if Scheme, replace "progn" with "begin"] you can say:
#+(and FOO (not (or BAR BAZ)))
(progn ...some stuff... )
Rob Warnock, 8L-855 firstname.lastname@example.org
Applied Networking http://reality.sgi.com/rpw3/
Silicon Graphics, Inc. Phone: 650-933-1673
1600 Amphitheatre Pkwy. FAX: 650-933-0511
Mountain View, CA 94043 PP-ASEL-IA