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.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no 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 10:30:04 PST Path: supernews.google.com!sn-xit-03!supernews.com!news!news.he.net!news-peer.gip.net!news.gsl.net!gip.net!newsfeed.cwix.com!isdnet!psinet-france!psiuk-f4!psiuk-p4!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: User define attributes Date: Mon, 16 Apr 2001 13:08:33 -0400 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: <9bf8uj$7e9$1@nh.pace.co.uk> 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> <3ADB1BAA.6F4E0437@gsde.hou.us.ray.com> NNTP-Posting-Host: 136.170.200.133 X-Trace: nh.pace.co.uk 987440915 7625 136.170.200.133 (16 Apr 2001 17:08:35 GMT) X-Complaints-To: newsmaster@pace.co.uk NNTP-Posting-Date: 16 Apr 2001 17:08:35 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: supernews.google.com comp.lang.ada:6920 Date: 2001-04-16T17:08:35+00:00 List-Id: It seems reasonable to me to say that if you have to provide a translation of a compound type into some stream of bytes (degenerating to the collective internal representations of the primitive types plus index/discriminant info) that adding a similar character representation ought to be near trivial. When you get down to the bottom layer, instead of binary, you translate to ASCII. Coming back in might be more difficult if you expect the input to be user forgiving, but that shouldn't be any worse than calling the 'Value routines for the primitive types. Or an implementation is free to say that the only thing guaranteed to work is Typename'Value(Typename'Image(X))? Personally, I'd be at least mostly happy if the requirement were to give me a dump of a compound structure from byte zero to byte N (plus the dope information?) in various formats. (ASCII, hex, integer, etc.) This would enable dumping the stuff out for debugging purposes which is usually the reason I'd want a 'Image attribute for them anyway. (Rolling your own isn't hard once you've got the object into a stream, but why not go for a convenience feature?) Most "real" outputs would want to be formatted in far more detail than I could ever expect to get from a 'Image attribute anyway, so I wouldn't need it except as a quick and dirty mechanism to see what is in the structure. It is certainly handy for student-level programs. ('Image and 'Value are a lot easier to explain than Text_IO when you just want to get someone rolling with a "Hello World" program.) Or possibly for outputing a compound object to a text file to be read back in at a later point? But then why not just use Streams? (Maybe there should be a "Typename'Dump (X)" attribute with no requirement other than the implementation provide some kind of human readable text for the contents of X?) MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/ "Samuel T. Harris" wrote in message news:3ADB1BAA.6F4E0437@gsde.hou.us.ray.com... > I believe I asked that very same question here some > years ago. The response I got was the difficulty in > defining such a thing within the language and the > difficulties in implementing it in general. To which > I countered that the very same issues are relevant > to the definition and implementation of streams. > That is as far as the thread went (as far as my > imperfect memory recalls). >