The task doesn't seem too different from that done by File::Find or any other treewalking program.
How about keeping partial solutions on a stack? Backtrack with pop, go forward with push. You could implement that with recursive calls and let the stack be local and mainly implicit in the return conditions.
I don't know if that could be called functional programming. It is pretty much how functional languages work under the hood.After Compline,
Zaxo
In reply to Re: Logic programming without using the RE engine as a crutch
by Zaxo
in thread Logic programming without using the RE engine as a crutch
by diotalevi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |