Skip to content

Commit

Permalink
Clarify there is no special meaning to else in match.
Browse files Browse the repository at this point in the history
Closes #1005.
  • Loading branch information
ashinn committed Oct 8, 2024
1 parent 25a5534 commit be31278
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/chibi/match/match.scm
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@

;;> If no patterns match an error is signalled.

;;> Note there is no \scheme{else} clause. \scheme{else} is sometimes
;;> used descriptively for the last pattern, since an identifier used
;;> only once matches anything, but it's preferred to use \scheme{_}
;;> described below.

;;> Identifiers will match anything, and make the corresponding
;;> binding available in the body.

Expand Down Expand Up @@ -128,7 +133,7 @@
;;> are bound if the \scheme{or} operator matches, but the binding is
;;> only defined for identifiers from the subpattern which matched.

;;> \example{(match 1 ((or) #t) (else #f))}
;;> \example{(match 1 ((or) #t) (_ #f))}
;;> \example{(match 1 ((or x) x))}
;;> \example{(match 1 ((or x 2) x))}

Expand Down

0 comments on commit be31278

Please sign in to comment.