
Is there a match
predicate in the standard libraries? Something that means “if this given value matches this given pattern, then return #t
, else return #f
.” I keep finding myself writing this in terms of match
, and I feel like there should be a better way.

@leafac I thought there was one, but cannot find it, so I may have imagined it. There’s check-match
from rackunit
for tests (it does not return a boolean). Otherwise, seems like you will have to roll your own.

@georges-duperon: Thank you for your answer.

@georges-duperon: I’m doing something about this: https://github.com/racket/racket/issues/1690 :slightly_smiling_face:

I read Fortifying Macros by Culpepper and Felleisen, where ports of loop
and parser
were made using syntax-parse
. I can’t seem to find the code for those, though. Does anybody know where/if they can be found?

Answered by Alex Harsanyi on Racket Users listserv.

@rkallos: I’d email @ryanc and ask.

@rkallos Wait, so there’s (already) a Racket implementation of the CL loop
hiding somewhere? Throwing a glance at my early implementation draft which has been bitrotting for the last few weeks… Be sure to post back here if you get an answer from @ryanc !


@lexi.lambda Sweet, thanks a lot!

Has anyone used, from scribble/srcdoc
, any of parameter-doc
, thing-doc
, or struct-doc
? All give me "illegal use of syntax"
errors. Whereas proc-doc
works great.

For instance #lang at-exp racket/base
(require scribble/srcdoc
(for-doc racket/base
scribble/manual))
(define current-foo (make-parameter "bar"))
(parameter-doc current-foo
(parameter/c string?)
v
@{Hi})

@greg A better error message would have been “must be used within a provide
form” (and I’m guessing that you’ve used proc-doc
successfully within provide
)

@mflatt Thanks! I’d wrapped proc-doc
in a define/doc
macro, long enough ago, that I forgot it was nested in a provide
. Dang.

It would be neat if http://pkgs.racket-lang.org\|pkgs.racket-lang.org showed, in addition to direct dependencies, direct dependents (“needed by”) as for example https://melpa.org/#/helm