[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: JONL at MIT-MC
- Subject: #%
- From: Robert W. Kerns <RWK at MIT-MC>
- Date: Wed, 10 Dec 80 12:17:00 GMT
- Cc: BUG-LISP at MIT-MC
- Original-date: 10 December 1980 07:17-EST
Date: 9 December 1980 14:18-EST
From: Jon L White <JONL at MIT-MC>
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))
`(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.