Merge branch 'master' of git://factorcode.org/git/factor

db4
Slava Pestov 2008-12-15 21:44:57 -06:00
commit 47c9ad635b
6 changed files with 16 additions and 15 deletions

3
basis/concurrency/combinators/combinators.factor Normal file → Executable file
View File

@ -28,7 +28,8 @@ PRIVATE>
: [future] ( quot -- quot' ) '[ _ curry future ] ; inline
: future-values dup [ ?future ] change-each ; inline
: future-values ( futures -- futures )
dup [ ?future ] change-each ; inline
PRIVATE>

View File

@ -21,6 +21,9 @@ C: <io-callback> io-callback
[ (make-overlapped) ] dip
handle>> ptr>> [ over set-OVERLAPPED-offset ] when* ;
M: winnt FileArgs-overlapped ( port -- overlapped )
make-overlapped ;
: <completion-port> ( handle existing -- handle )
f 1 CreateIoCompletionPort dup win32-error=0/f ;

View File

@ -1,10 +1,10 @@
USING: continuations destructors io.buffers io.files io.backend
io.timeouts io.ports io.pathnames io.files.private io.backend.windows
io.files.windows io.backend.windows.nt io.encodings.utf16n
windows windows.kernel32 kernel libc math threads system
environment alien.c-types alien.arrays alien.strings sequences
combinators combinators.short-circuit ascii splitting alien
strings assocs namespaces make accessors tr ;
io.timeouts io.ports io.pathnames io.files.private
io.backend.windows io.files.windows io.encodings.utf16n windows
windows.kernel32 kernel libc math threads system environment
alien.c-types alien.arrays alien.strings sequences combinators
combinators.short-circuit ascii splitting alien strings assocs
namespaces make accessors tr ;
IN: io.files.windows.nt
M: winnt cwd
@ -44,9 +44,6 @@ M: winnt normalize-path ( string -- string' )
M: winnt CreateFile-flags ( DWORD -- DWORD )
FILE_FLAG_OVERLAPPED bitor ;
M: winnt FileArgs-overlapped ( port -- overlapped )
make-overlapped ;
M: winnt open-append
0 ! [ dup file-info size>> ] [ drop 0 ] recover
[ (open-append) ] dip >>ptr ;

2
basis/math/bitwise/bitwise.factor Normal file → Executable file
View File

@ -67,7 +67,7 @@ DEFER: byte-bit-count
256 [
0 swap [ [ 1+ ] when ] each-bit
] B{ } map-as '[ HEX: ff bitand _ nth-unsafe ]
(( -- table )) define-declared
(( byte -- table )) define-declared
\ byte-bit-count make-inline

View File

@ -11,7 +11,7 @@ C: <grid-lines> grid-lines
SYMBOL: grid-dim
: half-gap grid get gap>> [ 2/ ] map ; inline
: half-gap ( -- gap ) grid get gap>> [ 2/ ] map ; inline
: grid-line-from/to ( orientation point -- from to )
half-gap v-

6
core/math/math.factor Normal file → Executable file
View File

@ -114,15 +114,15 @@ M: float fp-infinity? ( float -- ? )
<PRIVATE
: iterate-prep 0 -rot ; inline
: iterate-prep ( n quot -- i n quot ) 0 -rot ; inline
: if-iterate? [ 2over < ] 2dip if ; inline
: if-iterate? ( i n true false -- ) [ 2over < ] 2dip if ; inline
: iterate-step ( i n quot -- i n quot )
#! Apply quot to i, keep i and quot, hide n.
swap [ 2dup 2slip ] dip swap ; inline
: iterate-next [ 1+ ] 2dip ; inline
: iterate-next ( i n quot -- i' n quot ) [ 1+ ] 2dip ; inline
PRIVATE>