Re: How do I write directly to a memory address?



On Feb 9, 4:24 pm, Hyman Rosen <hyro...@xxxxxxxx> wrote:
On 2/9/2011 6:07 PM, Shark8 wrote:

In this context your "I really need to know what my subprogram
is going to do" seems very much like some college-kid whining
about how he "really needs to know what happens in book X,"
while decrying people telling him "read the book."

This is precisely to say that just as in reading the book the
answer to the question is answered, so to is your "I need to
know what happens" answered when a) contracts are made
and enforced AND b) proofs of completeness&  correctness
are done.

OK, I see that my attempts at being Socratic and oracular
are failing. What I'm trying to demonstrate is that the
chatter here about requirements and specifications and
contracts fails to capture essential aspects of programs
and even in Ada there's a good chance that you'll have to
read the bodies to know what's going on. (Thanks for playing
into that with the "read the book" example.)

The problem with my SumTo subprogram is that it's liable to
raise Storage_Error for a wide range of legal arguments.

But are they your intended arguments?
As MANY here have pointed out having (int x) is NOT
a guarantee that X is not zero, nor is it guarantee it is not
negative.
And yet many C programmers ASSUME that they *ARE* whether
based on comments or just assumptions is irrelevant to that point.

In Ada we *CAN* control our inputs, ie ( X : In Positive ) cannot be
attempted when X < Positive'First. And as was shown earlier,
with Ada 2012 we'll be able to constrain 'X' to be odd, or whatever.

The
problem with my Exponent subprogram is that its running time
is enormous.

So, you didn't indicate that time was an issue.
You assumed that I would believe it to be, but as we were
discussing completeness/correctness and the running time
was, in a word, irrelevant.

Neither of these aspects can be made visible
through Ada language facilities, and typical mathematical
proofs of correctness won't show you this either.

So? In the context of our conversation NEITHER of those
were an issue.

Just like C programmers, you Ada folks still find a way to
get your work done, though.

Yep.
.



Relevant Pages

  • Re: How do I write directly to a memory address?
    ... a guarantee that X is not zero, nor is it guarantee it is not ... And yet many C programmers ASSUME that they *ARE* whether ... Ada, and then no matter what I say, you say "but in Ada I can ... Function Sort(Input: Integer_Array) Return Integer_Array is ...
    (comp.lang.ada)
  • Re: Ada array vs C pointer (call by reference)
    ... Ada type "Float", to ensure that you're using the same kind of float ... that the C routine expects. ... Ada can't guarantee it directly. ...
    (comp.lang.ada)
  • Re: Float to String
    ... Samuel Tardieu wrote: ... > Even using T'Machine_Radix doesn't give you a guarantee that you will ... --Team Ada: "C'mon people let the world begin" (Paul McCartney) ...
    (comp.lang.ada)
  • Re: Basic Explaination of OO in Ada
    ... transition a little easier. ... Ada Distilled to reflect the changes in Ada 2005. ... No guarantee, ... Richard Riehle ...
    (comp.lang.ada)