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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,31982f45a4d88565 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-05-31 17:14:25 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newshub2.home.com!news.home.com!news1.sttls1.wa.home.com.POSTED!not-for-mail From: "Mark" Newsgroups: comp.lang.ada References: <3B12C9E0.5E9B06C8@earthlink.net> Subject: Re: A Record Interpretation of an Array Organization: Lundquist X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6600 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6600 Message-ID: Date: Fri, 01 Jun 2001 00:14:25 GMT NNTP-Posting-Host: 24.20.66.39 X-Complaints-To: abuse@home.net X-Trace: news1.sttls1.wa.home.com 991354465 24.20.66.39 (Thu, 31 May 2001 17:14:25 PDT) NNTP-Posting-Date: Thu, 31 May 2001 17:14:25 PDT Xref: archiver1.google.com comp.lang.ada:7952 Date: 2001-06-01T00:14:25+00:00 List-Id: "Marc A. Criley" wrote in message news:3B12C9E0.5E9B06C8@earthlink.net... > > (In case someone asks, "What problem are you actually trying to solve > here?" The answer is, to manipulate an array via a record-oriented > approach. I have a lot of code that does varied and sundry things with > record definitions, and by considering an array as a degenerate case of > a record (the fields are all of the same, rather than different, types), > I can reuse that code to do the exact same kinds of things to arrays > that I already do to records.) OK, then it seems like what you Really Want To Do :-) is to decouple your algorithms from data representations. This can be done in very lightweight ways, and the result is something that is absolutely clear in its intent and does not depend upon any unchecked programming or other monkey business. The idea is "abstract, then fulfill the abstractions" as opposed to "pretend it's something else that is equivalent." How about an example? Can you put up some code for some of the "varied and sundry things" that you would like to be able to reuse, and then we can see how that might be rewritten to be reusable?(The coercion approach seems like an attempt to reuse stuff that was not written to be reusable in the first place). Mark Lundquist