[racket] quasisyntax vs quasisyntax/loc

From: Tobias Hammer (tobias.hammer at dlr.de)
Date: Tue Jun 4 05:52:27 EDT 2013

Hi,

i have a problem with nested quasisyntax, quasisyntax/loc and unsyntax.  
Two quasisyntax with one unsyntax gets me one level up, as expected. But  
two quasisyntax/loc with unsyntax somehow gets me to the outmost level.

Can anybody tell me if this is intended or explain why this happens?

Tobias


; --- examples

(define-syntax (noloc stx)
   (syntax-case stx ()
     [(_)
      (let ([var 'outer])
        (quasisyntax
         (let ([var 'inner])
           (quasisyntax
             #,var))))]))

(noloc)
> #<syntax:10:29 outer>


(define-syntax (loc stx)
   (syntax-case stx ()
     [(_)
      (let ([var 'outer])
        (quasisyntax/loc stx
         (let ([var 'inner])
           (quasisyntax/loc #'here
             #,var))))]))

(loc)
> #<syntax inner>



-- 
---------------------------------------------------------
Tobias Hammer
DLR / Robotics and Mechatronics Center (RMC)
Muenchner Str. 20, D-82234 Wessling
Tel.: 08153/28-1487
Mail: tobias.hammer at dlr.de

Posted on the users mailing list.