Re: Questions about anonymous functions and classes/functions declarations

haberg@matematik.su.se (Hans Aberg)
6 Oct 2003 21:27:41 -0400

          From comp.compilers

Related articles
Questions about anonymous functions and classes/functions declarations mrfaro@libero.it (Gabriele Farina) (2003-10-04)
Re: Questions about anonymous functions and classes/functions declarat derkgwen@HotPOP.com (Derk Gwen) (2003-10-06)
Re: Questions about anonymous functions and classes/functions declarat lsantil@calstatela.edu (Louis Paul Santillan) (2003-10-06)
Re: Questions about anonymous functions and classes/functions declarat haberg@matematik.su.se (2003-10-06)
Re: Questions about anonymous functions and classes/functions declarat joachim.durchholz@web.de (Joachim Durchholz) (2003-10-06)
Re: Questions about anonymous functions and classes/functions declarat geoff@wozniak.ca (Geoff Wozniak) (2003-10-08)
Re: Questions about anonymous functions and classes/functions declarat joachim.durchholz@web.de (Joachim Durchholz) (2003-10-08)
Re: Questions about anonymous functions and classes/functions declarat witness@t-online.de (Uli Kusterer) (2003-10-13)
Re: Questions about anonymous functions and classes/functions declarat marcov@stack.nl (Marco van de Voort) (2003-10-13)
| List of all articles for this month |

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


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.