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

#%



    Date: 9 December 1980 14:18-EST
    From: Jon L White <JONL at MIT-MC>
    Subject: #%
    To: RWK at MIT-MC
    cc: BUG-LISP at MIT-MC

        Date: 8 December 1980 15:31-EST
        From: Robert W. Kerns <RWK at MIT-MC>
	#%`(....) is hardly ever right!  `#%(SI:XSET ,x ,y ,z) used to work
	perfectly well, until BACKQ make |`,/|| a macro.  If you REMPROP it's
	MACRO property, or (SETQ BACKQUOTE-EXPAND-WHEN 'READ), it works
	perfectly.  #%`(....) is identical with doing `(....) in an environment
	with BACKQUOTE-EXPAND-WHEN set to READ.
    this still isn't right -- the problem is that want a read-time "change of
    horses in mid-stream", so to speak.  Here is one correct way to do it:
      #+FM (sublis `((A . ,totsize) (B . ,(symbolconc sname '-CLASS)))
	       '#%(SI:MAKE-EXTEND A B))
    instead of
       `(SI:MAKE-EXTEND ,totsize ,(symbolconc sname '-CLASS))
    Whatever we do, we don't want to remove the macro property of |`,/||.

I don't understand 'read-time "change of horses in mid-stream".  At any rate,
since the read-macro for comma (at least used to) check at read-time if it is
inside a backquote, you really have to work hard to get one of those markers to
evaluate.  In fact, the *ONLY* way I have ever seen it happen is by #%
macro-expanding them.  I think one of two things should be done:

1)  Remove the macro property.
2)  Make MACROEXPAND know about it.

Also, please note that your 'correct' solution is not as correct as you think.
At the time of the macro-expansion, the macro sees just symbols A and B.  It
may very well do something illegal like reverse the order of evaluation, since
those are SIMPLEP.  However, (|`,/|| . A) is NOT SIMPLEP.  In your simple case,
you win, since what you're substituting for both happen to be reversable and
multiply evaluable, but if totsize weren't a fixnum, but where a
(progn (PRINT 'FOO) 5) and SI:MAKE-EXTEND were something more complicated that
actually looked at it's arguments, you might well lose.