Here is an update to my last mail:

First, I have found a workaround to my problem:
Instead of calling 

(compile f lambdaexp)

to modify function f to get the new definition of lambdaexp,
I now call

(setf (symbol-function f) (coerce lambdaexp 'function))
(compile f)

That seems to have the intended effect.

Second, it seems the error I found is not an error but a feature:
a colleague pointed me to the sentence

The consequences are unspecified if functions are redefined
individually at run time or multiply defined in the same file.

in section 3.2.2.3 Semantic Constraints of the Common Lisp HyperSpec.

Does this mean, that it is not allowed to dynamically change
the function stored in the symbol-function slot of a symbol?
Then even my workaround does not adhere to the standard.

It is clear, that I can bind the function to some other property of
the symbol and use funcall's, but that gives rather ugly-looking code.

So my question now is: what is the correct solution,
when I want to use dynamically generated (and dynamically modified)
functions? After all, elegant dynamic creation of functions
(using backquote syntax)  is THE feature of Lisp that I find
the most attractive in comparison to other programming languages.

Best regards 

 Gerhard





Reply via email to