[racket] Can you avoid voids in quasiquote?
I frequently write quasiquoted xexprs that contain this kind of pattern:
`(p "foo" "bar" ,(when test-condition (do-something)))
When test-condition is #f, I get:
'(p "foo" "bar" #<void>)
Which is wrong. What I wanted was:
'(p "foo" "bar")
I can fix it by doing this:
(filter-not void? `(p "foo" "bar" ,(when test-condition (do-something))))
Is this the best way? Or is there a cleverer way to make the nested
expression completely disappear?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140128/1b9030cc/attachment.html>