I noticed today that DrRacket's XML boxes are not hygenic

Lets say I have:

```
#lang racket

(define x [[<hello></hello>]])
```

(where [[ ]] denotes the text of an xml box)

X will be, as expected:

```
'(hello ())
```

However, if we redefine quasiquote at the top of the file:

```
#lang racket

(define-syntax (quasiquote stx) #'42)

(define x [[<hello></hello>]])
```

Now x is equal to 42.

I know in general that the quasiquote symbol (`) is not hygenic, but this
does not apply here.  When you look at the implementation of these boxes
the thing that the reader converts them to is:

```
(list 'quasiquote clean-xexpr))))
```

Where `clean-xexpr` is the xml converted to an xexpr.

So, the problem is not the use of the (`) symbol, but the fact that this
function is evaluating to an s-expression rather than a syntax object.

Understandably, if you return a syntax object: #`(quasiquote
#,clean-xexpr), the macro expander will complain about ambiguous scopes.
But, in general, is there a way to say we would like quasiquote to be bound
to the definition in the module defining XML boxes, rather than whatever
one the module using an XML box happens to have?

Thank you.

~Leif Andersen

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to