This question is about a high-level templating language called "Liquid". Why have I tagged it assembly? Because I imagine assembly programmers have more experience with manually handling multiple recursion.
In liquid you can create "Functions" by including a file with certain parameters:
{% include file var1="a" var2="b" %}
So far so good - we can create an effective multiple recursive loop with this if we have a way to return.
Unfortunately, liquid is one of the most handicapped forms of logic I've ever seen. It's barely turing-complete. There are no return values, there is no scope, and the arrays are just strings you can split.
With the multiple recursive function I'm writing, the global variables get clobbered by subcalls. I don't even have a stack to work with here!
If I set a boolean true on a tree node and recurse into lower nodes, if any of the lower nodes (Or subsequent nodes on the same level) set it it will clobber the higher node's active value.
This limits my options somewhat:
- Stuff them in a global variable and stash the variable before calling a subnode
- Oh no! The stash will get clobbered too!
- Some other mysterious logic I've been trying to find but can't.
I'd like the mysterious logic please!
Taking advantage of the fact that active always propagates upwards, there should be some order of operations that accomplishes it correctly, but I've been bashing my head against this for 3 days and I'm having trouble thinking straight.
Here is the code in question though reading that will probably make this more confusing.