[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Macro-Cache'ing a pure cell?
- To: JONL at MIT-MC
- Subject: Macro-Cache'ing a pure cell?
- From: Robert W. Kerns <RWK at MIT-MC>
- Date: Fri, 9 Jan 81 09:00:00 GMT
- Cc: BUG-LISP at MIT-MC
- Original-date: 9 January 1981 04:00-EST
Date: 8 January 1981 13:18-EST
From: Jon L White <JONL at MIT-MC>
Subject: Macro-Cache'ing a pure cell?
To: RWK at MIT-MC
cc: BUG-LISP at MIT-MC
Date: 8 January 1981 13:09-EST
From: Robert W. Kerns <RWK at MIT-MC>
I think it SHOULD do caching (like I had it doing before) when it finds
it is not writable, with the hashing scheme. . .
Unfortunately, it didn't work. Just because one has ONE cell in pure
space is no reason for the cacher to change the user's setting of
MACRO-EXPANSION-USE from MACROEXPAND to MACROMEMO; you cannot use the
hasharray unless this is done. Now maybe a warning msg is in order,
but that is another story.
You didn't change this part of the code at all, except to rename PUREP to
STATIC-AREAP. You did change the code for the DISPLACE case (which I seem to
have ignored) to PURCOPY before writing writeable pure code, and ignored the
MACROEXPANDED case. I changed the case you ignored to conform to the way you
changed the case I ignored.
Anyway, I decided that MACROFETCH looking at the state of MACRO-EXPANSION-USE
is really the wrong thing. If you have hash-memoized something, it should use
that, just like if you have DISPLACED something. If you change the switch from
MACROMEMO to MACROEXPANDED, and you want to no longer use the hashed
definitions (why??), you can always flush the cache. But with the bookkeeping
that goes on to handle redefinitions, there is no reason to insist on ignoring
the cache just because the user requests that you no longer add to it. So it
now just checks for the existance of a cache. There isn't any efficiency lost
by doing this, since the check for the CDR of MACROMEMO being NIL is fast.
It may still reasonable for MACROEXPANDED to restore the original form if it
finds MACRO-EXPANSION-USE to be other than MACROEXPANDED, on the theory that
the user changed it because he was grossed out. But that isn't essential,
since again, the user can get that effect by just doing
(FLUSH-MACROMEMOS () ()).
So I changed MACROFETCH, but not MACROEXPANDED. I did not install this yet.
Do you concur that this is reasonable?