>> 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
> 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
> 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)
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)
>
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
5 matches
Mail list logo