[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
MacIvory conversion experience
Date: Fri, 17 Feb 89 17:30 EST
From: barmar@Think.COM (Barry Margolin)
One problem that has surprised me, though, is that Symbolics changed the
order of the implicit arguments to flavor methods. On 3600's the first
two arguments to methods are SELF and SYS:SELF-MAPPING-TABLE, but on the
Ivory they are in the opposite order.
As Moon said, the change wasn't completely gratuitous.
Why should I care about this
implementation detail, you ask? Because I like to use
SI:ADVISE-PERMANENTLY to patch functions, and advice on a method needs
to know the layout of the arglist in order to access the arguments, and
it assumes that SELF is (CAR ARGLIST). Was there something I shouldz
have been using instead of CAR in order to be sure of compatibility?
Nothing documented, sorry.
When you use SI:ADVISE-PERMANENTLY with compiled advice, then the
symbols SELF and SYS:SELF-MAPPING-TABLE are bound inside the body of the
advice. This is undocumented, and unsupported. In fact, it has the
same bug that you note - the bindings are backwards on an I Machine. I
wrongly thought that anyone who would depend on the order of SELF and
SELF-MAPPING-TABLE would be content to manually play with ARGLIST.
The right fix isn't to write your own function, but to patch
SI:ENCAPSULATION-LAMBDA-LIST instead. I'll submit a patch for this for
7.4. I don't guarantee that it will pass patch-review. It will be
unsupported. It will be undocumented. I hope it will be better than
nothing, though. I'm open to hear of any better way to deal with
should I write my own function:
(defsubst arglist-self (arglist)
#+imach (cadr arglist)
#+3600 (car arglist)
#-(or 3600 imach) (error "Unknown architecture type."))