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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,65f09e2d2d4dad56 X-Google-Attributes: gid103376,public From: tmoran@bix.com Subject: Re: Representation Clauses And Freezing Date: 2000/07/22 Message-ID: #1/1 X-Deja-AN: 649549105 References: <3979C22C.627F3C89@acm.com> X-Complaints-To: abuse@pacbell.net X-Trace: news.pacbell.net 964292954 207.214.211.238 (Sat, 22 Jul 2000 12:09:14 PDT) Organization: SBC Internet Services NNTP-Posting-Date: Sat, 22 Jul 2000 12:09:14 PDT Newsgroups: comp.lang.ada Date: 2000-07-22T00:00:00+00:00 List-Id: >operations are class-wide. No matter how you extend the message, the >base class needs to be able to determine where the "real" data is in the >record, how big it is, how to checksum it, how to interpret it as raw >bytes, etc, etc. In a weakly typed language, you could do this by You can really do a lot with Streams. You can of course define a 'Write to one child of Root_Stream_Type that puts the bytes of the data object into a Stream_Element_Array. But a different child of Root_Stream_Type could instead put a kind_of_record_indicator, or a checksum, or a length, or even an address into its resulting Stream_Element_Array. So your Output_To_Device procedure could take a Stream_Element_Array that consisted of one (or more) triples of (count, checksum, start_address), should you want to do that. For bitmaps In Claw we use record rep clauses (with TAG_SIZE offsets included) to lay things out for Windows system calls, but we define Mono_Bitmap'Class'Read, VGA_Bitmap'Class'Read, etc, for use in embedding bitmaps in files or sending them over networks. That's also used internally for the function Read(Filename:String) return Claw.Root_Bitmap'Class; kind of thing for simple read/write of .bmp files.