From: | haberg@matematik.su.se (Hans Aberg) |
Newsgroups: | comp.compilers |
Date: | 6 Oct 2003 21:27:41 -0400 |
Organization: | Mathematics |
References: | 03-10-004 |
Keywords: | code, Java, design |
Posted-Date: | 06 Oct 2003 21:27:41 EDT |
"Gabriele Farina" <mrfaro@libero.it> wrote:
>[The only way I know to handle anonymous functions is to give each on a
>secret private name at compile time. As far as adding new methods at
>runtime, it's doable but it means that you have to keep most of the
>compiler symbol table at runtime and possibly the whole compiler if
>you're adding new code on the fly. -John]
I think that Java solves the fragile base class by a runtime name of
methods to compute its class offset. Once the name of the method is
stored in the runtime class, it can be used for other types of runtime
lookup/linking (perhaps called "reflections" in Java). These are
essentially DLL lookup techniques then.
If one wants dynamically definable functions, then that is probably
one the way of implementing a functional language interpreter. One
then implements functional closures, that can be combined either via
compiled code, or by other runtime structures that knows how to
combine them.
Hans Aberg
Return to the
comp.compilers page.
Search the
comp.compilers archives again.