1 ! Copyright (C) 2008 James Cash
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: tools.test lists math ;
8 { 1 2 3 4 5 } seq>list [ 2 + ] lmap list>seq
16 +nil+ } } } } [ 2 + ] lmap>array
24 +nil+ } } } } 0 [ + ] foldl
41 { 1 2 { 3 4 { 5 } } } seq>cons
44 { { 1 2 { 3 4 { 5 } } } } [
45 { 1 2 { 3 4 { 5 } } } seq>cons cons>seq
48 { T{ cons f 2 T{ cons f 3 T{ cons f 4 T{ cons f 5 +nil+ } } } } } [
49 { 1 2 3 4 } seq>cons [ 1+ ] lmap
53 { 1 2 3 4 5 } seq>list 0 [ + ] foldr
57 { 1 2 3 4 5 } seq>list lreverse list>seq
61 { 1 2 3 4 5 } seq>list llength
64 { { 3 4 { 5 6 { 7 } } } } [
65 { 1 2 { 3 4 { 5 } } } seq>cons [ atom? ] [ 2 + ] traverse cons>seq
69 { 1 2 3 } seq>list { 4 5 6 } seq>list lappend list>seq