From 82313cfcd1963ba854f97ef904ac35727f982aef Mon Sep 17 00:00:00 2001 From: elioat Date: Sun, 4 Dec 2022 08:16:02 -0500 Subject: starting to delve the deep of this data --- src/tmp.rkt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/tmp.rkt b/src/tmp.rkt index c90ea89..2f63905 100644 --- a/src/tmp.rkt +++ b/src/tmp.rkt @@ -1,5 +1,7 @@ #lang racket +; (require sugar) + (define test-data '#hash(("id" . 12) ("name" . "butterfree") ("sprite" . "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/12.png") @@ -29,6 +31,9 @@ (type . #hasheq((name . "flying") (url . "https://pokeapi.co/api/v2/type/3/")))))))) +; (define d (dict->list test-data)) ; or...you know...could convert from hash table to list? + + ; (hash? (car (hash-ref test-data "stats"))) ; #t --- BOOM! this gets us a hash table! ; (display (car (hash-ref test-data "stats"))) ; (list? (hash-ref test-data "stats")) ;; #t @@ -44,6 +49,9 @@ (display (~a " key: " k "\nvalue: " v "\n=====\n"))))) h) -(inspector test-data) +;;(inspector test-data) + +;; NEXT STEPS -> https://stackoverflow.com/questions/13504302/racket-scheme-filtering + -;; NEXT STEPS -> https://stackoverflow.com/questions/13504302/racket-scheme-filtering \ No newline at end of file +(displayln (hash-ref (car (hash-ref test-data "stats")) 'base_stat)) -- cgit 1.4.1-2-gfad0