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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f3687114209e3c2c X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!postnews.google.com!l42g2000yqe.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: Abusing tagged types Date: Fri, 28 Nov 2008 05:28:38 -0800 (PST) Organization: http://groups.google.com Message-ID: <7cca32f3-0815-4564-b83a-d19a0e59b8ab@l42g2000yqe.googlegroups.com> References: <87y6z4cefp.fsf@willow.rfc1149.net> NNTP-Posting-Host: 128.141.45.219 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1227878918 10648 127.0.0.1 (28 Nov 2008 13:28:38 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 28 Nov 2008 13:28:38 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: l42g2000yqe.googlegroups.com; posting-host=128.141.45.219; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.3) Gecko/2008092414 Firefox/3.0.3,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:2831 Date: 2008-11-28T05:28:38-08:00 List-Id: On 28 Lis, 11:50, Samuel Tardieu wrote: > Maciej> The type can be made tagged *only* to get the syntax sugar. > Maciej> Is it considered to be an abuse of the language feature? > > This will increase the memory size of every instance. Even if no > dispatching is used the tag will be stored in each object because > dispatching *could* be used. Let's say that in this case it does not matter anyway. I'm asking about the design principles - the *purpose* of tagged type is to achieve polymorphism with dispatching calls. Is it OK to use tagged type without this motivation? (well, Controlled is also in this category...) By the way - what is the rationale for allowing Obj.Operation only for tagged types and not for all types? "Ada 2005 Rationale" does not seem to explain this. -- Maciej Sobczak * www.msobczak.com * www.inspirel.com Database Access Library for Ada: www.inspirel.com/soci-ada