[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: #ifdef for liszt?



	From: Wilson.Harvey@CMU-CS-IUS

	Is there anything for the lisp compiler akin to the "#ifdef" statement
	for the C compiler?  Can anyone point me to something similar?
	Thanks.  -- Wilson

The reader has built into it a switch that works in both liszt and
lisp.  You can tell lisp whether or not to read an expression by
putting before that expression something like:

	#+feature	
	#-feature
	#+(or feature ...)
	#+(and feature ...)

where feature is on iff it is on the "(status features)" list (which
can be modified).  Thus you can do something like this:

	#-uomlisp (defun morerecent (file1 file2) ...)

since uomlisp is turned only in Franz's that contain all our hacks and
morerecent happens to already be defined in our stuff.  If you look at
the liszt code, you'll see lots of "#+vax"'s and "#+68k"'s where the
code needs to be different, eg:

	(defun cc-foo (x y z)
	   (bar #+vax vax-arg
		#+68k 68k-arg)
	    ...)

It can be quite convenient especially when you have two lisps that are
almost the same, you can maintain just one source containing these
things whenever the sources for the different lisps must be different.

I know this stuff is documented in the code in charmac.l; I can't
remember right now if it is documented in the Franz reference manual
and I don't have it with me right now to check.


Hope this helps.

				-Liz