drt24 / gnuprologjava

GNU Prolog for Java
8 stars 5 forks source link

Provide a method for printing arbitrary terms #25

Closed thetrime closed 8 years ago

thetrime commented 8 years ago

This is for issue #24. Possibly this should actually be an abstract method, and AtomTerm, IntegerTerm, and all the rest of them should provide their own implementations, rather than having a large if-then-else involving instanceof operators in TermWriter directly. If you'd like to do that, I suggest you merge this first, then file another issue to track the refactoring

drt24 commented 8 years ago

LGTM.

A refactoring to use an abstract method does sound like it would be better. If you want to do that you are welcome to file an issue and implement it, otherwise we can revisit that next time we need to add a new kind of term.