Hi there,

I am writing a simple macro `if-let` that tried to bind the condition to a 

(define-simple-macro (if-let (~describe "binding pairs" [binding:expr 
                             (~describe "\"then\" clause" then:expr)
                             (~describe "\"else\" clause" else:expr))
  (let ([val value])
    (if val (match-let ([binding val]) then) else)))

I finished the macro and start to write unit tests for it. Then I realized that
the "binding" should not working in "else" statement. That means:

(if-let [it #f]
  it   ; <- should report "unbound identifier".

However when I tried the following code:

(check-exn exn:fail?
           (lambda ()
             (if-let [it #f]
                     (fail "if-let: wrong-branch")


It gives error:

 it: unbound identifier in module

So the question is how to catch the "unbound identifier" exception for unit 


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