4 ms·
This example is not very different from an object oriented approach (an opaque interface with a "contains" method). That said, in a functional setting the tail
by ufo 12y ago
This example is not very different from an object oriented approach (an opaque interface with a "contains" method). That said, in a functional setting the tail recursion is great for functions like union and intersect.
- tel 12y agoSure, and functions can feel a lot like OO. I often think of it as though OO were blown apart into all of its constituent parts and those parts were made available. Then, further, those parts "hang together" better than the variety of OO formalisms ever did anyway.