1 USING: combinators kernel namespaces quotations regexp sequences
2 splitting xml.data xml.traversal ;
5 : implies ( x y -- z ) [ not ] dip or ; inline
7 : tag-init-form ( spec -- quot )
9 { [ dup quotation? ] [ [ object get tag get ] prepose ] }
10 { [ dup length 2 = ] [
12 tag get children>string
13 _ [ execute ] when* object get _ execute
16 { [ dup length 3 = ] [
19 _ [ execute ] when* object get _ execute
24 : with-tag-initializer ( tag obj quot -- )
25 [ object set tag set ] prepose with-scope ; inline
27 MACRO: (init-from-tag) ( specs -- quot )
28 [ tag-init-form ] map concat [ ] like
29 [ with-tag-initializer ] curry ;
31 : init-from-tag ( tag tuple specs -- tuple )
32 over [ (init-from-tag) ] dip ; inline
34 : <?insensitive-regexp> ( string ? -- regexp )
35 ! handle Java style case-insensitive flags
36 "(?i)" pick subseq-start [ drop "(?i)" "" replace t ] when
37 "i" "" ? <optioned-regexp> ;