unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Wolfgang J Moeller <wjm@heenes.com>
Cc: guile-devel@gnu.org
Subject: Re: enhancement requests
Date: Tue, 29 Mar 2011 11:50:38 +0200	[thread overview]
Message-ID: <m38vvy9rwx.fsf@unquote.localdomain> (raw)
In-Reply-To: <alpine.LNX.2.00.1103210026200.31502@gwdw03.gwdg.de> (Wolfgang J. Moeller's message of "Mon, 21 Mar 2011 01:24:59 +0100 (CET)")

Hi Wolfgang,

On Mon 21 Mar 2011 01:24, Wolfgang J Moeller <wjm@heenes.com> 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/



  parent reply	other threads:[~2011-03-29  9:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-17 11:50 enhancement requests Andy Wingo
2011-03-21  0:24 ` Wolfgang J Moeller
2011-03-21  8:23   ` Andy Wingo
2011-03-29  9:50   ` Andy Wingo [this message]
2011-03-29 14:40     ` Wolfgang J Moeller
2011-04-15  9:29   ` Andy Wingo
2011-04-18  9:53     ` Wolfgang J Moeller
2011-04-21  9:34       ` Andy Wingo
2011-04-21 10:21         ` enhancement requests ("load-ignoring-cached-go") Wolfgang J Moeller
2011-04-21 14:04           ` Andy Wingo
2011-04-21 15:56             ` Wolfgang J Moeller
2011-06-30 11:38               ` Andy Wingo
2011-04-23 19:17             ` Mark Harig
2011-03-29 10:18 ` enhancement requests Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m38vvy9rwx.fsf@unquote.localdomain \
    --to=wingo@pobox.com \
    --cc=guile-devel@gnu.org \
    --cc=wjm@heenes.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).