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
[ [ drop even? ] [ 2array ] 2bi ] collect-assoc-by
] unit-test
+
{
- H{ { t V{ 10 20 30 } } { f V{ 41 } } }
+ H{ { t V{ 10 21 } } { f V{ 30 41 } } }
} [
- { { 10 100 } { 20 200 } { 30 300 } { 41 401 } }
- [ even? ] collect-key-by
-] unit-test
+ { { 10 100 } { 21 200 } { 30 301 } { 41 401 } }
+ [ nip even? ] collect-key-by
+ ] unit-test
{
- H{ { t V{ 100 200 300 } } { f V{ 401 } } }
+ H{ { t V{ 10 30 } } { f V{ 21 41 } } }
} [
- { { 10 100 } { 20 200 } { 30 300 } { 41 401 } }
- [ even? ] collect-value-by
-] unit-test
+ { { 10 100 } { 21 200 } { 30 301 } { 41 401 } }
+ [ drop even? ] collect-key-by
+ ] unit-test
+
+{
+ H{ { t V{ 100 200 } } { f V{ 301 401 } } }
+} [
+ { { 10 100 } { 21 200 } { 30 301 } { 41 401 } }
+ [ nip even? ] collect-value-by
+ ] unit-test
+
+{
+ H{ { t V{ 100 301 } } { f V{ 200 401 } } }
+} [
+ { { 10 100 } { 21 200 } { 30 301 } { 41 401 } }
+ [ drop even? ] collect-value-by
+ ] unit-test
{
H{
}
} [
{ { 10 100 } { 20 200 } { 30 300 } { 41 401 } }
- [ dup 1 + 2array ] collect-key-by-multi
+ [ drop dup 1 + 2array ] collect-key-by-multi
] unit-test
}
} [
{ { 10 100 } { 20 200 } { 30 300 } { 41 401 } }
- [ dup 1 + 2array ] collect-value-by-multi
+ [ nip dup 1 + 2array ] collect-value-by-multi
] unit-test
} [
{ { 10 100 } { 20 200 } { 30 300 } { 41 401 } }
[ [ dup 1 + 2array ] dip ] collect-assoc-by-multi
-] unit-test
\ No newline at end of file
+] unit-test
+