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 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: If not Ada, what else... Date: Wed, 22 Jul 2015 09:26:56 +0200 Organization: cbb software GmbH Message-ID: References: <87k2u96jms.fsf@jester.gateway.sonic.net> <06f8a6f9-d219-4d40-b9ac-8518e93839bd@googlegroups.com> <87y4io63jy.fsf@jester.gateway.sonic.net> <7a29d3e9-d1bd-4f4a-b1a6-14d3e1a83a4d@googlegroups.com> <87mvz36fen.fsf@jester.gateway.sonic.net> <2215b44f-8a89-47c6-a4c4-52b74d2dac45@googlegroups.com> <9e492c82-868d-43d3-a18a-38274400e337@googlegroups.com> <40184feb-4053-4ac3-8eaa-c3bd9cd8a77c@googlegroups.com> <10272577-945f-4682-85bc-8ad47f3653ae@googlegroups.com> <87si8i81k2.fsf@atmarama.net> <1gsux33dqvjbp$.h0prf7p7g2vn.dlg@40tude.net> <5z82vu617j2h$.ls4rgwlc79r4.dlg@40tude.net> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: 5ZS5s7Q3rAN7MBP/UXLPIQ.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:26961 Date: 2015-07-22T09:26:56+02:00 List-Id: On Tue, 21 Jul 2015 15:55:26 -0700, Jeffrey R. Carter wrote: > On 07/21/2015 02:51 PM, Dmitry A. Kazakov wrote: >> On Tue, 21 Jul 2015 22:06:54 +0100, Simon Wright wrote: >> >>> "Dmitry A. Kazakov" writes: >>>> >>>> Operations do not belong to types. >>> >>> Huh? >> >> function "*" (X : Matrix; Y : Vector) return Vector; >> >> To which type does "*" belong? > > A concept of programming by extension is that operations on extensible types do > belong to a type. Why? Anyway, that does not answer the question. To which type belongs multiplication? > Since you seem to think that every type should be extensible Yes, or shrinkable, or exchangeable. The representation of the type values is an implementation detail. And, from the strong typing POV the value of another type is of another type no matter how you obtained that value. > and all programming should be by extension, Not at all. Programming shall not be focused on the representation of values. > I'd think this concept would be ingrained with you. On the contrary. I don't share this traditional flawed concept that the only classes are ones obtained per extension. That indeed leads to the idea of "true" types/classes and not-so-types, with operations of "true" types belonging to them, and other operations not deserving much attention, well, anything that does not fit the concept, does not exist, right? Ada 83 already had classes of constrained subtypes, like String and String (n..m), like Integer and Positive, like array and its slice etc. They share operations. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de