H{ } clone 10 { 1 2 3 4 5 } pick push-at-each
] unit-test
-{ f } [ f { } deep-at ] unit-test
-{ f } [ f { "foo" } deep-at ] unit-test
-{ f } [ H{ } { 1 2 3 } deep-at ] unit-test
-{ f } [ H{ { "a" H{ { "b" 1 } } } } { "a" "c" } deep-at ] unit-test
-{ 1 } [ H{ { "a" H{ { "b" 1 } } } } { "a" "b" } deep-at ] unit-test
-{ 4 } [ H{ { 1 H{ { 2 H{ { 3 4 } } } } } } { 1 2 3 } deep-at ] unit-test
+{ f } [ f { } deep-of ] unit-test
+{ f } [ f { "foo" } deep-of ] unit-test
+{ f } [ H{ } { 1 2 3 } deep-of ] unit-test
+{ f } [ H{ { "a" H{ { "b" 1 } } } } { "a" "c" } deep-of ] unit-test
+{ 1 } [ H{ { "a" H{ { "b" 1 } } } } { "a" "b" } deep-of ] unit-test
+{ 4 } [ H{ { 1 H{ { 2 H{ { 3 4 } } } } } } { 1 2 3 } deep-of ] unit-test
{ H{ { 2 1 } { 4 3 } } } [ H{ { 1 2 } { 3 4 } } assoc-invert ] unit-test
: push-at-each ( value keys assoc -- )
'[ _ push-at ] with each ; inline
-: deep-at ( assoc seq -- value/f )
+: deep-of ( assoc seq -- value/f )
[ of ] each ; inline
: substitute! ( seq assoc -- seq )
: google-search ( query -- results )
search-url http-get nip json>
- { "responseData" "results" } deep-at
+ { "responseData" "results" } deep-of
[ \ search-result from-slots ] map ;
<PRIVATE