Merge branch 'master' of git://factorcode.org/git/factor
commit
e6eff0adb8
|
@ -33,7 +33,7 @@ ARTICLE: { "lists.lazy" "construction" } "Constructing lazy lists"
|
||||||
{ $subsection 1lazy-list }
|
{ $subsection 1lazy-list }
|
||||||
{ $subsection 2lazy-list }
|
{ $subsection 2lazy-list }
|
||||||
{ $subsection 3lazy-list }
|
{ $subsection 3lazy-list }
|
||||||
{ $subsection seq>list }
|
{ $subsection sequence-tail>list }
|
||||||
{ $subsection >list }
|
{ $subsection >list }
|
||||||
{ $subsection lfrom } ;
|
{ $subsection lfrom } ;
|
||||||
|
|
||||||
|
@ -105,15 +105,15 @@ HELP: lfrom
|
||||||
{ $values { "n" "an integer" } { "list" "a lazy list of integers" } }
|
{ $values { "n" "an integer" } { "list" "a lazy list of integers" } }
|
||||||
{ $description "Return an infinite lazy list of incrementing integers starting from n." } ;
|
{ $description "Return an infinite lazy list of incrementing integers starting from n." } ;
|
||||||
|
|
||||||
HELP: seq>list
|
HELP: sequence-tail>list
|
||||||
{ $values { "index" "an integer 0 or greater" } { "seq" "a sequence" } { "list" "a list" } }
|
{ $values { "index" "an integer 0 or greater" } { "seq" "a sequence" } { "list" "a list" } }
|
||||||
{ $description "Convert the sequence into a list, starting from " { $snippet "index" } "." }
|
{ $description "Convert the sequence into a list, starting from " { $snippet "index" } "." }
|
||||||
{ $see-also >list } ;
|
{ $see-also >list } ;
|
||||||
|
|
||||||
HELP: >list
|
HELP: >list
|
||||||
{ $values { "object" "an object" } { "list" "a list" } }
|
{ $values { "object" "an object" } { "list" "a list" } }
|
||||||
{ $description "Convert the object into a list. Existing lists are passed through intact, sequences are converted using " { $link seq>list } " and other objects cause an error to be thrown." }
|
{ $description "Convert the object into a list. Existing lists are passed through intact, sequences are converted using " { $link sequence-tail>list } " and other objects cause an error to be thrown." }
|
||||||
{ $see-also seq>list } ;
|
{ $see-also sequence-tail>list } ;
|
||||||
|
|
||||||
{ leach foldl lazy-map ltake lfilter lappend lfrom lfrom-by lconcat lcartesian-product lcartesian-product* lcomp lcomp* lmerge lwhile luntil } related-words
|
{ leach foldl lazy-map ltake lfilter lappend lfrom lfrom-by lconcat lcartesian-product lcartesian-product* lcomp lcomp* lmerge lwhile luntil } related-words
|
||||||
|
|
||||||
|
|
|
@ -31,10 +31,13 @@ IN: mason.report
|
||||||
write-xml
|
write-xml
|
||||||
] with-file-writer ; inline
|
] with-file-writer ; inline
|
||||||
|
|
||||||
|
: file-tail ( file encoding lines -- seq )
|
||||||
|
[ file-lines ] dip short tail* "\n" join ;
|
||||||
|
|
||||||
:: failed-report ( error file what -- status )
|
:: failed-report ( error file what -- status )
|
||||||
[
|
[
|
||||||
error [ error. ] with-string-writer :> error
|
error [ error. ] with-string-writer :> error
|
||||||
file utf8 file-lines 400 short tail* :> output
|
file utf8 400 file-tail :> output
|
||||||
|
|
||||||
[XML
|
[XML
|
||||||
<h2><-what-></h2>
|
<h2><-what-></h2>
|
||||||
|
|
|
@ -172,7 +172,7 @@ M: or-parser parse ( input parser1 -- list )
|
||||||
#! Return the combined list resulting from the parses
|
#! Return the combined list resulting from the parses
|
||||||
#! of parser1 and parser2 being applied to the same
|
#! of parser1 and parser2 being applied to the same
|
||||||
#! input. This implements the choice parsing operator.
|
#! input. This implements the choice parsing operator.
|
||||||
parsers>> 0 swap seq>list
|
parsers>> sequence>list
|
||||||
[ parse ] with lazy-map lconcat ;
|
[ parse ] with lazy-map lconcat ;
|
||||||
|
|
||||||
: trim-head-slice ( string -- string )
|
: trim-head-slice ( string -- string )
|
||||||
|
|
Loading…
Reference in New Issue