1 ! Copyright (C) 2006 Matthew Willis and Chris Double.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: destructors io io.encodings.utf8 io.files kernel lists
4 lists.lazy math sequences tools.test ;
8 { 1 2 3 4 } >list list>array
11 { { { 1 4 } { 1 5 } { 2 4 } { 2 5 } { 3 4 } { 3 5 } } } [
12 { 1 2 3 } >list { 4 5 } >list 2list lcartesian-product* list>array
15 { { { 1 4 } { 1 5 } { 2 4 } { 2 5 } { 3 4 } { 3 5 } } } [
16 { 1 2 3 } >list { 4 5 } >list lcartesian-product list>array
20 { 1 2 3 } >list { 4 5 } >list 2list [ first2 + ] lcomp list>array
24 { 1 2 3 } >list { 4 5 } >list 2list { [ first odd? ] } [ first2 + ] lcomp* list>array
28 3 { 1 2 3 } >list [ + ] with lazy-map list>array
32 5 1 [ 2 * ] lfrom-by ltake list>array
35 [ [ ] lmap ] must-infer
36 [ [ ] lmap>array ] must-infer
37 [ [ drop ] foldr ] must-infer
38 [ [ drop ] foldl ] must-infer
39 [ [ drop ] leach ] must-infer
42 { { 1 2 3 } } [ { 1 2 3 4 5 } >list [ 2 > ] luntil list>array ] unit-test
45 "resource:LICENSE.txt" utf8 <file-reader> [
46 llines list>array drop
50 "resource:LICENSE.txt" utf8 <file-reader> [
51 lcontents list>array drop