From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: enhancement requests Date: Tue, 29 Mar 2011 11:50:38 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1301398476 6869 80.91.229.12 (29 Mar 2011 11:34:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 29 Mar 2011 11:34:36 +0000 (UTC) Cc: guile-devel@gnu.org To: Wolfgang J Moeller Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Mar 29 13:34:31 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q4XBr-0000P3-L2 for guile-devel@m.gmane.org; Tue, 29 Mar 2011 13:34:31 +0200 Original-Received: from localhost ([127.0.0.1]:52107 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4XBj-0004WO-Li for guile-devel@m.gmane.org; Tue, 29 Mar 2011 07:34:19 -0400 Original-Received: from [140.186.70.92] (port=41408 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q4XB9-00045g-9X for guile-devel@gnu.org; Tue, 29 Mar 2011 07:33:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q4XB6-0002MS-UU for guile-devel@gnu.org; Tue, 29 Mar 2011 07:33:42 -0400 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:59438 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q4XB6-0002MG-Sa for guile-devel@gnu.org; Tue, 29 Mar 2011 07:33:40 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 7D27D3A44; Tue, 29 Mar 2011 07:35:27 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=4GA0OTgzlTud/Zg8qdeaiQmdSUs=; b=J7+gGg 8xEQ5lkoTr2HKGJkcBbLOXjSc7jMzs1wRgQ61ojuoslYLwAET3lSWw+HToJ/HmOF zl6WuN2zqMKFrUdbQMfJt8u0Box83KDn378Qj8D7cz4FyrlMmGx/WK2UPOAs2eXq e+sI5rY4tAx9YJIDhypK+9fHGKnZPUVOKtXsY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=m8/8hjzflD1YwqGy1AyUSswvjhAJIM7B 6328ZhQlw43YhukAMoIUM8oaw6Z8Giva9Y0PfL4iMB6xzg27fxPpnikw75OMzM9n XNhJ6b8ASJvj1PQWniuFpxeWZzmS6Ahs0GpFEI2N//4V/JUH1qiBfZQl0JkFDIom ucttzCp6t00= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 6B9573A42; Tue, 29 Mar 2011 07:35:25 -0400 (EDT) Original-Received: from unquote.localdomain (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id A9BDA3A40; Tue, 29 Mar 2011 07:35:23 -0400 (EDT) In-Reply-To: (Wolfgang J. Moeller's message of "Mon, 21 Mar 2011 01:24:59 +0100 (CET)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: A3A72AE2-59F8-11E0-999E-E8AB60295C12-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:12047 Archived-At: Hi Wolfgang, On Mon 21 Mar 2011 01:24, Wolfgang J Moeller writes: > (define (unintern sym) ; UNINTERN: delete (local) shadowing symbol > (module-remove! (current-module) sym) > (if #f #f)) > > (define (undefine sym) ; UNDEFINE: provide an # 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/