Merge branch 'master' of git://github.com/otoburb/factor

db4
Slava Pestov 2011-03-14 21:56:03 -07:00
commit 8c7676bd6a
7 changed files with 14 additions and 12 deletions

View File

@ -23,7 +23,7 @@ HELP: output>array
{ "quot" quotation } { "quot" quotation }
{ "newquot" quotation } { "newquot" quotation }
} }
{ $description "Infers the number or outputs from the quotation and constructs an array from those outputs." } { $description "Infers the number of outputs from the quotation and constructs an array from those outputs." }
{ $examples { $examples
{ $example { $example
"USING: combinators combinators.smart math prettyprint ; "USING: combinators combinators.smart math prettyprint ;

View File

@ -139,7 +139,7 @@ HELP: select-tuples
{ $values { $values
{ "query/tuple" tuple } { "query/tuple" tuple }
{ "tuples" "an array of tuples" } } { "tuples" "an array of tuples" } }
{ $description "A SQL query is constructed from the slots of the exemplar tuple that are not " { $link f } ". Returns a multiple tuples from the database that match the query constructed from the exemplar tuple." } ; { $description "A SQL query is constructed from the slots of the exemplar tuple that are not " { $link f } ". Returns an array of multiple tuples from the database that match the query constructed from the exemplar tuple." } ;
HELP: count-tuples HELP: count-tuples
{ $values { $values

View File

@ -3,7 +3,7 @@
USING: accessors arrays assocs fry help.markup help.topics io USING: accessors arrays assocs fry help.markup help.topics io
kernel make math math.parser namespaces sequences sorting kernel make math math.parser namespaces sequences sorting
summary tools.completion vocabs.hierarchy help.vocabs summary tools.completion vocabs.hierarchy help.vocabs
vocabs words unicode.case help ; vocabs words unicode.case help unicode.categories ;
IN: help.apropos IN: help.apropos
: $completions ( seq -- ) : $completions ( seq -- )
@ -71,4 +71,4 @@ M: apropos >link ;
INSTANCE: apropos topic INSTANCE: apropos topic
: apropos ( str -- ) : apropos ( str -- )
<apropos> print-topic nl ; [ blank? ] trim <apropos> print-topic nl ;

View File

@ -37,7 +37,7 @@ $nl
{ $code "'[ 2 _ + ]" } ; { $code "'[ 2 _ + ]" } ;
ARTICLE: "namespaces-make" "Making sequences with variables" ARTICLE: "namespaces-make" "Making sequences with variables"
"The " { $vocab-link "make" } " vocabulary implements a facility for constructing sequences by holding an collector sequence in a variable. Storing the collector sequence in a variable rather than the stack may allow code to be written with less stack manipulation." "The " { $vocab-link "make" } " vocabulary implements a facility for constructing sequences by holding a collector sequence in a variable. Storing the collector sequence in a variable rather than the stack may allow code to be written with less stack manipulation."
$nl $nl
"Sequence construction is wrapped in a combinator:" "Sequence construction is wrapped in a combinator:"
{ $subsections make } { $subsections make }

View File

@ -1,7 +1,7 @@
! Copyright (C) 2009 Doug Coleman. ! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs calendar fry kernel parser sequences USING: accessors assocs calendar fry kernel locals parser
shuffle vocabs words memoize ; sequences vocabs words memoize ;
IN: calendar.holidays IN: calendar.holidays
SINGLETONS: all world commonwealth-of-nations ; SINGLETONS: all world commonwealth-of-nations ;
@ -15,7 +15,8 @@ SYNTAX: HOLIDAY:
parse-definition (( timestamp/n -- timestamp )) define-declared ; parse-definition (( timestamp/n -- timestamp )) define-declared ;
SYNTAX: HOLIDAY-NAME: SYNTAX: HOLIDAY-NAME:
scan-word "holiday" word-prop scan-word scan-object spin set-at ; [let scan-word "holiday" word-prop :> holidays scan-word :> name scan-object :> value
value name holidays set-at ] ;
>> >>
GENERIC: holidays ( n singleton -- seq ) GENERIC: holidays ( n singleton -- seq )

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs calendar calendar.holidays USING: accessors assocs calendar calendar.holidays
calendar.holidays.private combinators combinators.short-circuit calendar.holidays.private combinators combinators.short-circuit
fry kernel lexer math namespaces parser sequences shuffle fry kernel lexer math namespaces parser sequences
vocabs words ; vocabs words ;
IN: calendar.holidays.us IN: calendar.holidays.us

View File

@ -3,7 +3,8 @@
USING: accessors furnace.actions furnace.redirection USING: accessors furnace.actions furnace.redirection
html.forms http http.server http.server.dispatchers html.forms http http.server http.server.dispatchers
io.directories io.encodings.utf8 io.files io.pathnames io.directories io.encodings.utf8 io.files io.pathnames
kernel math.parser multiline namespaces sequences urls ; kernel math.parser multiline namespaces sequences urls
math ;
IN: webapps.imagebin IN: webapps.imagebin
TUPLE: imagebin < dispatcher path n ; TUPLE: imagebin < dispatcher path n ;
@ -14,13 +15,13 @@ TUPLE: imagebin < dispatcher path n ;
: next-image-path ( -- path ) : next-image-path ( -- path )
imagebin get imagebin get
[ path>> ] [ n>> number>string ] bi append-path ; [ path>> ] [ [ 1 + ] change-n n>> number>string ] bi append-path ;
M: imagebin call-responder* M: imagebin call-responder*
[ imagebin set ] [ call-next-method ] bi ; [ imagebin set ] [ call-next-method ] bi ;
: move-image ( mime-file -- ) : move-image ( mime-file -- )
next-image-path [ next-image-path dup exists? ] [ drop ] while
[ [ temporary-path>> ] dip move-file ] [ [ temporary-path>> ] dip move-file ]
[ [ filename>> ] dip ".txt" append utf8 set-file-contents ] 2bi ; [ [ filename>> ] dip ".txt" append utf8 set-file-contents ] 2bi ;