public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* A problem with interfaces
@ 2023-12-19 22:23 Panicz Maciej Godek
  2023-12-19 22:46 ` Per Bothner
  0 siblings, 1 reply; 3+ messages in thread
From: Panicz Maciej Godek @ 2023-12-19 22:23 UTC (permalink / raw)
  To: kawa

[-- 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?

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-12-19 23:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-19 22:23 A problem with interfaces Panicz Maciej Godek
2023-12-19 22:46 ` Per Bothner
2023-12-19 23:24   ` Panicz Maciej Godek

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