\r
: [future] ( quot -- quot' ) '[ _ curry future ] ; inline\r
\r
-: future-values dup [ ?future ] change-each ; inline\r
+: future-values ( futures -- futures )\r
+ dup [ ?future ] change-each ; inline\r
\r
PRIVATE>\r
\r
[ (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 ;
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
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 ;
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
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-
<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>