[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Argument Lists and ADVISE
Date: 23 Jun 1986 12:31-EDT
From: NGALL@arpa.bbng
Subject: Re: Argument Lists
Without information as to the number of required,
optional, and (in some implementations?) keyword arguments (and in the
case of keyword arguments, the names of the keywords), the
encapsulation function will be forced to do unnecessary consing
(because it will have to use &rest) and use a less efficient form of
function calling (in most impl.), APPLY.
If you can't find out the argument list, you can of course still write
something like ADVISE without using &REST provided that the user must
specify an argument list for the new definition. This is not such a bad
thing, because the user might, after all, want to advise the function to
take different arguments. And you can avoid APPLY if the user has to
explicitly call the old definition using a name like FORWARD or OLD-f
(it has to be distinct from the actual function name because the new
definition may want to call itself).
The syntax could be like DEFUN, e.g., from my Franz .lisprc file:
(define-embedding putd (name def)
(if (and *notice-redefinitions* (getd name))
(msg name " redefined (putd)" N))
(call-forward name def))
This is not to say that ARGUMENT-LIST wouldn't be useful, though.
-- Jeff