You're right that `|` isn't a valid terminal with the normal reader, but,
as it happens, the zero-length identifier can be written as `||`. (I don't
think the concept of a zero-length identifier is common in other languages:
it corresponds to the empty string.)

-Philip


On Mon, Feb 3, 2020 at 6:27 PM Kevin Forchione <[email protected]> wrote:

> Hi guys,
> I’ve been  trying to figure out how to use “|” in a macro. I’ve got syntax
> like this in mind:
>
>         (foo A | B)
>
> Not sure if I can do this because the reader expects a pair. If “|” isn’t
> a convenient literal to work with is there an alternative others have used
> that represents more or less the idea of “or” or “alternate”?
>
> Thanks!
>
> Kevin
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/447100AA-DB45-46C3-A7DC-2705A1668302%40gmail.com
> .
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAH3z3gbfU7x6y_XHmK-uKUeH%3D4exbnvw8wUNzNnipzOMeC7bbQ%40mail.gmail.com.

Reply via email to