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

What #+rmhackery a good idea #-rmhackery utter nonsense



    Date: 14 Jun 85 15:03 PDT
    From: Masinter.pa@Xerox.ARPA

    The #+rmhackery feature #-rmhackery lossage of "#+" and "#-" is one of
    the more dubious in GSSB. Expanding it with #+(good-ideap ':rmhackery)
    the obvious extension #-(good-ideap ':rmhackery) the awful extension of
    allowing arbitrary expressions in the feature-forms removes any hope of
    being able to do anything with a file of code than #+(good-ideap
    ':rmhackery) allows the natural extension to more complex situations
    #-(good-ideap ':rmhackery) load it.

I'm not sure what you mean.  Anyway, in our implementation, #+ and #-
does a READ with *package* bound to the keyword package as well as
turning off #. (see below).  It then uses STRING-EQUAL as the comparison
function with the symbols (presumed, but not forced [I think] to be
keywords) in *FEATURES* for the appropriate tokens (e.g., :LISPM and
:NIL are the appropriate tokens of #+(or LispM NIL)).  We've had this
for years and it doesn't seem to have any problems.

    What happened to the natural constructs

    (IF (STRING= (SOFTWARE-TYPE) "VMS") <YESVMS> <NOVMS>)

It doesn't allow
	#+LispM (progn
	   ... 20 pages of LispM specific code ...
	   )
	#-LispM (progn
	   ... 20 pages of generic CL code ...
	   )

    One could even imagine (whoa) a compiler that would expand
    (SOFTWARE-TYPE) into a constant, and evaluate STRING= at compile time if
    the args were constant (!)
Our compiler would do this today if somebody put STRING= in the list of
functions to apply constant folding to.

    Of course, there's always 

    #+#.(STRING= (SOFTWARE-TYPE) "VMS").

Says who?  In our implementation, #. is turned off while reading #+ or
#-.  Suppose I shipped some code that said
	#-LispM #.(error nil "This code hasn't been made to run on non-LispMs yet.")
Perhaps a better example would be building machine dependent data
structures inside #+ or #-:
	(defun hairy-thing ()
	  #+LispM '#.(compute-hairy-thing-for-LispM)
	  #-LispM '#.(compute-generic-hairy-thing))