Some ideas for the spec cleanup
Felix Thibault 02 Jul 2021 22:30 UTC
(the changes I mentioned before are in my repo under feature/later-binding)
I was thinking I could move what is listed under
Specification.Patterns to a separate section called Pattern Examples,
so then the information under the specification would be:
Pattern Grammar
Syntax
Tail Contexts
Side Effects
Errors
Using in Other Macros
and I was thinking of moving the examples in the syntax section to the
Pattern Examples Section if there were still no examples using those
forms, and adding something like:
a match-lambda* form like this:
(define check-and-sum
(match-lambda* (((? number? a) (? number? b)) (+ a b))
(_ 'fail)))
is equivalent to a regular match form like this:
(define (check-and-sum . arg*)
(match arg*
(((? number? a) (? number? b)) (+ a b))
(_ 'fail)))
or maybe something simpler that just gets the syntax across. Would
those changes make a big difference in how easy the spec is to use
from an implementation perspective or is there something else I need
to look at?