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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1a52c822fc0dbb23 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.germany.com!newsfeed-0.progon.net!progon.net!uucp.gnuu.de!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Rational for not making cursor tagged in Containers From: Georg Bauhaus In-Reply-To: <1xmzi7newnilp.23m3zze8h9yi.dlg@40tude.net> References: <1176998738.656903.141250@q75g2000hsh.googlegroups.com> <1177010938.200523.325290@p77g2000hsh.googlegroups.com> <1a8y2vakorfhx.225uqh4hifpd$.dlg@40tude.net> <1xmzi7newnilp.23m3zze8h9yi.dlg@40tude.net> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: # Message-Id: <1177066583.5876.30.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1 Date: Fri, 20 Apr 2007 12:56:23 +0200 NNTP-Posting-Date: 20 Apr 2007 11:54:45 CEST NNTP-Posting-Host: 185e83ec.newsspool1.arcor-online.net X-Trace: DXC=AmUTKa6[2MB@Y=h<_c3PkHic==]BZ:afN4Fo<]lROoRAFl8W>\BH3YBDS4AhY:H>IGA:ho7QcPOVC9hgFKLMHh1@I9CeKWl9PKN X-Complaints-To: usenet-abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:15142 Date: 2007-04-20T11:54:45+02:00 List-Id: On Fri, 2007-04-20 at 09:54 +0200, Dmitry A. Kazakov wrote: > In a better language any type could be able implement record interface: > > type Foo is interface record -- This not an implementation! > Mumble : Integer; > end record; > private > type Foo is new Float; -- Implements the record interface > function "Mumble" (X : Foo) return Integer; -- Getter > procedure "Mumble" (X : in out Foo; Value : Integer); -- Setter C# and Eiffel do it this way; I'm almost sure there is a bunch of Lisp macros achieving the same. But I think approaching simple records like this will be a huge mistake in a language like Ada, for the following reason: When a user of your type see the above definition type Foo is interface record ... it means that he or she will *have* to look at the implementation (or hope for extensive documentation): There is no way of knowing whether reading or writing a record component will just move some bits, or try to compute the first prime number of the 1969 lottery on the way. Having programmers implement record abstractions looses all predictability that the LRM can otherwise provide for simple records. We need some simple, fixed, stupid things outside the control of programmers. (More politely, leave some things to a compiler.) And, considering Controlled, forcing *all* types to be derived from this base suffers from the same effects for the same reason. Not every programming team consists of real or even wannabe language designers. But who else has even got a chance of knowing what they are doing to a larger program when implementing the concept of record?