]> gitweb.factorcode.org Git - factor.git/commitdiff
Simplify lazy-append nil? word
authorSamuel Tardieu <sam@rfc1149.net>
Thu, 27 Dec 2007 02:42:19 +0000 (03:42 +0100)
committerSamuel Tardieu <sam@rfc1149.net>
Thu, 27 Dec 2007 02:42:19 +0000 (03:42 +0100)
lazy-append tuples are always built using lappend. If list1 is nil, then
list2 is returned, hence nil? on a lazy-append object is always false.

extra/lazy-lists/lazy-lists.factor

index daf02eef228c8c55c8153b1084776e2715810fc4..c42daabc0508521f68b9771830a70c0305fa2751 100644 (file)
@@ -310,11 +310,7 @@ M: lazy-append cdr ( lazy-append -- cdr )
   lazy-append-list2 lappend ;
 
 M: lazy-append nil? ( lazy-append -- bool )
-  dup lazy-append-list1 nil? [
-    lazy-append-list2 nil?
-  ] [
-    drop f
-  ] if ;
+   drop f ;
 
 M: lazy-append list? ( object -- bool )
   drop t ;