Re: Separation of API and implementation



On Wed, 15 Aug 2007 17:11:27 -0400, Daniel T. wrote:

If a particular sub-class of X will only work with a particular subclass
of Y, then this needs to be made explicit in the code. Note, even a
double dispatch system doesn't help if it is an error to connect certain
Xs with certain Ys.

Yes, it is not enough to have MD alone. To detect wrong combinations
statically is a problem. I think we need fresh ideas regarding types
algebra. Presently we have only sets of types (classes) constrained to a
given type (instance). In a parallel hierarchy there is a set of pairs of
types and the constraint is put on the pair.

Maybe the pair of types in foo should be treated as some helper type
forming its own class of pairs (X,Y). Deriving from X should imply an
implicit deriving from the pair (X,Y) and thus require a derivation from Y,
or else an explicit confirmation that old Y is allowed as a member of new
pair. Then for this new pair foo gets overridden. [Just a guess, no more]

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
.



Relevant Pages

  • Re: PL/I, COBOL, Advantages, Equivalence, et al
    ... language construct for defining a type with its own constraints and identity. ... The feature in question is declaring numerical variables with explicit ... To apply another constraint, ...
    (comp.lang.pl1)
  • Re: So whats null then if its not nothing?
    ... Removing NULLs from the results of a DISTINCT ... that's as easy as adding a NOT NULL constraint to the ... > explicit NOT NULL constraint. ... It would "give the DBA the control" ...
    (comp.databases.theory)
  • Re: [slightly OT] ActiveMQ limiting the topic size
    ... Sorry forgot to be explicit in the question: ... #1 how to enforce the max queue/topic size? ... success (the constraint seems to be ignored): ...
    (comp.lang.java.programmer)
  • Re: How to implement nested dictionaries?
    ... "new" constraint is required to always be the last constraint given. ... Sorry -- I should have been more explicit. ... when I move IXMLSerializable to be the first ancestor my references to ... far, IXMLSerializable isn't an ancestor, it's a constraint. ...
    (microsoft.public.dotnet.languages.csharp)