mark.warren
2019-3-14 07:33:25

@notjack Yes sort of like STM.


mflatt
2019-3-14 12:43:52

That looks like the bug fixed recently for this issue: https://github.com/racket/racket/issues/2458 Are you using v7.2, or at least a pre-release version that’s more than 17 days old?


sorawee
2019-3-14 14:50:11

Yep, I am using 7.2


jerome.martin.dev
2019-3-14 20:19:19

Hello Racketeers! I wanna check for the presence of some keywords in a syntax-class (but the keyword themselves don’t have any value following them, they are just stand-alone keywords). I make a pattern to match them, but how do I retrieve the information about whether one of them is present or not if there’s no syntax binding? (~optional #:my-keyword <a-value>:expr) can be checked with (~? <a-value>), but what about (~optional #:my-keyword)?


samth
2019-3-14 20:21:32

@jerome.martin.dev try (~and p ...) around that


jerome.martin.dev
2019-3-14 20:21:47

oh, right!


jerome.martin.dev
2019-3-14 20:22:02

thanks a lot, I forgot this trick!


jerome.martin.dev
2019-3-14 20:59:42

I made a SO question to document that: https://stackoverflow.com/questions/55171895/how-do-i-check-for-the-presence-of-a-keyword-in-a-racket-syntax You are welcome to suggest a better answer than mine :slightly_smiling_face:


alexknauth
2019-3-14 21:07:15

Maybe a better place would be in the syntax/parse examples section on optional keyword arguments:



joshgrant
2019-3-14 21:16:43

@joshgrant has joined the channel


jerome.martin.dev
2019-3-14 21:47:49

@alexknauth Yeah, why not! I’ll do a PR too :slightly_smiling_face:


jerome.martin.dev
2019-3-14 21:48:13

SO and this page of the doc were the two places where I looked for an answer


oldsin
2019-3-14 23:52:03

How do you match a single line comment using lexer? Is there a way to match (eof) as the end of a single line comment? :disappointed_relieved:



oldsin
2019-3-15 00:18:52

Almost forgot racket source is a good place to learn! Thanks :pray:


alexknauth
2019-3-15 00:22:32

The important part is that it doesn’t need to include a newline at the end, it just greedily consumes all characters that are not newlines.


oldsin
2019-3-15 00:26:30

Yes I see. @mbutterick I guess your jsonic lexer tutorial probably needs an update on matching single line comment.


matias
2019-3-15 02:41:13

That’s unfortunate. I did consider a macro, I was just a little unsure if that would mess things up in some way. I guess I’ll do that then.


matias
2019-3-15 02:41:19

Thanks!