diff options
Diffstat (limited to 'src/tmp.rkt')
-rw-r--r-- | src/tmp.rkt | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/tmp.rkt b/src/tmp.rkt index c8bcbbb..def2ea0 100644 --- a/src/tmp.rkt +++ b/src/tmp.rkt @@ -1,4 +1,6 @@ -'#hash(("id" . 12) +#lang racket + +(define test-data '#hash(("id" . 12) ("name" . "butterfree") ("sprite" . "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/12.png") ("stats" @@ -26,4 +28,19 @@ . (#hasheq((slot . 1) (type . #hasheq((name . "bug") (url . "https://pokeapi.co/api/v2/type/7/")))) #hasheq((slot . 2) - (type . #hasheq((name . "flying") (url . "https://pokeapi.co/api/v2/type/3/"))))))) \ No newline at end of file + (type . #hasheq((name . "flying") (url . "https://pokeapi.co/api/v2/type/3/")))))))) + + +(define (inspector1 h) + (hash-map h + (lambda (k v) + (display (~a "key: " k ", value: " v "\n"))))) + +(define (inspector2 h) + (hash-map h + (lambda (k v) + (if (hash? v) (~a "value " v " was a hash table!\n") + (display (~a "key: " k ", value: " v "\n")))))) + +; (inspector1 test-data) +(inspector2 test-data) \ No newline at end of file |