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:38:08 PST Path: supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!netnews.com!xfer02.netnews.com!iad-peer.news.verio.net!news.verio.net!sea-read.news.verio.net.POSTED!not-for-mail Newsgroups: comp.lang.ada From: Brian Rogoff Subject: Re: User define attributes In-Reply-To: <3adb0ba1$1@pull.gecm.com> Message-ID: 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> <3adb0ba1$1@pull.gecm.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Mon, 16 Apr 2001 15:37:03 GMT NNTP-Posting-Host: 206.184.139.136 X-Complaints-To: abuse@verio.net X-Trace: sea-read.news.verio.net 987435423 206.184.139.136 (Mon, 16 Apr 2001 15:37:03 GMT) NNTP-Posting-Date: Mon, 16 Apr 2001 15:37:03 GMT Organization: Verio Xref: supernews.google.com comp.lang.ada:6917 Date: 2001-04-16T15:37:03+00:00 List-Id: On Mon, 16 Apr 2001, Martin Dowie wrote: > 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?.. Given the desire to make array and function call syntax identical, I wonder why there is even an attribute syntax at all, rather than just having function call syntax and system defined functions. I'd much rather just write Image(X) everywhere (but write A[I] for array access :). -- Brian > 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. > > > >