public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Panicz Maciej Godek <godek.maciek@gmail.com>
To: kawa <kawa@sourceware.org>
Subject: A problem with interfaces
Date: Tue, 19 Dec 2023 23:23:39 +0100	[thread overview]
Message-ID: <CAMFYt2ZHGRRm0nnhWcWqwa4_sGQHeoMEo6Qtf+x769LrtxOd2g@mail.gmail.com> (raw)

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

GRASP is a  fairly large project (over 22k lines of code in 77 files), but
I ran into a problem.

Until recently, I had an interface called Tile in the (editor interfaces
elements) module, defined in the following way:

(define-interface Tile (Element)
  (extent)::Extent)

where define-interface is a macro that would expand to

(define-simple-class Tile (Element) interface: #t
  ((extent)::Extent #!abstract))

The (editor interfaces elements) module imports the module (editor
interfaces painting), and they are used in various places in the project.
Among others, those interfaces are implemented by the Atom class, which is
defined in the (editor types primitive) module (which imports both
aforementioned modules)

I tried refactoring this, by defining  a new interface:

(define-interface Extensive ()
  (extent)::Extent)

in the (editor interfaces painting) module, and changing the definition of
Tile to

(define-interface Tile (Extensive Element))

But when I do this, the system claims that Atom is not Extensive (even
though it implements a sub-interface of the Tile interface). How could that
be?

Also, during compilation I get warnings like this from one of the modules:

*type editor.interfaces.Painter is incompatible with required type
editor.interfaces.Painter.*

How are they supposed to be understood?

             reply	other threads:[~2023-12-19 22:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-19 22:23 Panicz Maciej Godek [this message]
2023-12-19 22:46 ` Per Bothner
2023-12-19 23:24   ` Panicz Maciej Godek

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=CAMFYt2ZHGRRm0nnhWcWqwa4_sGQHeoMEo6Qtf+x769LrtxOd2g@mail.gmail.com \
    --to=godek.maciek@gmail.com \
    --cc=kawa@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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).