Hi Everyone,
I'm having trouble getting the value associated with a key in a
hash-table and I'm totally confused as to what I'm doing wrong. The
code I'm using is shown below:
(use-modules (curl))
(use-modules (json))
;; use curl to hit the site's api to get results of query as json
() jamil egdemir
() Sun, 7 Dec 2014 17:44:46 -0500
(hashq-get-handle queryResults 'documents)
IIUC, the hash table object ‘queryResults’ is made by:
https://github.com/aconchillo/guile-json/blob/master/json/parser.scm
proc ‘read-object’. For interop w/ the ‘make-hash-table’ it calls,
Thien-Thi,
> IIUC, the hash table object ‘queryResults’ is made by:
>
> https://github.com/aconchillo/guile-json/blob/master/json/parser.scm
>
> proc ‘read-object’. For interop w/ the ‘make-hash-table’ it calls, you
> might try some variants of ‘hashq-get-handle’, namely ‘hash-get-handle’
> or ‘
jamil egdemir writes:
> I'm having trouble getting the value associated with a key in a
> hash-table and I'm totally confused as to what I'm doing wrong. The
> code I'm using is shown below:
>
> (use-modules (curl))
> (use-modules (json))
>
> ;; use curl to hit the site's api to get
Mark,
> Based on a quick glance at the json code, I suspect you want this:
>
> (hash-get-handle queryResults "documents")
>
> i.e. change 'hashq-get-handle' to 'hash-get-handle', and pass a string
> as the key, not a symbol.
BOOM!
scheme@(guile-user)> (hash-get-handle queryResults "documents")
On Sunday, December 7, 2014 4:49 PM, jamil egdemir wrote:
>Mark,
>
>> Based on a quick glance at the json code, I suspect you want this:
>>
>> (hash-get-handle queryResults "documents")
>>
>> i.e. change 'hashq-get-handle' to 'hash-get-handle', and pass a string
>> as the key, not a symbol.