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?
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to