diff options
-rw-r--r-- | src/tmp.rkt | 12 |
1 files changed, 10 insertions, 2 deletions
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)) |