From: "Ken Garlington" <Ken.Garlington@computer.org>
Subject: Re: Nonsense (was Re: How to do it in Ada ?)
Date: Tue, 17 Jul 2001 00:13:53 GMT
Date: 2001-07-17T00:13:53+00:00 [thread overview]
Message-ID: <5rL47.64$3h.25862251@newssvr11.news.prodigy.com> (raw)
In-Reply-To: yAG47.358161$p33.7256533@news1.sttls1.wa.home.com
"Mark Lundquist" <up.yerz@nospam.com> wrote in message
news:yAG47.358161$p33.7256533@news1.sttls1.wa.home.com...
:
: I <up.yerz@nospam.com> wrote nonsense in message
: news:P0F47.357734$p33.7248200@news1.sttls1.wa.home.com...
: >
: >[snip]
: >
: > Alternatively, the declaration could be written this way:
: >
: > X := new X_Array_Type (1 .. N) := (others => 0);
: >
:
: What a bunch of crap! I can't belive I wrote that. It must have been
: before my first cup of coffee this morning. Or, I started writing that
line
: and then went away, and then came back and blew a brain fuse when I
resumed
: typing. Maybe when I went away, it was to get the cup of coffee!
:
: What one *could* write (not that you'd want to, but it illustrates the
: language concept I was trying to highlight), is:
:
: X : new X_Array_Type (1 .. N);
:
: begin
: X := (others => 0);
This still looks a little off... perhaps you meant something like
package X_Array is
type Object is array (Positive range <>) of Integer;
type Object_Access is access Object;
function New_Object_Access return Object_Access;
end X_Array;
package body X_Array is
function N return Positive is... (see other post)
function New_Object_Access return Object_Access is
X : Object_Access := new Object(1 .. N);
begin
X.all := (others => 0);
return X;
end New_Object_Access;
end X_Array;
next prev parent reply other threads:[~2001-07-17 0:13 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-07-16 3:33 How to do it in Ada ? Tomasz Wegrzanowski
2001-07-16 5:31 ` Jeffrey Carter
2001-07-16 6:41 ` Al Christians
2001-07-16 6:51 ` tmoran
2001-07-16 16:56 ` Mark Lundquist
2001-07-16 18:42 ` Nonsense (was Re: How to do it in Ada ?) Mark Lundquist
2001-07-16 22:20 ` Jeffrey Carter
2001-07-17 0:13 ` Ken Garlington [this message]
2001-07-17 3:53 ` Robert Dewar
2001-07-16 22:18 ` How to do it in Ada ? Jeffrey Carter
2001-07-17 4:06 ` tmoran
2001-07-20 5:39 ` David Thompson
2001-07-16 17:37 ` Ken Garlington
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox