1 ! Copyright (C) 2010 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors assocs classes.tuple combinators.short-circuit
4 effects.parser fry generalizations gml.runtime kernel
5 kernel.private lexer locals macros namespaces parser
6 prettyprint sequences system words ;
9 TUPLE: macro macro-id timestamp log ;
12 next-macro-id [ 0 ] initialize
15 macros [ H{ } clone ] initialize
19 : <macro> ( -- macro )
21 next-macro-id [ get ] [ inc ] bi >>macro-id
22 nano-count >>timestamp
23 V{ } clone >>log ; inline
25 : save-euler-op ( euler-op -- ) current-macro get log>> push ;
27 MACRO:: log-euler-op ( class def inputs -- )
28 class inputs def inputs '[ [ current-macro get [ _ boa save-euler-op ] [ _ ndrop ] if ] _ _ nbi ] ;
32 (GML:) :> ( word name effect def )
34 name "-record" append create-in :> record-class
35 record-class tuple effect in>> define-tuple-class
37 record-class def effect in>> length
38 '[ _ _ _ log-euler-op ] :> logging-def
40 word name effect logging-def define-gml-primitive