Suppose I wanted to use some tests from Anarki: (suite cut
(test finds-element-in-list
(assert-same '(3 4 5) (cut '(1 2 3 4 5) 2)))
...)
I'm already using "test" for something else, but I'd like to be able to use the Anarki tests as they are without having to rename all the "test" macros.I could use something like: (anarki-test-suite ; or e.g. zck-unit-test
(suite cut
(test finds-element-in-list
(assert-same '(3 4 5) (cut '(1 2 3 4 5) 2)))
...))
Which would say that within the lexical scope of "anarki-test-suite", "suite" and "test" would refer to Anarki's versions of these macros.The Arc compiler keeps track of lexical variables introduced by "fn", and similarly could keep track of lexical macros introduced by some "lexical-macro" form. (lexical-macro test anarki-test
(test finds-element-in-list ...))
And then "anarki-test" would be evaluated at compile time? Hmm...Meanwhile, anarki-test-suite" would be a plain macro that expanded into the lexical-macro form. Has anyone tried something like this? Any preferred way of being able to introduce lexically scoped macros that you like? |