[Prev][Next][Index][Thread]

Sealed domain question



If in a library I have the following definitions:

  define open abstract class <base> (<object>) 
  end class <base>;
 
  define class <derived> (<base>)
  end class <derived>;

  define sealed domain make(singleton(<derived>));
  define sealed domain initialize(<derived>);

The module in this library exports <base> and <derived>.

In another library which uses the above module I try:

  define method initialize( o :: <base>, #key) => ()
    // do something
  end method initialize;

With Harlequin Dylan I get a sealed domain error:

  "This method on initialize cannot be added because it is in a domain
   declared sealed in library x."

I know 'initialize' is a sideways definition and is not necessarily
good style but this structure comes up in some code I'm trying to
compile with Harlequin Dylan. Should it be a sealed domain violation
if <base> is open and unsealed?

Chris.



Follow-Ups: