-USING: accessors sequences assocs kernel quotations namespaces
-xml.data xml.traversal combinators macros parser lexer words fry
-regexp ;
+USING: combinators kernel namespaces quotations regexp sequences
+xml.data xml.traversal ;
IN: xmode.utilities
: implies ( x y -- z ) [ not ] dip or ; inline
-: map-find ( seq quot -- result elt )
- [ f ] 2dip
- '[ nip @ dup ] find
- [ [ drop f ] unless ] dip ; inline
-
: tag-init-form ( spec -- quot )
{
{ [ dup quotation? ] [ [ object get tag get ] prepose ] }
: with-tag-initializer ( tag obj quot -- )
[ object set tag set ] prepose with-scope ; inline
-MACRO: (init-from-tag) ( specs -- )
+MACRO: (init-from-tag) ( specs -- quot )
[ tag-init-form ] map concat [ ] like
[ with-tag-initializer ] curry ;