]> gitweb.factorcode.org Git - factor.git/commitdiff
lists: nothing was using the traverse combinator and it had a stack effect error...
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Mon, 9 Nov 2009 06:54:15 +0000 (00:54 -0600)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Mon, 9 Nov 2009 06:54:15 +0000 (00:54 -0600)
basis/lists/lists-docs.factor
basis/lists/lists.factor

index 7fba57a4bbfb3421dfa998663449df73d29f1600..53fde946872390a1e3b7365477e89994247220f6 100644 (file)
@@ -44,7 +44,6 @@ ARTICLE: { "lists" "combinators" } "Combinators for lists"
     foldl
     foldr
     lmap>array
-    traverse
 } ;
 
 ARTICLE: { "lists" "manipulation" } "Manipulating lists"
@@ -151,12 +150,6 @@ HELP: list>array
 { $values { "list" list } { "array" array } }
 { $description "Convert a list into an array." } ;
 
-HELP: traverse    
-{ $values { "list"  list } { "pred" { $quotation "( list/elt -- ? )" } }
-          { "quot" { $quotation "( list/elt -- result)" } }  { "result" "a new cons object" } }
-{ $description "Recursively traverses the list object, replacing any elements (which can themselves be sublists) that pred" 
- " returns true for with the result of applying quot to." } ;
-
 HELP: list
 { $class-description "The class of lists. All lists are expected to conform to " { $link { "lists" "protocol" } } "." } ;
 
index ddf1ab91098e2e7abab454a4424775fbc4af404b..f3475f960b54077a42142167f7d01a0991e256d5 100644 (file)
@@ -93,11 +93,5 @@ PRIVATE>
 : list>array ( list -- array )  
     [ ] lmap>array ;
 
-:: traverse ( list pred quot: ( list/elt -- result ) -- result )
-    list [| elt |
-        elt dup pred call [ quot call ] when
-        dup list? [ pred quot traverse ] when
-    ] lmap ; inline recursive
-
 INSTANCE: cons list
 INSTANCE: +nil+ list