[Ecls-list] "Problem" with overloading functions from compiled file
Goffioul Michael
goffioul at imec.be
Thu Sep 7 08:59:50 UTC 2006
[Of course, I forgot to write the part about that "problem" in my
previous mail]
When I wanted to implement my own REPL loop and wanted to overload some
of
the functions defined in top.lsp. However I discovered a problem with no
easy
workaround. In a compiled file, functions that call each other do it by
calling directly the equivalent C function. As the call is "hard-coded",
you
can't overload it.
For example:
(defun f1 (x)
;; do something
)
(defun f2 (y)
(let ((z (f1 y)))
;; do something
))
If you put those 2 functions in the same file and compile it, the C code
for F2
will call the C function for F1. Later on, if you want to redefine F1
with some
other implementation, the function F2 won't use it because it calls the
C function
directly, and not "the function associated with the symbol F1". So, in
the end,
you also have to redefine F2, even if the implementation is the same.
I don't say it's bad, indeed it's speed up code execution. But sometimes
it might
be a limiting factor.
Bye,
Michael.
More information about the ecl-devel
mailing list