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

MacIvory conversion experience

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

    Your HIDDEN-ADVISE is pretty nice, but it suffers from one flaw.

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.

A minor third flaw is that it will be fooled by (DECLARE (ARGLIST ...)).
It should get REAL-ARGLIST.

    Sometimes I have used advise to allow a function to take a different
    number of arguments than the original DEFUN specifies.
    DESTRUCTURING-BIND will signal an error if the arguments and pattern
    don't match.

    There's actually a simple solution, though: ZL:DESTRUCTURING-BIND isn't
    as picky about the arguments matching, but otherwise is similar to

    I generally like the idea of advice being able to access all the
    arguments by name, though, not just the implicit ones used by flavors
    and lexical closures.  Do you think you could consider something like
    Juergen's code for a future enhancement to advice?

I could consider it, but it's trickier than you're suggesting because of
the redefinition problem.  Given the scarcity of resources here, and the
relatively low priority of the suggested improvement, I doubt it will be
touched in the near future unless the whole encapsulation mechanism is
redone from scratch.  I don't think that will happen, either.  I'm

Of course, priorities are always subject to change, but please don't
hold your breath waiting for this one.