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!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: operation can be dispatching in only one type Date: Fri, 27 Nov 2015 13:58:32 +0100 Organization: A noiseless patient Spider Message-ID: References: <04eb6626-644b-4b16-a329-c35659a9fbe2@googlegroups.com> <1ephv5ugr5mib$.9ehadf3dddct$.dlg@40tude.net> <1nf8wc05tjtvf$.1ctjb9hsr0qsp.dlg@40tude.net> <8132c558-aec2-41f4-8024-4a75a2d497ae@googlegroups.com> <17c8a7kqoxvff.aa1raqev6xlu$.dlg@40tude.net> <75a4c7be-391d-4e5d-9e6e-23607132c943@googlegroups.com> <343b78d1-c1ba-40d3-af80-e18de45f2e3d@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Injection-Date: Fri, 27 Nov 2015 12:56:09 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="45bffd6a911624777cad79aac3181090"; logging-data="2338"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18ZbswxCn0Q1mB4upW/hdCm" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 In-Reply-To: Cancel-Lock: sha1:0ibxw+DdH7uE17NAz8Owkj3CIPM= Xref: news.eternal-september.org comp.lang.ada:28557 Date: 2015-11-27T13:58:32+01:00 List-Id: Le 27/11/2015 09:37, Dmitry A. Kazakov a écrit : >> That's what is called syntactic sugar. (Sugar is pleasant, isn't it? But >> > not in my coffee, no thanks ;-) ) > Why do you use record types at all? It surely is just sugar dust put on a > memory chunk. You certainly could declare Get and Set operations to extract > and set members at the specified memory offsets. No? 1) For types not exported by packages 2) For types exported by packages where you want the structure to be public, like information returned by queries. You don't always need to hide information. And when a construct provides higher abstraction level, it is NOT syntactic sugar. A record provides typing and controls over raw memory. -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00 http://www.adalog.fr