[SCUTS][STAX] Macro call in static var initialiser

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

[SCUTS][STAX] Macro call in static var initialiser

laurence taylor
I'm trying to call a macro like so:

public static var tFun : Function1<FunctionTypeSignature, Bool> =  C.f1( F.n(_ = Std.is(_.args, Array) ) );

where C.f1  = function(x:Dynamic):Function1<Dynamic,Dynamic>{ return x;}; //coerces input to Function1
and FunctionTypeSignature = { args : Array<FunctionParameter>, ret : Type };

and Function1 is in [STAX] Prelude

even if I do :  F.n(_ = true)

I get:

macro/F.hx:109: characters 11-114 : Invalid field access : call

Is this a library issue? or a platform issue?

regards,
Laurence

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

Re: [SCUTS][STAX] Macro call in static var initialiser

laurence taylor
Ok, haxe is trying to initialise the function before the cache of F, so is there any way to influence the order of initialisation of static vars?

On Sun, Jun 12, 2011 at 1:52 PM, laurence taylor <[hidden email]> wrote:
I'm trying to call a macro like so:

public static var tFun : Function1<FunctionTypeSignature, Bool> =  C.f1( F.n(_ = Std.is(_.args, Array) ) );

where C.f1  = function(x:Dynamic):Function1<Dynamic,Dynamic>{ return x;}; //coerces input to Function1
and FunctionTypeSignature = { args : Array<FunctionParameter>, ret : Type };

and Function1 is in [STAX] Prelude

even if I do :  F.n(_ = true)

I get:

macro/F.hx:109: characters 11-114 : Invalid field access : call

Is this a library issue? or a platform issue?

regards,
Laurence


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

Re: [SCUTS][STAX] Macro call in static var initialiser

Heinz Hölzer-2
In reply to this post by laurence taylor
Hi Laurence,

Can you please post a complete example (without stax if possible) that produces this error.
Do you use the current haxelib version of scuts or current svn version?

thx,
heinz

Am 12.06.2011 13:52, schrieb laurence taylor:
I'm trying to call a macro like so:

public static var tFun : Function1<FunctionTypeSignature, Bool> =  C.f1( F.n(_ = Std.is(_.args, Array) ) );

where C.f1  = function(x:Dynamic):Function1<Dynamic,Dynamic>{ return x;}; //coerces input to Function1
and FunctionTypeSignature = { args : Array<FunctionParameter>, ret : Type };

and Function1 is in [STAX] Prelude

even if I do :  F.n(_ = true)

I get:

macro/F.hx:109: characters 11-114 : Invalid field access : call

Is this a library issue? or a platform issue?

regards,
Laurence


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

Re: [SCUTS][STAX] Macro call in static var initialiser

laurence taylor
To be fair, I'm using it in a macro, I'll post something.

svn btw

2011/6/12 Heinz Hölzer <[hidden email]>
Hi Laurence,

Can you please post a complete example (without stax if possible) that produces this error.
Do you use the current haxelib version of scuts or current svn version?

thx,
heinz

Am 12.06.2011 13:52, schrieb laurence taylor:
I'm trying to call a macro like so:

public static var tFun : Function1<FunctionTypeSignature, Bool> =  C.f1( F.n(_ = Std.is(_.args, Array) ) );

where C.f1  = function(x:Dynamic):Function1<Dynamic,Dynamic>{ return x;}; //coerces input to Function1
and FunctionTypeSignature = { args : Array<FunctionParameter>, ret : Type };

and Function1 is in [STAX] Prelude

even if I do :  F.n(_ = true)

I get:

macro/F.hx:109: characters 11-114 : Invalid field access : call

Is this a library issue? or a platform issue?

regards,
Laurence


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


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

Re: [SCUTS][STAX] Macro call in static var initialiser

laurence taylor
Ok, the redux version doesn't display the same behaviour, so I'm going to assume it is a haxe initialisation issue. I will try and replicate it if I can, and will post.

On Sun, Jun 12, 2011 at 11:55 PM, laurence taylor <[hidden email]> wrote:
To be fair, I'm using it in a macro, I'll post something.

svn btw

2011/6/12 Heinz Hölzer <[hidden email]>
Hi Laurence,

Can you please post a complete example (without stax if possible) that produces this error.
Do you use the current haxelib version of scuts or current svn version?

thx,
heinz

Am 12.06.2011 13:52, schrieb laurence taylor:
I'm trying to call a macro like so:

public static var tFun : Function1<FunctionTypeSignature, Bool> =  C.f1( F.n(_ = Std.is(_.args, Array) ) );

where C.f1  = function(x:Dynamic):Function1<Dynamic,Dynamic>{ return x;}; //coerces input to Function1
and FunctionTypeSignature = { args : Array<FunctionParameter>, ret : Type };

and Function1 is in [STAX] Prelude

even if I do :  F.n(_ = true)

I get:

macro/F.hx:109: characters 11-114 : Invalid field access : call

Is this a library issue? or a platform issue?

regards,
Laurence


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



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