<div dir="ltr"><div><br></div><div>I don't see why you would need to loop. 'hash-ref' or the more general 'dict-ref' can look up values by key.<br><br></div><div>(define anime-hash (hash-ref json-hash 'anime))<br>
</div><div>(define rating-hash (hash-ref json-hash 'rating))<br></div><div>(foo (hash-ref anime-hash 'title)<br></div><div> (hash-ref json-hash 'episodes_watched)</div><div> (hash-ref anime-hash 'episode_count)<br>
...)<br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Jun 8, 2014 at 10:02 AM, Kieran Coldron <span dir="ltr"><<a href="mailto:kieran@coldron.com" target="_blank">kieran@coldron.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
This is my first time using racket or any lisp like language, but so
far I really like racket but I'm a complete noob.<br>
<br>
I am wanting to make a simple application in racket for the website
<a href="http://hummingbird.me/users/Epictest/library" target="_blank">hummingbird.me</a>,
an anime tracking website. Here is a mockup of the gui in racket.<br>
<a href="http://a.pomf.se/gwelbo.png" target="_blank"><img alt="mockup gui" src="cid:part2.07050704.01090605@coldron.com" border="0" height="400" width="800"></a><br>
<br>
<br>
I want to populate this list-box with the json data from the users
libary<br>
<br>
this is what the json data looks like <a href="http://pastebin.com/VXNnZGbk" target="_blank">http://pastebin.com/VXNnZGbk</a>
and after converting it to a hash:<br>
<br>
'(#hasheq((private . #f)<br>
(id . 5419481)<br>
(status . "currently-watching")<br>
(episodes_watched . 12)<br>
(last_watched . "2014-06-07T22:49:04.788Z")<br>
(rewatched_times . 0)<br>
(notes . null)<br>
(notes_present . null)<br>
(rewatching . #f)<br>
(anime .<br>
#hasheq(<br>
(url . <a href="http://hummingbird.me/anime/baccano" target="_blank">"http://hummingbird.me/anime/baccano"</a>)<br>
(title . "Baccano!")<br>
(status . "Finished Airing")<br>
(slug . "baccano")<br>
(alternate_title . "")<br>
(episode_count . 13)<br>
(cover_image .
<a href="http://static.hummingbird.me/anime/poster_images/000/002/039/large/26DCC78BD23438E7D713B8E2A825F46F_800_1094.jpg?1383481747" target="_blank">"http://static.hummingbird.me/anime/poster_images/000/002/039/large/26DCC78BD23438E7D713B8E2A825F46F_800_1094.jpg?1383481747"</a>)<br>
(synopsis . "")<br>
(show_type . "TV")))<br>
(rating . #hasheq(<br>
(value . "4.5")<br>
(type . "advanced"))))<br>
#hasheq((private . #f)<br>
(id . 5419483)<br>
(status . "currently-watching")<br>
(episodes_watched . 12)<br>
(last_watched . "2014-06-07T22:49:22.644Z")<br>
(rewatched_times . 0)<br>
(notes . null)<br>
(notes_present . null)<br>
(rewatching . #f)<br>
(anime .<br>
#hasheq(<br>
(url . <a href="http://hummingbird.me/anime/steins-gate" target="_blank">"http://hummingbird.me/anime/steins-gate"</a>)<br>
(title . "Steins;Gate")<br>
(status . "Finished Airing")<br>
(slug . "steins-gate")<br>
(alternate_title . "")<br>
(episode_count . 24)<br>
(cover_image .
<a href="http://static.hummingbird.me/anime/poster_images/000/005/646/large/5646.jpg?1387138585" target="_blank">"http://static.hummingbird.me/anime/poster_images/000/005/646/large/5646.jpg?1387138585"</a>)<br>
(synopsis . "")<br>
(show_type . "TV")))<br>
(rating . #hasheq(<br>
(value . "5.0")<br>
(type . "advanced")))))<br>
<br>
I understand that somehow I have to loop through the the hash to get
the data I require and possibly store it in a second hash? How would
I go about doing this? <br>
Sorry if this is a stupid question and having no idea what I'm doing.<br>
<br>
--<br>
Kieran Coldron<br>
</div>
<br>____________________<br>
Racket Users list:<br>
<a href="http://lists.racket-lang.org/users" target="_blank">http://lists.racket-lang.org/users</a><br>
<br></blockquote></div><br></div>