move hashtables.lib to assocs.lib
parent
cbd44e20da
commit
225ead4ced
|
@ -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> ;
|
||||||
|
|
|
@ -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
|
||||||
|
@ -85,4 +85,4 @@ over @center grid-add
|
||||||
|
|
||||||
: automata-window ( -- ) [ [ automata-window* ] with-scope ] with-ui ;
|
: automata-window ( -- ) [ [ automata-window* ] with-scope ] with-ui ;
|
||||||
|
|
||||||
MAIN: automata-window
|
MAIN: automata-window
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
@ -163,4 +163,4 @@ VARS: population-label cohesion-label alignment-label separation-label ;
|
||||||
|
|
||||||
: boids-window ( -- ) [ [ boids-window* ] with-scope ] with-ui ;
|
: boids-window ( -- ) [ [ boids-window* ] with-scope ] with-ui ;
|
||||||
|
|
||||||
MAIN: boids-window
|
MAIN: boids-window
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
@ -16,4 +16,4 @@ IN: namespaces.lib
|
||||||
|
|
||||||
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||||
|
|
||||||
: set* ( val var -- ) namestack* set-hash-stack ;
|
: set* ( val var -- ) namestack* set-hash-stack ;
|
||||||
|
|
Loading…
Reference in New Issue