public inbox for
 help / color / mirror / Atom feed
From: daniel szmulewicz <>
Subject: Re: The Expression problem
Date: Tue, 30 Aug 2022 21:24:41 +0300	[thread overview]
Message-ID: <> (raw)
Message-ID: <20220830182441.D6ITOOhvS4fPehd-TgEWIB70yua5KW-824jh4TzKaA4@z> (raw)
In-Reply-To: <>

[-- Attachment #1: Type: text/plain, Size: 1778 bytes --]

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

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:
> True multiple inheritance is supported.
> --
>         --Per Bothner

  reply	other threads:[~2022-08-30 18:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-29 21:35 daniel szmulewicz
2022-08-29 21:35 ` daniel szmulewicz
2022-08-29 22:11 ` Per Bothner
2022-08-30 18:24   ` daniel szmulewicz [this message]
2022-08-30 18:24     ` daniel szmulewicz
2022-08-30 18:57     ` Per Bothner
2022-08-30 18:57       ` Per Bothner
2022-08-31  7:13       ` Helmut Eller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='' \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).