Version 1.1 of ais/ai-00260.txt

Unformatted version of ais/ai-00260.txt version 1.1
Other versions for file ais/ai-00260.txt

!standard 13.13.2 (31)          01-02-13 AI95-00260/00
!standard 13.13.2 (34)
!class amendment 01-02-13
!status received 01-02-13
!priority Low
!difficulty Medium
!subject How to replace S'Class'Input with custom versions
S'Class'Output writes the tag of an item with String'Output. This routine cannot be replaced, so it is not possible to write the tag in an arbitrary user-defined format (to match an external standard, for example).
A more general problem is that the dispatching accomplished by S'Class'Input cannot be duplicated in normal user code. (If it could, that mechanism could be used to eliminate the problem above by overridding the appropriate operations).
( Ideas needed )
A significant annoyance.
!ACATS test

From: Pascal Obry
Sent: Wednesday, January 31, 2001 3:00 PM


I have a comment/question about an Ada feature. The current implementation
for S'Class'Output seems to be not flexible enough for some job. Let's look at
the definition for 'Class'Ouput:

  29. S'Class'Output

           S'Class'Output denotes a procedure with the following

       30.      procedure S'Class'Output(
                   Stream : access Ada.Streams.Root_Stream_Type'Class;
                   Item   : in T'Class)

       31. First writes the external tag of Item to Stream (by calling
           String'Output(Tags.External_Tag(Item'Tag) - *Note 3.9::.) and
           then dispatches to the subprogram denoted by the Output
           attribute of the specific type identified by the tag.

The problem here is the way the tag is written using String'Output.

My goal was to write (on disk using streams) objects in XML. But this is not
possible because the tag is written with the string's bounds (String'Output) !
So there is some binary data dumped into the XML file !!!

Of course it is possible to write the tag myself, but then it will be just
impossible to read back the object from the disk...

To summarize:
   It is possible to stream an object to disk only in binary format.

It would be nice to be able to control the way the tag is written. I don't
have a proposal for this right now...

I have talked about this issue with my ACT support and we came to the
conclusion that it is just impossible to do what I wanted!

Please let me know if this is clear enough or if you need some more info.


From: Tucker Taft
Sent: Wednesday, January 31, 2001 5:40 PM

It is definitely frustrating that the dispatching performed by
S'Class'Input cannot be duplicated by "normal" user code.  Essentially
one wants to be able to dispatch using an (internal) tag rather
than an object.  Alternatively, one wants to be able to construct
an object with default initialization given a tag.
Some kind of "magic" generic might be defined to provide this
capability, or something similar.  This definitely will require
some head-scratching.


Questions? Ask the ACAA Technical Agent