On Wed, May 31, 2017 at 10:05 PM, Steve Byan's Lists
<steve-l...@byan-roper.org> wrote:
>
> I did consider using an association list representation for the attributes, 
> but I'm depending on s-expression pattern matching for parsing the records. 
> It's wonderfully convenient for this. I'm under the impression that `match` 
> requires proper lists as input.

`match` is very flexible. Assuming your pmem_flush lists always have
the same attributes in the same order, you could do:

(match datum
  [`(pmem_flush
     (threadId . ,thread-id)
     (startTime . ,start-time)
     ...)
   < do something with thread-id, start-time, etc. >]
   ...)

If they're not always in the same order, you can use the
`list-no-order` pattern instead of `list`. If you only want to match
some of the pairs, you can do that too:

(match datum
  [(list-no-order pmem_flush (cons 'startTime t) _ ...) t]
  ...)

- Jon

-- 
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