haxe.Template foreach dynamic function

111 views
Skip to first unread message

theRemix

unread,
Feb 6, 2014, 1:04:28 AM2/6/14
to haxe...@googlegroups.com
I want to create a macro for haxe.Template to 'do something x times' inside of a template.
example:
::foreach $$iterate(3)::
  ::__current__::
::end::

so i've gotten this to work:
$$iterate(3)
// [0,1,2,3]

using this:

private static inline function iterate(resolve : String -> Dynamic, n : Int):Array<Int>
  {
    return [0,1,2,3];
  }

however this won't work.

::foreach $$iterate(3)::

error is

ERR: exception thrown : Unexpected 'false'
Called
from /usr/lib/haxe/std/haxe/Template.hx line 86
Called from a C function

is there something i'm missing?
Message has been deleted

theRemix

unread,
Feb 20, 2014, 3:43:27 PM2/20/14
to haxe...@googlegroups.com
Why was this message deleted?
Reply all
Reply to author
Forward
0 new messages