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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,103b407e8b68350b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-03 02:02:47 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!arclight.uoregon.edu!enews.sgi.com!news.xtra.co.nz!53ab2750!not-for-mail From: "AG" Newsgroups: comp.lang.ada References: <1043773909.385612@master.nyc.kbcfp.com> <1043855067.848326@master.nyc.kbcfp.com> <3OXZ9.85359$Ve4.6306@sccrnsc03> <1043880843.44251@master.nyc.kbcfp.com> <1043938782.244443@master.nyc.kbcfp.com> <25ji3v8n915cnnnaqpjvm4f7i01a66r9pf@4ax.com> <1043949507.331484@master.nyc.kbcfp.com> <1044025336.3067@master.nyc.kbcfp.com> Subject: Re: Anybody in US using ADA ? One silly idea.. X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: Date: Mon, 3 Feb 2003 23:04:39 -0800 NNTP-Posting-Host: 219.88.60.226 X-Complaints-To: newsadmin@xtra.co.nz X-Trace: news.xtra.co.nz 1044266567 219.88.60.226 (Mon, 03 Feb 2003 23:02:47 NZDT) NNTP-Posting-Date: Mon, 03 Feb 2003 23:02:47 NZDT Organization: Xtra Xref: archiver1.google.com comp.lang.ada:33716 Date: 2003-02-03T23:04:39-08:00 List-Id: "Dmitry A. Kazakov" wrote in message news:h96l3vsrtf76akihqdu61r9edeav442eig@4ax.com... > On Fri, 31 Jan 2003 10:02:15 -0500, Hyman Rosen > wrote: > >Why? Since you're converting, what possible relevance is there > >to requiring that the operation be present in both types? > > I do not want flawed implicit type conversions. I want sub- and > supertyping. If an implementation of sub-/supertyping is based on some > conversions, I do not care. > > >> Ada does this. > > > >Really? It does convert-in/convert-out of different types? > >I've never seen that before. Can you show me sample code? > > procedure Query (X : in out Float); > -- The initial value is used as a default > ... > I : Integer := 10; > begin > Query (Float (I)); A bit of an unfortunate example that. A quick twiddle of the code produced this: with ada.text_io; procedure tes is procedure Query (X : in out Float) is begin x := x - 0.5; end; I : Integer := 10; begin Query (Float (I)); ada.text_io.put_line(integer'image(i)); end; The output is "10" of course which isn't surprising but seems to sort of contradict the example's purpose. Not much point in having a conversion like that ...