3 ms·
I think the Visitor example is a mistake. Couldn't you replicate the Clojure version in Java by having a "Formatter" singleton that has a function for each of t
by OmarIsmail 11y ago
I think the Visitor example is a mistake. Couldn't you replicate the Clojure version in Java by having a "Formatter" singleton that has a function for each of the different item type/format type combinations?
- js8 11y agoI don't think so, the whole point is that Clojure will select the correct function dynamically (that's what multiple dispatch is about). In all cases you need 4 different functions (for each type/format combinations).