Re: [racket-users] Using match to decompose a nested hash

2018-03-21 Thread Greg Hendershott
>> You forgot some parentheses: > And, now I feel dumb. Thanks, Jos. I've made the same mistake -- every time I haven't used `hash-table` for awhile and forget. Most recently a couple weeks ago. The `hash`/`hasheq` functions take `ht k v ... ...`, and most match patterns mirror their

Re: [racket-users] Using match to decompose a nested hash

2018-03-20 Thread Alex Knauth
> On Mar 20, 2018, at 11:51 PM, Alex Knauth wrote: > > > >> On Mar 19, 2018, at 11:37 AM, David Storrs wrote: >> >> This does not work: > >> (define user (hash 'name "bob" 'job (hash 'type 'dev 'id 112))) >> (match user >> [(hash-table

Re: [racket-users] Using match to decompose a nested hash

2018-03-20 Thread Alex Knauth
> On Mar 19, 2018, at 11:37 AM, David Storrs wrote: > > This does not work: > (define user (hash 'name "bob" 'job (hash 'type 'dev 'id 112))) > (match user > [(hash-table ('name name) ('job (hash-table 'type type 'id id))) >(displayln name) >(displayln type)

Re: [racket-users] Using match to decompose a nested hash

2018-03-19 Thread David Storrs
And, now I feel dumb. Thanks, Jos. On Mon, Mar 19, 2018 at 12:02 PM, Jos Koot wrote: > You forgot some parentheses: > > (match user > [(hash-table ('name name) ('job (hash-table ('type type) ('id id ; > <--- >(displayln name) >(displayln type) >

RE: [racket-users] Using match to decompose a nested hash

2018-03-19 Thread Jos Koot
You forgot some parentheses: (match user [(hash-table ('name name) ('job (hash-table ('type type) ('id id ; <--- (displayln name) (displayln type) (displayln id)]) Jos _ From: racket-users@googlegroups.com [mailto:racket-users@googlegroups.com] On Behalf Of David