Thanks again Philip for taking the time to reply. This is a rather unpleasant pitfall of the REPL. If you try to evaluate the > expression `(if #f some-unbound-identifier 1)`, you will see that it > evaluates to `#f` in the REPL but raises an unbound identifier error in a > module. At the REPL, `some-unbound-identifier` refers to a top-level > variable, and it is allowed to support, for example, forward references to > identifiers that will be defined in a subsequent interaction, or > interactive re-definition of variables. >
When entering '(hex a b c 1 2 3)' into the REPL, I don't think the symbols 'a', 'b' and 'c' are undefined or forward-references as they appear in the taken branch of the conditional. Maybe syntax objects are different coming from the REPL than a module, somehow resulting in the macro working as expected? Anyway, I take your point the top level has issues. I will be far more wary of it in future. -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/729c89d9-a301-47ff-8974-93618ef59390%40googlegroups.com.