]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://factorcode.org/git/factor
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 14 Jan 2010 23:22:02 +0000 (17:22 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 14 Jan 2010 23:22:02 +0000 (17:22 -0600)
Conflicts:
core/sequences/sequences-docs.factor

basis/grouping/grouping-docs.factor
basis/math/combinatorics/combinatorics-docs.factor
basis/windows/time/time.factor
core/sequences/sequences-docs.factor
extra/infix/infix-docs.factor

index e1044b0feb0e5ef1bddff64fd1c97ab9b01dc820..2c2fee1d70e79233249c8803478f3652bcb2f97f 100644 (file)
@@ -52,7 +52,7 @@ HELP: <groups>
 { $examples
     { $example
         "USING: arrays kernel prettyprint sequences grouping ;"
-        "9 >array 3 <groups> reverse! concat >array ." "{ 6 7 8 3 4 5 0 1 2 }"
+        "9 iota >array 3 <groups> reverse! concat >array ." "{ 6 7 8 3 4 5 0 1 2 }"
     }
     { $example
         "USING: kernel prettyprint sequences grouping ;"
@@ -67,7 +67,7 @@ HELP: <sliced-groups>
 { $examples
     { $example
         "USING: arrays kernel prettyprint sequences grouping ;"
-        "9 >array 3 <sliced-groups>"
+        "9 iota >array 3 <sliced-groups>"
         "dup [ reverse! drop ] each concat >array ."
         "{ 2 1 0 5 4 3 8 7 6 }"
     }
index 10584f2004da48505c8061ff0b30cddc6bc1c218..ec3cd6ee76c9f96847106d463e918ded20e5dd24 100644 (file)
@@ -31,7 +31,7 @@ HELP: permutation
 { $notes "Permutations are 0-based and a bounds error will be thrown if " { $snippet "n" } " is larger than " { $snippet "seq length factorial 1 -" } "." }
 { $examples
     { $example "USING: math.combinatorics prettyprint ;"
-        "1 3 permutation ." "{ 0 2 1 }" }
+        "1 { 0 1 2 } permutation ." "{ 0 2 1 }" }
     { $example "USING: math.combinatorics prettyprint ;"
         "5 { \"apple\" \"banana\" \"orange\" } permutation ." "{ \"orange\" \"banana\" \"apple\" }" }
 } ;
@@ -41,7 +41,7 @@ HELP: all-permutations
 { $description "Outputs a sequence containing all permutations of " { $snippet "seq" } " in lexicographical order." }
 { $examples
     { $example "USING: math.combinatorics prettyprint ;"
-        "3 all-permutations ." "{ { 0 1 2 } { 0 2 1 } { 1 0 2 } { 1 2 0 } { 2 0 1 } { 2 1 0 } }" }
+        "{ 0 1 2 } all-permutations ." "{ { 0 1 2 } { 0 2 1 } { 1 0 2 } { 1 2 0 } { 2 0 1 } { 2 1 0 } }" }
 } ;
 
 HELP: each-permutation
index dfe12aaf3c21e7147e017400933ac2f33e2c4cbe..904c85200e583509959a70edf683461f5815ed8f 100644 (file)
@@ -8,8 +8,7 @@ IN: windows.time
 : >64bit ( lo hi -- n )
     32 shift bitor ; inline
 
-: windows-1601 ( -- timestamp )
-    1601 1 1 0 0 0 instant <timestamp> ;
+: windows-1601 ( -- timestamp ) 1601 <year-gmt> ;
 
 : FILETIME>windows-time ( FILETIME -- n )
     [ dwLowDateTime>> ] [ dwHighDateTime>> ] bi >64bit ;
index 2b0a07739a305cdfa33cea7bf168de96de53331f..9f570f97d5af49645c975d0b328f05c8fadbafea 100644 (file)
@@ -999,7 +999,7 @@ HELP: pusher
      { "quot" quotation } { "accum" vector } }
 { $description "Creates a new vector to accumulate the values which return true for a predicate.  Returns a new quotation which accepts an object to be tested and stored in the accumulator if the test yields true. The accumulator is left on the stack for convenience." }
 { $example "! Find all the even numbers:" "USING: prettyprint sequences math kernel ;"
-           "10 [ even? ] pusher [ each ] dip ."
+           "10 iota [ even? ] pusher [ each ] dip ."
            "V{ 0 2 4 6 8 }"
 }
 { $notes "Used to implement the " { $link filter } " word. Compare this word with " { $link accumulator } ", which is an unfiltering version." } ;
@@ -1241,7 +1241,7 @@ HELP: binary-reduce
 { $description "Like " { $link reduce } ", but splits the sequence in half recursively until each sequence is small enough, and calls the quotation on these smaller sequences. If the quotation computes values that depend on the size of their input, such as bignum arithmetic, then this algorithm can be more efficient than using " { $link reduce } "." }
 { $examples "Computing factorial:"
     { $example "USING: prettyprint sequences math ;"
-    "40 rest-slice 1 [ * ] binary-reduce ."
+    "40 iota rest-slice 1 [ * ] binary-reduce ."
     "20397882081197443358640281739902897356800000000" }
 } ;
 
index 917480dd3ffe89a276158b4857c4f31fcf2aaf82..9c42bf256b84138e44984a73583ccf02264a5955 100644 (file)
@@ -68,9 +68,9 @@ $nl
 "Please note: in Factor " { $emphasis "fixnums are sequences too." } " If you are not careful with sequence accesses you may introduce subtle bugs:"
 { $example
     "USING: arrays infix locals ;"
-    ":: add-2nd-element ( x y -- res )"
+    ":: add-2nd-elements ( x y -- res )"
     "    [infix x[1] + y[1] infix] ;"
-    "{ 1 2 3 } 5 add-2nd-element ."
+    "{ 1 2 3 } { 0 1 2 3 } add-2nd-elements ."
     "3"
 }
 ;