diff options
author | elioat <elioat@tilde.institute> | 2022-12-06 15:38:42 -0500 |
---|---|---|
committer | elioat <elioat@tilde.institute> | 2022-12-06 15:38:42 -0500 |
commit | ef8f76bda521bb4559ee051e99ac192e7f01c0bd (patch) | |
tree | 15364d30895eda08587708d8779dfc28129e1e3d /src | |
parent | 9c854b69cdbafd92c78120d795022c7b00dd0d30 (diff) | |
download | december-2022-ef8f76bda521bb4559ee051e99ac192e7f01c0bd.tar.gz |
like a bluebird, building a nest
Diffstat (limited to 'src')
-rw-r--r-- | src/tmp.rkt | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tmp.rkt b/src/tmp.rkt index c711882..089e066 100644 --- a/src/tmp.rkt +++ b/src/tmp.rkt @@ -47,13 +47,16 @@ ; (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 +; [(list? v) (map (lambda (x) (inspector x)) v)] +; [(hash? (car (hash-ref k "stats")) (map (lambda (x) (inspector x)) v))] (define (inspector h) "display the contents of a hash table for human eyeballs and let the hash table fall back out" (hash-map h (lambda (k v) - (cond [(list? v) (map (lambda (x) (inspector x)) v)] - [(hash? (car (hash-ref k "stats")) (map (lambda (x) (inspector x)) v))] ; if I'm going to hard code this, don't think I can use a cond + (cond [(list? v) (cond + [(hash? (car (hash-ref k "stats")) (map (lambda (x) (inspector x) v)))] ; this is probably dumb, since it'll require at least another level of nesting... + [map (lambda (x) (inspector x)) v])] [(display (~a " key: " k "\nvalue: " v "\n=====\n"))]))) h) |