Merge branch 'master' of http://dharmatech.onigirihouse.com/factor into record1_strings

db4
Slava Pestov 2008-01-31 23:21:29 -06:00
commit a234995c97
7 changed files with 11 additions and 12 deletions

View File

@ -127,7 +127,7 @@ ARTICLE: { "concurrency" "processes" } "Processes"
{ $code ": odd? ( n -- ? ) 2 mod 1 = ;\n1 self send 2 self send 3 self send\n\nreceive .\n => 1\n\n[ odd? ] receive-if .\n => 3\n\nreceive .\n => 2" } ;
ARTICLE: { "concurrency" "self" } "Self"
"A process can get access to its own process object using " { $link self } " so it can pass it to other processes. This allows the other processes to send messages back. A simple example of using this gets the current processes 'self' and spawns a process which sends a message to it. We then receive the message from the original process:"
"A process can get access to its own process object using " { $link self } " so it can pass it to other processes. This allows the other processes to send messages back. A simple example of using this gets the current process' 'self' and spawns a process which sends a message to it. We then receive the message from the original process:"
{ $code "self [ \"Hello!\" swap send ] spawn 2drop receive .\n => \"Hello!\"" } ;
ARTICLE: { "concurrency" "servers" } "Servers"
@ -150,7 +150,7 @@ ARTICLE: { "concurrency" "exceptions" } "Exceptions"
"Exceptions are only raised in the parent when the parent does a " { $link receive } " or " { $link receive-if } ". This is because the exception is sent from the child to the parent as a message." ;
ARTICLE: { "concurrency" "futures" } "Futures"
"A future is a placeholder for the result of a computation that is being calculated in a process. When the process has completed the computation the future can be queried to find out the result. If the computation has not completed when the future is queried them the process will block until the result is completed. <p>A future is created using " { $link future } ".\n\nThe quotation will be run in a spawned process, and a future object is immediately returned. This future object can be resolved using " { $link ?future } ".\n\nFutures are useful for starting calculations that take a long time to run but aren't needed until later in the process. When the process needs the value it can use '?future' to get the result or block until the result is available. For example:"
"A future is a placeholder for the result of a computation that is being calculated in a process. When the process has completed the computation the future can be queried to find out the result. If the computation has not completed when the future is queried them the process will block until the result is completed. A future is created using " { $link future } ".\n\nThe quotation will be run in a spawned process, and a future object is immediately returned. This future object can be resolved using " { $link ?future } ".\n\nFutures are useful for starting calculations that take a long time to run but aren't needed until later in the process. When the process needs the value it can use '?future' to get the result or block until the result is available. For example:"
{ $code "[ 30 fib ] future\n...do stuff...\n?future" } ;
ARTICLE: { "concurrency" "promises" } "Promises"

View File

@ -1,6 +1,6 @@
! Copyright (C) 2007 Matthew Willis
! See http://factorcode.org/license.txt for BSD license.
USING: cryptlib cryptlib.libcl kernel alien sequences
USING: cryptlib cryptlib.libcl kernel alien sequences continuations
byte-arrays namespaces io.buffers math generic io strings
io.streams.lines io.streams.plain io.streams.duplex combinators
alien.c-types ;

View File

@ -4,7 +4,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: io kernel namespaces prettyprint quotations
sequences strings words xml.writer compiler.units effects ;
sequences strings words xml.writer xml.entities compiler.units effects ;
IN: html.elements

View File

@ -1,9 +1,9 @@
! Copyright (C) 2004, 2006 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: generic assocs help http io io.styles io.files
USING: generic assocs help http io io.styles io.files continuations
io.streams.string kernel math math.parser namespaces
quotations assocs sequences strings words html.elements
xml.writer sbufs ;
xml.writer xml.entities sbufs ;
IN: html
GENERIC: browser-link-href ( presented -- href )

View File

@ -1,7 +1,7 @@
! Copyright (C) 2007 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
IN: io.streams.null
USING: kernel io ;
USING: kernel io continuations ;
TUPLE: null-stream ;

View File

@ -1,7 +1,6 @@
USING: combinators io io.files io.streams.duplex
USING: combinators io io.files io.streams.duplex continuations
io.streams.string kernel math math.parser
namespaces pack prettyprint sequences strings system ;
USING: hexdump tools.interpreter ;
namespaces pack prettyprint sequences strings system hexdump ;
IN: tar
: zero-checksum 256 ;

View File

@ -1,5 +1,5 @@
USING: calendar furnace furnace.validator io.files kernel
namespaces sequences http.server.responders html math.parser rss
namespaces sequences http.server.responders html math math.parser rss
xml.writer xmode.code2html ;
IN: webapps.pastebin
@ -94,7 +94,7 @@ C: <annotation> annotation
: annotate-paste ( n summary author mode contents -- )
<annotation> swap get-paste
[ paste-annotations push store save-store ] keep
[ paste-annotations push ] keep
paste-link permanent-redirect ;
[ "n" show-paste ]