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,c1fe4bc1dd51fc87 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder1-1.proxad.net!club-internet.fr!feedme-small.clubint.net!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: User-defined type attributes Date: Thu, 13 Mar 2008 20:46:41 -0500 Organization: Jacob's private Usenet server Message-ID: References: <30f629fd-69d3-4d40-995f-9933f52b8dad@s37g2000prg.googlegroups.com> <965suhjl0bxt$.74se2ylyksin.dlg@40tude.net> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1205459483 32546 69.95.181.76 (14 Mar 2008 01:51:23 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 14 Mar 2008 01:51:23 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1914 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1914 Xref: g2news1.google.com comp.lang.ada:20359 Date: 2008-03-13T20:46:41-05:00 List-Id: "Dmitry A. Kazakov" wrote in message news:965suhjl0bxt$.74se2ylyksin.dlg@40tude.net... ... > Why? The only thing you need is formal generic ADTs. Ada's generics lack > ADTs, which is the reason why you need to pass operations together with the > formal types. There exist formal built-in types like "private", "<>", > "digits <>" etc, but there is no user-defined ones. Add these and all > primitive operations will go with the actual type just per magic. It would > be IMO a natural step for anybody who wanted generics to evolve in an > Ada-way. (Not for me, as you know, I prefer generics removed from the > language.) Generic formal derived types are the way to bring an ADT into a generic. After all, they do bring in all of the primitive operations of the ADT. The only problem is that they can't be used on unrelated types, but that's not very relevant if you are using tagged types (and you might as well being doing so if you're defining any sort of composite type). Randy.