From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ebbca47c76670bb2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-08-01 07:49:22 PST Newsgroups: comp.lang.ada Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!world!news From: Robert A Duff Subject: Re: Reemergence of predefined equality operator... Sender: news@world.std.com (Mr Usenet Himself) Message-ID: Date: Thu, 1 Aug 2002 14:48:52 GMT References: NNTP-Posting-Host: shell01.theworld.com Organization: The World Public Access UNIX, Brookline, MA X-Newsreader: Gnus v5.7/Emacs 20.7 Xref: archiver1.google.com comp.lang.ada:27572 Date: 2002-08-01T14:48:52+00:00 List-Id: Dale Stanbrough writes: > 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? Well, maybe, but I don't understand your example below. The parameter of Put is a generic formal type, but you have written Natural. If it were Natural, then the reemergence issue would not arise, and ``item mod 10'' means exactly the same as ``Standard."mod" (item, 10)''. If it's a generic formal type, then ``Standard."mod" (item, 10)'' would be illegal. Either way, I don't see the point of Standard."mod". Also, you didn't do anything special for the "<", "+", and "/" shown below, which have the same issue. > 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. A new "mod" is *not* imported by a generic parameter. The generic package we're talking about takes the type, and the "mod" we're talking about is simply the primitive "mod" for that type. The question is, inside the generic, should the primitive "mod" be user-defined if the actual type has one? > Dale - Bob