Print

Print


Michael Feldman wrote:
>
> [said Wes]
> >
> > Is it really?  Anyone ever seen anything like the following in an Ada
> > book?
> >
> > Thinking in Java, by Bruce Eckel, Chapter 3:
> >
> > after taking three pages to introduce assignment, 95% of it devoted to
> > aliasing, the section ends with
> >
> >   "Aliasing and its solution is a complex issue and, although you must
> >   wait until Chapter 12 for all the answers, you should be aware of it at
> >   this point so you can watch for pitfalls."
> >
> In context, I think this is a reasonable statement. Aliasing has
> many meanings in computing. I think he means "assigning two pointers
> to designate the same heap block." This _is_ difficult to get right.

The point I took from Wes's comment was not that the statement, in
itself, was wrong.  I understood his point to be that the chapter
introducing simple assignment required three pages on aliasing, and
a forward reference to a deeper discussion.

Ada automatically allocates stack space for simple variables.

My (mis?)understanding is that Java requires some kind of dynamic
allocation for most variables.  It apparently manages the allocated
space for you (garbage collects), but you can still wind up with
multiple pointers to the same space.  (Java folks, is that right?)

In Ada you don't have to worry about aliasing unless you intentionally
introduce it via "new" or "aliased."

Wes, was that your point?

Best,
Sam Mize

--
Samuel Mize -- [log in to unmask] (home email) -- Team Ada
Fight Spam: see http://www.cauce.org/ \\\ Smert Spamonam