]> gitweb.factorcode.org Git - factor.git/commitdiff
combinators.lib 3apply is kernel's tri@; remove and update usages
authorU-SLAVA-DFB8FF805\Slava <Slava@slava-dfb8ff805.(none)>
Fri, 27 Jun 2008 07:17:19 +0000 (02:17 -0500)
committerU-SLAVA-DFB8FF805\Slava <Slava@slava-dfb8ff805.(none)>
Fri, 27 Jun 2008 07:17:19 +0000 (02:17 -0500)
13 files changed:
core/kernel/kernel-tests.factor
extra/combinators/lib/lib-tests.factor
extra/combinators/lib/lib.factor
extra/io/windows/files/files.factor
extra/io/windows/nt/backend/backend.factor
extra/project-euler/032/032.factor
extra/project-euler/039/039.factor [changed mode: 0644->0755]
extra/project-euler/075/075.factor [changed mode: 0644->0755]
extra/reports/noise/noise.factor
extra/semantic-db/semantic-db.factor
extra/windows/com/syntax/syntax.factor
extra/windows/com/wrapper/wrapper.factor
extra/windows/ole32/ole32.factor [changed mode: 0644->0755]

index 4b129ad59d2596c322239414acbe63aa719ef84b..c5bd0615a713ca3b89c542c3753fce3056c0417a 100755 (executable)
@@ -117,3 +117,8 @@ IN: kernel.tests
 : 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
index 680e3220b065ebde45899d5a58cf0d63f9075741..e511e88fccd8b4104fe4c1d6367e3e669e7b7840 100755 (executable)
@@ -10,9 +10,6 @@ IN: combinators.lib.tests
 [ 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
 
index 63e9750e8b481830ab2aa9d686ace8f9cb4a5c34..3fab4f62ae6ecad4143f5bf63fc89182eea5a78b 100755 (executable)
@@ -36,8 +36,6 @@ MACRO: napply ( n -- )
     '[ , 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
 
index 6787936f96752c9c8007330d1c6c0a8b6c6b4b22..a4aae1a0059f11f1cdd38c2d25dab735b60bc178 100755 (executable)
@@ -4,7 +4,7 @@ USING: alien.c-types io.binary io.backend io.files io.buffers
 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
 
@@ -216,11 +216,11 @@ M: winnt link-info ( path -- info )
         "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 -- )
index 1a7462f304ed3960fe2e0c1ccf77daebdcb9ed2c..786275c736342ba4a0386c7dc5746fb79632f538 100755 (executable)
@@ -3,7 +3,7 @@ continuations destructors io io.backend io.ports io.timeouts
 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
index 68b42ca4423a4e9db53bc8bba885133dffa41929..8a54c595a974d53c8f6a36c399bad4387de45161 100755 (executable)
@@ -31,11 +31,11 @@ IN: project-euler.032
 
 : 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 ;
@@ -65,7 +65,7 @@ PRIVATE>
 
 ! multiplicand/multiplier/product
 : mmp ( pair -- n )
-    first2 2dup * [ number>string ] 3apply 3append string>number ;
+    first2 2dup * [ number>string ] tri@ 3append string>number ;
 
 PRIVATE>
 
old mode 100644 (file)
new mode 100755 (executable)
index 9075b19..7a9f51f
@@ -44,7 +44,7 @@ SYMBOL: p-count
     dup sum max-p < [
         dup sum adjust-p-count
         [ u-transform ] [ a-transform ] [ d-transform ] tri
-        [ (count-perimeters) ] 3apply
+        [ (count-perimeters) ] tri@
     ] [
         drop
     ] if ;
old mode 100644 (file)
new mode 100755 (executable)
index 453ebfa..8e5b849
@@ -57,7 +57,7 @@ SYMBOL: p-count
     dup sum max-p < [
         dup sum adjust-p-count
         [ u-transform ] [ a-transform ] [ d-transform ] tri
-        [ (count-perimeters) ] 3apply
+        [ (count-perimeters) ] tri@
     ] [
         drop
     ] if ;
index 3537d2e719de6fb38af72b1ce17efa40aad9201a..fc8ba9821c7977b9916630d58df10a28d0e46dd6 100755 (executable)
@@ -20,7 +20,6 @@ IN: reports.noise
         { 2swap 3 }\r
         { 2with 2 }\r
         { 2with* 3 }\r
-        { 3apply 1/2 }\r
         { 3curry 2 }\r
         { 3drop 1 }\r
         { 3dup 2 }\r
index 27e8cf1d9030df56b6df9e2b4abc3e6bdc30b785..89ad6fe2d0a55029eb63b0132b56c9da1bd893b0 100755 (executable)
@@ -36,10 +36,10 @@ TUPLE: arc id subject object relation ;
 : 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 ;
index 4ce0d3a89cd7ac4bca9268f6bf16e6615838e074..e0ea65e8be2d49c37ef1a1afc02f0f5ee4bd83b3 100755 (executable)
@@ -1,4 +1,4 @@
-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 ;
index 6d6aa078e8b8151c4b4e6b8b4880c9a9d8e72bf3..266439ad799a848a01fb3524e6286fc0b3e2421d 100755 (executable)
@@ -2,8 +2,8 @@ USING: alien alien.c-types windows.com.syntax
 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 ;
@@ -84,7 +84,7 @@ unless
     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 ;
old mode 100644 (file)
new mode 100755 (executable)
index a71a569..7daba37
@@ -1,5 +1,5 @@
 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
 
@@ -132,5 +132,5 @@ FUNCTION: void ReleaseStgMedium ( LPSTGMEDIUM pmedium ) ;
     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 ;