move hashtables.lib to assocs.lib

db4
Doug Coleman 2008-01-16 11:25:29 -10:00
parent cbd44e20da
commit 225ead4ced
4 changed files with 12 additions and 9 deletions

View File

@ -11,14 +11,17 @@ IN: assocs.lib
! set-hash with alternative stack effects ! set-hash with alternative stack effects
: put-hash* ( table key value -- ) swap rot set-at ; : put-hash* ( table key value -- ) spin set-at ;
: put-hash ( table key value -- table ) swap pick set-at ; : put-hash ( table key value -- table ) swap pick set-at ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
: set-hash-stack ( value key seq -- ) : set-hash-stack ( value key seq -- )
dupd [ key? ] when find-last nip set-at ; dupd [ key? ] with find-last nip set-at ;
: at-default ( key assoc -- value/key ) : at-default ( key assoc -- value/key )
dupd at [ nip ] when* ; dupd at [ nip ] when* ;
: at-peek ( key assoc -- value ? )
at* dup >r [ peek ] when r> ;

View File

@ -14,7 +14,7 @@ USING: kernel namespaces math quotations arrays hashtables sequences threads
ui.gadgets.packs ui.gadgets.packs
ui.gadgets.grids ui.gadgets.grids
ui.gadgets.theme ui.gadgets.theme
namespaces.lib hashtables.lib vars namespaces.lib assocs.lib vars
rewrite-closures automata ; rewrite-closures automata ;
IN: automata.ui IN: automata.ui

View File

@ -20,7 +20,7 @@ USING: kernel namespaces
ui.gadgets.grids ui.gadgets.grids
ui.gestures ui.gestures
combinators.cleave combinators.cleave
hashtables.lib vars rewrite-closures boids ; assocs.lib vars rewrite-closures boids ;
IN: boids.ui IN: boids.ui

View File

@ -1,8 +1,8 @@
! USING: kernel quotations namespaces sequences hashtables.lib ; ! USING: kernel quotations namespaces sequences assocs.lib ;
USING: kernel namespaces namespaces.private quotations sequences USING: kernel namespaces namespaces.private quotations sequences
hashtables.lib ; assocs.lib ;
IN: namespaces.lib IN: namespaces.lib