<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>Suppose you have </div><div><br></div><div> (define L .. the quoted list below ..)</div><div><br></div><div>and </div><div> </div><div> ;; Symbol Any -> Void </div><div> ;; add key and value to the GUI </div><div> (define (send-to-gui key value) </div><div> ... )</div><div><br></div><div>Then you can do things like this: </div><div><br></div><div> > (for ((h (in-list L))) (for (([key value] h)) (send-to-gui key value)))</div><div><br></div><div>The outer for loop iterates over list L and binds each of the hashes to h. The inner for loop iterates over the key-value pairs in each hash h. It binds each such pair, separately, to the variables key and value. The body of the inner loop can do what it wants. I used send-to-gui here. You may wish to see what displayln does. </div><div><br></div><div>-- Matthias</div><div><br></div><div><br></div><div><br></div><br><div><div>On Jun 8, 2014, at 10:02 AM, Kieran Coldron wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
<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">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"><span><gwelbo.png></span></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">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 class="moz-txt-link-rfc2396E" href="http://hummingbird.me/anime/baccano">"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 class="moz-txt-link-rfc2396E" href="http://static.hummingbird.me/anime/poster_images/000/002/039/large/26DCC78BD23438E7D713B8E2A825F46F_800_1094.jpg?1383481747">"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 class="moz-txt-link-rfc2396E" href="http://hummingbird.me/anime/steins-gate">"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 class="moz-txt-link-rfc2396E" href="http://static.hummingbird.me/anime/poster_images/000/005/646/large/5646.jpg?1387138585">"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> Racket Users list:<br> <a href="http://lists.racket-lang.org/users">http://lists.racket-lang.org/users</a><br></blockquote></div><br></body></html>