Trouble using hashq-get-handle in Guile

2014-12-07 Thread jamil egdemir
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

Re: Trouble using hashq-get-handle in Guile

2014-12-07 Thread Thien-Thi Nguyen
() 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,

Re: Trouble using hashq-get-handle in Guile

2014-12-07 Thread jamil egdemir
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 ‘

Re: Trouble using hashq-get-handle in Guile

2014-12-07 Thread Mark H Weaver
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

Re: Trouble using hashq-get-handle in Guile

2014-12-07 Thread jamil egdemir
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")

Re: Trouble using hashq-get-handle in Guile

2014-12-07 Thread Mike Gran
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.