No, there isn't something here that you're missing. An addition here would probably be useful, though -- you might take a look at how Clojure does this, since they pattern match on a lot of dictionaries.
Sam On Thu, Aug 30, 2018 at 11:36 AM David Storrs <david.sto...@gmail.com> wrote: > > I'd like to be able to write something like this: > > (match (hash 'a 1 'b 2) > [(hash-table ('a a) ('b b) ('c c)) (list a b c)]) > > ...except with something that says "if 'c isn't present, that's fine. Use > this value instead." > > I've gone through the page on pattern matching and been unable to find > anything. I've tried various things with #:when but that doesn't seem to do > what I need -- it only controls whether the match succeeds or fails. > > I could write multiple clauses or do the defaulting before the match, but > that's a lot of bother and it feels like there should be a more elegant > solution. Have I missed anything? > > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.