Hiho,
I'd like to make an announcement about a couple of important (or so I
feel) updates I've pushed to haxelib today.
## Leveraging the compiler cache
Because tink was released before macro reification, some if its code
called tink.macro.tools.AST.build which does about the same thing
(plus a couple of handy extras) but is a macro. The resulting
macro-in-macro call would prevent from a lot of tinks code to be
cached. Also there were calls to Std.format, which caused the same
problem.
But from this day forth, tink is fully cachable!
## Expression matching
Once tink became rather good at building expressions (and even more so
after macro reification also made it simpler), one of the remaining
difficulties in writing macros gained importance: traversing/parsing
the AST. Expression matching is the most intuitive and simple way to
do this, and that's what ExprTools.match does as documented here (the
last function of this section at the time of writing):
https://github.com/back2dos/tinkerbell/wiki/tink_macros#wiki-expression_tools_advanced
In fact this was an undocumented feature for quite some time:
https://github.com/back2dos/tinkerbell/commit/d5f34f2ea1729bde9ec49b3ad5a3a99ce7bc3480
The API is now largely final, but if I broke your code, next time
please do not hesitate to ask me before using an undocumented feature
;)
## Extended for loop syntax
After last week's discussion on what I'd summarize as "the limitations
of Haxe for loops", I've now completed the first version of my ideas
for an extended for loop syntax here:
https://github.com/back2dos/tinkerbell/wiki/tink_lang#wiki-for
In a nutshell, you can now easily iterate over multiple targets
simultaneously and you can have numerical loops with arbitrary steps
in both an upward and downward direction.
That's pretty much all for today, except for a couple of minor
enhancements. Thanks for any feedback.
Regards,
Juraj