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=unavailable autolearn_force=no version=3.4.4 Path: border1.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!aioe.org!.POSTED!not-for-mail From: Victor Porton Newsgroups: comp.lang.ada Subject: Re: A bad counterintuitive behaviour of Ada about OO Date: Fri, 08 Aug 2014 13:56:39 +0300 Organization: Aioe.org NNTP Server Message-ID: References: <932kntuq5rrr.8sumwibqrufn.dlg@40tude.net> <1ohy7vnbntskq$.h139ov04mlxu$.dlg@40tude.net> <17wt4z4suijym$.fibkp6sw5itz$.dlg@40tude.net> <1k6qcfme6203h.1jon846ebrywu$.dlg@40tude.net> NNTP-Posting-Host: AnnUDmZwVERVUXyHDyOl5A.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8Bit X-Complaints-To: abuse@aioe.org User-Agent: KNode/4.12.4 X-Notice: Filtered by postfilter v. 0.8.2 Xref: number.nntp.dca.giganews.com comp.lang.ada:188245 Date: 2014-08-08T13:56:39+03:00 List-Id: Dmitry A. Kazakov wrote: > On Fri, 08 Aug 2014 12:01:48 +0200, J-P. Rosen wrote: > >> Le 08/08/2014 11:13, Dmitry A. Kazakov a écrit : >>> How mathematics may not apply to the elementary types like Integer? >> Because computer integers are not the same as mathematical ones, and the >> way they are used are different. > > Interesting, it was always OO proponents' argument that numbers are not > numbers. > >> Moreover, classification is used in mathematics for the theory of >> numbers, which is not relevant to practical usage of numbers. > > Having integers ordered is unpractical? Being them additive has no usage? > >>> Do you propose not to formalize "some features"? This is not how Ada >>> generics work anyway. "Some features" are formalized in Ada through >>> formal generic parameters. The only difference to classes is that >>> classes do that through types, while generics do in an untyped manner. >> >> And those types must be related through inheritance, while generics may >> be instantiated on types that have no conceptual relationship. > > I don't know which relationships are "conceptual" and which are not. > > generic > type Element_Type is private; > with function "<" (Left, Right : Element_Type) return Boolean is <>; > with function "=" (Left, Right : Element_Type) return Boolean is <>; > package Ada.Containers.Ordered_Sets is > > Isn't all types acceptable as Element_Type a "conceptual" class? Making elementary classes would certainly require multiple inheritance (and even "virtual" multiple inheritance, in C++ terms). I think it would be very hard to modify Ada standard to support this. -- Victor Porton - http://portonvictor.org