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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,604e0f87aa06eab6 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-24 21:48:55 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: amir@iae.nsk.su (Amir Yantimirov) Newsgroups: comp.lang.ada Subject: Re: Imitation is the sincerest form of flattery Date: 24 Mar 2003 21:48:54 -0800 Organization: http://groups.google.com/ Message-ID: <5115eb96.0303242148.57027600@posting.google.com> References: <7eee7v4hpvj0i5s345uonlen5315rhiau8@4ax.com> <4dkea.75440$gi1.38045@nwrdny02.gnilink.net> <5115eb96.0303220201.44527637@posting.google.com> <5115eb96.0303232053.2fcc7d78@posting.google.com> NNTP-Posting-Host: 81.1.215.198 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1048571335 14453 127.0.0.1 (25 Mar 2003 05:48:55 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 25 Mar 2003 05:48:55 GMT Xref: archiver1.google.com comp.lang.ada:35666 Date: 2003-03-25T05:48:55+00:00 List-Id: "Dmitry A. Kazakov" wrote in message news:... >Amir Yantimirov wrote: >> Oops. Sorry. Anyway, the idea is type functionality may be extended >> freely so it don't have to be specified in type declaration. > If nothing specified then nothing can be checked at compile time. There are > languages like SmallTalk for this, they have their place, but of little > interest. Because the real challenge is: to check as much as possible, > giving up as little as we can. Not that. I propose something alike this: type TFoo = record ... end record; procedure Bar ( Baz : in out TFoo); with TFoo: 'First = 1; 'Last = 32; [].Read = ReadBits; [].Write = WriteBits; end with; begin Baz[40] := 0; -- compile error! > > Fine. But what's the gain? I rarely needs any _polymorphic_ feature > > for such types above "this type is distinct four-byte thing". > > And what is lost? You need no class-wide objects? Declare them specific! > > BTW, Boolean is an enumeration type, check google, and you'll find periodic > discussions in c.l.a concerning "extensionable" enumeration types: > > type Four_State_Logical is new Boolean with (Uncertain, Contradictory); Different levels of abstraction needs different solutions. So I argue only that ALL types should be tagged. Amir Yantimirov http://www174.pair.com/yamir/programming/