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

Re: Questions from M. Hagiya

    Date: 1 September 1984 19:03-EDT
    From: Earl A. Killian <EAK @ MIT-MC>

        Date: Sun, 26 Aug 84 21:11 EDT
        From: Daniel L. Weinreb <DLW at SCRC-QUABBIN.ARPA>

        If we evaluate (setf (symbol-function 'moshi) (symbol-function 'if)),
        does Common Lisp specify that this "works", i.e. that the symbol "moshi"
        (a Japanese word for "if") can now be used as the name-symbol of a
        special form, just as well as "if"?  (I told him I thought the answer
        was "no", but it's not stated clearly in the manual.)

    I would tend to agree withj your "no"; on the other hand I feel
    strongly that there ought to be a *PORTABLE* way to do renaming.
    Obviously having MOSHI be a synonym for IF can easily be done by
    macros; the more interesting case is when you want to make MOSHI
    mean IF and IF then mean something else.  Unfortunately most
    compilers seem to build the known function names right into the
    compiler source (e.g. (EQ F '+)) rather than using a database
    that can be rearranged (e.g. by using symbol property lists).
Not just the gut of the compiler that does (EQ F '+), but
macro packages and code-transformers inside and outside compilers
expect `(+ ,x ,y) or whatever to generate a reference to the +
that it knows about.  If we follow your line (which is not without
merit), it will be extremely difficult, if not impossible,
to write macros that can be used with referential transparency
in systems where renaming is taking place.