]> gitweb.factorcode.org Git - factor.git/commitdiff
Changing vocabs USING: to reflect which words are in lists and lists.lazy
authorJames Cash <james.nvc@gmail.com>
Tue, 3 Jun 2008 20:57:29 +0000 (16:57 -0400)
committerJames Cash <james.nvc@gmail.com>
Tue, 3 Jun 2008 20:57:29 +0000 (16:57 -0400)
extra/globs/globs.factor
extra/lists/lazy/examples/examples.factor
extra/lists/lazy/lazy-docs.factor
extra/lists/lazy/lazy-tests.factor
extra/lists/lists-tests.factor
extra/math/primes/factors/factors.factor
extra/parser-combinators/parser-combinators.factor
extra/project-euler/007/007.factor

index db1921d86dbab209ac7cdc86e049cbf162716528..d131946ffbf18cb5e7b97273e6ef1dddd8359f23 100755 (executable)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2007 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: parser-combinators regexp lists lists.lazy sequences kernel
+USING: parser-combinators regexp lists sequences kernel
 promises strings unicode.case ;
 IN: globs
 
index 844ae31085686e7edd3935f0f17ec5c3c8f8a9fe..9e8fb77439e1ad198783f0246e421040fdf6a779 100644 (file)
@@ -11,5 +11,5 @@ IN: lazy-lists.examples
 : odds 1 lfrom [ 2 mod 1 = ] lfilter ;
 : powers-of-2 1 [ 2 * ] lfrom-by ;
 : ones 1 [ ] lfrom-by ;
-: squares naturals [ dup * ] lmap ;
+: squares naturals [ dup * ] lazy-map ;
 : first-five-squares 5 squares ltake list>array ;
index f410b993175737871d26dd0f2d6c093af7480236..f2b03fe10825e540cfc7eb6f601e18c4de6c8231 100644 (file)
@@ -34,9 +34,9 @@ HELP: lazy-map
 { $values { "list" "a cons object" } { "quot" "a quotation with stack effect ( obj -- X )" } { "result" "resulting cons object" } }
 { $description "Perform a similar functionality to that of the " { $link map } " word, but in a lazy manner. No evaluation of the list elements occurs initially but a " { $link <lazy-map> } " object is returned which conforms to the list protocol. Calling " { $link car } ", " { $link cdr } " or " { $link nil? } " on this will evaluate elements as required." } ;
 
-HELP: lmap-with
+HELP: lazy-map-with
 { $values { "value" "an object" } { "list" "a cons object" } { "quot" "a quotation with stack effect ( obj elt -- X )" } { "result" "resulting cons object" } }
-{ $description "Variant of " { $link lmap } " which pushes a retained object on each invocation of the quotation." } ;
+{ $description "Variant of " { $link lazy-map } " which pushes a retained object on each invocation of the quotation." } ;
 
 HELP: ltake
 { $values { "n" "a non negative integer" } { "list" "a cons object" } { "result" "resulting cons object" } }
@@ -86,7 +86,7 @@ HELP: >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." } 
 { $see-also seq>list } ;
     
-{ leach lreduce lmap lmap-with ltake lfilter lappend lfrom lfrom-by lconcat lcartesian-product lcartesian-product* lcomp lcomp* lmerge lreduce lwhile luntil } related-words
+{ leach lreduce lazy-map lazy-map-with ltake lfilter lappend lfrom lfrom-by lconcat lcartesian-product lcartesian-product* lcomp lcomp* lmerge lreduce lwhile luntil } related-words
 
 HELP: lconcat
 { $values { "list" "a list of lists" } { "result" "a list" } }
index f4bb7b595bfc1e3554e72463db974422ca06349d..5749f94364de35e3d2b0b2694bdbadeb1724dfe9 100644 (file)
@@ -25,5 +25,5 @@ IN: lists.lazy.tests
 ] unit-test
 
 [ { 4 5 6 } ] [ 
-    3 { 1 2 3 } >list [ + ] lmap-with list>array
+    3 { 1 2 3 } >list [ + ] lazy-map-with list>array
 ] unit-test
index 41f2d1d3566d140e68ddac2c38c2316e5015c9b2..718b4bff4e69303c29a8c12ef606d3f198df6e73 100644 (file)
@@ -9,7 +9,7 @@ IN: lists.tests
         T{ cons f 2 
             T{ cons f 3
                 T{ cons f 4
-                T{ cons f f f } } } } } [ 2 + ] map-cons
+                T{ cons f f f } } } } } [ 2 + ] lmap
 ] unit-test
 
 { 10 } [
@@ -17,5 +17,5 @@ IN: lists.tests
         T{ cons f 2 
             T{ cons f 3
                 T{ cons f 4
-                T{ cons f f f } } } } } 0 [ + ] reduce-cons
+                T{ cons f f f } } } } } 0 [ + ] lreduce
 ] unit-test
\ No newline at end of file
index b38a7926d23a7a261fa5fa26773e42f41f40968c..aba7e90bc906da5b1cf6cd7ed7e93742dc649ca2 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (C) 2007 Samuel Tardieu.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: arrays kernel lists lists.lazy math math.primes namespaces sequences ;
+USING: arrays kernel lists math math.primes namespaces sequences ;
 IN: math.primes.factors
 
 <PRIVATE
index 0a7ea49c4c77fc006a237f3c256ae79936a910b6..2414c1ced38ab4d91123f32b4e89ecc18490a407 100755 (executable)
@@ -147,8 +147,8 @@ TUPLE: and-parser parsers ;
             >r parse-result-parsed r>
             [ parse-result-parsed 2array ] keep
             parse-result-unparsed <parse-result>
-        ] lmap-with
-    ] lmap-with lconcat ;
+        ] lazy-map-with
+    ] lazy-map-with lconcat ;
 
 M: and-parser parse ( input parser -- list )
     #! Parse 'input' by sequentially combining the
@@ -171,7 +171,7 @@ M: or-parser parse ( input parser1 -- list )
     #! of parser1 and parser2 being applied to the same
     #! input. This implements the choice parsing operator.
     or-parser-parsers 0 swap seq>list
-    [ parse ] lmap-with lconcat ;
+    [ parse ] lazy-map-with lconcat ;
 
 : left-trim-slice ( string -- string )
     #! Return a new string without any leading whitespace
@@ -216,7 +216,7 @@ M: apply-parser parse ( input parser -- result )
     -rot parse [
         [ parse-result-parsed swap call ] keep
         parse-result-unparsed <parse-result>
-    ] lmap-with ;
+    ] lazy-map-with ;
 
 TUPLE: some-parser p1 ;
 
index 40178c42919dddc22527bb657aa8a598e5602ef0..04686a8328766d133f6ab69558870f3e972e06a7 100644 (file)
@@ -1,6 +1,6 @@
 ! Copyright (c) 2007 Aaron Schaefer.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: lists.lazy math math.primes ;
+USING: lists math math.primes ;
 IN: project-euler.007
 
 ! http://projecteuler.net/index.php?section=problems&id=7