Open scriptum opened 8 years ago
I don't know of a workaround, but the codegen should not emit duplicate assignments.
Same thing with lexim project. Seems that memfiles iterator due to two yields not compatible with macros. More precisely, iterator + several yields + macros = double substitution. Probably, iterators need more attention.
This issue has been automatically marked as stale because it has not had recent activity. If you think it is still a valid issue, write a comment below; otherwise it will be closed. Thank you for your contributions.
I'm trying to understand how to use term-rewriting macros for performance optimization purposes. One interesting thing is hoisting for regular expressions.
Simple example:
In this example Regex object created for every line.
Hoisting could improve performance (idea taken from docs):
Now magic. Take a look at generated C code:
Global variable initialized twice!
But replace
memfiles.open
tosystem.open
:This looks good.
I guess this is because memfiles iterator is more complicated and probable this is not a bug. Is there any workaround?