Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • Your code doesn't follow the answer in the duplicate. You use (.pgreet (BaseClass .)) instead of (.pgreet this)`. There's a huge difference. Commented Dec 14, 2016 at 23:30
  • What is this arg? Isn't it the object of the class Baseclass? If not, (defn greet [this] (.pgreet this)) how do I invoke greet? What do I pass for this arg? Commented Dec 15, 2016 at 4:15
  • No, if you followed the answer given in the other question, this would be an object of a subclass of the class BaseClass. The BaseClass has no pgreet method -- it's the gen-classed on that has a pgreet method. Commented Dec 15, 2016 at 4:23
  • Possible duplicate of How to invoke superclass' method in a Clojure gen-class method? Commented Dec 15, 2016 at 4:25