'Using' macro functions from a class used in a macro.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

'Using' macro functions from a class used in a macro.

laurence taylor
Where does it end?

I'm having real trouble with initialisation order in Macros, goes something like this.

Traits seem like a good idea, so I try to build a library, which includes grabbing Interfaces and including them, only:

The ClassType definition is returned without its fields, even if you Compiler.include it so:

I have to write a parser to grab the files and parse function declarations manually,

so I use Stephans parser thing, but

Statics used in the library are not initialised and Using doesn't seem to work in the context of macros used by functions used in build, even though it works normally.

Does anyone have a description of the bootstrapping behaviour that would make any of this predicatable?

regards
Laurence

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: 'Using' macro functions from a class used in a macro.

Nicolas Cannasse
Le 26/11/2011 13:01, Laurence Taylor a écrit :

> Where does it end?
>
> I'm having real trouble with initialisation order in Macros, goes
> something like this.
>
> Traits seem like a good idea, so I try to build a library, which
> includes grabbing Interfaces and including them, only:
>
> The ClassType definition is returned without its fields, even if you
> Compiler.include it so:
>
> I have to write a parser to grab the files and parse function
> declarations manually,
>
> so I use Stephans parser thing, but
>
> Statics used in the library are not initialised and Using doesn't seem
> to work in the context of macros used by functions used in build, even
> though it works normally.
>
> Does anyone have a description of the bootstrapping behaviour that would
> make any of this predicatable?

statics _should_ be correctly initialized, since all the statics code is
called before the macro is executed.

As for "using-in-macro", there is a reported issue there :
http://code.google.com/p/haxe/issues/detail?id=584

Best,
Nicolas

--
haXe - an open source web programming language
http://haxe.org