bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #31472] Probable psyntax bug with multiple defininitions in the mac


From: Stefan Israelsson Tampe
Subject: [bug #31472] Probable psyntax bug with multiple defininitions in the macro expansion
Date: Thu, 09 Jun 2011 16:48:43 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101216 Linux Mint/1 (Debian) Firefox/3.6.13

Follow-up Comment #3, bug #31472 (project guile):

I'm trying to understand useful ideoms where this is useful.

One main is to store a state, t, shared by different users 
that are published in an interface. This can be solved by,

(library 
 (temporaries-bug)
 (export foo1 foo2)
 (import (rnrs))

 (define-syntax define-foo
   (lambda (x)
     (syntax-case x ()
       ((_ name)
        (identifier? #'name) 
        #'(begin
            (define (name) #t)
            (let ((t '(foo name)))
              (set! name (lambda () t))))))))

 (define-foo foo1)
 (define-foo foo2))

Any more ideoms?

/Stefan

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31472>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]