comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephe_on_the_web@toadmail.com>
Subject: Re: Records that could be arrays
Date: Fri, 24 Feb 2006 05:31:29 -0500
Date: 2006-02-24T05:31:29-05:00	[thread overview]
Message-ID: <uk6blqc8u.fsf@toadmail.com> (raw)
In-Reply-To: dtkgrp$1fkc$1@ulysses.news.tiscali.de

Wilhelm Spickermann <zhopi.20.unbenutzbar@spamgourmet.com> writes:

> This becomes also visible in the missing loop statements in
> typical polar coordinate operations. And it would be rather
> unusual for an array to have a special equality definition 

Perhaps it is "unusual" in your experience because you are overly
restrictive in using arrays for such types.

Having said that, I don't think I've ever overridden equality for an
array. But I rarely override equality for any type, so that's not a
good measure.

> while it is rather normal for a record (phi is "dont care" when
> theta is zero -- or AFAIK the other way round in North America).

Right. So if we are using an array to represet these coordinates, we
would override equality for that type.

Ada lets us do that, so there is (by definition :) nothing "wrong"
with it!

Equal rights for arrays :).

I see this as similar to a discussion of implementation for a
container. At a high level, we don't care whether a "set" is implemented
as an array of bits or a list of some sort. At a lower level, we do,
and we ask "what is the implementation that gives the fastest
execution time" or similar questions.

At a high level, a "point" is an abstract object, and we don't care
about the representation. At the low level, we ask "would it ever be
convenient to use a loop to process the elements of this type". If the
answer is 'yes', we use an array.

What I have been saying is that the answer is almost always 'yes',
when you consider operations like Text_IO and AUnit checks.

If we implemented points as limited private types, we wouldn't be
having this discussion. But writing access functions instead of just
using Ada syntax is "obviously" too heavy for points, so we make them
public types. But the priciple still applies; the implementation of
the type is logically separate from the abstract interface of the type.

-- 
-- Stephe



  reply	other threads:[~2006-02-24 10:31 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-23  4:11 Records that could be arrays Justin Gombos
2006-02-23  4:51 ` tmoran
2006-02-23 13:19   ` Justin Gombos
2006-02-24 10:19     ` Stephen Leake
2006-02-23  6:32 ` Wilhelm Spickermann
2006-02-23 13:08   ` Stephen Leake
2006-02-23 13:20   ` Justin Gombos
2006-02-23 14:29     ` Wilhelm Spickermann
2006-02-24 10:31       ` Stephen Leake [this message]
2006-02-26 22:34         ` Wilhelm Spickermann
2006-02-23  8:21 ` john Doef
2006-02-23  9:22 ` Jean-Pierre Rosen
2006-02-23 13:11   ` Stephen Leake
2006-02-23 13:37   ` Justin Gombos
2006-02-23 13:06 ` Stephen Leake
2006-02-23 20:23   ` Simon Wright
2006-02-24 21:23   ` Randy Brukardt
2006-02-25 11:39     ` Dmitry A. Kazakov
2006-02-26  3:24       ` Steve Whalen
2006-02-26  9:51         ` Dmitry A. Kazakov
2006-02-27  2:26           ` Steve Whalen
2006-02-27  9:33             ` Dmitry A. Kazakov
2006-03-01 22:44             ` Robert A Duff
replies disabled

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