racket / htdp

Other
91 stars 69 forks source link

Fix #171 #172

Closed sorawee closed 2 years ago

sorawee commented 2 years ago

Here's one possible fix.

I'm kinda uncomfortable with assuming that any match expander is pretending to be a struct. This is mostly to make posn (which uses a custom match expander) work. I can use a trick similar to https://racket.discourse.group/t/impersonate-syntax-transformer-cursed-or-not/971/13 to make this more precise, if that's really a concern.

I recognize quote, ?, and cons by textual appearance (~datum), not by binding. Let me know if this should be changed.

Also, I recognize many literal constants that Racket allows, just to be safe. But let me know if I should remove any.

Also, I strictly follow the grammar, so the list pattern is not supported. Let me know if it should be supported, and I'll adjust both documentation and implementation.

sorawee commented 2 years ago

I added the list pattern support + updated the doc. Please re-review when you get a chance, @mfelleisen @samth.

mfelleisen commented 2 years ago

This looks fine by me. I'd say merge it all and push. THANKS so much.

mfelleisen commented 2 years ago

(I did it myself .. )