From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.bugs Subject: Re: Errors using `reload' command Date: Wed, 09 Feb 2011 10:51:04 +0100 Message-ID: <877hd9zgc7.fsf@gnu.org> References: <8CD91EE4B5F7F3C-2564-1D76E@webmail-m030.sysops.aol.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1297245101 2995 80.91.229.12 (9 Feb 2011 09:51:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 9 Feb 2011 09:51:41 +0000 (UTC) To: bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Wed Feb 09 10:51:37 2011 Return-path: Envelope-to: guile-bugs@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 1Pn6i0-0004l6-P9 for guile-bugs@m.gmane.org; Wed, 09 Feb 2011 10:51:36 +0100 Original-Received: from localhost ([127.0.0.1]:39265 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pn6i0-0007cb-C3 for guile-bugs@m.gmane.org; Wed, 09 Feb 2011 04:51:36 -0500 Original-Received: from [140.186.70.92] (port=54245 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pn6hs-0007cM-9x for bug-guile@gnu.org; Wed, 09 Feb 2011 04:51:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pn6hr-0006Kg-4E for bug-guile@gnu.org; Wed, 09 Feb 2011 04:51:28 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:45637) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pn6hq-0006KV-Uc for bug-guile@gnu.org; Wed, 09 Feb 2011 04:51:27 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1Pn6hj-0004U8-HK for bug-guile@gnu.org; Wed, 09 Feb 2011 10:51:19 +0100 Original-Received: from 193.50.110.208 ([193.50.110.208]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 09 Feb 2011 10:51:19 +0100 Original-Received: from ludo by 193.50.110.208 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 09 Feb 2011 10:51:19 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 35 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 193.50.110.208 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 21 =?iso-8859-1?Q?Pluvi=F4se?= an 219 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux) Cancel-Lock: sha1:HADpof0xZwPnO7BrAo2QU/mF+7E= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5090 Archived-At: Hi! Andy Wingo writes: > On Tue 08 Feb 2011 23:58, Andy Wingo writes: > >> On Thu 03 Feb 2011 20:18, Mark Harig writes: >> >>> scheme@(guile-user)> ,re (ice-9 readline) >> >> Actually now this causes an infinite loop. Doh. We need defvar, >> somehow... > > What do people think about this: > > (define-syntax define-once > (syntax-rules () > ((_ sym val) > (define sym (if (defined? 'sym) sym val))))) Looks cool! How about this variant? (define-syntax define-once (syntax-rules () ((_ sym val) (define sym (if (defined? 'sym) sym val))) ((_ sym val docstring) (begin (define-once sym val) (set-doc-property! (module-variable (current-module) 'sym) docstring))))) Ludo’.