[racket] Is there a technical or social reason that parser-tools/lexer doesn't have an "else"?

From: Danny Yoo (dyoo at hashcollision.org)
Date: Mon May 21 20:26:39 EDT 2012

> parser-tools/lex-sre has a sequence regular expression (:), which can
> match an empty sequence. (It does warn you that it accepts an empty
> sequence, since it's guaranteed to succeed, but it doesn't consume
> input.)

Yes, that's true.

The documentation clearly knows this situation happens, and happens
often enough to warrant mention.  That's the whole point behind the
paragraph:

---
    Hint: If (any-char custom-error-behavior) is the last rule, then
there will always be a match, and custom-error-behavior is executed to
handle the error situation as desired, only consuming the first
character from the input buffer.
---

    (http://docs.racket-lang.org/parser-tools/Lexers.html)

I'm pretty certain that there can't be a technical reason behind the
lack of explicit support, but I wanted to make sure.  Maybe there's
some overriding social or historical reason for it.

Posted on the users mailing list.