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

Re: EQ(UAL) in SUBST



The general problem with using EQ is that in Maclisp, flonums and many
fixnums which are '=' are not necessarily EQ. While it is fine for the
LispM as an independent language to use EQ, but since EQ is itself a very
different operation on the LispM, I'm not sure if this is a good idea.
The notion of EQUALness is much more general across implementations than
is the notion of EQness. I suggest that perhaps we could win with a compromise
such one that called EQUAL on atoms and EQ on lists. This would make SUBSTing
for flonums, fixnums, strings, etc behave more uniformly across dialects. 
I agree that checking lists for EQUALness is an un-necessary slowness.

There is also the other problem of whether (SUBST 'FOO '(A B) '((A B) A B))
should return (FOO A B) or (FOO . FOO). This, it seems to me, is a far more
severe issue since it plays a role in the existing definitions of SUBSTs
and other similar mechanisms and code could conceivably broken in Maclisp
or LispM depending on who changed and why. 

I would prefer if CAR's and CDR's were treated identically, but I can 
understand why others might find it more comfortable to ignore subtails.
Whatever it does, however, I think uniformity would be important. Macsyma 
users use SUBST a lot, but we can shield them on that score since we can 
always write one that maintains whatever semantics we feel they need.
Macsyma internal code using SUBST is trivially findable and we could adapt
to any well-defined set of changes as well, so don't worry too much about
that. Macsyma does have to run on Multics, too, so we'd have to be doing
the adaptation anyway now that the potential bug has been pointed out.

-kmp