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)))))

-- 
http://wingolog.org/

Reply via email to