comp.lang.ada
 help / color / mirror / Atom feed
From: "Marin David Condic" <marin.condic.auntie.spam@pacemicro.com>
Subject: Re: User define attributes
Date: Mon, 16 Apr 2001 13:08:33 -0400
Date: 2001-04-16T17:08:35+00:00	[thread overview]
Message-ID: <9bf8uj$7e9$1@nh.pace.co.uk> (raw)
In-Reply-To: 3ADB1BAA.6F4E0437@gsde.hou.us.ray.com

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" <u61783@gsde.hou.us.ray.com> 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).
>






  reply	other threads:[~2001-04-16 17:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-14 13:33 User define attributes Ayende Rahien
2001-04-16  7:27 ` Martin Dowie
2001-04-16 11:23   ` Ayende Rahien
2001-04-16 11:37     ` Martin Dowie
2001-04-16 14:35       ` Samuel T. Harris
2001-04-16 15:20         ` Martin Dowie
2001-04-16 15:37           ` Brian Rogoff
2001-04-16 16:19           ` Samuel T. Harris
2001-04-16 17:08             ` Marin David Condic [this message]
2001-04-16 22:00               ` Samuel T. Harris
2001-04-17 12:34                 ` Georg Bauhaus
2001-04-17 20:35                   ` Samuel T. Harris
2001-04-24 21:00                   ` Samuel T. Harris
2001-04-16 17:37             ` Martin Dowie
     [not found]           ` <0tEC6.7646$FY5.638172@www.newsranger.com>
2001-04-16 17:34             ` Martin Dowie
2001-04-18 12:14         ` Marius Amado Alves
2001-04-18 20:50           ` Samuel T. Harris
2001-04-19  1:35             ` Jeffrey Carter
2001-04-19 12:50               ` Samuel T. Harris
2001-04-20 19:08             ` Marius Amado Alves
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox