comp.lang.ada
 help / color / mirror / Atom feed
From: "Samuel T. Harris" <u61783@gsde.hou.us.ray.com>
Subject: Re: User define attributes
Date: Mon, 16 Apr 2001 17:00:17 -0500
Date: 2001-04-16T17:00:17-05:00	[thread overview]
Message-ID: <3ADB6B71.386A647E@gsde.hou.us.ray.com> (raw)
In-Reply-To: 9bf8uj$7e9$1@nh.pace.co.uk

Marin David Condic wrote:
> 
> 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))?

My functions, and my original question, dealt with Ada's
aggregate with named notation. Specifically qualified aggregates
where the full type name and a "'" preceeds the aggregate.

> 
> 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?)

Of course, aggregates using named notation have no need for
dope vectors. Record discriminants come first so no problem there.
By using qualified aggregates, even complications introduced by
tagged types are trivially handled.

> 
> 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?)

I don't need "real" outputs. I just want convenient output
for anything I want, in function form suitable to be called
directly from the debugger. By standardizing on Ada aggregate
notation, I can even switch output with source code and source
code as input. I even handle pointers in a portable manner.

One of the inconveniences in my experience with using streams
or other binary representation for transmission is that I
cannot simply use a network sniffer to spoof the contents.
If I'm passing all data packets with textual contents, I can
read what a distributed system is doing with any old spoofer.


-- 
Samuel T. Harris, Principal Engineer
Raytheon, Aerospace Engineering Services
"If you can make it, We can fake it!"



  reply	other threads:[~2001-04-16 22:00 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
2001-04-16 22:00               ` Samuel T. Harris [this message]
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