Merge branch 'master' of git://factorcode.org/git/factor
commit
47c9ad635b
|
@ -28,7 +28,8 @@ PRIVATE>
|
||||||
|
|
||||||
: [future] ( quot -- quot' ) '[ _ curry future ] ; inline
|
: [future] ( quot -- quot' ) '[ _ curry future ] ; inline
|
||||||
|
|
||||||
: future-values dup [ ?future ] change-each ; inline
|
: future-values ( futures -- futures )
|
||||||
|
dup [ ?future ] change-each ; inline
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,9 @@ C: <io-callback> io-callback
|
||||||
[ (make-overlapped) ] dip
|
[ (make-overlapped) ] dip
|
||||||
handle>> ptr>> [ over set-OVERLAPPED-offset ] when* ;
|
handle>> ptr>> [ over set-OVERLAPPED-offset ] when* ;
|
||||||
|
|
||||||
|
M: winnt FileArgs-overlapped ( port -- overlapped )
|
||||||
|
make-overlapped ;
|
||||||
|
|
||||||
: <completion-port> ( handle existing -- handle )
|
: <completion-port> ( handle existing -- handle )
|
||||||
f 1 CreateIoCompletionPort dup win32-error=0/f ;
|
f 1 CreateIoCompletionPort dup win32-error=0/f ;
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
USING: continuations destructors io.buffers io.files io.backend
|
USING: continuations destructors io.buffers io.files io.backend
|
||||||
io.timeouts io.ports io.pathnames io.files.private io.backend.windows
|
io.timeouts io.ports io.pathnames io.files.private
|
||||||
io.files.windows io.backend.windows.nt io.encodings.utf16n
|
io.backend.windows io.files.windows io.encodings.utf16n windows
|
||||||
windows windows.kernel32 kernel libc math threads system
|
windows.kernel32 kernel libc math threads system environment
|
||||||
environment alien.c-types alien.arrays alien.strings sequences
|
alien.c-types alien.arrays alien.strings sequences combinators
|
||||||
combinators combinators.short-circuit ascii splitting alien
|
combinators.short-circuit ascii splitting alien strings assocs
|
||||||
strings assocs namespaces make accessors tr ;
|
namespaces make accessors tr ;
|
||||||
IN: io.files.windows.nt
|
IN: io.files.windows.nt
|
||||||
|
|
||||||
M: winnt cwd
|
M: winnt cwd
|
||||||
|
@ -44,9 +44,6 @@ M: winnt normalize-path ( string -- string' )
|
||||||
M: winnt CreateFile-flags ( DWORD -- DWORD )
|
M: winnt CreateFile-flags ( DWORD -- DWORD )
|
||||||
FILE_FLAG_OVERLAPPED bitor ;
|
FILE_FLAG_OVERLAPPED bitor ;
|
||||||
|
|
||||||
M: winnt FileArgs-overlapped ( port -- overlapped )
|
|
||||||
make-overlapped ;
|
|
||||||
|
|
||||||
M: winnt open-append
|
M: winnt open-append
|
||||||
0 ! [ dup file-info size>> ] [ drop 0 ] recover
|
0 ! [ dup file-info size>> ] [ drop 0 ] recover
|
||||||
[ (open-append) ] dip >>ptr ;
|
[ (open-append) ] dip >>ptr ;
|
||||||
|
|
|
@ -67,7 +67,7 @@ DEFER: byte-bit-count
|
||||||
256 [
|
256 [
|
||||||
0 swap [ [ 1+ ] when ] each-bit
|
0 swap [ [ 1+ ] when ] each-bit
|
||||||
] B{ } map-as '[ HEX: ff bitand _ nth-unsafe ]
|
] B{ } map-as '[ HEX: ff bitand _ nth-unsafe ]
|
||||||
(( -- table )) define-declared
|
(( byte -- table )) define-declared
|
||||||
|
|
||||||
\ byte-bit-count make-inline
|
\ byte-bit-count make-inline
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@ C: <grid-lines> grid-lines
|
||||||
|
|
||||||
SYMBOL: grid-dim
|
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 )
|
: grid-line-from/to ( orientation point -- from to )
|
||||||
half-gap v-
|
half-gap v-
|
||||||
|
|
|
@ -114,15 +114,15 @@ M: float fp-infinity? ( float -- ? )
|
||||||
|
|
||||||
<PRIVATE
|
<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 )
|
: iterate-step ( i n quot -- i n quot )
|
||||||
#! Apply quot to i, keep i and quot, hide n.
|
#! Apply quot to i, keep i and quot, hide n.
|
||||||
swap [ 2dup 2slip ] dip swap ; inline
|
swap [ 2dup 2slip ] dip swap ; inline
|
||||||
|
|
||||||
: iterate-next [ 1+ ] 2dip ; inline
|
: iterate-next ( i n quot -- i' n quot ) [ 1+ ] 2dip ; inline
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue