bug-kawa
[Top][All Lists]
Advanced

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

[Bug-kawa] [bug #36556] Macro problem


From: Helmut Eller
Subject: [Bug-kawa] [bug #36556] Macro problem
Date: Mon, 28 May 2012 20:56:46 +0000
User-agent: Opera/9.80 (X11; Linux i686; U; en) Presto/2.10.229 Version/11.64

URL:
  <http://savannah.gnu.org/bugs/?36556>

                 Summary: Macro problem
                 Project: Kawa
            Submitted by: ellerh
            Submitted on: Mon 28 May 2012 08:56:45 PM GMT
                Category: None
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

Compiling this code with java -jar kawa-1.12.jar --version -C x.scm

(define (bind-return loop-id k body)
  (let ((return-id (datum->syntax loop-id 'return)))
    #`(call/cc
       (lambda (#,k)
         (let-syntax ((#,return-id
                       (syntax-rules ()
                         ((_ exp)
                          (call-with-values (lambda () exp) #,k)))))
           #,body)))))

(define (simple-loop form)
  (syntax-case form ()
    ((loop-id forms ...)
     (bind-return
      #'loop-id #'k
      #`(let loop ()
          (begin forms ...)
          (loop))))))

(define-syntax xloop simple-loop)

(display (if (eq? (xloop (return #t)) #t)
             'ok
             'failed))


aborts with:


x.scm:24:26: call to unnamed procedure has too many arguments (2; must be 0)






    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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