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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,640b65cbfbab7216 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nac.net!newspeer.monmouth.com!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Ada.Strings.Bounded Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <013e1d52-c25f-49ea-83ef-6ac4860858bf@s13g2000prd.googlegroups.com> <8g2rpvi2ahu0$.1ebsyq5yu1whf.dlg@40tude.net> <9a3ad8ca-9f44-42db-9f7c-c5f9e3ee60f3@w1g2000prd.googlegroups.com> <1jdzw15tbj376$.nyv9yml75wj4$.dlg@40tude.net> <80c6fdca-1a89-4d98-b61d-9a405e57d8e5@s13g2000prd.googlegroups.com> <1wh7cbu67y4wz$.7iu8likx0fct.dlg@40tude.net> <144w648u50r6q.1erjxxu0cplbw.dlg@40tude.net> <611360e0-595c-43a7-b5cb-137a278ec0c1@s13g2000prd.googlegroups.com> <15389tuelo6x6$.1c1a6yixordts$.dlg@40tude.net> <4c1be2a2-0178-4c1f-8c96-526020550f42@w4g2000prd.googlegroups.com> <15514187-d7d0-4650-a058-13ec5684be2c@w5g2000prd.googlegroups.com> Date: Mon, 21 Apr 2008 20:50:16 +0200 Message-ID: <1w2xd1u1j4e5e$.137isx6aepjiu.dlg@40tude.net> NNTP-Posting-Date: 21 Apr 2008 20:50:18 CEST NNTP-Posting-Host: bccb6674.newsspool3.arcor-online.net X-Trace: DXC=ZYL3Q8oobnV\PS5Xo=M[RVMcF=Q^Z^V3X4Fo<]lROoRQ^;5]aA^R6>R]W7P8[[k<1Q[6LHn;2LCV^[ On Mon, 21 Apr 2008 09:35:36 -0700 (PDT), Eric Hughes wrote: > ARM 2.4.1 "Decimal Literals" > has no length limitation on 'numeral'. Hmm, I don't see it saying this. Do you mean that the syntax rule specifies not limit? If so, we have visited this before, that would not prove your point. Putting no explicit limit does not require its absence. Consider German highways, there is no speed limit, alas only at certain places. Should it mean existence of cars moving faster that light? It is legal not to compile [some] legal programs. > On Apr 21, 8:08 am, Robert A Duff >> Universal_integers can be >> implicitly converted to various integer types. > > This was the whole point of the discussion--why such implicit > conversions do not break the type system. It's not like integers are > a tagged type. I don't see any difference, except that the type tag is not stored in (more precisely, cannot be obtained from) the values. >> type My_Int is range 1..100; >> Y : constant My_Int := 1 + 1; -- The "+" of My_Int is called. >> -- Y is of type My_Int. > > Are there other places in Ada when the context of an operation > determines the type of the operands of the function and thus also the > function signature? The context does not define the types. It resolves overloaded symbols. > Context-dependent function selection need not break correctness of a > program, even when there's ambiguity in what function might be > selected (non-deterministic execution). The conditions for this to > work are implicitly present with integer types. I believe it's > possible to make them explicit for arbitrary types. The following program: with Ada.Text_IO; use Ada.Text_IO; procedure Test_Int is type My_Int is range 1..100; function "+" (L, R : My_Int) return My_Int is begin return 10; end "+"; Y : constant My_Int := 1 + 1; begin Put_Line (My_Int'Image (Y)); end Test_Int; illustrates Robert's point. It shall print 10. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de