assocs.extras: adding deep-at.

John Benediktsson 2012-05-14 17:04:52 -07:00
parent 214063400e
commit be3558c55f
2 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1,7 @@
USING: assocs.extras tools.test ;
IN: assocs.extras
{ f } [ H{ } { 1 2 3 } deep-at ] unit-test
{ 4 } [ H{ { 1 H{ { 2 H{ { 3 4 } } } } } } { 1 2 3 } deep-at ] unit-test

View File

@ -11,3 +11,5 @@ IN: assocs.extras
: assoc-sift ( assoc -- assoc' )
[ nip ] assoc-filter ; inline
: deep-at ( assoc seq -- value/f )
[ swap at ] each ;