In the srfi examples, 'digit' is used as a named character set, but
it's not documented (only num and numeric are). Chibi seems to
recognize 'digit' as well. Is it a real charset, or do we need to
update the examples?
It's a non-standard Chibi extension, so the examples should be fixed.
In the sample implementation, all three of num, numeric, and digit are defined in terms of the local implementation of charset:digit from SRFI 14. The definitions of charsets given in that SRFI are Java-1.0-specific rather than Unicode-blessed and are desperately in need of an overhaul. The Right Thing is to match characters iff they have character class "Nd" in the most recent UnicodeData.txt file. Guile is known to be out-of-date on this, and probably some other Schemes as well.
Many sre forms accept multiple <sre> but it's not exactly clear how to
interpret it. For example, what does (submatch <sre-1> <sre-2>) mean?
I suppose it's the same as (submatch (seq <sre-1> <sre-2>)) though I'm
not sure if that's intended.
It's always "implicit seq", like the "implicit begin" in similar Scheme constructs like lambda and define.
It's even worse with w/case and w/nocase
I confess to finding this part baffling as well.
(~ sre1 sre2 sre3) could use some elaboration too. It briefly mentions
"complement _of union_" in the syntax summary. (- sre1 sre2 sre3)
follows the same "of union" rule according to chibi scheme, though it
feels weird because (- 1 2 3) is (- (- 1 2) 3) not (- 1 (+ 2 3)).''
I don't follow you. In Scheme, (- 1 2 3), (- (- 1 2) 3), and (- 1 (+ 2 3)) are all -4, which could be described as "difference of sum". (Long ago I worked with a Lisp in which - and / were right-associative, so that (- 1 2 3) was (+ -1 +2 -3), but that has never been true in any mainstream Lisp.)