Cleanups and fixes

db4
Slava Pestov 2008-02-23 22:48:45 -06:00
parent 46ab3bdd18
commit cc600ad54f
6 changed files with 15 additions and 15 deletions

View File

@ -116,7 +116,7 @@ M: method-spec definition
: forget-method ( class generic -- )
check-method
[ delete-at* ] with-methods
[ method-word forget ] [ drop ] if ;
[ method-word forget-word ] [ drop ] if ;
M: method-spec forget*
first2 forget-method ;

View File

@ -310,13 +310,11 @@ M: immutable-sequence clone-like like ;
<PRIVATE
: iterate-seq >r dup length swap r> ; inline
: (each) ( seq quot -- n quot' )
iterate-seq [ >r nth-unsafe r> call ] 2curry ; inline
>r dup length swap [ nth-unsafe ] curry r> compose ; inline
: (collect) ( quot into -- quot' )
[ >r over slip r> set-nth-unsafe ] 2curry ; inline
[ >r keep r> set-nth-unsafe ] 2curry ; inline
: collect ( n quot into -- )
(collect) each-integer ; inline
@ -415,7 +413,7 @@ PRIVATE>
>r dup length 1- swap r> (monotonic) all? ; inline
: interleave ( seq between quot -- )
[ (interleave) ] 2curry iterate-seq 2each ; inline
[ (interleave) ] 2curry >r dup length swap r> 2each ; inline
: unfold ( pred quot tail -- seq )
V{ } clone [
@ -695,9 +693,9 @@ PRIVATE>
: sequence-hashcode-step ( oldhash newpart -- newhash )
swap [
dup -2 fixnum-shift >fixnum swap 5 fixnum-shift >fixnum
dup -2 fixnum-shift-fast swap 5 fixnum-shift-fast
fixnum+fast fixnum+fast
] keep bitxor ; inline
] keep fixnum-bitxor ; inline
: sequence-hashcode ( n seq -- x )
0 -rot [

View File

@ -34,10 +34,10 @@ IN: benchmark.sockets
: socket-benchmarks
10 clients
20 clients
40 clients
80 clients
160 clients
320 clients
640 clients ;
40 clients ;
! 80 clients
! 160 clients
! 320 clients
! 640 clients ;
MAIN: socket-benchmarks

2
extra/sequences/next/next.factor Normal file → Executable file
View File

@ -3,6 +3,8 @@ IN: sequences.next
<PRIVATE
: iterate-seq >r dup length swap r> ; inline
: (map-next) ( i seq quot -- )
! this uses O(n) more bounds checks than is really necessary
>r [ >r 1+ r> ?nth ] 2keep nth-unsafe r> call ; inline

View File

@ -28,7 +28,7 @@
! Connection closed by foreign host.
USING: combinators kernel prettyprint io io.timeouts io.server
sequences namespaces io.sockets continuations ;
sequences namespaces io.sockets continuations calendar ;
IN: smtp.server
SYMBOL: data-mode

View File

@ -1,5 +1,5 @@
USING: math kernel sequences io.files tools.crossref tools.test
parser namespaces source-files ;
parser namespaces source-files generic definitions ;
IN: temporary
GENERIC: foo