I’ve written a long tutorial exploring the user of Racket’s Concurrent ML (CML) inspired concurrency paradigm to write an API wrapping git-cat-file. It is meant to serve as an introduction to kill-safety and CML concurrency, while assuming some existing knowledge of Racket or other Schemes. I found that there weren’t a lot of resources beyond the reference documentation that explained how to put these APIs together, and I hope this can fill that hole.
Beyond any feedback about the writing itself, one request for help: Is there a way to make the links to Racket standard forms correctly link to docs.racket-lang.org, instead of being red squiggles? That would really increase the value of Scribble generating all those links. Thanks!
the match regexp pattern can be written with or using and to bind the match: (and message (or "missing" "ambiguous"))
in the reader response, I’d probably do something like for/first + a rem function, though your single pass approach is reasonable:
(define found
(findf (lambda (p) (equal? got-key (Pending-key p))) pending))
(define new-pending
(if found (remove found pending) pending))
(loop … (if found (cons (pending->response found contents) response-attempts) response-attempts) …)
The for/first would allow me to put pending->response in the loop, but then remove would be less concise (you’d need to remf and check for got-key again).