about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorelioat <elioat@tilde.institute>2022-12-02 21:45:39 -0500
committerelioat <elioat@tilde.institute>2022-12-02 21:45:39 -0500
commitcdffe0c2593514f23ebdd65684069f100c6472be (patch)
treef2ba4bbd10db19529411111296ac8522e7754c5a
parent4c22154d2bf972bf8ba503de7846441dcfd9e97c (diff)
downloaddecember-2022-cdffe0c2593514f23ebdd65684069f100c6472be.tar.gz
yo...hash tables got me like (ಥ﹏ಥ)
-rw-r--r--src/pokedex.rkt12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/pokedex.rkt b/src/pokedex.rkt
index af7f1ff..10d3a17 100644
--- a/src/pokedex.rkt
+++ b/src/pokedex.rkt
@@ -14,6 +14,7 @@
 ;; basic GET request
 (require net/url)
 (require json)
+(require nested-hash)
 
 
 ;; API URL
@@ -43,8 +44,13 @@
 
 (define (inspector h)
     "display the contents of a hash table for human eyeballs"
-    (hash-for-each h
+    (hash-map h
         (lambda (k v)
-            (display (~a "key: " k ", value: " v "\n")))))
+            (display (~a "key: " k ", value: " v "\n")))) ; QUESTION: is there a functional difference between hash-map and hash-for-each here?
+    h)
+
+
+(hash-ref (inspector (dex-entry 5)) "types") ;; struggling to figure out how to access the nested hash tables stats and types...
+
+
 
-(inspector (dex-entry 5))
\ No newline at end of file