random-weighted: Use fry instead of bake

db4
Eduardo Cavazos 2008-06-30 10:05:29 -05:00
parent 3c9d01deb9
commit 55ee2258a7
1 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
USING: kernel namespaces arrays quotations sequences assocs combinators USING: kernel namespaces arrays quotations sequences assocs combinators
mirrors math math.vectors random macros bake ; mirrors math math.vectors random macros fry ;
IN: random-weighted IN: random-weighted
@ -16,5 +16,5 @@ probabilities layers [ 1000 * ] map 1000 random [ > ] curry find drop ;
dup [ second ] map swap [ first ] map random-weighted swap nth ; dup [ second ] map swap [ first ] map random-weighted swap nth ;
MACRO: call-random-weighted ( exp -- ) MACRO: call-random-weighted ( exp -- )
[ keys ] [ values <enum> >alist ] bi swap [ keys ] [ values <enum> >alist ] bi
[ , random-weighted , case ] bake ; '[ , random-weighted , case ] ;