Cleanups
parent
71bc5e9e10
commit
2dc0757850
|
@ -32,10 +32,8 @@ IN: heaps.tests
|
||||||
|
|
||||||
: random-alist ( n -- alist )
|
: random-alist ( n -- alist )
|
||||||
[
|
[
|
||||||
[
|
drop 32 random-bits dup number>string
|
||||||
32 random-bits dup number>string swap set
|
] H{ } map>assoc ;
|
||||||
] times
|
|
||||||
] H{ } make-assoc ;
|
|
||||||
|
|
||||||
: test-heap-sort ( n -- ? )
|
: test-heap-sort ( n -- ? )
|
||||||
random-alist dup >alist sort-keys swap heap-sort = ;
|
random-alist dup >alist sort-keys swap heap-sort = ;
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
! Copyright (C) 2005, 2008 Slava Pestov.
|
! Copyright (C) 2005, 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: arrays byte-arrays kernel kernel.private math namespaces
|
USING: arrays byte-arrays kernel kernel.private math namespaces
|
||||||
make sequences strings words effects generic generic.standard
|
make sequences strings words effects generic generic.standard
|
||||||
classes classes.algebra slots.private combinators accessors
|
classes classes.algebra slots.private combinators accessors
|
||||||
words sequences.private assocs alien quotations ;
|
words sequences.private assocs alien quotations hashtables ;
|
||||||
IN: slots
|
IN: slots
|
||||||
|
|
||||||
TUPLE: slot-spec name offset class initial read-only ;
|
TUPLE: slot-spec name offset class initial read-only ;
|
||||||
|
@ -86,7 +86,7 @@ ERROR: bad-slot-value value class ;
|
||||||
] [ ] make ;
|
] [ ] make ;
|
||||||
|
|
||||||
: writer-props ( slot-spec -- assoc )
|
: writer-props ( slot-spec -- assoc )
|
||||||
[ "writing" set ] H{ } make-assoc ;
|
"writing" associate ;
|
||||||
|
|
||||||
: define-writer ( class slot-spec -- )
|
: define-writer ( class slot-spec -- )
|
||||||
[ name>> writer-word ] [ writer-quot ] [ writer-props ] tri
|
[ name>> writer-word ] [ writer-quot ] [ writer-props ] tri
|
||||||
|
|
Loading…
Reference in New Issue