Is there a way to decompose nested hashes?

(define user (hash 'name  "bob" 'job (hash 'type 'dev 'id 112)))
(match user
   [(hash-table ('name name) ('job job))
    (displayln name)
    (displayln job)])

bob
#hash((id . 112) (type . dev))

This works, and prints the name and type on separate lines as shown.  I can
then decompose type with another match.  This does not work:

(match user
  [(hash-table ('name name) ('job (hash-table 'type type 'id id)))
   (displayln name)
   (displayln type)
   (displayln id)])
; id49: unbound identifier;
;  also, no #%top syntax transformer is bound
;   in: id49
; [,bt for context]

Is there a way to do this without nesting 'match' constructs?

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