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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6689542a60dbcc55,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news3.google.com!proxad.net!feeder1-2.proxad.net!usenet-fr.net!gegeweb.org!aioe.org!not-for-mail From: =?utf-8?Q?Yannick_Duch=C3=AAne_=28Hibou57?= =?utf-8?Q?=29?= Newsgroups: comp.lang.ada Subject: Discriminated records are not the most efficient, but ... Date: Sat, 21 Aug 2010 23:18:35 +0200 Organization: Ada At Home Message-ID: NNTP-Posting-Host: +TrWgxz148iwP+7CHi2Trg.user.speranza.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes Content-Transfer-Encoding: Quoted-Printable X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 User-Agent: Opera Mail/10.61 (Win32) Xref: g2news1.google.com comp.lang.ada:13587 Date: 2010-08-21T23:18:35+02:00 List-Id: Discriminated records are not the most efficient, but ... other ways to = do = are likely to be turned into program logic errors. Fully agree with this (do not like the technique of returning a special = = value to indicate a state, which is a common practice with YouKnowWho). Here is precisely a quote in this area: > Often these tags are folded into the type as "reserved values", > and their occurrence is not consistently checked: this is a fairly > common source of programming errors http://en.wikipedia.org/wiki/Tagged_union (in =E2=80=9CAdvantages and disadvantages=E2=80=9D) Well, this efficiency leak should at least be really weighted (heavy in = = this/that case ? not heavy ?) instead of supposed by reflex. This may be a good =E2=80=9CWarning: suspicious design=E2=80=9D topic to= check for = compilers, but I do not see a way how a compilers could determine such a= = suspicious design is in use (honestly, I have an idea, but prefer not to= = talk about it, because this would requires a bloat in the language). This is an example where, while Ada help, sometime it needs your help in= = return.