comp.lang.ada
 help / color / mirror / Atom feed
* Stumbling over arrays.(A bit of a ramble. Read if your bored.)
@ 2002-10-01 21:00 Caffeine Junky
  2002-10-01 21:58 ` Chad R. Meiners
  2002-10-02 12:33 ` Georg Bauhaus
  0 siblings, 2 replies; 4+ messages in thread
From: Caffeine Junky @ 2002-10-01 21:00 UTC (permalink / raw)


My Ada95 skills have increased dramatically in the last few months. It
seems like I'm finally getting it.

Yet, I still have a tendency to stumble over Ada's handling of arrays.
They dont intimidate me, because I know the compiler actively works to
keep me from really screwing up a data structure. Records are a piece of
cake to handle. Classes and Objects are becoming quite clear. However, I
think my past exposure to C/C++ has set certain assumptions in my mind
concerning arrays that arent necessarily true in Ada95.

I'm still a novice when it comes to programming in general, so I'm taking
the time to really get a grip on fundemental CS concepts.(Sort/Search
algorithms, the Stack, Memory managment, etc...) before moving into more
abstract areas such as Aspect Oriented/Object oriented programming, UML,
Literate Programming, etc...
Yet Ada arrays still have me going "Damnit! Why is everything so
tedious?"

So, I'm looking for suggestions on excercises I can do to help me really
internalize Ada's view of Arrays(generic, Strings, etc...). I can use
Arrays right now, but for me it's more a process of reading the compiler
messages and making adjustments to the array declaration. Sort of like
playing "Whack a mole."

Any pointers would be helpful.

NiCad



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Stumbling over arrays.(A bit of a ramble. Read if your bored.)
  2002-10-01 21:00 Stumbling over arrays.(A bit of a ramble. Read if your bored.) Caffeine Junky
@ 2002-10-01 21:58 ` Chad R. Meiners
  2002-10-02 12:33 ` Georg Bauhaus
  1 sibling, 0 replies; 4+ messages in thread
From: Chad R. Meiners @ 2002-10-01 21:58 UTC (permalink / raw)



"Caffeine Junky" <nospam@hotmail.com> wrote in message
news:02om9.1609$DN4.1573@sccrnsc01...
> Any pointers would be helpful.
>
> NiCad

Give us a case example of you "Wacking the Mole".   It will make giving
pointers easier for us.

-CRM





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Stumbling over arrays.(A bit of a ramble. Read if your bored.)
  2002-10-01 21:00 Stumbling over arrays.(A bit of a ramble. Read if your bored.) Caffeine Junky
  2002-10-01 21:58 ` Chad R. Meiners
@ 2002-10-02 12:33 ` Georg Bauhaus
  2002-10-03  1:10   ` Caffeine Junky
  1 sibling, 1 reply; 4+ messages in thread
From: Georg Bauhaus @ 2002-10-02 12:33 UTC (permalink / raw)


Caffeine Junky <nospam@hotmail.com> wrote:
: So, I'm looking for suggestions on excercises I can do to help me really
: internalize Ada's view of Arrays(generic, Strings, etc...). I can use
: Arrays right now, but for me it's more a process of reading the compiler
: messages and making adjustments to the array declaration. Sort of like
: playing "Whack a mole."

do these ring a bell:
component type
unconstrained
constrained
anonymous
bound
slice
"array attributes"

and then later:
passed by reference
passed by copy
?

There is a section on arrays in
http://www.crystalcode.com/codemage/MainMenu/Coding/Ada/IntroducingAda.php

-- georg



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Stumbling over arrays.(A bit of a ramble. Read if your bored.)
  2002-10-02 12:33 ` Georg Bauhaus
@ 2002-10-03  1:10   ` Caffeine Junky
  0 siblings, 0 replies; 4+ messages in thread
From: Caffeine Junky @ 2002-10-03  1:10 UTC (permalink / raw)


On Wed, 02 Oct 2002 08:33:53 -0400, Georg Bauhaus wrote:

> do these ring a bell:
> component type
> unconstrained
> constrained
> anonymous
> bound
> slice
> "array attributes"
> 
> and then later:
> passed by reference
> passed by copy
> ?
> 
> There is a section on arrays in
> http://www.crystalcode.com/codemage/MainMenu/Coding/Ada/IntroducingAda.php
> 
> -- georg
 
Oh yeah. I understand Ada arrays. I can use them. I just have a
tendency to get them mixed up from time to time. 
I'm writing a bunch of practice Sort methods for practice. Variations on
Quicksort, Merge Sort, and Heap Sort. These are giving me a ton of
practice on arrays. 
They dont seem nearly as confusing as they did a few days ago.

I just read the article. It has cleared up a couple of things.

I'm gonna post up some of the code I've written. Somebody might actually
find it useful.

I'm having alot of fun with tasking/threaded quicksorts. I never realized
there could be so many different ways to implement the same algorithm.

As an off subject, if compile a protected type module in a system with
Linux pthreads installed, should the compiler (GNAT 3.14) automatically
compile it as a multithreaded module? Or do I have to explicitly direct
the compiler to do that?
Protected Types seem to be an order of magnitude safer than just plain
tasks.

Thanks for the pointers.

NiCad



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-10-03  1:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-01 21:00 Stumbling over arrays.(A bit of a ramble. Read if your bored.) Caffeine Junky
2002-10-01 21:58 ` Chad R. Meiners
2002-10-02 12:33 ` Georg Bauhaus
2002-10-03  1:10   ` Caffeine Junky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox