ashinn / chibi-scheme

Official chibi-scheme repository
Other
1.23k stars 141 forks source link

`(chibi match)` documentation and tests arguably misleading about the `else` keyword #1005

Closed dpk closed 1 month ago

dpk commented 1 month ago

https://github.com/ashinn/chibi-scheme/blob/05c546e38d886a660018c6d9a3c6bec2bcf325d7/lib/chibi/match/match.scm#L131

https://github.com/ashinn/chibi-scheme/blob/05c546e38d886a660018c6d9a3c6bec2bcf325d7/lib/chibi/match-test.sld#L31

https://github.com/ashinn/chibi-scheme/blob/05c546e38d886a660018c6d9a3c6bec2bcf325d7/lib/chibi/match-test.sld#L36

These examples (and others in the test file) give the misleading impression that the else keyword is meaningful in match. In fact, what these are doing is binding a variable called else. The equivalent of else in match is _.

It should probably be explicitly documented that else has no special meaning in match, as (for example) Racket does.