unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: bug-guile@gnu.org
Subject: Re: Errors using `reload' command
Date: Wed, 09 Feb 2011 10:51:04 +0100	[thread overview]
Message-ID: <877hd9zgc7.fsf@gnu.org> (raw)
In-Reply-To: m3y65pei0o.fsf@unquote.localdomain

Hi!

Andy Wingo <wingo@pobox.com> writes:

> On Tue 08 Feb 2011 23:58, Andy Wingo <wingo@pobox.com> writes:
>
>> On Thu 03 Feb 2011 20:18, Mark Harig <idirectscm@aim.com> 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’.




  reply	other threads:[~2011-02-09  9:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-03 19:18 Errors using `reload' command Mark Harig
2011-02-08 22:48 ` Andy Wingo
2011-02-08 22:58 ` Andy Wingo
2011-02-09  8:20   ` Andy Wingo
2011-02-09  9:51     ` Ludovic Courtès [this message]
2011-02-09 19:59       ` Andy Wingo
2011-02-09 20:49         ` Ludovic Courtès

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=877hd9zgc7.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=bug-guile@gnu.org \
    /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).