Thank you for the prompt response. This reference indeed tells me how to create new classes or extend existing classes. However, I was interested in a way to add functionality without touching existing code. For example, make all instances on the java.lang.String class respond to `foo`, as in (foo "a string") -> "bar". To quote from a paper , "the expression problem (aka the extensibility problem) refers to a fundamental dilemma of programming: to which degree can your application be structured in such a way that both the data model and the set of virtual operations over it can be extended without the need to modify existing code, without the need for code repetition and without runtime type errors." Not all languages have viable solutions to the Expression problem. Clojure and ABCL haved designs that address it, and I was wondering where Kawa is positioned. Kind regards, Daniel On Tue, Aug 30, 2022 at 1:12 AM Per Bothner wrote: > On 8/29/22 14:35, daniel szmulewicz via Kawa wrote: > > > I was wondering what was Kawa's stance regarding the Expression problem, > > ie. extending existing Java classes. > > ABCL provides a mechanism to specialize on Java classes as documented in > > section 4.5.2 of the user manual. Clojure provides defprotocol and > defmulti > > to extend existing types. I skimmed through the Kawa manual and am still > > unsure. I am very curious to hear more from the experts. > > You can definitely extend existing Java classes and inetrfaces. See: > > https://www.gnu.org/software/kawa/Defining-new-classes.html > > True multiple inheritance is supported. > -- > --Per Bothner > per@bothner.com http://per.bothner.com/ >