News for hackers. Stuff that matters.
Re:Don't Implement Unification by Recursion by philzook on Monday October 28, 2024 @03:55PM (#41975462)
I like what I find clearest (a moving target for all sorts of reasons). I typically find recursion clearest for things dealing with terms/ASTs. My coding style usually leans towards comprehensions or fold/map etc rather than loops. That's why I find the loop being clearer for this algorithm surprising.
Re:Don't Implement Unification by Recursion by tines on Monday October 28, 2024 @05:05PM (#41976276)
Same here, the answer is easy for me: recursive algorithms are for recursive data structures.
Re:Don't Implement Unification by Recursion by CodeWriter23 on Monday October 28, 2024 @05:49PM (#41976774)
Calling this out. A loop calling a function in terms of style is roughly the same as a function calling itself.