Loading ...
Sorry, an error occurred while loading the content.

Re: [eiffel-nice-library] COMPARABLE, next step

Expand Messages
  • Peter Horan
    ... Thanks. I ll have to take a look at the catcall definitions again. -- Peter Horan School of Information Technology peter@deakin.edu.au
    Message 1 of 4 , Nov 3, 2002
    • 0 Attachment
      Franck Arnaud wrote:
      >
      > > It is not a catcall if availability is not changed.
      >
      > That's limited to classes with no descendants
      > in the system, for calls correctly statically typed
      > with those descendant-free types, because with
      > 'like Current' availability is always (implicitely
      > if not explicitely) changed when descendants exist.

      Thanks. I'll have to take a look at the catcall definitions again.
      --
      Peter Horan School of Information Technology
      peter@... Deakin University
      +61-3-5227 1234 (Voice) Geelong, Victoria 3217, AUSTRALIA
      +61-3-5227 2028 (FAX) http://www.cm.deakin.edu.au/~peter

      -- The Eiffel guarantee: From specification to implementation
      -- (http://www.cetus-links.org/oo_eiffel.html)
    • Franck Arnaud
      ... That s limited to classes with no descendants in the system, for calls correctly statically typed with those descendant-free types, because with like
      Message 2 of 4 , Nov 3, 2002
      • 0 Attachment
        > It is not a catcall if availability is not changed.

        That's limited to classes with no descendants
        in the system, for calls correctly statically typed
        with those descendant-free types, because with
        'like Current' availability is always (implicitely
        if not explicitely) changed when descendants exist.

        > Can someone remind me of the technical reasons why we cannot say
        > a.is_equal(b: ANY) ?

        We could I guess. It does not remove the catcalls, but
        restricts them to cases where there are explicit
        redefinitions, so allows more valid scenarios (often not
        statically type checked of course).

        On the other hand, it allows creating new broken cases,
        e.g. in PARENT, one could redefine

        is_equal(other:CHILD)

        making a catcall of:
        a_parent.is_equal(another_parent)

        and even:
        a_parent.is_equal (a_parent)

        which becomes a (run-time) type error for
        a PARENT dynamic type, while this would be
        correct in the 'like Current' case.

        (Actually, I'm not really sure such an explicit redefinition
        is not allowed with 'like Current' in the ancestor, but it's
        clearly against the aim of 'like Current', while it's a
        perfectly valid covariant redefinition of an ANY parameter.)

        Another point is that if "like Current" is not useful
        for is_equal, it's hard to think it could be useful for
        anything else, at least as a type for a routine parameter
        (as opposed to function or attribute type). This brings
        us back to the language issue: is_equal is an instance of
        a binary method, and what is the correct idiom or language
        feature to support binary methods is a language question,
        once that question is answered generally, it's easy to
        apply the answer to is_equal (and COMPARABLE).
      • Peter Horan
        ... For some reason, I have always thought of the acronym CAT standing for Changed Availabilty AND Type, whereas it is Changed Availablity OR Type. So, because
        Message 3 of 4 , Nov 3, 2002
        • 0 Attachment
          Peter Horan wrote:
          >
          > Franck Arnaud wrote:
          > >
          > > > It is not a catcall if availability is not changed.
          > >
          > > That's limited to classes with no descendants
          > > in the system, for calls correctly statically typed
          > > with those descendant-free types, because with
          > > 'like Current' availability is always (implicitely
          > > if not explicitely) changed when descendants exist.
          >
          > Thanks. I'll have to take a look at the catcall definitions again.

          For some reason, I have always thought of the acronym CAT standing for Changed
          Availabilty AND Type, whereas it is Changed Availablity OR Type. So, because the
          type changes dynamically because of "like Current" it is a catcall.
          --
          Peter Horan School of Information Technology
          peter@... Deakin University
          +61-3-5227 1234 (Voice) Geelong, Victoria 3217, AUSTRALIA
          +61-3-5227 2028 (FAX) http://www.cm.deakin.edu.au/~peter

          -- The Eiffel guarantee: From specification to implementation
          -- (http://www.cetus-links.org/oo_eiffel.html)
        Your message has been successfully submitted and would be delivered to recipients shortly.