greghendershott / fear-of-macros

A practical guide to Racket macros
251 stars 27 forks source link

Fix `dot notation for nested hash lookups' example #19

Closed leafac closed 8 years ago

leafac commented 8 years ago

The previous snippet had a guard of "fender" clause that always resulted in an error, even on valid calls. The fixed snippet performs a check and only errors in bad cases.

leafac commented 8 years ago

@greghendershott, can you please take a look at my contributions (here and on #18)? I'd love some feedback to make them better. Thanks a lot.

greghendershott commented 8 years ago

I'm sorry I've been so slow to respond; I've been swamped at $NEW_DAY_JOB and running behind on PRs generally, not just yours. Thank you for contributing; I'll take a look as soon as I can.

greghendershott commented 8 years ago

Yes, good catch. I'll merge the PR.

(The discussion below this code points out that error-handling code is tedious and obscures the main logic -- syntax-parse is wonderful to use instead. It looks like I unintentionally demonstrated another good reason: error-handling code can be buggy, too. :) )

leafac commented 8 years ago

@greghendershott: Thanks a lot for looking at the pull request and merging them. And thanks for maintaining Fear of Macros, I certainly learned a lot from it 👍