1 ! Copyright (C) 2007, 2010 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: parser kernel sequences words effects combinators assocs
4 definitions quotations namespaces memoize accessors
10 : real-macro-effect ( effect -- effect' )
11 in>> { "quot" } <effect> ;
15 : define-macro ( word definition effect -- )
17 [ [ memoize-quot [ call ] append ] keep define-declared ]
18 [ drop "macro" set-word-prop ]
19 [ 2drop changed-effect ]
22 SYNTAX: MACRO: (:) define-macro ;
24 PREDICATE: macro < word "macro" word-prop >boolean ;
26 M: macro make-inline cannot-be-inline ;
28 M: macro definer drop \ MACRO: \ ; ;
30 M: macro definition "macro" word-prop ;
33 [ call-next-method ] [ f "macro" set-word-prop ] bi ;
35 M: macro always-bump-effect-counter? drop t ;