comp.lang.ada
 help / color / mirror / Atom feed
From: "Mark" <up.yerz@nospam.com>
Subject: Re: A Record Interpretation of an Array
Date: Fri, 01 Jun 2001 00:14:25 GMT
Date: 2001-06-01T00:14:25+00:00	[thread overview]
Message-ID: <B7BR6.89883$p33.1865700@news1.sttls1.wa.home.com> (raw)
In-Reply-To: 3B12C9E0.5E9B06C8@earthlink.net


"Marc A. Criley" <mcqada@earthlink.net> 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






  parent reply	other threads:[~2001-06-01  0:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-05-28 22:53 A Record Interpretation of an Array Marc A. Criley
2001-05-29  3:29 ` Jeffrey Carter
2001-05-29 13:34 ` Ted Dennison
2001-05-29 14:16 ` Marin David Condic
2001-05-31  0:55 ` Keith Thompson
2001-05-31 12:47   ` Marc A. Criley
2001-06-01  1:22     ` Keith Thompson
2001-06-01  0:14 ` Mark [this message]
2001-06-01  8:45   ` Ehud Lamm
2001-06-01 12:39   ` Marc A. Criley
2001-06-01 18:20     ` Tucker Taft
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox