Re: Records that could be arrays
- From: "Dmitry A. Kazakov" <mailbox@xxxxxxxxxxxxxxxxx>
- Date: Sat, 25 Feb 2006 12:39:20 +0100
On Fri, 24 Feb 2006 15:23:51 -0600, Randy Brukardt wrote:
Claw also has types like this:
type Point_Type is record
X, Y : Int;
end record;
type Size_Type is record
Width, Height : Int; -- Width=X_Size, Height=Y_Size.
end record;
type Rectangle_Type is record
Left, Top, Right, Bottom : Int;
end record;
That's partly because we're matching the Windows definitions for these
types, but also because these "feel" like records to me.
I think that the essential question is whether co-ordinates have the same
type. The rest is a question of language deficiency. In this case an
inability to provide an array interface to a record type (to have
enumerated components), or a record interface to an array (to have named
components.)
It looks logical to choose the same type for all co-ordinates. However for
a teletype display they probably should be different. There is a subtler
question whether absolute co-ordinates and distances should of the same
type. Sort of, whether the relativity theory applies to GUI... (:-))
--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
.
- Follow-Ups:
- Re: Records that could be arrays
- From: Steve Whalen
- Re: Records that could be arrays
- References:
- Records that could be arrays
- From: Justin Gombos
- Re: Records that could be arrays
- From: Stephen Leake
- Re: Records that could be arrays
- From: Randy Brukardt
- Records that could be arrays
- Prev by Date: Re: limited types (Was: Records that could be arrays)
- Next by Date: OT: Re: help with include and library files in GPS
- Previous by thread: Re: Records that could be arrays
- Next by thread: Re: Records that could be arrays
- Index(es):