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

MacIvory conversion experience



    Date: Tue, 21 Feb 89 18:20 EST
    From: Michael Greenwald <Greenwald@stony-brook.scrc.symbolics.com>

	Date: Tue, 21 Feb 89 17:12 EST
	From: Barry Margolin <barmar@Think.COM>

	    Date: Tue, 21 Feb 89 15:32 EST
	    From: Michael Greenwald <Greenwald@stony-brook.scrc.symbolics.com>

	    A second flaw, too.  What if you redefine the function to have a
	    different arglist?  HIDDEN-ADVISE won't be up-to-date, and, in fact,
	    might raise an error.  ADVISE (actually all forms of encapsulation) is
	    (are) supposed to work across redefinition of the function.

	I thought about that, and decided that it isn't really a problem.  If
	the argument order changes, a piece of advice that is using CAR, etc.
	and hasn't been updated would also be incorrect, so it's no worse than
	the current situation.  

    I disagree (mildly).  There are two differences.  In the CAR case (or if
    the ADVISE form explicitly uses (destructuring-bind arglist ..)) then the
    bug is in the user code, not in the system utility.  

You DOCUMENT the limitation of the system utility.  I don't think anyone
really expects you to make advise work as well as instance variables
across redefinitions.

							 Second, if ADVISE did
    the destructuring-bind itself, then it would raise an error even if the
    user >didn't< use the feature explicitly.

That's why it should use ZL:DESTRUCTURING-BIND, which never signals an
error.

    How about a compromise: we document the trick of using DESTRUCTURING-BIND
    of the ARGLIST, and warn that if you redefine the arglist you'd better
    redefine the advice, too.  Maybe we even provide a macro you can use
    inside the body of your advice.

Well, this macro would have the same limitations as if the feature were
built into ADVISE.

    I don't know if this would get into the system in the near future, either.

Hey, I submit feature requests all the time with the full knowledge that
90% of them will never be implemented.  But it never hurts to hash out a
strawman design.

                                                barmar