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.

Reply via email to