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 X-Google-Thread: 103376,36a29c2860aff686 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news3.google.com!feeder.news-service.com!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: Properties Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <3b84c8e7-1a51-4a7c-9646-119f1fc51478@s4g2000yql.googlegroups.com> <7c064ffc-8454-471f-bade-62b4309b7290@v19g2000yqa.googlegroups.com> Date: Mon, 29 Nov 2010 09:34:21 +0100 Message-ID: <1f9la9inb7hou.50293r1dkf6h$.dlg@40tude.net> NNTP-Posting-Date: 29 Nov 2010 09:34:21 CET NNTP-Posting-Host: c3b8b262.newsspool1.arcor-online.net X-Trace: DXC=M?Y1WQkkUOD74okIm;?DS@ic==]BZ:afN4Fo<]lROoRA<`=YMgDjhgBd2OU1aaAFVD[6LHn;2LCVN7enW;^6ZC`D\`mfM[68DCCdBUm7KFoM4I X-Complaints-To: usenet-abuse@arcor.de Xref: g2news2.google.com comp.lang.ada:16663 Date: 2010-11-29T09:34:21+01:00 List-Id: On Sun, 28 Nov 2010 11:43:12 -0800 (PST), Shark8 wrote: > On Nov 28, 1:15�am, "Dmitry A. Kazakov" > wrote: >> On Sat, 27 Nov 2010 19:21:55 -0800 (PST), Shark8 wrote: >>> I would like to submit a proposal for future Ada development; namely >>> "Properties." >> >> Instead of properties I would prefer a full abstraction of record, array, >> access, numeric types. E.g. you declare something as a record of certain >> members and privately implement it as another record with other members or >> as anything you like providing operations to read/write the publicly >> declared members. I think it is a more simple and more natural to Ada model >> than properties. > > I'm not sure I see the difference between properties and your "full- > abstraction"; that is to say, aren't properties merely a way of > implementing that sort of abstraction (though with the additional > option of being read-only or write-only)? You want to expose something as a property, I want to hide the implementation making the clients think of the thing in the terms I defined. > Couldn't we have something similar to > > Type Something is record > S : String_Property; > end record; type Something is private record S : String; end record; or type Properly_Designed_Unbounded_String is private array (Positive range <>) of Character; > Or am I completely misunderstanding your intent? > Also, do you have a possible syntax for these abstractions? {it may > help me fully-understand your position.} I would use the word "private" to indicate that the implementation follows in the private part, e.g. type Impossible_In_Ada is private array (Positive range <>) of T'Class; private type Impossible_In_Ada is record ... -- The type is implemented as a record type end record; ... -- Overriding of the array interface operations required Furthermore, I want record, array, access, number be interfaces. I.e. you should be able to hang, for example, a record view on any type you wanted: type S is new T and record Foo : String end record with ...; Note it is not an extension of S with a new member. It is adding an interface making S appear to have the component Foo. The physical implementation might ibe overriding the primitive operation ".Foo" (getter/setter), or indeed an extension (implementation of a component by a component). -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de