1 IN: xmode.utilities.tests
2 USING: accessors xmode.utilities tools.test xml xml.data kernel
3 strings vectors sequences io.files prettyprint assocs
6 { 1 2 3 4 5 6 7 8 } [ H{ { 3 "hi" } } at ] map-find
10 { 1 2 3 4 5 6 7 8 } [ H{ { 11 "hi" } } at ] map-find
13 TUPLE: company employees type ;
15 : <company> V{ } clone f company boa ;
17 : add-employee employees>> push ;
19 <TAGS: parse-employee-tag
21 TUPLE: employee name description ;
25 { { "name" f (>>name) } { f (>>description) } }
26 init-from-tag swap add-employee ;
30 \ parse-employee-tag see
35 { { "type" >upper (>>type) } }
38 children>> [ tag? ] filter
39 [ parse-employee-tag ] with each ;
44 T{ employee f "Joe" "VP Sales" }
45 T{ employee f "Jane" "CFO" }
50 "resource:basis/xmode/utilities/test.xml"
51 file>xml parse-company-tag