Merge branch 'master' of git://factorcode.org/git/factor
commit
930ec70c75
|
@ -10,6 +10,10 @@ tools.test kernel namespaces random math.ranges sequences fry ;
|
|||
|
||||
[ f ] [ "X" PH{ { "A" "B" } } at ] unit-test
|
||||
|
||||
! We have to define these first so that they're compiled before
|
||||
! the below hashtables are parsed...
|
||||
<<
|
||||
|
||||
TUPLE: hash-0-a ;
|
||||
|
||||
M: hash-0-a hashcode* 2drop 0 ;
|
||||
|
@ -18,6 +22,8 @@ TUPLE: hash-0-b ;
|
|||
|
||||
M: hash-0-b hashcode* 2drop 0 ;
|
||||
|
||||
>>
|
||||
|
||||
[ ] [
|
||||
PH{ }
|
||||
"a" T{ hash-0-a } rot new-at
|
||||
|
|
|
@ -4,14 +4,14 @@ USING: help.markup help.syntax math sequences kernel ;
|
|||
HELP: new-nth
|
||||
{ $values { "val" object } { "i" integer } { "seq" sequence } { "seq'" sequence } }
|
||||
{ $contract "Persistent analogue of " { $link set-nth } ". Outputs a new sequence with the " { $snippet "i" } "th element replaced by " { $snippet "val" } "." }
|
||||
{ $notes "This operation runs in " { $snippet "O(log_32 n)" } " time on " { $link "persistent.vectors" } " and " { $snippet "O(n)" } " time on all other sequences." } ;
|
||||
{ $notes "This operation runs in " { $snippet "O(log_32 n)" } " time on " { $vocab-link "persistent.vectors" } " and " { $snippet "O(n)" } " time on all other sequences." } ;
|
||||
|
||||
HELP: ppush
|
||||
{ $values { "val" object } { "seq" sequence } { "seq'" sequence } }
|
||||
{ $contract "Persistent analogue of " { $link push } ". Outputs a new sequence with all elements of " { $snippet "seq" } " together with " { $snippet "val" } " added at the end." }
|
||||
{ $notes "This operation runs in amortized " { $snippet "O(1)" } " time on " { $link "persistent.vectors" } " and " { $snippet "O(n)" } " time on all other sequences." } ;
|
||||
{ $notes "This operation runs in amortized " { $snippet "O(1)" } " time on " { $vocab-link "persistent.vectors" } " and " { $snippet "O(n)" } " time on all other sequences." } ;
|
||||
|
||||
HELP: ppop
|
||||
{ $values { "seq" sequence } { "seq'" sequence } }
|
||||
{ $contract "Persistent analogue of " { $link pop* } ". Outputs a new sequence with all elements of " { $snippet "seq" } " except for the final element." }
|
||||
{ $notes "This operation runs in amortized " { $snippet "O(1)" } " time on " { $link "persistent.vectors" } " and " { $snippet "O(n)" } " time on all other sequences." } ;
|
||||
{ $notes "This operation runs in amortized " { $snippet "O(1)" } " time on " { $vocab-link "persistent.vectors" } " and " { $snippet "O(n)" } " time on all other sequences." } ;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
USING: help.markup help.syntax kernel math sequences ;
|
||||
IN: persistent-vectors
|
||||
IN: persistent.vectors
|
||||
|
||||
HELP: PV{
|
||||
{ $syntax "elements... }" }
|
||||
|
@ -12,7 +12,7 @@ HELP: >persistent-vector
|
|||
HELP: persistent-vector
|
||||
{ $class-description "The class of persistent vectors." } ;
|
||||
|
||||
ARTICLE: "persistent-vectors" "Persistent vectors"
|
||||
ARTICLE: "persistent.vectors" "Persistent vectors"
|
||||
"A " { $emphasis "persistent vector" } " differs from an ordinary vector (" { $link "vectors" } ") in that it is immutable, and all operations yield new persistent vectors instead of modifying inputs. Unlike immutable operations on ordinary sequences, persistent vector operations are efficient and run in sub-linear time."
|
||||
$nl
|
||||
"The class of persistent vectors:"
|
||||
|
@ -31,4 +31,4 @@ $nl
|
|||
$nl
|
||||
"This implementation of persistent vectors is based on the " { $snippet "clojure.lang.PersistentVector" } " class from Rich Hickey's Clojure language for the JVM (" { $url "http://clojure.org" } ")." ;
|
||||
|
||||
ABOUT: "persistent-vectors"
|
||||
ABOUT: "persistent.vectors"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
USING: multiline system parser combinators ;
|
||||
USING: eval multiline system combinators ;
|
||||
IN: game-input.backend
|
||||
|
||||
STRING: set-backend-for-macosx
|
||||
|
|
Loading…
Reference in New Issue