2

I am writing a DSL using boo and I would like to keep it as DRY as possible. I was wondering if there is any way to reuse nested macro. E.g. in

topmacro1:
    submacro:
        topmacro1['submacro'] = 'defined'

topmacro2:
    submacro:
        topmacro2['submacro'] = 'defined'

The submacro macro just sets a value in the parent macro's hash. Is there any way to avoid redefining submacro in every parrent macro?

Thanks in advance,

Thomas

1 Answers1

0

I think the best you can do is to break out the body of the submacro into a function and simply call that function. That should be DRY enough.

justin.m.chase
  • 13,061
  • 8
  • 52
  • 100