]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://factorcode.org/git/factor into unicode
authorDaniel Ehrenberg <ehrenbed@carleton.edu>
Tue, 4 Mar 2008 23:51:40 +0000 (17:51 -0600)
committerDaniel Ehrenberg <ehrenbed@carleton.edu>
Tue, 4 Mar 2008 23:51:40 +0000 (17:51 -0600)
Conflicts:

core/io/files/files-tests.factor
core/io/files/files.factor
core/io/io-tests.factor
core/io/streams/c/c-tests.factor
core/io/streams/lines/lines-tests.factor
core/source-files/source-files.factor
extra/benchmark/sockets/sockets.factor
extra/http/server/templating/templating-tests.factor
extra/http/server/templating/templating.factor
extra/io/launcher/launcher.factor
extra/io/mmap/mmap-tests.factor
extra/io/unix/launcher/launcher.factor
extra/io/unix/unix-tests.factor

20 files changed:
1  2 
core/io/files/files-docs.factor
core/io/files/files-tests.factor
core/io/files/files.factor
core/io/io-tests.factor
core/io/streams/c/c-tests.factor
core/source-files/source-files.factor
core/vocabs/loader/loader.factor
extra/benchmark/sockets/sockets.factor
extra/bootstrap/image/upload/upload.factor
extra/http/server/templating/templating-tests.factor
extra/http/server/templating/templating.factor
extra/io/launcher/launcher.factor
extra/io/mmap/mmap-tests.factor
extra/io/server/server-tests.factor
extra/io/unix/files/files.factor
extra/io/unix/launcher/launcher.factor
extra/io/unix/unix-tests.factor
extra/io/windows/windows.factor
extra/porter-stemmer/porter-stemmer-tests.factor
extra/xmode/utilities/utilities-tests.factor

Simple merge
index d277576b2f06f6495b7d607ac78f10c747ebf2d4,6943163c5dad8a7f5ff119f8b4f9e1ed92081da4..79ada7e4c2a6d61d11365d8781bf7c39fbb0d55f
@@@ -1,5 -1,5 +1,5 @@@
- IN: temporary
+ IN: io.files.tests
 -USING: tools.test io.files io threads kernel continuations ;
 +USING: tools.test io.files io threads kernel continuations io.encodings.ascii ;
  
  [ "passwd" ] [ "/etc/passwd" file-name ] unit-test
  [ "awk" ] [ "/usr/libexec/awk/" file-name ] unit-test
index 785de80f36bb20c84e57dc5b0072709dc15117fe,b51d7670693dba2b9964517090eccb5f2116cfcc..5779aa67833de536bc877464ece6a243e00dd9cc
@@@ -163,21 -146,13 +163,21 @@@ HOOK: move-file io-backend ( from to -
  ! Copying files
  HOOK: copy-file io-backend ( from to -- )
  
- : copy-file-to ( from to -- )
 +M: object copy-file
 +    dup parent-directory make-directories
 +    binary <file-writer> [
 +        swap binary <file-reader> [
 +            swap stream-copy
 +        ] with-disposal
 +    ] with-disposal ;
 +
+ : copy-file-into ( from to -- )
      to-directory copy-file ;
  
- : copy-files-to ( files to -- )
-     [ copy-file-to ] curry each ;
+ : copy-files-into ( files to -- )
+     [ copy-file-into ] curry each ;
  
- DEFER: copy-tree-to
+ DEFER: copy-tree-into
  
  : copy-tree ( from to -- )
      over directory? [
index 2ac55a33facbb6e76dab85cb9b24d3c41ea83bb3,e3c249ec5d4e7fe805a5270723e94befbc00a00b..8b5e763e45c6b5e4945d500ec23f1edefbd6f889
@@@ -1,6 -1,6 +1,6 @@@
  USING: arrays io io.files kernel math parser strings system
 -tools.test words namespaces ;
 +tools.test words namespaces io.encodings.ascii io.encodings.binary ;
- IN: temporary
+ IN: io.tests
  
  [ f ] [
      "resource:/core/io/test/no-trailing-eol.factor" run-file
index db2a476b4066a60414f897e0bad186f8a1471daa,3da9f27646173a8f27f6a06815ba7bee94d5f5e0..6c7e57cabb025e60ee6c6e75f9224cb522739044
@@@ -1,8 -1,8 +1,8 @@@
 -USING: tools.test io.files io io.streams.c ;
 +USING: tools.test io.files io io.streams.c io.encodings.ascii ;
- IN: temporary
+ IN: io.streams.c.tests
  
  [ "hello world" ] [
 -    "test.txt" temp-file [
 +    "test.txt" temp-file ascii [
          "hello world" write
      ] with-file-writer
  
index dc50cc9aa85662c0c3a353720f4873b327d161b6,98c39ae39017ae7203283e24dde893a478edcd91..55300a3c29a2fbef3cf4a62517cbbe2a3919e890
@@@ -68,7 -68,10 +68,10 @@@ uses definitions 
  : reset-checksums ( -- )
      source-files get [
          swap ?resource-path dup exists?
-         [ utf8 file-lines swap record-checksum ] [ 2drop ] if
+         [
+             over record-modified
 -            file-lines swap record-checksum
++            utf8 file-lines swap record-checksum
+         ] [ 2drop ] if
      ] assoc-each ;
  
  M: pathname where pathname-string 1 2array ;
index 9c74ce644be1bf30c92942efdfc8bd9ebe66a049,acc6c783a5977adad4711b5f2562f1388034c782..b21329de9c0639a789413f18dabdea904b386e05
@@@ -2,9 -2,9 +2,9 @@@
  ! See http://factorcode.org/license.txt for BSD license.
  USING: namespaces sequences io.files kernel assocs words vocabs
  definitions parser continuations inspector debugger io io.styles
 -io.streams.lines hashtables sorting prettyprint source-files
 +hashtables sorting prettyprint source-files
  arrays combinators strings system math.parser compiler.errors
- splitting ;
+ splitting init ;
  IN: vocabs.loader
  
  SYMBOL: vocab-roots
index b6b20630a179f6e1155ffb55731adaa32d3b1b60,c739bb787cd6a00039929a3e114000f9f0a933d2..c10a123af30cd18e303b62ebd37e010c169eb297
@@@ -1,20 -1,40 +1,50 @@@
- USING: io.sockets io.server io kernel math threads io.encodings.ascii\r
- debugger tools.time prettyprint concurrency.combinators ;\r
 -USING: io.sockets io kernel math threads\r
++USING: io.sockets io kernel math threads io.encodings.ascii\r
+ debugger tools.time prettyprint concurrency.count-downs\r
+ namespaces arrays continuations ;\r
  IN: benchmark.sockets\r
  \r
+ SYMBOL: counter\r
\r
+ : number-of-requests 1 ;\r
\r
+ : server-addr "127.0.0.1" 7777 <inet4> ;\r
\r
+ : server-loop ( server -- )\r
+     dup accept [\r
+         [\r
+             read1 CHAR: x = [\r
+                 "server" get dispose\r
+             ] [\r
+                 number-of-requests\r
+                 [ read1 write1 flush ] times\r
+                 counter get count-down\r
+             ] if\r
+         ] with-stream\r
+     ] curry "Client handler" spawn drop server-loop ;\r
\r
  : simple-server ( -- )\r
++<<<<<<< HEAD:extra/benchmark/sockets/sockets.factor
 +    7777 local-server "benchmark.sockets" ascii [\r
 +        read1 CHAR: x = [\r
 +            stop-server\r
 +        ] [\r
 +            20 [ read1 write1 flush ] times\r
 +        ] if\r
 +    ] with-server ;\r
++=======
+     [\r
+         server-addr <server> dup "server" set [\r
+             server-loop\r
+         ] with-disposal\r
+     ] ignore-errors ;\r
++>>>>>>> b80434b2e394480fa317348955b1f7b89e284bde:extra/benchmark/sockets/sockets.factor
  \r
  : simple-client ( -- )\r
-     "localhost" 7777 <inet> <client> [\r
+     server-addr <client> [\r
          CHAR: b write1 flush\r
-         20 [ CHAR: a dup write1 flush read1 assert= ] times\r
+         number-of-requests\r
+         [ CHAR: a dup write1 flush read1 assert= ] times\r
+         counter get count-down\r
      ] with-stream ;\r
  \r
  : stop-server ( -- )\r
index b390213697eff10f76f03a6952407321cb8a70af,084f30a103400c9ef76bb4ba97c67c632409efe8..72e0b3c46b52a3a55a076e0dc7d4e7488e1f1e88
@@@ -2,9 -2,14 +2,14 @@@
  ! See http://factorcode.org/license.txt for BSD license.
  IN: bootstrap.image.upload
  USING: http.client crypto.md5 splitting assocs kernel io.files
 -bootstrap.image sequences io namespaces io.launcher math ;
 +bootstrap.image sequences io namespaces io.launcher math io.encodings.ascii ;
  
- : destination "slava@factorcode.org:www/images/latest/" ;
+ SYMBOL: upload-images-destination
+ : destination ( -- dest )
+   upload-images-destination get
+   "slava@/var/www/factorcode.org/newsite/images/latest/"
+   or ;
  
  : checksums "checksums.txt" temp-file ;
  
index 2c15120552012327f5bf8a54cd3f7de83a17848a,ceb2ed95bef6133385caa2ba3d564ee7d843eb78..dcc78ea20e799d87107d13d9d3928249a8cce858
@@@ -1,6 -1,6 +1,6 @@@
  USING: io io.files io.streams.string http.server.templating kernel tools.test
 -    sequences ;
 +    sequences io.encodings.utf8 ;
- IN: temporary
+ IN: http.server.templating.tests
  
  : test-template ( path -- ? )
      "extra/http/server/templating/test/" swap append
index 6838df894213fce6e30efa77fc2235e602c56f4e,4c451f7f6ea95df1e1790ae2ccd746ae99a6ca05..70539bf3766956ca4e29d2600bbb0a125f6c7411
@@@ -82,10 -82,10 +82,10 @@@ DEFER: <% delimite
              templating-vocab use+
              ! so that reload works properly
              dup source-file file set
-             dup ?resource-path utf8 file-contents
 -            ?resource-path file-contents
++            ?resource-path utf8 file-contents
              [ eval-template ] [ html-error. drop ] recover
          ] with-file-vocabs
-     ] assert-depth drop ;
+     ] curry assert-depth ;
  
  : run-relative-template-file ( filename -- )
      file get source-file-path parent-directory
index b1990df6544b705a14c161d2a3f7d8bf4920a001,c5ea4feeaf831e55752291dd4e3c5222c83ac04e..ea5c58a3d305d5662b6b4f844a41700c7b61bce2
@@@ -1,8 -1,9 +1,9 @@@
  ! Copyright (C) 2008 Slava Pestov.
  ! See http://factorcode.org/license.txt for BSD license.
 -USING: io io.backend io.nonblocking io.streams.duplex
 -io.timeouts system kernel namespaces strings hashtables
 -sequences assocs combinators vocabs.loader init threads
 -continuations math ;
 +USING: io io.backend io.timeouts system kernel namespaces
 +strings hashtables sequences assocs combinators vocabs.loader
- init threads continuations math io.encodings ;
++init threads continuations math io.encodings io.streams.duplex
++io.nonblocking ;
  IN: io.launcher
  
  ! Non-blocking process exit notification facility
index 388deac0db794bb59ca7791b6fab6858beb6e81a,832b88b248770786ec05cb6fc33cd174d4e2e839..81c3faec1e965c58cc0372d0813e2a9f2993681b
@@@ -1,10 -1,9 +1,10 @@@
 -USING: io io.mmap io.files kernel tools.test continuations sequences ;
 +USING: io io.mmap io.files kernel tools.test continuations
 +sequences io.encodings.ascii ;
- IN: temporary
+ IN: io.mmap.tests
  
  [ "mmap-test-file.txt" resource-path delete-file ] ignore-errors
 -[ ] [ "mmap-test-file.txt" resource-path [ "12345" write ] with-file-writer ] unit-test
 +[ ] [ "mmap-test-file.txt" resource-path ascii [ "12345" write ] with-file-writer ] unit-test
  [ ] [ "mmap-test-file.txt" resource-path dup file-length [ CHAR: 2 0 pick set-nth drop ] with-mapped-file ] unit-test
  [ 5 ] [ "mmap-test-file.txt" resource-path dup file-length [ length ] with-mapped-file ] unit-test
 -[ "22345" ] [ "mmap-test-file.txt" resource-path file-contents ] unit-test
 +[ "22345" ] [ "mmap-test-file.txt" resource-path ascii file-contents ] unit-test
  [ "mmap-test-file.txt" resource-path delete-file ] ignore-errors
index 6c3c177513a58ebbe91c3b5ee35ef84701f92f85,8e56169bb36725fe530ad8c6f8f1030ceaa60ceb..e1297a9839d5ab294561d318e125b740332ca449
@@@ -1,4 -1,4 +1,4 @@@
- IN: temporary
+ IN: io.server.tests
  USING: tools.test io.server io.server.private ;
  
 -{ 1 0 } [ [ ] server-loop ] must-infer-as
 +{ 2 0 } [ [ ] server-loop ] must-infer-as
Simple merge
index 8384c2fce602e391e8f2abfef46cd418177ed0af,58e41a06c053a4d89186b2c36e8a74bfe7d70bde..63002887ab6499694f15e4b6e23e15ad1cbca229
@@@ -1,10 -1,10 +1,18 @@@
  ! Copyright (C) 2007, 2008 Slava Pestov.
  ! See http://factorcode.org/license.txt for BSD license.
++<<<<<<< HEAD:extra/io/unix/launcher/launcher.factor
 +USING: io io.backend io.launcher io.unix.backend io.unix.files
 +io.nonblocking sequences kernel namespaces math system
 + alien.c-types debugger continuations arrays assocs 
 +combinators unix.process parser-combinators memoize 
 +promises strings threads unix io.encodings.latin1 ;
++=======
+ USING: io io.backend io.launcher io.nonblocking io.unix.backend
+ io.unix.files io.nonblocking sequences kernel namespaces math
+ system alien.c-types debugger continuations arrays assocs
+ combinators unix.process strings threads unix
+ io.unix.launcher.parser ;
++>>>>>>> b80434b2e394480fa317348955b1f7b89e284bde:extra/io/unix/launcher/launcher.factor
  IN: io.unix.launcher
  
  ! Search unix first
index ca5d0f29fde8716b4b61d0b93dd888efb1ce3bdb,680cb0b3e5ad7a650464025971810a6db61292fa..c8ed4fc41c41afc8620ee00fe80e6554989dea1f
@@@ -1,7 -1,7 +1,7 @@@
  USING: io.files io.sockets io kernel threads
  namespaces tools.test continuations strings byte-arrays
 -sequences prettyprint system ;
 +sequences prettyprint system io.encodings.binary io.encodings.ascii ;
- IN: temporary
+ IN: io.unix.tests
  
  ! Unix domain stream sockets
  : socket-server "unix-domain-socket-test" temp-file ;
Simple merge
index 1e46fcd871180b698d59a7d6244fed5702b3eabc,7294ac0e8fc1ba4b981ae9c588ef567d73398cf3..da0658f94d2b8e18b9aaeab6f7844c2720c334f5
@@@ -1,6 -1,6 +1,6 @@@
- IN: temporary
+ IN: porter-stemmer.tests
  USING: arrays io kernel porter-stemmer sequences tools.test
 -io.files ;
 +io.files io.encodings.utf8 ;
  
  [ 0 ] [ "xa" consonant-seq ] unit-test
  [ 0 ] [ "xxaa" consonant-seq ] unit-test