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: Safety of user-defined operators Date: Sun, 3 Jun 2018 09:58:07 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <5e86db65-84b9-4b5b-9aea-427a658b5ae7@googlegroups.com> NNTP-Posting-Host: CvkHMVp693S8Z+lk11jyqg.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.8.0 X-Notice: Filtered by postfilter v. 0.8.3 Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:52869 Date: 2018-06-03T09:58:07+02:00 List-Id: On 2018-06-03 09:39, G.B. wrote: > On 02.06.18 14:43, Dmitry A. Kazakov wrote: > >> It is semantically problematic because it limits the implementation or >> forces a wrong implementation in case of temporal, volatile, shared >> objects. A special operator would allow implementation via proper >> procedure. >> >> It is analogous to automatic dereferencing and indexing. There will be >> no solution to until these operations will be done via user-defined >> procedure. No number of kludges and obscure helper type will ever >> work. Assignment is no different. >> > > What set of guarantees can user-defined Ada offer, in comparison, > when users will provide those operations to the compiler that are > now guarandteed by the language? (Where to "draw the line"?) > > Example: > > - typed, indexed RAM (array), > > as opposed to > > - typed, indexed data structure (user defined). It is not who provides implementation but what the interface of an array is. The difference is between: Update (Get_Reference (A, I), V) and Update (A, I, V) There is no way #1 can handle all important cases of containers and there is no way to shape #1 in a way acceptable from the software design POV. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de