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 } }
|
||||
{ $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
|
||||
"Creating a new circular object:"
|
||||
{ $subsection <circular> }
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Colors as a first-class data type
|
|
@ -64,7 +64,7 @@ HELP: n||-rewrite
|
|||
{ "quot" 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
|
||||
"AND combinators:"
|
||||
{ $subsection 0&& }
|
||||
|
|
|
@ -27,8 +27,9 @@ HELP: ||
|
|||
}
|
||||
} ;
|
||||
|
||||
ARTICLE: "combinators.short-circuit.smart" "combinators.short-circuit.smart"
|
||||
"The " { $vocab-link "combinators.short-circuit.smart" } " vocabulary infers the number of inputs that the sequence of quotations takes." $nl
|
||||
ARTICLE: "combinators.short-circuit.smart" "Smart short-circuit combinators"
|
||||
"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:"
|
||||
{ $subsection && }
|
||||
"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 -- )
|
||||
'[
|
||||
_ [ "," split [ hidden render ] each ] when*
|
||||
nested-forms get " " join f like nested-forms-key hidden-form-field
|
||||
[ modify-form ] each-responder
|
||||
<div "display: none;" =style div>
|
||||
_ [ "," split [ hidden render ] each ] when*
|
||||
nested-forms get " " join f like nested-forms-key hidden-form-field
|
||||
[ modify-form ] each-responder
|
||||
</div>
|
||||
] [code] ;
|
||||
|
||||
: compile-form-attrs ( method action attrs -- )
|
||||
|
@ -109,7 +111,7 @@ CHLOE: form
|
|||
|
||||
STRING: button-tag-markup
|
||||
<t:form class="inline" xmlns:t="http://factorcode.org/chloe/1.0">
|
||||
<button type="submit"></button>
|
||||
<div><button type="submit"></button></div>
|
||||
</t:form>
|
||||
;
|
||||
|
||||
|
@ -120,7 +122,7 @@ CHLOE: button
|
|||
button-tag-markup string>xml body>>
|
||||
{
|
||||
[ [ attrs>> chloe-attrs-only ] dip add-tag-attrs ]
|
||||
[ [ attrs>> non-chloe-attrs-only ] dip "button" tag-named add-tag-attrs ]
|
||||
[ [ children>> ] dip "button" tag-named (>>children) ]
|
||||
[ [ attrs>> non-chloe-attrs-only ] dip "button" deep-tag-named add-tag-attrs ]
|
||||
[ [ children>> ] dip "button" deep-tag-named (>>children) ]
|
||||
[ nip ]
|
||||
} 2cleave compile-chloe-tag ;
|
||||
|
|
|
@ -99,8 +99,12 @@ M: object modify-form drop ;
|
|||
|
||||
: same-host? ( url -- ? )
|
||||
dup [
|
||||
url get
|
||||
[ [ protocol>> ] [ host>> ] [ port>> ] tri 3array ] bi@ =
|
||||
url get [
|
||||
[ protocol>> ]
|
||||
[ host>> ]
|
||||
[ port>> remap-port ]
|
||||
tri 3array
|
||||
] bi@ =
|
||||
] when ;
|
||||
|
||||
: 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 ;
|
||||
|
||||
CHLOE: write-style
|
||||
drop [ <style> write-style </style> ] [code] ;
|
||||
drop [
|
||||
<style "text/css" =type style>
|
||||
write-style
|
||||
</style>
|
||||
] [code] ;
|
||||
|
||||
CHLOE: even
|
||||
[ "index" value even? swap when ] process-children ;
|
||||
|
|
|
@ -123,8 +123,8 @@ DEFER: compile-element
|
|||
|
||||
: compile-prologue ( xml -- )
|
||||
[
|
||||
[ before>> compile-chunk ]
|
||||
[ prolog>> [ write-prolog ] [code-with] ]
|
||||
[ before>> compile-chunk ]
|
||||
bi
|
||||
] compile-quot
|
||||
[ 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
|
||||
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:"
|
||||
{ $subsection smtp-server }
|
||||
{ $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
|
||||
|
||||
[ "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* ;
|
||||
|
||||
: protocol-port ( protocol -- port )
|
||||
{
|
||||
{ "http" [ 80 ] }
|
||||
{ "https" [ 443 ] }
|
||||
{ "feed" [ 80 ] }
|
||||
{ "ftp" [ 21 ] }
|
||||
[ drop f ]
|
||||
} case ;
|
||||
|
||||
<PRIVATE
|
||||
|
||||
: unparse-username-password ( url -- )
|
||||
|
@ -155,13 +164,19 @@ M: string >url
|
|||
% password>> [ ":" % % ] when* "@" %
|
||||
] [ 2drop ] if ;
|
||||
|
||||
: url-port ( url -- port/f )
|
||||
[ port>> ] [ port>> ] [ protocol>> protocol-port ] tri =
|
||||
[ drop f ] when ;
|
||||
|
||||
PRIVATE>
|
||||
|
||||
: unparse-host-part ( url protocol -- )
|
||||
%
|
||||
"://" %
|
||||
{
|
||||
[ unparse-username-password ]
|
||||
[ host>> url-encode % ]
|
||||
[ port>> [ ":" % # ] when* ]
|
||||
[ url-port [ ":" % # ] when* ]
|
||||
[ path>> "/" head? [ "/" % ] unless ]
|
||||
} cleave ;
|
||||
|
||||
|
@ -212,15 +227,6 @@ PRIVATE>
|
|||
[ [ host>> ] [ port>> ] bi <inet> ] [ protocol>> ] bi
|
||||
secure-protocol? [ <secure> ] when ;
|
||||
|
||||
: protocol-port ( protocol -- port )
|
||||
{
|
||||
{ "http" [ 80 ] }
|
||||
{ "https" [ 443 ] }
|
||||
{ "feed" [ 80 ] }
|
||||
{ "ftp" [ 21 ] }
|
||||
[ drop f ]
|
||||
} case ;
|
||||
|
||||
: ensure-port ( url -- url' )
|
||||
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:"
|
||||
{ $subsection nth }
|
||||
{ $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:"
|
||||
{ $subsection set-nth }
|
||||
{ $subsection set-nth-unsafe }
|
||||
|
@ -1283,8 +1285,7 @@ ARTICLE: "virtual-sequences-protocol" "Virtual sequence protocol"
|
|||
|
||||
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" } "."
|
||||
$nl
|
||||
"One current limitation of the virtual sequence protocol is that sequences must be indexed starting at zero." ;
|
||||
{ $subsection "virtual-sequences-protocol" } ;
|
||||
|
||||
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."
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: namespaces assocs sorting sequences kernel accessors
|
||||
hashtables sequences.lib db.types db.tuples db combinators
|
||||
calendar calendar.format math.parser syndication urls xml.writer
|
||||
xmode.catalog validators
|
||||
calendar calendar.format math.parser math.order syndication urls
|
||||
xml.writer xmode.catalog validators
|
||||
html.forms
|
||||
html.components
|
||||
html.templates.chloe
|
||||
|
@ -58,7 +58,9 @@ TUPLE: paste < entity annotations ;
|
|||
swap >>id ;
|
||||
|
||||
: pastes ( -- pastes )
|
||||
f <paste> select-tuples ;
|
||||
f <paste> select-tuples
|
||||
[ [ date>> ] compare ] sort
|
||||
reverse ;
|
||||
|
||||
TUPLE: annotation < entity parent ;
|
||||
|
||||
|
@ -111,7 +113,7 @@ M: annotation entity-url
|
|||
<feed-action>
|
||||
[ pastebin-url ] >>url
|
||||
[ "Factor Pastebin" ] >>title
|
||||
[ pastes <reversed> ] >>entries ;
|
||||
[ pastes ] >>entries ;
|
||||
|
||||
! ! !
|
||||
! PASTES
|
||||
|
|
|
@ -5,9 +5,11 @@
|
|||
<t:title>Pastebin</t:title>
|
||||
|
||||
<table width="100%">
|
||||
<th align="left" width="50%">Summary:</th>
|
||||
<th align="left" width="100">Paste by:</th>
|
||||
<th align="left" width="200">Date:</th>
|
||||
<tr>
|
||||
<th align="left" width="50%">Summary:</th>
|
||||
<th align="left" width="100">Paste by:</th>
|
||||
<th align="left" width="200">Date:</th>
|
||||
</tr>
|
||||
|
||||
<t:bind-each t:name="pastes">
|
||||
<tr>
|
||||
|
|
|
@ -56,11 +56,9 @@
|
|||
|
||||
<t:if t:value="footer">
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<td colspan="2" class="footer">
|
||||
<t:bind t:name="footer">
|
||||
<small>
|
||||
<t:farkup t:name="parsed" t:parsed="true" />
|
||||
</small>
|
||||
<t:farkup t:name="parsed" t:parsed="true" />
|
||||
</t:bind>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -41,7 +41,11 @@
|
|||
.contents {
|
||||
padding: 4px;
|
||||
margin: 4px;
|
||||
border: 1px dashed grey;
|
||||
border: 1px dashed gray;
|
||||
background: #f5f1fd;
|
||||
width: 200px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
font-size: 75%;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue