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

Re: Function invocation by key word



Since the subject of "parsing" argument vectors has come up, I'd like to
issue an advertisement for DEFUN-KEYED which allows you to define
functions that takes arguments by key rather than by position in the
argument vector.  In many circumstances it leads to more readable code
and solves the &optional argument screw where it is impossible to
specify &optional argument n without specifying &optional arguments 1
thru n-1.   DEFUN-KEYED runs only on the Lisp machine (for no better
reason than that I have lost the perseverence necessary to get it to
work with the PDP-10 compiler).  It is implemented with macros in such
a way that its innards are effectively invisible to the user and it
entails no loss of efficiency other than at macro expansion time.  It
has been in use for almost a year.  A description accompanies the code
in AI:BAK;DEFKEY >.