From: "Jeffrey R. Carter" <spam@spam.com>
Subject: Half Constrained Array Types and Slices
Date: Thu, 02 Mar 2006 05:00:06 GMT
Date: 2006-03-02T05:00:06+00:00 [thread overview]
Message-ID: <qZuNf.2045$6I.1540@newsread3.news.pas.earthlink.net> (raw)
Robert Duff present a concept from his idea for an Ada-like language (not called
Duff) some time ago, that there was no need for "box" ("<>") in his language:
type String (Length : Natural) is array (1 .. Length) of Character;
(IIRC)
In Ada we have constrained and unconstrained array types; I call this a "half
constrained" array type so we have names for all of them. Since his language
doesn't have box, I presume an unconstrained array type would be:
type Unconstrained (Lo : Positive; Hi : Natural) is array (Lo .. Hi) of Component;
while a constrained type would look like an Ada constrained type:
type Constrained is array (Lo .. Hi) of Component;
I was wondering how slices would work with this kind of syntax. I would expect a
slice of a half-constrained array to have the fixed lower bound specified in its
type declaration; that would differ from the others.
In Ada, we deal with slices of constrained array types by having the 1st named
subtype be a constrained subtype of an unconstrained base type; that wouldn't
seem to work here, since it would have a base type with 2 discriminants and a
subtype with only 1.
--
Jeff Carter
"C's solution to this [variable-sized arrays] has real problems,
and people who are complaining about safety definitely have a point."
Dennis Ritchie
25
next reply other threads:[~2006-03-02 5:00 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-02 5:00 Jeffrey R. Carter [this message]
2006-03-02 8:34 ` Half Constrained Array Types and Slices Dmitry A. Kazakov
2006-03-02 15:34 ` Georg Bauhaus
2006-03-02 19:37 ` Dmitry A. Kazakov
2006-03-02 20:06 ` Jeffrey R. Carter
2006-03-02 20:37 ` Dmitry A. Kazakov
2006-03-02 21:01 ` Robert A Duff
2006-03-02 20:40 ` Robert A Duff
2006-03-02 14:32 ` Larry Kilgallen
2006-03-02 20:08 ` Jeffrey R. Carter
2006-03-02 20:48 ` Robert A Duff
2006-03-06 2:16 ` Larry Kilgallen
2006-03-06 18:50 ` Martin Krischik
2006-03-02 20:38 ` Robert A Duff
2006-03-03 5:15 ` Jeffrey R. Carter
2006-03-03 8:57 ` Dmitry A. Kazakov
2006-03-03 23:41 ` Robert A Duff
2006-03-06 17:50 ` Jeff Carter
2006-03-06 18:31 ` Dmitry A. Kazakov
2006-03-07 19:02 ` Jeff Carter
2006-03-08 14:29 ` Dmitry A. Kazakov
2006-03-09 22:44 ` Robert A Duff
2006-03-10 8:46 ` Dmitry A. Kazakov
2006-03-06 19:49 ` Stefan Lucks
2006-03-08 17:36 ` brian.b.mcguinness
2006-03-08 17:56 ` Jeff Carter
2006-03-09 22:36 ` Robert A Duff
2006-03-10 4:28 ` Jeffrey R. Carter
2006-03-10 8:46 ` Dmitry A. Kazakov
2006-03-10 17:33 ` Robert A Duff
2006-03-10 21:24 ` Dmitry A. Kazakov
2006-03-10 17:38 ` Robert A Duff
2006-03-11 0:19 ` Randy Brukardt
2006-03-11 1:43 ` Jeffrey R. Carter
2006-03-11 8:38 ` Niklas Holsti
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox