Merge branch 'master' of git://factorcode.org/git/factor
commit
2acf8b5847
|
@ -0,0 +1 @@
|
||||||
|
One-time and recurring events
|
|
@ -0,0 +1 @@
|
||||||
|
Defining multiple words with the same name
|
|
@ -0,0 +1 @@
|
||||||
|
Fast searching of sorted arrays
|
|
@ -0,0 +1 @@
|
||||||
|
An abstraction for enforcing a mutual-exclusion invariant
|
|
@ -43,7 +43,7 @@ HELP: push-growing-circular
|
||||||
{ "elt" object } { "circular" circular } }
|
{ "elt" object } { "circular" circular } }
|
||||||
{ $description "Pushes an element onto a " { $link growing-circular } " object." } ;
|
{ $description "Pushes an element onto a " { $link growing-circular } " object." } ;
|
||||||
|
|
||||||
ARTICLE: "circular" "circular"
|
ARTICLE: "circular" "Circular sequences"
|
||||||
"The " { $vocab-link "circular" } " vocabulary implements the " { $link "sequence-protocol" } " to allow an arbitrary start index and wrap-around indexing." $nl
|
"The " { $vocab-link "circular" } " vocabulary implements the " { $link "sequence-protocol" } " to allow an arbitrary start index and wrap-around indexing." $nl
|
||||||
"Creating a new circular object:"
|
"Creating a new circular object:"
|
||||||
{ $subsection <circular> }
|
{ $subsection <circular> }
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Colors as a first-class data type
|
|
@ -64,7 +64,7 @@ HELP: n||-rewrite
|
||||||
{ "quot" quotation } }
|
{ "quot" quotation } }
|
||||||
{ $description "A macro that reqrites the code to pass " { $snippet "N" } " parameters from the stack to each OR quotation." } ;
|
{ $description "A macro that reqrites the code to pass " { $snippet "N" } " parameters from the stack to each OR quotation." } ;
|
||||||
|
|
||||||
ARTICLE: "combinators.short-circuit" "combinators.short-circuit"
|
ARTICLE: "combinators.short-circuit" "Short-circuit combinators"
|
||||||
"The " { $vocab-link "combinators.short-circuit" } " vocabulary stops a computation early once a condition is met." $nl
|
"The " { $vocab-link "combinators.short-circuit" } " vocabulary stops a computation early once a condition is met." $nl
|
||||||
"AND combinators:"
|
"AND combinators:"
|
||||||
{ $subsection 0&& }
|
{ $subsection 0&& }
|
||||||
|
|
|
@ -27,8 +27,9 @@ HELP: ||
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ARTICLE: "combinators.short-circuit.smart" "combinators.short-circuit.smart"
|
ARTICLE: "combinators.short-circuit.smart" "Smart short-circuit combinators"
|
||||||
"The " { $vocab-link "combinators.short-circuit.smart" } " vocabulary infers the number of inputs that the sequence of quotations takes." $nl
|
"The " { $vocab-link "combinators.short-circuit.smart" } " vocabulary is similar to " { $vocab-link "combinators.short-circuit" } " except the combinators here infer the number of inputs that the sequence of quotations takes."
|
||||||
|
$nl
|
||||||
"Generalized AND:"
|
"Generalized AND:"
|
||||||
{ $subsection && }
|
{ $subsection && }
|
||||||
"Generalized OR:"
|
"Generalized OR:"
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Slava Pestov
|
|
@ -0,0 +1 @@
|
||||||
|
Ad-hoc evaluation of strings of code
|
|
@ -72,9 +72,11 @@ CHLOE: a
|
||||||
|
|
||||||
: compile-hidden-form-fields ( for -- )
|
: compile-hidden-form-fields ( for -- )
|
||||||
'[
|
'[
|
||||||
_ [ "," split [ hidden render ] each ] when*
|
<div "display: none;" =style div>
|
||||||
nested-forms get " " join f like nested-forms-key hidden-form-field
|
_ [ "," split [ hidden render ] each ] when*
|
||||||
[ modify-form ] each-responder
|
nested-forms get " " join f like nested-forms-key hidden-form-field
|
||||||
|
[ modify-form ] each-responder
|
||||||
|
</div>
|
||||||
] [code] ;
|
] [code] ;
|
||||||
|
|
||||||
: compile-form-attrs ( method action attrs -- )
|
: compile-form-attrs ( method action attrs -- )
|
||||||
|
@ -109,7 +111,7 @@ CHLOE: form
|
||||||
|
|
||||||
STRING: button-tag-markup
|
STRING: button-tag-markup
|
||||||
<t:form class="inline" xmlns:t="http://factorcode.org/chloe/1.0">
|
<t:form class="inline" xmlns:t="http://factorcode.org/chloe/1.0">
|
||||||
<button type="submit"></button>
|
<div><button type="submit"></button></div>
|
||||||
</t:form>
|
</t:form>
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -120,7 +122,7 @@ CHLOE: button
|
||||||
button-tag-markup string>xml body>>
|
button-tag-markup string>xml body>>
|
||||||
{
|
{
|
||||||
[ [ attrs>> chloe-attrs-only ] dip add-tag-attrs ]
|
[ [ attrs>> chloe-attrs-only ] dip add-tag-attrs ]
|
||||||
[ [ attrs>> non-chloe-attrs-only ] dip "button" tag-named add-tag-attrs ]
|
[ [ attrs>> non-chloe-attrs-only ] dip "button" deep-tag-named add-tag-attrs ]
|
||||||
[ [ children>> ] dip "button" tag-named (>>children) ]
|
[ [ children>> ] dip "button" deep-tag-named (>>children) ]
|
||||||
[ nip ]
|
[ nip ]
|
||||||
} 2cleave compile-chloe-tag ;
|
} 2cleave compile-chloe-tag ;
|
||||||
|
|
|
@ -99,8 +99,12 @@ M: object modify-form drop ;
|
||||||
|
|
||||||
: same-host? ( url -- ? )
|
: same-host? ( url -- ? )
|
||||||
dup [
|
dup [
|
||||||
url get
|
url get [
|
||||||
[ [ protocol>> ] [ host>> ] [ port>> ] tri 3array ] bi@ =
|
[ protocol>> ]
|
||||||
|
[ host>> ]
|
||||||
|
[ port>> remap-port ]
|
||||||
|
tri 3array
|
||||||
|
] bi@ =
|
||||||
] when ;
|
] when ;
|
||||||
|
|
||||||
: cookie-client-state ( key request -- value/f )
|
: cookie-client-state ( key request -- value/f )
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
Chris Double
|
||||||
|
Doug Coleman
|
||||||
|
Eduardo Cavazos
|
||||||
|
Slava Pestov
|
|
@ -0,0 +1 @@
|
||||||
|
Generalized stack shufflers and combinators to arbitrary numbers of inputs
|
|
@ -0,0 +1 @@
|
||||||
|
Slava Pestov
|
|
@ -0,0 +1 @@
|
||||||
|
HTML components for form rendering and validation
|
|
@ -0,0 +1 @@
|
||||||
|
web
|
|
@ -0,0 +1 @@
|
||||||
|
Rendering HTML with a familiar look and feel
|
|
@ -0,0 +1 @@
|
||||||
|
web
|
|
@ -0,0 +1 @@
|
||||||
|
Slava Pestov
|
|
@ -0,0 +1 @@
|
||||||
|
HTML form rendering and validation
|
|
@ -0,0 +1 @@
|
||||||
|
web
|
|
@ -1 +1 @@
|
||||||
HTML reader, writer and utilities
|
HTML implementation of formatted output stream protocol
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Slava Pestov
|
|
@ -0,0 +1 @@
|
||||||
|
Slava Pestov
|
|
@ -37,7 +37,11 @@ CHLOE: style
|
||||||
] ?if ;
|
] ?if ;
|
||||||
|
|
||||||
CHLOE: write-style
|
CHLOE: write-style
|
||||||
drop [ <style> write-style </style> ] [code] ;
|
drop [
|
||||||
|
<style "text/css" =type style>
|
||||||
|
write-style
|
||||||
|
</style>
|
||||||
|
] [code] ;
|
||||||
|
|
||||||
CHLOE: even
|
CHLOE: even
|
||||||
[ "index" value even? swap when ] process-children ;
|
[ "index" value even? swap when ] process-children ;
|
||||||
|
|
|
@ -123,8 +123,8 @@ DEFER: compile-element
|
||||||
|
|
||||||
: compile-prologue ( xml -- )
|
: compile-prologue ( xml -- )
|
||||||
[
|
[
|
||||||
[ before>> compile-chunk ]
|
|
||||||
[ prolog>> [ write-prolog ] [code-with] ]
|
[ prolog>> [ write-prolog ] [code-with] ]
|
||||||
|
[ before>> compile-chunk ]
|
||||||
bi
|
bi
|
||||||
] compile-quot
|
] compile-quot
|
||||||
[ if-not-nested ] [code] ;
|
[ if-not-nested ] [code] ;
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
XHTML templating engine with extensible compiler and separation of concerns
|
|
@ -0,0 +1 @@
|
||||||
|
web
|
|
@ -1,2 +1,2 @@
|
||||||
Slava Pestov
|
Slava Pestov
|
||||||
Matthew Willis
|
Alex Chapman
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Simple templating engine mixing Factor code with content
|
|
@ -0,0 +1 @@
|
||||||
|
web
|
|
@ -0,0 +1 @@
|
||||||
|
HTML templating engine interface
|
|
@ -0,0 +1 @@
|
||||||
|
web
|
|
@ -0,0 +1 @@
|
||||||
|
Doug Coleman
|
|
@ -0,0 +1 @@
|
||||||
|
Generalization of make for constructing several sequences simultaneously
|
|
@ -0,0 +1 @@
|
||||||
|
collections
|
|
@ -0,0 +1 @@
|
||||||
|
Slava Pestov
|
|
@ -0,0 +1 @@
|
||||||
|
Generic word for converting objects to strings for human consumption
|
|
@ -0,0 +1,2 @@
|
||||||
|
Doug Coleman
|
||||||
|
Slava Pestov
|
|
@ -0,0 +1 @@
|
||||||
|
Random number generator protocol and implementations
|
|
@ -41,7 +41,7 @@ HELP: send-email
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
ARTICLE: "smtp" "SMTP Client Library"
|
ARTICLE: "smtp" "SMTP client library"
|
||||||
"Configuring SMTP:"
|
"Configuring SMTP:"
|
||||||
{ $subsection smtp-server }
|
{ $subsection smtp-server }
|
||||||
{ $subsection smtp-read-timeout }
|
{ $subsection smtp-read-timeout }
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Slava Pestov
|
|
@ -0,0 +1 @@
|
||||||
|
Generic word for converting an object into a brief one-line string
|
|
@ -0,0 +1 @@
|
||||||
|
Utility for defining multiple symbols at a time
|
|
@ -225,3 +225,5 @@ urls [
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
[ "foo#3" ] [ URL" foo" clone 3 >>anchor present ] unit-test
|
[ "foo#3" ] [ URL" foo" clone 3 >>anchor present ] unit-test
|
||||||
|
|
||||||
|
[ "http://www.foo.com/" ] [ "http://www.foo.com:80" >url present ] unit-test
|
||||||
|
|
|
@ -148,6 +148,15 @@ M: string >url
|
||||||
]
|
]
|
||||||
[ url-decode >>anchor ] bi* ;
|
[ url-decode >>anchor ] bi* ;
|
||||||
|
|
||||||
|
: protocol-port ( protocol -- port )
|
||||||
|
{
|
||||||
|
{ "http" [ 80 ] }
|
||||||
|
{ "https" [ 443 ] }
|
||||||
|
{ "feed" [ 80 ] }
|
||||||
|
{ "ftp" [ 21 ] }
|
||||||
|
[ drop f ]
|
||||||
|
} case ;
|
||||||
|
|
||||||
<PRIVATE
|
<PRIVATE
|
||||||
|
|
||||||
: unparse-username-password ( url -- )
|
: unparse-username-password ( url -- )
|
||||||
|
@ -155,13 +164,19 @@ M: string >url
|
||||||
% password>> [ ":" % % ] when* "@" %
|
% password>> [ ":" % % ] when* "@" %
|
||||||
] [ 2drop ] if ;
|
] [ 2drop ] if ;
|
||||||
|
|
||||||
|
: url-port ( url -- port/f )
|
||||||
|
[ port>> ] [ port>> ] [ protocol>> protocol-port ] tri =
|
||||||
|
[ drop f ] when ;
|
||||||
|
|
||||||
|
PRIVATE>
|
||||||
|
|
||||||
: unparse-host-part ( url protocol -- )
|
: unparse-host-part ( url protocol -- )
|
||||||
%
|
%
|
||||||
"://" %
|
"://" %
|
||||||
{
|
{
|
||||||
[ unparse-username-password ]
|
[ unparse-username-password ]
|
||||||
[ host>> url-encode % ]
|
[ host>> url-encode % ]
|
||||||
[ port>> [ ":" % # ] when* ]
|
[ url-port [ ":" % # ] when* ]
|
||||||
[ path>> "/" head? [ "/" % ] unless ]
|
[ path>> "/" head? [ "/" % ] unless ]
|
||||||
} cleave ;
|
} cleave ;
|
||||||
|
|
||||||
|
@ -212,15 +227,6 @@ PRIVATE>
|
||||||
[ [ host>> ] [ port>> ] bi <inet> ] [ protocol>> ] bi
|
[ [ host>> ] [ port>> ] bi <inet> ] [ protocol>> ] bi
|
||||||
secure-protocol? [ <secure> ] when ;
|
secure-protocol? [ <secure> ] when ;
|
||||||
|
|
||||||
: protocol-port ( protocol -- port )
|
|
||||||
{
|
|
||||||
{ "http" [ 80 ] }
|
|
||||||
{ "https" [ 443 ] }
|
|
||||||
{ "feed" [ 80 ] }
|
|
||||||
{ "ftp" [ 21 ] }
|
|
||||||
[ drop f ]
|
|
||||||
} case ;
|
|
||||||
|
|
||||||
: ensure-port ( url -- url' )
|
: ensure-port ( url -- url' )
|
||||||
dup protocol>> '[ _ protocol-port or ] change-port ;
|
dup protocol>> '[ _ protocol-port or ] change-port ;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Slava Pestov
|
|
@ -0,0 +1 @@
|
||||||
|
Value validation for the web framework
|
|
@ -0,0 +1 @@
|
||||||
|
Slava Pestov
|
|
@ -0,0 +1 @@
|
||||||
|
Checksum protocol and implementations
|
|
@ -0,0 +1 @@
|
||||||
|
Slava Pestov
|
|
@ -0,0 +1 @@
|
||||||
|
Factor source code lexer
|
|
@ -0,0 +1 @@
|
||||||
|
Slava Pestov
|
|
@ -0,0 +1 @@
|
||||||
|
Sequence construction utility
|
|
@ -0,0 +1 @@
|
||||||
|
collections
|
|
@ -1258,6 +1258,8 @@ ARTICLE: "sequence-protocol" "Sequence protocol"
|
||||||
"At least one of the following two generic words must have a method for accessing elements; the " { $link sequence } " mixin has default definitions which are mutually recursive:"
|
"At least one of the following two generic words must have a method for accessing elements; the " { $link sequence } " mixin has default definitions which are mutually recursive:"
|
||||||
{ $subsection nth }
|
{ $subsection nth }
|
||||||
{ $subsection nth-unsafe }
|
{ $subsection nth-unsafe }
|
||||||
|
"Note that sequences are always indexed starting from zero."
|
||||||
|
$nl
|
||||||
"At least one of the following two generic words must have a method for storing elements; the " { $link sequence } " mixin has default definitions which are mutually recursive:"
|
"At least one of the following two generic words must have a method for storing elements; the " { $link sequence } " mixin has default definitions which are mutually recursive:"
|
||||||
{ $subsection set-nth }
|
{ $subsection set-nth }
|
||||||
{ $subsection set-nth-unsafe }
|
{ $subsection set-nth-unsafe }
|
||||||
|
@ -1283,8 +1285,7 @@ ARTICLE: "virtual-sequences-protocol" "Virtual sequence protocol"
|
||||||
|
|
||||||
ARTICLE: "virtual-sequences" "Virtual sequences"
|
ARTICLE: "virtual-sequences" "Virtual sequences"
|
||||||
"Virtual sequences allow different ways of accessing a sequence without having to create a new sequence or a new data structure altogether. To do this, they translate the virtual index into a normal index into an underlying sequence using the " { $link "virtual-sequences-protocol" } "."
|
"Virtual sequences allow different ways of accessing a sequence without having to create a new sequence or a new data structure altogether. To do this, they translate the virtual index into a normal index into an underlying sequence using the " { $link "virtual-sequences-protocol" } "."
|
||||||
$nl
|
{ $subsection "virtual-sequences-protocol" } ;
|
||||||
"One current limitation of the virtual sequence protocol is that sequences must be indexed starting at zero." ;
|
|
||||||
|
|
||||||
ARTICLE: "sequences-integers" "Integer sequences and counted loops"
|
ARTICLE: "sequences-integers" "Integer sequences and counted loops"
|
||||||
"Integers support the sequence protocol in a trivial fashion; a non-negative integer presents its non-negative predecessors as elements. For example, the integer 3, when viewed as a sequence, contains the elements 0, 1, and 2. This is very useful for performing counted loops."
|
"Integers support the sequence protocol in a trivial fashion; a non-negative integer presents its non-negative predecessors as elements. For example, the integer 3, when viewed as a sequence, contains the elements 0, 1, and 2. This is very useful for performing counted loops."
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: namespaces assocs sorting sequences kernel accessors
|
USING: namespaces assocs sorting sequences kernel accessors
|
||||||
hashtables sequences.lib db.types db.tuples db combinators
|
hashtables sequences.lib db.types db.tuples db combinators
|
||||||
calendar calendar.format math.parser syndication urls xml.writer
|
calendar calendar.format math.parser math.order syndication urls
|
||||||
xmode.catalog validators
|
xml.writer xmode.catalog validators
|
||||||
html.forms
|
html.forms
|
||||||
html.components
|
html.components
|
||||||
html.templates.chloe
|
html.templates.chloe
|
||||||
|
@ -58,7 +58,9 @@ TUPLE: paste < entity annotations ;
|
||||||
swap >>id ;
|
swap >>id ;
|
||||||
|
|
||||||
: pastes ( -- pastes )
|
: pastes ( -- pastes )
|
||||||
f <paste> select-tuples ;
|
f <paste> select-tuples
|
||||||
|
[ [ date>> ] compare ] sort
|
||||||
|
reverse ;
|
||||||
|
|
||||||
TUPLE: annotation < entity parent ;
|
TUPLE: annotation < entity parent ;
|
||||||
|
|
||||||
|
@ -111,7 +113,7 @@ M: annotation entity-url
|
||||||
<feed-action>
|
<feed-action>
|
||||||
[ pastebin-url ] >>url
|
[ pastebin-url ] >>url
|
||||||
[ "Factor Pastebin" ] >>title
|
[ "Factor Pastebin" ] >>title
|
||||||
[ pastes <reversed> ] >>entries ;
|
[ pastes ] >>entries ;
|
||||||
|
|
||||||
! ! !
|
! ! !
|
||||||
! PASTES
|
! PASTES
|
||||||
|
|
|
@ -5,9 +5,11 @@
|
||||||
<t:title>Pastebin</t:title>
|
<t:title>Pastebin</t:title>
|
||||||
|
|
||||||
<table width="100%">
|
<table width="100%">
|
||||||
<th align="left" width="50%">Summary:</th>
|
<tr>
|
||||||
<th align="left" width="100">Paste by:</th>
|
<th align="left" width="50%">Summary:</th>
|
||||||
<th align="left" width="200">Date:</th>
|
<th align="left" width="100">Paste by:</th>
|
||||||
|
<th align="left" width="200">Date:</th>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<t:bind-each t:name="pastes">
|
<t:bind-each t:name="pastes">
|
||||||
<tr>
|
<tr>
|
||||||
|
|
|
@ -56,11 +56,9 @@
|
||||||
|
|
||||||
<t:if t:value="footer">
|
<t:if t:value="footer">
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2">
|
<td colspan="2" class="footer">
|
||||||
<t:bind t:name="footer">
|
<t:bind t:name="footer">
|
||||||
<small>
|
<t:farkup t:name="parsed" t:parsed="true" />
|
||||||
<t:farkup t:name="parsed" t:parsed="true" />
|
|
||||||
</small>
|
|
||||||
</t:bind>
|
</t:bind>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
|
@ -41,7 +41,11 @@
|
||||||
.contents {
|
.contents {
|
||||||
padding: 4px;
|
padding: 4px;
|
||||||
margin: 4px;
|
margin: 4px;
|
||||||
border: 1px dashed grey;
|
border: 1px dashed gray;
|
||||||
background: #f5f1fd;
|
background: #f5f1fd;
|
||||||
width: 200px;
|
width: 200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
font-size: 75%;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue