From: Randy Coulman
Subject: Functions
Date: 
Message-ID: <1gdj3eINN73l@access.usask.ca>
I'm currently building an application using Allegro CL 4.1 and CLIM 1.1 on 
a Sparc 1+.  One piece of functionality I need to include in my application
is to allow users to specify and edit functions.  These functions would 
ideally be lambda expressions.  Later, the application would use apply or 
funcall to use the lambda expressions.  Unfortunately, the new standard says
that lambda expressions are no longer valid function arguments to funcall
and apply.  Instead, it is necessary to use #'(lambda ... instead of 
'(lambda ...  I can easily make it a requirement that these functions need
to be specified with #'.  However, this takes away the ability to later edit
the function.  

As an example, my application uses a class of object called Observers.  Each 
observer knows how to make one binary (i.e., t or nil) observation about the 
real world.  This is accomplished through the use of an observer function 
(ofun).  The application I'm building allows the user to define new
observers, so they need to be able to define the ofun's as well.  E.g.:

Defining Observer...
Name: Always
Ofun: '(lambda (c)
         (declare (ignore c))
         t)
...

If I use #'(lambda ... above, then editing would look like this:

Editing Observer...
Name: Always
Ofun: #<Interpreted Function (unnamed) @ ...>

Am I missing something completely obvious about how to get around this 
problem?  If not, can anyone suggest a reasonable work around?

The way I'm doing it now is to define these functions in a source file,
giving them names (strings) and storing them in a hash table.  If the user
wants to define new functions, they have to edit the source file before
loading the system.  This is not acceptable.

Thanks in advance for any help.

Randy

P.S.  Please e-mail instead-of/in-addition-to posting any replies.  Our
news feed is behind by about 5 or 6 days right now.  I'll post a 
summary.

-- 
Randy A. Coulman                |       ARIES Laboratory
Research Assistant              |       Department of Computational Science
                                |       University of Saskatchewan
·······@cs.Usask.ca             |       Saskatoon, SK   S7N 0W0