Re: Records that could be arrays
- From: Stephen Leake <stephe_on_the_web@xxxxxxxxxxxx>
- Date: Fri, 24 Feb 2006 05:19:18 -0500
Justin Gombos <rpbkbq.xax.gld@xxxxxxxx> writes:
On 2006-02-23, tmoran@xxxxxxx <tmoran@xxxxxxx> wrote:
But with
type Rows is new Local_Float;
type Cols is new Local_Float;
the compiler's type checking can point out such errors. In that case,
of course, you have to use a record
Sure, my rule wouldn't apply there because we're no longer talking
about a composite of a single element type.
Cohen uses x,y coodinates of different types as an example of over
typing. I'm kind of on the fence. I've been declaring every
dimension within a coordinate system to have the same element type
because it seems to be more of a hinderance than a benefit to seperate
them. The question is whether y is a function of x,
Or if you want the Cartesian magnitude: sqrt (x**2 + y**2). Or any
other function that involves x and y in a single expression. Like
rotation:
Rotated_Point := (a * Point (x) + b * Point (y), c * Point (x) + d *
Point (y));
which can't always be answered when the type comes into existence.
If it's a _point_, we already know about such things. If it's a
genuinely new type, yes, it might be unclear.
--
-- Stephe
.
- References:
- Records that could be arrays
- From: Justin Gombos
- Re: Records that could be arrays
- From: tmoran
- Re: Records that could be arrays
- From: Justin Gombos
- Records that could be arrays
- Prev by Date: Re: Quick question about Ada code formatting.
- Next by Date: Re: Records that could be arrays
- Previous by thread: Re: Records that could be arrays
- Next by thread: Re: Records that could be arrays
- Index(es):