don't redefine delete-random
parent
6b3b48a106
commit
efb5fa0814
|
@ -1,2 +1,3 @@
|
||||||
Doug Coleman
|
Doug Coleman
|
||||||
Ryan Murphy
|
Ryan Murphy
|
||||||
|
Slava Pestov
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
! Copyright 2007, 2008 Ryan Murphy, Slava Pestov
|
! Copyright 2007, 2008 Ryan Murphy, Slava Pestov
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
|
|
||||||
USING: arrays kernel math namespaces tools.test
|
USING: arrays kernel math namespaces tools.test
|
||||||
heaps heaps.private math.parser random assocs sequences sorting
|
heaps heaps.private math.parser random assocs sequences sorting
|
||||||
accessors math.order ;
|
accessors math.order ;
|
||||||
|
@ -54,9 +53,6 @@ IN: heaps.tests
|
||||||
[ t ] swap [ 2^ test-entry-indices ] curry unit-test
|
[ t ] swap [ 2^ test-entry-indices ] curry unit-test
|
||||||
] each
|
] each
|
||||||
|
|
||||||
: delete-random ( seq -- elt )
|
|
||||||
dup length random dup pick nth >r swap delete-nth r> ;
|
|
||||||
|
|
||||||
: sort-entries ( entries -- entries' )
|
: sort-entries ( entries -- entries' )
|
||||||
[ [ key>> ] compare ] sort ;
|
[ [ key>> ] compare ] sort ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue