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,7936408ed8296efa X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-16 08:26:05 PST From: "Martin Dowie" Newsgroups: comp.lang.ada References: <9b9g7c$cp6$1@taliesin.netcom.net.uk> <3ada9cf5$1@pull.gecm.com> <9behk1$ik9$1@taliesin.netcom.net.uk> <3adad7ab$1@pull.gecm.com> <3ADB033A.F10344A9@gsde.hou.us.ray.com> Subject: Re: User define attributes Date: Mon, 16 Apr 2001 16:20:13 +0100 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 NNTP-Posting-Host: sg2c11210.dsge.edinbr.gmav.gecm.com Message-ID: <3adb0ba1$1@pull.gecm.com> X-Trace: 16 Apr 2001 16:11:29 GMT, sg2c11210.dsge.edinbr.gmav.gecm.com Path: supernews.google.com!sn-xit-03!supernews.com!news-feed.riddles.org.uk!freenix!isdnet!newsfeed.icl.net!dispose.news.demon.net!demon!btnet-peer0!btnet-feed5!btnet!newreader.ukcore.bt.net!pull.gecm.com!sg2c11210.dsge.edinbr.gmav.gecm.com Xref: supernews.google.com comp.lang.ada:6916 Date: 2001-04-16T16:20:13+01:00 List-Id: been there; done that; got the compiler listing... :-) I suspect there are many companies out there with very similar generics. I suppose we have to ask the question - if it is that easy (and relative to the actual application, it usually is!) then why isn't 'Image for composite types part of the language?.. Samuel T. Harris wrote in message news:3ADB033A.F10344A9@gsde.hou.us.ray.com... > It is trivial to build a generic which implements the a > width, value, and image function for arrays. All it needs > are the width, value, and image functions for the indexes > and composite types. > > It is somewhat harder to build a generic for records > since the "index" are the field names and the composite > function depend upon which field is in use. But it > can be done. > > I routinely write width, value, and image functions > for all my important types. Having these generics > in place, I get these routines with some simple > handler code and a generic instantiations. With them > I get the following advantages ... > > 1. I can easily insert put_line kinds of debug code. > 2. If supported, I can call them within my debugger. > 3. I can defer aggregrate initialization of variables > to file_io during elaboration, and vice-versa.