> On Oct 11, 2017, at 2:56 PM, George Neuner <gneun...@comcast.net> wrote:
> Hmm.  For completeness?   I'm having trouble imaging why you'd want to
> match a literal hash table.  Or boxes.  The other options make more
> sense.  Oh well.

Imagine you’re parsing some JSON. You could parse the JSON into Racket
data structures using string->jsexpr, then use match to extract the data
into bindings:

  (match (string->jsexpr some-json-data)
    [(hash-table ['name name]
                 ['age age])
     (list name age)])

This turns out to be enormously useful, especially when combined with
other match patterns.


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