From 742cf2632a0319a71fdd10bc0afd634da2e69aa6 Mon Sep 17 00:00:00 2001 From: elioat Date: Sun, 4 Dec 2022 12:42:19 -0500 Subject: GETTING SO CLOSE --- src/tmp.rkt | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/tmp.rkt b/src/tmp.rkt index b46a1aa..08cd3fd 100644 --- a/src/tmp.rkt +++ b/src/tmp.rkt @@ -53,15 +53,16 @@ ;; NEXT STEPS -> https://stackoverflow.com/questions/13504302/racket-scheme-filtering -(hash-ref test-data "stats") ; all stats -(hash-ref (car (hash-ref test-data "stats")) 'base_stat) ; value for a given stat -(hash-ref (hash-ref (car (hash-ref test-data "stats")) 'stat) 'name) ; name for a given stat - - -(map - (lambda (x) (displayln "t")) ;; need a way to not use car, but just hit every item in the sequence - (hash-ref test-data "stats")) - - +; (hash-ref test-data "stats") ; all stats +; (hash-ref (car (hash-ref test-data "stats")) 'base_stat) ; value for a given stat +; (hash-ref (hash-ref (car (hash-ref test-data "stats")) 'stat) 'name) ; name for a given stat +(define (inspector2 h) + (hash-map h + (lambda (k v) + (if (list? v) (map + (lambda (x) (inspector2 x)) v) + (display (~a " key: " k "\nvalue: " v "\n=====\n"))))) + h) +(inspector2 test-data) -- cgit 1.4.1-2-gfad0