comp.lang.ada
 help / color / mirror / Atom feed
From: Dale Stanbrough <dstanbro@bigpond.net.au>
Subject: Re: Reemergence of predefined equality operator...
Date: Thu, 01 Aug 2002 11:14:38 GMT
Date: 2002-08-01T11:14:38+00:00	[thread overview]
Message-ID: <dstanbro-3A1595.21143801082002@news-server.bigpond.net.au> (raw)
In-Reply-To: wcc7kjb1pm8.fsf@shell01.TheWorld.com

Robert A Duff wrote:

> For "=", this seems "obviously" wrong.  But as I pointed out elsewhere,
> the situation for other operators (eg, "mod"), is not so obvious.
> Even if the language were changed, or even if Text_IO.Integer_IO took
> "mod" as an "is <>" parameter as above, it's not clear (to me) what the
> right answer is.

Wouldn't it be appropriate for Text_IO.Integer_IO, if it wants to be
sure of the mod operator it is using, to simply specify it?

E.g.
   
   procedure put (item : natural) is
      zero_char : constant := character'pos ('0');
   begin
      if item < 10 then
         put (character'val (item + zero_char));
      else
         put (item / 10);
         put (Standard."mod" (item, 10));
      end if;
   end;


That way if a new mod was imported via a generic parameter it 
simply wouldn't be used in this case.

Dale



  parent reply	other threads:[~2002-08-01 11:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-31 22:25 Reemergence of predefined equality operator Dale Stanbrough
2002-07-31 22:47 ` Robert A Duff
2002-08-01  1:30   ` Vincent Marciante
2002-08-01 12:06     ` Robert Dewar
2002-08-25 17:46       ` Vincent Marciante
2002-08-25 22:04         ` Robert A Duff
2002-08-01 11:14   ` Dale Stanbrough [this message]
2002-08-01 14:48     ` Robert A Duff
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox