Fixes and cleanups
parent
39e2b3450d
commit
9b9b2747a3
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2007 Daniel Ehrenberg
|
! Copyright (C) 2007 Daniel Ehrenberg
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: delegate sequences.private sequences assocs prettyprint.sections
|
USING: delegate sequences.private sequences assocs prettyprint.sections
|
||||||
io definitions kernel continuations ;
|
io definitions kernel continuations listener ;
|
||||||
IN: delegate.protocols
|
IN: delegate.protocols
|
||||||
|
|
||||||
PROTOCOL: sequence-protocol
|
PROTOCOL: sequence-protocol
|
||||||
|
@ -12,8 +12,10 @@ PROTOCOL: assoc-protocol
|
||||||
at* assoc-size >alist set-at assoc-clone-like { assoc-find 1 }
|
at* assoc-size >alist set-at assoc-clone-like { assoc-find 1 }
|
||||||
delete-at clear-assoc new-assoc assoc-like ;
|
delete-at clear-assoc new-assoc assoc-like ;
|
||||||
|
|
||||||
PROTOCOL: stream-protocol
|
PROTOCOL: input-stream-protocol
|
||||||
stream-read1 stream-read stream-read-until dispose
|
stream-read1 stream-read stream-read-until stream-read-quot ;
|
||||||
|
|
||||||
|
PROTOCOL: output-stream-protocol
|
||||||
stream-flush stream-write1 stream-write stream-format
|
stream-flush stream-write1 stream-write stream-format
|
||||||
stream-nl make-span-stream make-block-stream stream-readln
|
stream-nl make-span-stream make-block-stream stream-readln
|
||||||
make-cell-stream stream-write-table ;
|
make-cell-stream stream-write-table ;
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
USING: assocs http kernel math math.parser namespaces sequences
|
USING: assocs http kernel math math.parser namespaces sequences
|
||||||
io io.sockets io.streams.string io.files io.timeouts strings
|
io io.sockets io.streams.string io.files io.timeouts strings
|
||||||
splitting calendar continuations accessors vectors math.order
|
splitting calendar continuations accessors vectors math.order
|
||||||
io.encodings.8-bit io.encodings.binary fry debugger inspector ;
|
io.encodings.8-bit io.encodings.binary io.streams.duplex
|
||||||
|
fry debugger inspector ;
|
||||||
IN: http.client
|
IN: http.client
|
||||||
|
|
||||||
: max-redirects 10 ;
|
: max-redirects 10 ;
|
||||||
|
|
|
@ -82,10 +82,8 @@ IN: http.server.auth.admin
|
||||||
|
|
||||||
same-password-twice
|
same-password-twice
|
||||||
|
|
||||||
user new "username" value >>username select-tuple [
|
user new "username" value >>username select-tuple
|
||||||
user-exists? on
|
[ user-exists ] when
|
||||||
validation-failed
|
|
||||||
] when
|
|
||||||
|
|
||||||
"username" value <user>
|
"username" value <user>
|
||||||
"realname" value >>realname
|
"realname" value >>realname
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
! Copyright (C) 2003, 2008 Slava Pestov.
|
! Copyright (C) 2003, 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: io io.sockets io.files logging continuations kernel
|
USING: io io.sockets io.files io.streams.duplex logging
|
||||||
math math.parser namespaces parser sequences strings
|
continuations kernel math math.parser namespaces parser
|
||||||
prettyprint debugger quotations calendar
|
sequences strings prettyprint debugger quotations calendar
|
||||||
threads concurrency.combinators assocs ;
|
threads concurrency.combinators assocs ;
|
||||||
IN: io.server
|
IN: io.server
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
! Copyright (C) 2005, 2008 Slava Pestov.
|
! Copyright (C) 2005, 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel continuations io io.encodings io.encodings.private
|
USING: kernel continuations io io.encodings io.encodings.private
|
||||||
io.timeouts debugger inspector listener accessors ;
|
io.timeouts debugger inspector listener accessors delegate
|
||||||
|
delegate.protocols ;
|
||||||
IN: io.streams.duplex
|
IN: io.streams.duplex
|
||||||
|
|
||||||
! We ensure that the stream can only be closed once, to preserve
|
! We ensure that the stream can only be closed once, to preserve
|
||||||
|
@ -28,50 +29,9 @@ M: stream-closed-twice summary
|
||||||
|
|
||||||
PRIVATE>
|
PRIVATE>
|
||||||
|
|
||||||
M: duplex-stream stream-flush
|
CONSULT: input-stream-protocol duplex-stream in ;
|
||||||
out stream-flush ;
|
|
||||||
|
|
||||||
M: duplex-stream stream-readln
|
CONSULT: output-stream-protocol duplex-stream out ;
|
||||||
in stream-readln ;
|
|
||||||
|
|
||||||
M: duplex-stream stream-read1
|
|
||||||
in stream-read1 ;
|
|
||||||
|
|
||||||
M: duplex-stream stream-read-until
|
|
||||||
in stream-read-until ;
|
|
||||||
|
|
||||||
M: duplex-stream stream-read-partial
|
|
||||||
in stream-read-partial ;
|
|
||||||
|
|
||||||
M: duplex-stream stream-read
|
|
||||||
in stream-read ;
|
|
||||||
|
|
||||||
M: duplex-stream stream-write1
|
|
||||||
out stream-write1 ;
|
|
||||||
|
|
||||||
M: duplex-stream stream-write
|
|
||||||
out stream-write ;
|
|
||||||
|
|
||||||
M: duplex-stream stream-nl
|
|
||||||
out stream-nl ;
|
|
||||||
|
|
||||||
M: duplex-stream stream-format
|
|
||||||
out stream-format ;
|
|
||||||
|
|
||||||
M: duplex-stream make-span-stream
|
|
||||||
out make-span-stream ;
|
|
||||||
|
|
||||||
M: duplex-stream make-block-stream
|
|
||||||
out make-block-stream ;
|
|
||||||
|
|
||||||
M: duplex-stream make-cell-stream
|
|
||||||
out make-cell-stream ;
|
|
||||||
|
|
||||||
M: duplex-stream stream-write-table
|
|
||||||
out stream-write-table ;
|
|
||||||
|
|
||||||
M: duplex-stream stream-read-quot
|
|
||||||
in stream-read-quot ;
|
|
||||||
|
|
||||||
M: duplex-stream set-timeout
|
M: duplex-stream set-timeout
|
||||||
[ in set-timeout ] [ out set-timeout ] 2bi ;
|
[ in set-timeout ] [ out set-timeout ] 2bi ;
|
||||||
|
|
|
@ -4,13 +4,13 @@ IN: io.unix.pipes.tests
|
||||||
|
|
||||||
[ { 0 0 } ] [ { "ls" "grep x" } with-pipeline ] unit-test
|
[ { 0 0 } ] [ { "ls" "grep x" } with-pipeline ] unit-test
|
||||||
|
|
||||||
! [ ] [
|
[ { 0 f 0 } ] [
|
||||||
! {
|
{
|
||||||
! "ls"
|
"ls"
|
||||||
! [
|
[
|
||||||
! input-stream [ utf8 <decoder> ] change
|
input-stream [ utf8 <decoder> ] change
|
||||||
! input-stream get lines reverse [ print ] each f
|
input-stream get lines reverse [ print ] each f
|
||||||
! ]
|
]
|
||||||
! "grep x"
|
"grep x"
|
||||||
! } with-pipeline
|
} with-pipeline
|
||||||
! ] unit-test
|
] unit-test
|
||||||
|
|
Loading…
Reference in New Issue