I'm confused about the behavior of quasiquote and quasisyntax in some cases 
(using Racket v6.10.1).  I'll list some examples alongside my questions.


This vector quasiquote behavior makes sense to me:
> `#(3 ,@'(4))
'#(3 4)

The analogous quasisyntax gives an error, which seems strange.  What's 
going on here?: 
> #`#(3 #,@'(4))
; list->vector: contract violation
;   expected: list?
;   given: #f
; [,bt for context]

Note that quasisyntax-ing a list instead of a vector works:
> #`(3 #,@'(4))
#<syntax:3:2 (3 4)>

Also note that adding a trailing element to the vector quasisyntax avoids 
the error:
> #`#(3 #,@'(4) 5)
#<syntax:4:2 #(3 4 5)>


Next, is this the expected behavior of unquote-splicing a non-list at the 
end of a list quasiquote?  I noticed Chez Scheme gives the same result:
> `(3 ,@4)
'(3 . 4)

When unquote-splicing a non-list elsewhere, we get an error, which makes 
sense:
> `(3 ,@4 5)
; unquote-splicing: contract violation
;   expected: list?
;   given: 4
; [,bt for context]

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