name and n (could be more) can't be used as a binding name of with-args

Create issue
Issue #88 resolved
Takashi Kato repo owner created an issue

This raises an error

(with-args (cdr args)
     ((name (#\n "name") #t #f))
  name)

Comments (2)

  1. Takashi Kato reporter

    This is a macro problem. Smaller code is the following:

    (import (rnrs))
    
    (define-syntax let-it
      (lambda (x)
        (define (bind-it k binding)
          (syntax-case binding ()
        ((var . val) 
         (let ((name (syntax->datum #'var)))
           #`(#,(datum->syntax k name) val)))
        (_ (error 'let-it "invalid form"))))
        (syntax-case x ()
          ((k ((var . val) rest ...) body ...)
           (with-syntax (((var1 val1) (bind-it #'k #'(var . val))))
         #'(let ((var1 val1))
             (let-it (rest ...) body ...))))
          ((_ () body ...)
           #'(begin body ...)))))
    
    (let-it ((name . 'name)) (display name))
    

    Seems variable look upper confused by the datum->syntax.

  2. Log in to comment