From: daniel szmulewicz <firstname.lastname@example.org>
Subject: Re: The Expression problem
Date: Tue, 30 Aug 2022 21:24:41 +0300 [thread overview]
Message-ID: <CAABPU69g-Qb4EUopv2TT3crN93+V1=vf7sE15D4iPU5c3-0oBQ@mail.gmail.com> (raw)
Message-ID: <20220830182441.D6ITOOhvS4fPehd-TgEWIB70yua5KW-824jh4TzKaA4@z> (raw)
[-- 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 <email@example.com> 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
> > 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
> firstname.lastname@example.org http://per.bothner.com/
next prev parent 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
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 \
* 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).