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,d7ad26fbff0ddd28 X-Google-Attributes: gid103376,public From: david.c.hoos.sr@ada95.com Subject: Re: Generic package exporting a type with a rep spec Date: 1998/05/12 Message-ID: <6j9b0i$m2a$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 352504406 References: <6j7j5j$7i1$1@newsreader.digex.net> X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 4.01; Windows NT) X-Http-Proxy: 1.0 ALHUNWMS1 Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Tue May 12 11:15:30 1998 GMT Newsgroups: comp.lang.ada Date: 1998-05-12T00:00:00+00:00 List-Id: In article <6j7j5j$7i1$1@newsreader.digex.net>, "Bob Mikkelsen" wrote: > > Is there any good way to construct a generic package which exports a data > structure whose rep spec may vary on separate instantiations? > > We are trying to solve a problem where we have data coming in from various > sources. All the data requires similar processing when it gets to us, but > when it is imported or exported to the sources, it may have slightly > different forms: sometimes 7 bytes, sometimes 11. > > We are trying to generalize the representation of the data in the generic by > bringing the data size into the generic with a generic formal parameter, but > when we try to use this value in the rep spec, the complier gets very fussy > (a static value is required). > > Any solution not requiring C will be welcomed. > Well, I'm not sure I have fully understood your problem, but it sounds like a job for tagged types. Assuming that either the source of the message or something in its content defines of which type it is, tagged types are the ticket, I believe. I have posted a tagged_types example on my FTP site at: ftp://ftp.ada95.com/pub/tagged_types If this is not going in the right direction to solve your problem, please send more details (preferably by E-Mail) -----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading