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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Extending a third party tagged type while adding finalization Date: Tue, 5 Dec 2017 22:29:41 +0100 Organization: Aioe.org NNTP Server Message-ID: References: <4db43571-7f86-4e73-8849-c41160927703@googlegroups.com> <6496a10f-c97e-4e42-b295-2478ad464b2f@googlegroups.com> <6106dfe6-c614-4fc1-aace-74bf8d7435e3@googlegroups.com> <24767ee5-cda8-45e4-98d1-7da44757bd40@googlegroups.com> <037e7f02-9149-4648-b7c5-91f67c1c1961@googlegroups.com> NNTP-Posting-Host: sWq1fEaAu/L5fGxxOY76vQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 Content-Language: en-US X-Notice: Filtered by postfilter v. 0.8.2 Xref: reader02.eternal-september.org comp.lang.ada:49391 Date: 2017-12-05T22:29:41+01:00 List-Id: On 2017-12-05 22:09, Randy Brukardt wrote: > "Dmitry A. Kazakov" wrote in message > news:p04d5g$6jd$1@gioia.aioe.org... >> On 2017-12-04 21:54, Randy Brukardt wrote: >> >>> The sort things that can't afford to be controlled are those that aren't >>> really ADTs anyway (think coordinates of a windows). >> >> What? Window coordinates are a perfect example of ADT. There are lots of >> quite specific operations defined on coordinates which are beyond normal >> arithmetic: scaling, rotation, moving, relative to absolute conversions, >> logical to physical conversions, coordinate systems, scalar and vector >> products, coordinate translation ... the list is almost infinite. > > ADT = "abstract data type". And there is nothing "abstract" about > coordinates, where you usually want to use an aggregate of X and Y values to > create them. Just because the type isn't private doesn't mean that you can't > have operations on them (Janus/Ada internally has essentially no private > types, but there sure are a lot of operations :-). I don't know your definition of ADT, but mine is in agreement with Wikipedia: "In computer science, an abstract data type (ADT) is a mathematical model for data types, where a data type is defined by its behavior (semantics) from the point of view of a user of the data, specifically in terms of possible values, possible operations on data of this type, and the behavior of these operations. This contrasts with data structures, which are concrete representations of data, and are the point of view of an implementer, not a user." > The sorts of things that one doesn't want to make controlled also tend to be > the sorts of things that one doesn't want to make private. Ergo, my advice > above. As always, YMMV. Initialization and finalization are properties of ADT only when these are related to its behavior/semantics. The semantics of coordinates does not require the implementation to provide any initialization or finalization beyond default. That does not make it less ADT. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de