]> gitweb.factorcode.org Git - factor.git/commitdiff
fix more compiler errors
authorDoug Coleman <erg@jobim.local>
Fri, 17 Apr 2009 19:44:08 +0000 (14:44 -0500)
committerDoug Coleman <erg@jobim.local>
Fri, 17 Apr 2009 19:44:08 +0000 (14:44 -0500)
16 files changed:
basis/concurrency/exchangers/exchangers-tests.factor
basis/concurrency/flags/flags-tests.factor
basis/furnace/sessions/sessions-tests.factor
basis/hash2/hash2-tests.factor
basis/heaps/heaps-tests.factor
basis/math/intervals/intervals-tests.factor
basis/mirrors/mirrors-tests.factor
basis/persistent/hashtables/hashtables-tests.factor
basis/random/mersenne-twister/mersenne-twister-tests.factor
basis/threads/threads-tests.factor
basis/tools/deploy/shaker/shaker.factor
core/combinators/combinators-tests.factor
core/continuations/continuations-tests.factor
core/kernel/kernel-tests.factor
extra/lint/lint-tests.factor
extra/partial-continuations/partial-continuations-tests.factor

index 569b1a72c2cf3fee247f1e489dfaa1594e853a54..3b5b014fe3854a83b681a39a61ea55c13f208e3c 100644 (file)
@@ -3,7 +3,7 @@ USING: sequences tools.test concurrency.exchangers
 concurrency.count-downs concurrency.promises locals kernel\r
 threads ;\r
 \r
-:: exchanger-test ( -- )\r
+:: exchanger-test ( -- string )\r
     [let |\r
         ex [ <exchanger> ]\r
         c [ 2 <count-down> ]\r
index a66629331652532fed94f07fdbd0fb24496deed3..05ff74b03f27236dcf436e2e74aef8688ba07aa3 100644 (file)
@@ -11,7 +11,7 @@ kernel threads locals accessors calendar ;
 \r
 [ f ] [ flag-test-1 ] unit-test\r
 \r
-:: flag-test-2 ( -- )\r
+:: flag-test-2 ( -- )\r
     [let | f [ <flag> ] |\r
         [ 1 seconds sleep f raise-flag ] "Flag test" spawn drop\r
         f lower-flag\r
index b325c778cfa2ae8f8aac7d8adcde459e5fd2ec88..99855c76fa8fc09a05841a2343381233f1de03bf 100644 (file)
@@ -22,7 +22,7 @@ M: foo call-responder*
     "x" [ 1+ ] schange\r
     "x" sget number>string "text/html" <content> ;\r
 \r
-: url-responder-mock-test ( -- )\r
+: url-responder-mock-test ( -- string )\r
     [\r
         <request>\r
             "GET" >>method\r
@@ -34,7 +34,7 @@ M: foo call-responder*
         [ write-response-body drop ] with-string-writer\r
     ] with-destructors ;\r
 \r
-: sessions-mock-test ( -- )\r
+: sessions-mock-test ( -- string )\r
     [\r
         <request>\r
             "GET" >>method\r
index 6f97c7c3d5412fd65606f39540a6edef2d9b5253..15bbcb36ef518acc702e601fdb87aa7a50357d76 100644 (file)
@@ -4,7 +4,7 @@ IN: hash2.tests
 [ t ] [ 1 2 { 1 2 } 2= ] unit-test
 [ f ] [ 1 3 { 1 2 } 2= ] unit-test
 
-: sample-hash ( -- )
+: sample-hash ( -- hash )
     5 <hash2>
     dup 2 3 "foo" roll set-hash2
     dup 4 2 "bar" roll set-hash2
index 7e780cbe5ef674cf56b22a4aef1335d362306143..b4761075628044451643170673cbabd6267c3d9b 100644 (file)
@@ -54,7 +54,7 @@ IN: heaps.tests
 : sort-entries ( entries -- entries' )
     [ [ key>> ] compare ] sort ;
 
-: delete-test ( n -- ? )
+: delete-test ( n -- obj1 obj2 )
     [
         random-alist
         <min-heap> [ heap-push-all ] keep
index 378ca2fb4b0cbb99774c8f35b93d03a68270e58a..8b4345690143b980bd17f0eb552d3b0bd0b2aa1c 100644 (file)
@@ -255,11 +255,11 @@ IN: math.intervals.tests
     0 pick interval-contains? over first \ recip eq? and [
         2drop t
     ] [
-        [ [ random-element ] dip first execute ] 2keep
-        second execute interval-contains?
+        [ [ random-element ] dip first execute( a -- b ) ] 2keep
+        second execute( a -- b ) interval-contains?
     ] if ;
 
-[ t ] [ 80000 [ drop unary-test ] all? ] unit-test
+[ t ] [ 80000 iota [ drop unary-test ] all? ] unit-test
 
 : random-binary-op ( -- pair )
     {
@@ -286,11 +286,11 @@ IN: math.intervals.tests
     0 pick interval-contains? over first { / /i mod rem } member? and [
         3drop t
     ] [
-        [ [ [ random-element ] bi@ ] dip first execute ] 3keep
-        second execute interval-contains?
+        [ [ [ random-element ] bi@ ] dip first execute( a b -- c ) ] 3keep
+        second execute( a b -- c ) interval-contains?
     ] if ;
 
-[ t ] [ 80000 [ drop binary-test ] all? ] unit-test
+[ t ] [ 80000 iota [ drop binary-test ] all? ] unit-test
 
 : random-comparison ( -- pair )
     {
@@ -305,7 +305,7 @@ IN: math.intervals.tests
     [ [ [ random-element ] bi@ ] dip first execute ] 3keep
     second execute dup incomparable eq? [ 2drop t ] [ = ] if ;
 
-[ t ] [ 40000 [ drop comparison-test ] all? ] unit-test
+[ t ] [ 40000 iota [ drop comparison-test ] all? ] unit-test
 
 [ t ] [ -10 10 [a,b] 0 100 [a,b] assume> 0 10 (a,b] = ] unit-test
 
@@ -322,7 +322,7 @@ IN: math.intervals.tests
 [ t ] [ -10 10 [a,b] interval-abs 0 10 [a,b] = ] unit-test
 
 ! Test that commutative interval ops really are
-: random-interval-or-empty ( -- )
+: random-interval-or-empty ( -- obj )
     10 random 0 = [ empty-interval ] [ random-interval ] if ;
 
 : random-commutative-op ( -- op )
@@ -333,7 +333,7 @@ IN: math.intervals.tests
     } random ;
 
 [ t ] [
-    80000 [
+    80000 iota [
         drop
         random-interval-or-empty random-interval-or-empty
         random-commutative-op
index aad033600abaf4c17f8b9e9c58da1d9c9c117962..b5bac614ffef181491e9d374e792c9bc5f8cf9ba 100644 (file)
@@ -56,6 +56,6 @@ TUPLE: color
 ! Test reshaping with a mirror
 1 2 3 color boa <mirror> "mirror" set
 
-[ ] [ "IN: mirrors.tests USE: math TUPLE: color { green integer } { red integer } { blue integer } ;" eval ] unit-test
+[ ] [ "IN: mirrors.tests USE: math TUPLE: color { green integer } { red integer } { blue integer } ;" (( -- )) eval ] unit-test
 
 [ 1 ] [ "red" "mirror" get at ] unit-test
index 5ed72e5d599904f61a92983ef5aa6ca181510635..eea31dd34e700c5475d231658dea0468da04ae29 100644 (file)
@@ -83,7 +83,7 @@ M: hash-0-b hashcode* 2drop 0 ;
 : random-string ( -- str )
     1000000 random ; ! [ CHAR: a CHAR: z [a,b] random ] "" replicate-as ;
 
-: random-assocs ( -- hash phash )
+: random-assocs ( -- hash phash )
     [ random-string ] replicate
     [ H{ } clone [ '[ swap _ set-at ] each-index ] keep ]
     [ PH{ } clone swap [ spin new-at ] each-index ]
@@ -92,7 +92,7 @@ M: hash-0-b hashcode* 2drop 0 ;
 : ok? ( assoc1 assoc2 -- ? )
     [ assoc= ] [ [ assoc-size ] bi@ = ] 2bi and ;
 
-: test-persistent-hashtables-1 ( n -- )
+: test-persistent-hashtables-1 ( n -- )
     random-assocs ok? ;
 
 [ t ] [ 10 test-persistent-hashtables-1 ] unit-test
@@ -106,7 +106,7 @@ M: hash-0-b hashcode* 2drop 0 ;
 [ t ] [ 10000 test-persistent-hashtables-1 ] unit-test
 [ t ] [ 50000 test-persistent-hashtables-1 ] unit-test
 
-: test-persistent-hashtables-2 ( n -- )
+: test-persistent-hashtables-2 ( n -- )
     random-assocs
     dup keys [
         [ nip over delete-at ] [ swap pluck-at nip ] 3bi
index fe58e3d07c02ba5629aa46d178ba33fbf3d48604..c35d7488ac5ac40bd460090679a279efb5bd81d0 100644 (file)
@@ -11,7 +11,7 @@ IN: random.mersenne-twister.tests
     100 [ 100 random ] replicate ;
 
 : test-rng ( seed quot -- )
-    [  <mersenne-twister> ] dip with-random ;
+    [  <mersenne-twister> ] dip with-random ; inline
 
 [ f ] [ 1234 [ randoms randoms = ] test-rng ] unit-test
 
index adac84338d53552f2f3fbaee6a65a6a1b7edd56c..610a664c7b85f6542e6c3038051d0ee7bf20892f 100644 (file)
@@ -31,7 +31,7 @@ yield
 
 [ [ 3 throw ] "A" suspend ] [ 3 = ] must-fail-with
 
-:: spawn-namespace-test ( -- )
+:: spawn-namespace-test ( -- )
     [let | p [ <promise> ] g [ gensym ] |
         [
             g "x" set
index 3bb9ae72ac5b757af47f631a6fe38537bab7b03a..2fc1ada108c3eb4449ec347cdfa19e19f12f55d0 100755 (executable)
@@ -374,9 +374,9 @@ SYMBOL: deploy-vocab
             [:c]
             [print-error]
             '[
-                [ _ execute ] [
-                    _ execute nl
-                    _ execute
+                [ _ execute( obj -- ) ] [
+                    _ execute( obj -- ) nl
+                    _ execute( obj -- )
                 ] recover
             ] %
         ] if
index 76f9f63c49be13be25f66bd60a7e08af227d05c4..a8049f709ec46795dd3ee4afd1b9fed840f1bd5d 100644 (file)
@@ -357,7 +357,7 @@ DEFER: corner-case-1
 
 [ 4 ] [ 2 2 [ + ] curry 1array case ] unit-test
 
-: test-case-8 ( n -- )
+: test-case-8 ( n -- string )
     {
         { 1 [ "foo" ] }
     } case ;
index 34a4ed28794c7b5d32f41902a0c0b74955c43cc9..2111cce358676c4e2a09eb9bc00effb1a1a6ebc0 100644 (file)
@@ -3,7 +3,7 @@ continuations debugger parser memory arrays words
 kernel.private accessors eval ;
 IN: continuations.tests
 
-: (callcc1-test) ( -- )
+: (callcc1-test) ( n obj -- n' obj )
     [ 1- dup ] dip ?push
     over 0 = [ "test-cc" get continue-with ] when
     (callcc1-test) ;
@@ -59,7 +59,7 @@ IN: continuations.tests
 ! : callstack-overflow callstack-overflow f ;
 ! [ callstack-overflow ] must-fail
 
-: don't-compile-me ( -- ) { } [ ] each ;
+: don't-compile-me ( -- ) { } [ ] each ;
 
 : foo ( -- ) callstack "c" set 3 don't-compile-me ;
 : bar ( -- a b ) 1 foo 2 ;
index 63346f4701fecfea0a490c394377aa83be4408c3..84a356805bc0cbe4e23b9e4893d62419309ff116 100644 (file)
@@ -27,7 +27,7 @@ IN: kernel.tests
 
 [ ] [ :c ] unit-test
 
-: (overflow-d-alt) ( -- ) 3 ;
+: (overflow-d-alt) ( -- ) 3 ;
 
 : overflow-d-alt ( -- ) (overflow-d-alt) overflow-d-alt ;
 
@@ -107,7 +107,7 @@ IN: kernel.tests
 ! Regression
 : (loop) ( a b c d -- )
     [ pick ] dip swap [ pick ] dip swap
-    < [ [ 1+ ] 3dip (loop) ] [ 2drop 2drop ] if ; inline
+    < [ [ 1+ ] 3dip (loop) ] [ 2drop 2drop ] if ; inline recursive
 
 : loop ( obj obj -- )
     H{ } values swap [ dup length swap ] dip 0 -roll (loop) ;
@@ -168,4 +168,4 @@ IN: kernel.tests
 
 [ 3 -1 5/6 ] [ 1 2 3 4 5 6 [ + ] [ - ] [ / ] 2tri* ] unit-test
 
-[ { 1 2 } { 3 4 } { 5 6 } ] [ 1 2 3 4 5 6 [ 2array ] 2tri@ ] unit-test
\ No newline at end of file
+[ { 1 2 } { 3 4 } { 5 6 } ] [ 1 2 3 4 5 6 [ 2array ] 2tri@ ] unit-test
index 70035f18546769168ee95181ffa24f5c9775ac44..7326bc65b0b4e610b17b1e4ee09f6a8fb79abbb9 100644 (file)
@@ -2,7 +2,7 @@ USING: io lint kernel math tools.test ;
 IN: lint.tests
 
 ! Don't write code like this
-: lint1 ( -- ) [ "hi" print ] [ ] if ; ! when
+: lint1 ( obj -- ) [ "hi" print ] [ ] if ; ! when
 
 [ { { lint1 { [ [ ] if ] } } } ] [ \ lint1 lint-word ] unit-test
 
index 7e876b0934949f17042d848536f7a0cb4a5bc5cd..d6fdefd1aa2b0fd474d4319ee8590c7cdb9530c5 100644 (file)
@@ -7,7 +7,7 @@ SYMBOL: sum
 : range ( r from to -- n )
     over - 1 + rot [ 
         -rot [ over + pick call drop ] each 2drop f  
-    ] bshift 2nip ;
+    ] bshift 2nip ; inline
 
 [ 55 ] [
     0 sum set