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

Re: Conversion between types coming soon?

Expand Messages
  • kb0wno
    I was thinking (it is March 1, 2002 for those of you that want to write this date down) about convertion asd generic classes. You would need something like:
    Message 1 of 6 , Mar 1, 2002
      I was thinking (it is March 1, 2002 for those of you that want to
      write this date down) about convertion asd generic classes. You
      would need something like:

      class
      FOO [G -> NUMERIC create default_create, convert {DOUBLE} end]
      ...
      end

      --
      This would allow you to do something like this, without having to
      know the actual conversion's name:

      bar: G is
      do
      Result := 10.0
      end
      -- Ok, it is stupid feature.

      I don't remember seeing this in the generic class description. Of
      course, there would be an "automatic" conversion if the generic
      class conforms to the convert's type (in this case DOUBLE.) I don't
      think that this leads to any confusion, although the rule might be a
      bit complex. The other case (which is the one that I want) should
      be handled by the convert rules. For example:

      length: DOUBLE is
      local
      index: INTEGER
      do
      from
      index := lower
      until
      index > upper
      loop
      Result := Result + (item (index) * item (index))
      index := index + 1
      end

      Result := Result ^ 0.5
      end

      In this case, the compiler needs to check for a convert that G
      conforms to in the class DOUBLE. I don't think that this changes
      anything in the purposal.

      Gary.

      --- In ise_users@y..., "kb0wno" <kb0wno@y...> wrote:
      > I would like to use the purposed "convert" mechanism that has been
      > purposed going to be available soon? I'm writting a VECTOR and
      > MATRIX classes that I hoped would be generic classes that conforms
      > to NUMERIC (figured that it would go nicely with the EiffelOpenGL
      > stuff...although it contains a VECTOR class it is based on DOUBLE
      > only).
      >
      > Thanks for the info,
      > Gary M. Smithrud.
    • David Broadfoot
      ... Actually, it s March 2 here. But why would I want to write it down? It ll be different tomorrow. DB
      Message 2 of 6 , Mar 2, 2002
        > -----Original Message-----
        > From: kb0wno [mailto:kb0wno@...]
        > Sent: Saturday, 2 March 2002 3:39
        > To: ise_users@yahoogroups.com
        > Subject: [ise_users] Re: Conversion between types coming soon?
        >
        > I was thinking (it is March 1, 2002 for those of you that want to
        > write this date down) about convertion asd generic classes. You
        > would need something like:


        Actually, it's March 2 here. But why would I want to write it down? It'll be
        different tomorrow.

        DB
      • Gary Smithrud
        It s a sarcastic (slightly insulting) statement used on people that don t have a thought very often thus the other person wants to remember this amazing event.
        Message 3 of 6 , Mar 2, 2002
          It's a sarcastic (slightly insulting) statement used
          on people that don't have a thought very often thus
          the other person wants to remember this amazing event.
          I think that it is from American TV many years ago.
          Thus, I was just insulting myself. Well, someone has
          to do it.

          Gary.
          PS. Hopefully my label in the group has changed to
          something better than kb0wno.

          --- David Broadfoot <david@...> wrote:
          > > -----Original Message-----
          > > From: kb0wno [mailto:kb0wno@...]
          > > Sent: Saturday, 2 March 2002 3:39
          > > To: ise_users@yahoogroups.com
          > > Subject: [ise_users] Re: Conversion between types
          > coming soon?
          > >
          > > I was thinking (it is March 1, 2002 for those of
          > you that want to
          > > write this date down) about convertion asd generic
          > classes. You
          > > would need something like:
          >
          >
          > Actually, it's March 2 here. But why would I want to
          > write it down? It'll be
          > different tomorrow.
          >
          > DB
          >
          >


          __________________________________________________
          Do You Yahoo!?
          Yahoo! Sports - sign up for Fantasy Baseball
          http://sports.yahoo.com
        • Emmanuel STAPF [ISE]
          ... This is only new proposal and have not been adopted. In the meantime, you have to write your own conversion function for different types of VECTOR or
          Message 4 of 6 , Mar 2, 2002
            > I would like to use the purposed "convert" mechanism that has been
            > purposed going to be available soon? I'm writting a VECTOR and
            > MATRIX classes that I hoped would be generic classes that conforms
            > to NUMERIC (figured that it would go nicely with the EiffelOpenGL
            > stuff...although it contains a VECTOR class it is based on DOUBLE
            > only).

            This is only new proposal and have not been adopted. In the meantime,
            you have to write your own conversion function for different types of
            VECTOR or MATRIX.

            Regards,
            Manu
          • smithrud
            That s too bad...I was hoping (or hopping) that it was further along than that. Oh well. Thanks for the info, Gary. ... been ... conforms ... EiffelOpenGL ...
            Message 5 of 6 , Mar 3, 2002
              That's too bad...I was hoping (or hopping) that it was further along
              than that. Oh well.

              Thanks for the info,
              Gary.

              --- In ise_users@y..., "Emmanuel STAPF [ISE]" <manus@e...> wrote:
              > > I would like to use the purposed "convert" mechanism that has
              been
              > > purposed going to be available soon? I'm writting a VECTOR and
              > > MATRIX classes that I hoped would be generic classes that
              conforms
              > > to NUMERIC (figured that it would go nicely with the
              EiffelOpenGL
              > > stuff...although it contains a VECTOR class it is based on
              DOUBLE
              > > only).
              >
              > This is only new proposal and have not been adopted. In the
              meantime,
              > you have to write your own conversion function for different types
              of
              > VECTOR or MATRIX.
              >
              > Regards,
              > Manu
            Your message has been successfully submitted and would be delivered to recipients shortly.