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

DISPLACE



    Date: 18 March 1980 23:10-EST
    From: Alan Bawden <ALAN at MIT-MC>
    To:   JONL, REES
    cc:   BUG-LISP
    Re:   DISPLACEing macros and purified code.

    Is there any reason that the function DISPLACE couldn't check the
    purity of its first argument and NOT displace if it is pure?? (Simply
    return the second argument.)

    I realize that this makes the contract of DISPLACE even more unusual
    than it is (I seem to remember resistence to the PROGN hack for this
    reason) but after all the whole point of DISPLACE is that it should be
    the correct function to call to do "what you always want a displacing
    macro to do"...
----
No, it's not. I disagree strongly with what's been done to DISPLACE and what 
you're trying to further. Please choose another name for the thing 
you're trying to  evolve...

I have code all over that uses DISPLACE according to its originally defined
meaning which was simply a short form of RPLACA/RPLACD pair ... Such code
is probably sufficiently debugged that your change won't hurt me, but I think
the whole philosophy is wrong. There needs to be a general-purpose thing
which errs out on atoms and pure stuff and only works on lists. Common names
should be used for very general operations -- if you want make DISPLACE hairy, 
give it a hairy name -- like MACRO-DISPLACE. The name displace should be used
for the very simple concept.

As nice as it is to have things that operate in a 'generic' way,
accepting tons of different args and dispatching appropriately, don't think
people can't still be screwed by it. Teco is a good example -- things can be
hard to debug because the error you die on may not be related to the error
you actually made if the system is too forgiving. If I try to DISPLACE pure
space or an atom, I want to know about it when it happens. Not an hour later
when I find that something I thought I'd displaced wasn't really displaced.
In the special case that I am MACRO-DISPLACE'ing, maybe I don't really care
because I know that it don't make any difference functionally if the DISPLACE
happens or not ... but that's a much different functionality.