1 ! Copyright (C) 2007 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: strings arrays hashtables assocs sequences
4 xml.writer xml.utilities kernel namespaces ;
6 GENERIC: >plist ( obj -- tag )
8 M: string >plist "string" build-tag ;
11 [ >plist ] map "array" build-tag* ;
14 >alist [ >r "key" build-tag r> >plist ] assoc-map concat
17 : build-plist ( obj -- tag )
18 >plist 1array "plist" build-tag*
19 dup { { "version" "1.0" } } update ;
21 : print-plist ( obj -- )
22 build-plist build-xml print-xml ;