diff --git a/basis/lists/lazy/lazy-tests.factor b/basis/lists/lazy/lazy-tests.factor index 8fb638b856..39f92158a6 100644 --- a/basis/lists/lazy/lazy-tests.factor +++ b/basis/lists/lazy/lazy-tests.factor @@ -35,5 +35,7 @@ IN: lists.lazy.tests [ [ drop ] leach ] must-infer [ lnth ] must-infer +[ { 1 2 3 } ] [ { 1 2 3 4 5 } >list [ 2 > ] luntil list>array ] unit-test + [ ] [ "resource:license.txt" utf8 llines list>array drop ] unit-test [ ] [ "resource:license.txt" utf8 lcontents list>array drop ] unit-test diff --git a/basis/lists/lazy/lazy.factor b/basis/lists/lazy/lazy.factor index 57cacaa494..122a2205dd 100644 --- a/basis/lists/lazy/lazy.factor +++ b/basis/lists/lazy/lazy.factor @@ -111,14 +111,15 @@ C: lazy-until over nil? [ drop ] [ ] if ; M: lazy-until car ( lazy-until -- car ) - cons>> car ; + cons>> car ; M: lazy-until cdr ( lazy-until -- cdr ) - [ quot>> ] [ cons>> unswons ] bi over call( elt -- ? ) - [ 2drop nil ] [ luntil ] if ; + [ [ cons>> cdr ] [ quot>> ] bi ] + [ [ cons>> car ] [ quot>> ] bi call( elt -- ? ) ] bi + [ 2drop nil ] [ luntil ] if ; M: lazy-until nil? ( lazy-until -- ? ) - drop f ; + drop f ; TUPLE: lazy-while cons quot ; @@ -128,13 +129,13 @@ C: lazy-while over nil? [ drop ] [ ] if ; M: lazy-while car ( lazy-while -- car ) - cons>> car ; + cons>> car ; M: lazy-while cdr ( lazy-while -- cdr ) - [ cons>> cdr ] keep quot>> lwhile ; + [ cons>> cdr ] keep quot>> lwhile ; M: lazy-while nil? ( lazy-while -- ? ) - [ car ] keep quot>> call( elt -- ? ) not ; + [ car ] keep quot>> call( elt -- ? ) not ; TUPLE: lazy-filter cons quot ;