: total-failure-2 [ ] (call) unimplemented ;
[ total-failure-2 ] must-fail
+
+! From combinators.lib
+[ 1 1 2 2 3 3 ] [ 1 2 3 [ dup ] tri@ ] unit-test
+[ 1 4 9 ] [ 1 2 3 [ sq ] tri@ ] unit-test
+[ [ sq ] tri@ ] must-infer
[ 1 2 3 4 5 [ drop drop drop drop drop 2 ] 5 nkeep ] must-infer
{ 2 1 2 3 4 5 } [ 1 2 3 4 5 [ drop drop drop drop drop 2 ] 5 nkeep ] unit-test
[ [ 1 2 3 + ] ] [ 1 2 3 [ + ] 3 ncurry ] unit-test
-[ 1 1 2 2 3 3 ] [ 1 2 3 [ dup ] 3apply ] unit-test
-[ 1 4 9 ] [ 1 2 3 [ sq ] 3apply ] unit-test
-[ [ sq ] 3apply ] must-infer
[ { 1 2 } { 2 4 } { 3 8 } { 4 16 } { 5 32 } ] [ 1 2 3 4 5 [ dup 2^ 2array ] 5 napply ] unit-test
[ [ dup 2^ 2array ] 5 napply ] must-infer
'[ , ntuck , nslip ] ]
map concat >quotation [ call ] append ;
-: 3apply ( obj obj obj quot -- ) 3 napply ; inline
-
: 2with ( param1 param2 obj quot -- obj curry )
with with ; inline
io.windows kernel math splitting
windows windows.kernel32 windows.time calendar combinators
math.functions sequences namespaces words symbols system
-combinators.lib io.ports destructors accessors
+io.ports destructors accessors
math.bitfields math.bitfields.lib ;
IN: io.windows.files
"FILETIME" <c-object>
"FILETIME" <c-object>
[ GetFileTime win32-error=0/f ] 3keep
- [ FILETIME>timestamp >local-time ] 3apply
+ [ FILETIME>timestamp >local-time ] tri@
] with-destructors ;
: (set-file-times) ( handle timestamp/f timestamp/f timestamp/f -- )
- [ timestamp>FILETIME ] 3apply
+ [ timestamp>FILETIME ] tri@
SetFileTime win32-error=0/f ;
: set-file-times ( path timestamp/f timestamp/f timestamp/f -- )
io.windows io.windows.files libc kernel math namespaces
sequences threads classes.tuple.lib windows windows.errors
windows.kernel32 strings splitting io.files
-io.buffers qualified ascii combinators.lib system
+io.buffers qualified ascii system
accessors locals ;
QUALIFIED: windows.winsock
IN: io.windows.nt.backend
: 1and4 ( n -- ? )
number>string 1 cut-slice 4 cut-slice
- [ string>number ] 3apply [ * ] dip = ;
+ [ string>number ] tri@ [ * ] dip = ;
: 2and3 ( n -- ? )
number>string 2 cut-slice 3 cut-slice
- [ string>number ] 3apply [ * ] dip = ;
+ [ string>number ] tri@ [ * ] dip = ;
: valid? ( n -- ? )
dup 1and4 swap 2and3 or ;
! multiplicand/multiplier/product
: mmp ( pair -- n )
- first2 2dup * [ number>string ] 3apply 3append string>number ;
+ first2 2dup * [ number>string ] tri@ 3append string>number ;
PRIVATE>
dup sum max-p < [
dup sum adjust-p-count
[ u-transform ] [ a-transform ] [ d-transform ] tri
- [ (count-perimeters) ] 3apply
+ [ (count-perimeters) ] tri@
] [
drop
] if ;
dup sum max-p < [
dup sum adjust-p-count
[ u-transform ] [ a-transform ] [ d-transform ] tri
- [ (count-perimeters) ] 3apply
+ [ (count-perimeters) ] tri@
] [
drop
] if ;
{ 2swap 3 }\r
{ 2with 2 }\r
{ 2with* 3 }\r
- { 3apply 1/2 }\r
{ 3curry 2 }\r
{ 3drop 1 }\r
{ 3dup 2 }\r
: delete-arc ( arc -- ) delete-tuples ;
: create-arc ( subject object relation -- )
- [ id>> ] 3apply <arc> insert-tuple ;
+ [ id>> ] tri@ <arc> insert-tuple ;
: nodes>arc ( subject object relation -- arc )
- [ [ id>> ] [ f ] if* ] 3apply <arc> ;
+ [ [ id>> ] [ f ] if* ] tri@ <arc> ;
: select-arcs ( subject object relation -- arcs )
nodes>arc select-tuples ;
-USING: alien alien.c-types effects kernel windows.ole32 combinators.lib
+USING: alien alien.c-types effects kernel windows.ole32
parser lexer splitting grouping sequences.lib sequences namespaces
assocs quotations shuffle accessors words macros alien.syntax
fry arrays ;
windows.com.syntax.private windows.com continuations kernel
sequences.lib namespaces windows.ole32 libc vocabs
assocs accessors arrays sequences quotations combinators
-math combinators.lib words compiler.units destructors fry
-math.parser ;
+math words compiler.units destructors fry
+math.parser combinators.lib ;
IN: windows.com.wrapper
TUPLE: com-wrapper vtbls disposed ;
swap append ;
: compile-alien-callback ( word return parameters abi quot -- alien )
- [ alien-callback ] 4 ncurry
+ '[ , , , , alien-callback ]
[ [ (( -- alien )) define-declared ] pick slip ]
with-compilation-unit
execute ;
USING: alien alien.syntax alien.c-types alien.strings math
-kernel sequences windows windows.types combinators.lib
+kernel sequences windows windows.types
math.order ;
IN: windows.ole32
utf16n string>alien "GUID" <c-object> [ CLSIDFromString ole32-error ] keep ;
: guid>string ( guid -- string )
GUID-STRING-LENGTH 1+ [ "ushort" <c-array> ] keep
- [ StringFromGUID2 drop ] { 2 } multikeep utf16n alien>string ;
+ [ StringFromGUID2 drop ] 2keep drop utf16n alien>string ;