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

RE: RE: Catcall Errors Now?

Expand Messages
  • boxer41a
    I think it is only a POTENTIAL catcall, right? I don t remember why I used NUMERIC, but the postcondition in the multiplication feature, *, in NUMERIC says
    Message 1 of 8 , Sep 18, 2013
    • 0 Attachment

      I think it is only a POTENTIAL catcall, right?


      I don't remember why I used NUMERIC, but the postcondition in the multiplication feature, *, in NUMERIC says nothing about commutative property.  Am I missing something?



      --- In eiffel_software@yahoogroups.com, <eiffel_software@yahoogroups.com> wrote:

      It is a catcall, though, isn't it? I think you are in trouble when your `add' command takes a MATRIX rather than an ARRAY2[DOUBLE]. You are restricting the domain. 


      Also, I don't buy your MATRIX being a NUMERIC. The header comment for NUMERIC say that it is modeled on a commutative ring and matrices do not in general commute under multiplication.  


      Carl




      --- In eiffel_software@yahoogroups.com, <boxer41a@...> wrote:

      Compile time 



      --- In eiffel_software@yahoogroups.com, <eiffel_software@yahoogroups.com> wrote:

      > I just tried version 7.3 on an older project and now I get catcall
      > errors; it will not compile.

      Can you be more specific on the kind of errors you are getting? Compile or runtime errors?

      Thanks,
      Manu

      >
      > Why is this an error now and not a warning?
      >
      > How do I fix this?
      >
      >
      > class MATRIX
      > inherit
      > NUMERIC
      > ARRAY2 [DOUBLE]
      > feature
      > add (other: MATRIX)
      > require
      > same_size: is_same_size (other)
      > do
      > ...
      > put (item (r, c) + other.item (r, c), r, c) <---- catcall
      > on other.item
      > ...
      > end
      >
      >
      >
      >
      >
      >
    • carl94706
      Actually, I m not so sure about whether it is a catcall or not. I was just trying to promote some discussion. Without seeing the rest of your class, it is hard
      Message 2 of 8 , Sep 24, 2013
      • 0 Attachment

        Actually, I'm not so sure about whether it is a catcall or not. I was just trying to promote some discussion. Without seeing the rest of your class, it is hard to tell. If you redefined `item' and say `r' and `c' were NATURAL instead of INTEGER, then I think there would be a catcall since the domain would be restricted. That's a lot of ifs.


        As for NUMERIC, I am only referring to the header comment, which claims a model of a commutative ring, but as you noticed, doesn't seem to enforce that in the contracts. Applying the interface to matrices strikes me as quite complicated, getting divides and quotient to work.


        Carl




        ---In eiffel_software@yahoogroups.com, <boxer41a@...> wrote:

        I think it is only a POTENTIAL catcall, right?


        I don't remember why I used NUMERIC, but the postcondition in the multiplication feature, *, in NUMERIC says nothing about commutative property.  Am I missing something?



        --- In eiffel_software@yahoogroups.com, <eiffel_software@yahoogroups.com> wrote:

        It is a catcall, though, isn't it? I think you are in trouble when your `add' command takes a MATRIX rather than an ARRAY2[DOUBLE]. You are restricting the domain. 


        Also, I don't buy your MATRIX being a NUMERIC. The header comment for NUMERIC say that it is modeled on a commutative ring and matrices do not in general commute under multiplication.  


        Carl




        --- In eiffel_software@yahoogroups.com, <boxer41a@...> wrote:

        Compile time 



        --- In eiffel_software@yahoogroups.com, <eiffel_software@yahoogroups.com> wrote:

        > I just tried version 7.3 on an older project and now I get catcall
        > errors; it will not compile.

        Can you be more specific on the kind of errors you are getting? Compile or runtime errors?

        Thanks,
        Manu

        >
        > Why is this an error now and not a warning?
        >
        > How do I fix this?
        >
        >
        > class MATRIX
        > inherit
        > NUMERIC
        > ARRAY2 [DOUBLE]
        > feature
        > add (other: MATRIX)
        > require
        > same_size: is_same_size (other)
        > do
        > ...
        > put (item (r, c) + other.item (r, c), r, c) <---- catcall
        > on other.item
        > ...
        > end
        >
        >
        >
        >
        >
        >
      Your message has been successfully submitted and would be delivered to recipients shortly.