manual/macros [en]

All languages

Differences between version #15096 and #15118

168a169,186
> ===== Array Reification =====
> 
> **new in haxe 2.11**
> 
> Imagine you have an ''Array<Expr>'' in your macro and want to use it as argument list to a function call. 
> <code haxe>
> var exprArray:Array<Expr> = [macro "foo", macro 2];
> // we want to call someFunc("foo", 2) here
> var myCall = macro someFunc($[exprArray]);
> // note that we are NOT calling someFunc(["foo", 2]) here
> </code>
> 
> The ''$[x]'' notation can be used where an ''Array<Expr>'' is expected. If used in other places, a normal array declaration will be generated:
> 
> <code haxe>
> macro for (i in $[exprArray]) trace(i); // becomes for (i in ["foo", 2])
> </code>
> 
175c193
< Read on to know if you want to learn every bit about Haxe macro possibilities : [[advanced]]
---
> Read on to know if you want to learn every bit about Haxe macro possibilities : [[advanced]]
\ No newline at end of file

	
Ver Date User Action
#15796 2012-12-14 21:18:43 MarcWeber View | Diff
#15795 2012-12-14 15:00:52 JLM View | Diff
#15794 2012-12-14 14:58:43 JLM View | Diff
#15597 2012-10-28 16:07:47 ncannasse View | Diff
#15596 2012-10-28 16:04:09 ncannasse View | Diff
#15595 2012-10-28 15:53:47 ncannasse View | Diff
#15414 2012-08-24 23:50:52 Confidant View | Diff
#15118 2012-07-18 14:13:51 Simn View | Diff
#15096 2012-07-16 19:46:08 JLM View | Diff
#15094 2012-07-16 18:37:31 ncannasse View | Diff
#15092 2012-07-16 18:32:21 ncannasse View | Diff
#15089 2012-07-16 18:14:54 ncannasse View | Diff
#14425 2012-07-14 07:15:41 Confidant View | Diff
#14424 2012-07-14 06:55:36 Confidant View | Diff
#14406 2012-07-10 10:48:58 ncannasse View | Diff
#14363 2012-07-04 18:00:38 ncannasse View | Diff
#14183 2012-05-30 19:53:55 Simn View | Diff
#12651 2012-03-27 16:41:58 Simn View | Diff
#12649 2012-03-27 16:22:13 ncannasse View | Diff
#11950 2011-11-30 12:38:40 JLM Restored to version #10852

Previous | Next