* Re: Anonymous array clarification.(Better idea, I think.)
@ 2001-08-20 21:40 McDoobie
2001-08-20 21:58 ` David C. Hoos
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: McDoobie @ 2001-08-20 21:40 UTC (permalink / raw)
Okay, from the above posts in this thread, I think I might be getting
somewhere.
I'm thinking my problem stems from understanding the difference between an
"Object" and a type. As I'm coming from a C background, Objects and
Classes are real fuzzy for me.
So if I say...
type foo_array is array(1..N) of character;
this would be an Object declaration. Then I would instantiate it
thusly....
bar_array : foo_array;
correct?
However if I say...
some_chars : array(1..N) of character;
this would be just a simple array declaration, with none of the Object
Oriented properties carried along with it.
And with the Object "foo_array" declared above, I could say ...
type Upper_Case is subtype foo_array;
and it should work?
Am I beginning to get the picture?
McDoobie
chris@dont.spam.me
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Anonymous array clarification.(Better idea, I think.)
2001-08-20 21:40 Anonymous array clarification.(Better idea, I think.) McDoobie
@ 2001-08-20 21:58 ` David C. Hoos
2001-08-20 23:33 ` Jeffrey Carter
2001-08-21 0:49 ` Darren New
2 siblings, 0 replies; 4+ messages in thread
From: David C. Hoos @ 2001-08-20 21:58 UTC (permalink / raw)
To: comp.lang.ada
----- Original Message -----
From: "McDoobie" <chris@dont.spam.me>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada.eu.org>
Sent: Monday, August 20, 2001 4:40 PM
Subject: Re: Anonymous array clarification.(Better idea, I think.)
> Okay, from the above posts in this thread, I think I might be getting
> somewhere.
>
> I'm thinking my problem stems from understanding the difference between an
> "Object" and a type. As I'm coming from a C background, Objects and
> Classes are real fuzzy for me.
>
> So if I say...
>
> type foo_array is array(1..N) of character;
>
> this would be an Object declaration. Then I would instantiate it
> thusly....
>
> bar_array : foo_array;
>
> correct?
>
No. Bar_array is an object declaration. foo_array is a type declaration.
> However if I say...
>
> some_chars : array(1..N) of character;
>
> this would be just a simple array declaration, with none of the Object
> Oriented properties carried along with it.
>
some_chars is also an object declaration, but of an anonymous array type.
> And with the Object "foo_array" declared above, I could say ...
>
> type Upper_Case is subtype foo_array;
>
> and it should work?
There is nothing yet to"work," since there are no executable statements,
only declarations. In fact, you have declared no object of type Upper_Case,
so it does noting for you but to declare a type of which you have declared
no object.
None of whjat you've done so far has anything to do with the object-oriented
features of Ada.
It seems like you really need to get hold of a good Ada book.
>
> Am I beginning to get the picture?
>
> McDoobie
> chris@dont.spam.me
> _______________________________________________
> comp.lang.ada mailing list
> comp.lang.ada@ada.eu.org
> http://ada.eu.org/mailman/listinfo/comp.lang.ada
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Anonymous array clarification.(Better idea, I think.)
2001-08-20 21:40 Anonymous array clarification.(Better idea, I think.) McDoobie
2001-08-20 21:58 ` David C. Hoos
@ 2001-08-20 23:33 ` Jeffrey Carter
2001-08-21 0:49 ` Darren New
2 siblings, 0 replies; 4+ messages in thread
From: Jeffrey Carter @ 2001-08-20 23:33 UTC (permalink / raw)
McDoobie wrote:
>
> So if I say...
>
> type foo_array is array(1..N) of character;
>
> this would be an Object declaration. Then I would instantiate it
> thusly....
>
> bar_array : foo_array;
>
> correct?
>
> However if I say...
>
> some_chars : array(1..N) of character;
>
> this would be just a simple array declaration, with none of the Object
> Oriented properties carried along with it.
This has nothing to do with object orientedness. Bar_Array is a variable
of type Foo_Array, and Some_Chars is a variable of an unnamed
(anonymous) array type.
>
> And with the Object "foo_array" declared above, I could say ...
>
> type Upper_Case is subtype foo_array;
>
> and it should work?
This will not work. Perhaps you mean
subtype Upper_Case is Foo_Array;
or maybe
type Upper_Case is new Foo_Array;
I can't tell what you're trying to accomplish here.
>
> Am I beginning to get the picture?
Unfortunately, it doesn't look that way.
--
Jeffrey Carter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Anonymous array clarification.(Better idea, I think.)
2001-08-20 21:40 Anonymous array clarification.(Better idea, I think.) McDoobie
2001-08-20 21:58 ` David C. Hoos
2001-08-20 23:33 ` Jeffrey Carter
@ 2001-08-21 0:49 ` Darren New
2 siblings, 0 replies; 4+ messages in thread
From: Darren New @ 2001-08-21 0:49 UTC (permalink / raw)
McDoobie wrote:
> Am I beginning to get the picture?
You should also be aware that Ada uses the terms "class" and "object"
differently from most OO languages.
--
Darren New / Senior MTS & Free Radical / Invisible Worlds Inc.
San Diego, CA, USA (PST). Cryptokeys on demand. dnew@san.rr.com
When was sliced bread invented?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2001-08-21 0:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-20 21:40 Anonymous array clarification.(Better idea, I think.) McDoobie
2001-08-20 21:58 ` David C. Hoos
2001-08-20 23:33 ` Jeffrey Carter
2001-08-21 0:49 ` Darren New
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox