HI
 
The following works:
 
#lang racket
(syntax-case (list 'a 'b) () ((x ...) #'(list 'x ...)))
; -> #<syntax:3:40 (list (quote a) (quote b))>

The docs on syntax-case say:
 
(syntax-case stx-expr (literal-id ...)  

  clause ...)
 
However, as far as I have seen, the docs do not specify the exact type of
stx-expr.
It appears that a stx-expr not necessarily is (evaluates to) a
syntax-object.
 
In (syntax->datum x), x must be (evaluate to) a syntax.
In my opinion it would be logical to have syntax->datum to accept any
stx-expr.
 
Question 1:
where are the docs on what is a stx-expr.
If there are none, can they be added?
 
Question 2:
Would it be possible to extend syntax->datum such as to accept any stx-expr?
 
I use syntax->datum frequently for debugging syntax-transformers.
There is no button in DrRacket for debug-syntax-transformers-included.
Of course I can use debug after replacing syntax-transformers by
runtime-procedures.
However, then literal-ids are not correctly recognized because of phase
distinction.
 
Question 3:
What can I do in order to debug syntax-transformers correctly, specifically
when literal-ids are involved?
 
Thanks, Jos Koot
 
 
 

-- 
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