[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: MacLisp Info Line <email@example.com>
- Subject: Re: Apply
- From: Denis R Howlett <firstname.lastname@example.org>
- Date: Wed, 12 Aug 1992 09:40:01 -0400 (EDT)
I too discovered that apply and funcall don't work for lambda lists any
more and was rather disheartened since a great deal of our user interface
code relies on constructing functions which are then attached to buttons.
Much of this code is created with backquotes so that variables can be
insterted, a simple example might be:
(defun make-menu-items (items)
(dolist (item items)
(push (make-instance ...
(declare (ignore window))
I know the code isn't quite right but you get the idea, each lambda
expression is created at run time.
The solution I have adopted (but don't like) is to make the function
dispatcher more intelligent and do the following:
;; attached-function & window are bound in preceding lines
(funcall (if (listp attached-function)
(eval `(function ,attached-function))
This allows my dispatcher to deal with all the things that funcall (and
apply used to deal with), but I always thought it was bad form to use eval
in the middle of code? ...