guile-devel
[Top][All Lists]
Advanced

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

Re: enhancement requests


From: Andy Wingo
Subject: Re: enhancement requests
Date: Tue, 29 Mar 2011 11:50:38 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)

Hi Wolfgang,

On Mon 21 Mar 2011 01:24, Wolfgang J Moeller <address@hidden> writes:

>   (define (unintern sym)      ; UNINTERN: delete (local) shadowing symbol
>     (module-remove! (current-module) sym)
>     (if #f #f))
>
>   (define (undefine sym)      ; UNDEFINE: provide an #<undefined> shadowing 
> symbol
>     (module-ensure-local-variable! (current-module) sym)
>     (variable-unset! (module-variable (current-module) sym))
>     (if #f #f))
>
> are what I wanted, in order to
>  (a) undo MACRO definitions - you can't re-DEFINE a name after DEFINE-SYNTAX;

You can certainly re-define a name after define-syntax.  This used to
not be the case, at least with psyntax, but this changed at some point
in upstream psyntax, and I merged in similar functionality in our copy
sometime last year or the year before.

>  (b) recover built-in functions once you have re-defined them;

Hummmm.  However, functions which have been defined in your module in
terms of your local functions might keep a hold on your local functions.
Whether this happens depends on whether the code in question has been
run or not, and whether the code was introduced from a macro or not.
For the mechanism, see "Compiled Procedures are VM Programs" in the
manual.

Basically I'm hesitant to include such functionality in Guile itself,
because it gets harder for me (as maintainer, bug-hunter, etc) to reason
about users' code after you ,undefine.

>  (c) test code that uses UNDEFINED? .

How is this different from (not (defined? 'sym)) ?  And what kind of
code would you use this for?

Cheers,

Andy
-- 
http://wingolog.org/



reply via email to

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