3 ms·
If you had experience in a functional programming language, you'd have recognized this as a fold and written the foldMyStructure function. If your Visitor patte
by gmartres 15y ago
If you had experience in a functional programming language, you'd have recognized this as a fold and written the foldMyStructure function. If your Visitor pattern solution is similar to the example code in https://secure.wikimedia.org/wikipedia/en/wiki/Visitor_pattern https://secure.wikimedia.org/wikipedia/en/wiki/Visitor_patte... then it is certainly longer than the natural solution in functional programming.