On Wed, 2013-02-27 at 16:13 +0100, Andy Wingo wrote:
> On Wed 27 Feb 2013 16:08, Andy Wingo <wi...@pobox.com> writes:
> 
> > Here is a Guile 2-compatible version:
> >
> >   (cond-expand
> >    (guile-2) ; nothing
> >    (else ; guile < 2.0
> >     (define-macro (define-once sym exp)
> >       `(define ,sym (if (module-locally-bound? ',sym) ,sym ,val)))))
> 
> Sorry, thinko+typo.  Should be:
> 
>   (cond-expand
>    (guile-2) ; nothing
>    (else ; guile < 2.0
>     (define-macro (define-once sym exp)
>       `(define ,sym
>          (if (module-locally-bound? (current-module) ',sym)
>              ,sym
>              ,exp)))))
> 

This works a treat (well, of course I didn't actually get to test on
guile 2.0 myself, but I will doubtless hear about it if it should fail
there :)

Thank you all who responded.

Richard



Reply via email to