leafac
2017-5-12 14:21:29

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.


georges-duperon
2017-5-12 15:21:34

@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.


leafac
2017-5-12 15:39:00

@georges-duperon: Thank you for your answer.


leafac
2017-5-12 15:47:05

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


rkallos
2017-5-12 18:03:18

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?


abmclin
2017-5-12 20:09:26

Answered by Alex Harsanyi on Racket Users listserv.


stamourv
2017-5-12 20:12:57

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


georges-duperon
2017-5-12 23:13:13

@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 !



georges-duperon
2017-5-13 00:30:48

@lexi.lambda Sweet, thanks a lot!


greg
2017-5-13 00:52:21

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.


greg
2017-5-13 00:53:18

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})


mflatt
2017-5-13 01:33:45

@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)


greg
2017-5-13 01:52:33

@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.


greg
2017-5-13 02:35:17

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