imatix / gsl

iMatix GSL code generator
http://www.imatix.com
GNU General Public License v3.0
539 stars 107 forks source link

Accessing scope from macro unclear #110

Closed machinekoder closed 8 years ago

machinekoder commented 8 years ago

Is it possible to access the caller scope of macro? I would like to do something like this:

.macro foo (bar)
.  for field  <-- iterates over outgoing.field at first call
.    foo(name)
.  endfor
.endmacro

.for outgoing
.  foo(name)
.endfor
machinekoder commented 8 years ago

Got it:

.macro foo (scp, bar)
.  for my.scp.field
.    foo(field, name)
.  endfor
.endmacro

.for outgoing
.  foo(outgoing, name)
.endfor