guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: procedure-source availability


From: Mark H Weaver
Subject: Re: procedure-source availability
Date: Sun, 30 Sep 2012 23:40:48 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.7) Gecko/20120922 Icedove/10.0.7

On 09/30/2012 04:11 PM, Panicz Maciej Godek wrote:
I've found a bug report on savannah, which noted the lack of
``procedure-source'' for guile 1.9.11
http://savannah.gnu.org/bugs/?30469
I wonder if any further decisions were made regarding the maintenance
of ``procedure-source''. I would find it really useful for my
application if the sexp containing the lambda expression that was used
to generate the procedure was stored in it's property list, and I
don't understand why this isn't currently done.

Out of curiosity, why do you need this?

The reason I ask is that, in the presence of macros, it is not clear what you mean by the "procedure-source".

Do you mean before macro expansion? If so, what use it is to you, since it may contain user macros that your code cannot understand? Furthermore, many procedures simply don't exist before macro expansion. For example, a record type definition expands to several procedure definitions that do not exist in the original source.

If you mean after macro expansion (or perhaps in some intermediate state of macro expansion, e.g. at the point where the macro expander first encounters the lambda expression), then a normal sexp with the original identifier names is no longer sufficient. In psyntax, these intermediate forms are represented as syntax objects, but at the very least you'd need to rename the identifiers to prevent unintended variable capture.

It's a very thorny issue, and I suspect that's the reason that 'procedure-source' no longer works. If we are going to reimplement that functionality, then we first need to figure out precisely what it _should_ do in the general case. Which brings me back to the question: "Why do you need this?"

    Regards,
      Mark



reply via email to

[Prev in Thread] Current Thread [Next in Thread]