Re: How do I write directly to a memory address?
- From: Shark8 <onewingedshark@xxxxxxxxx>
- Date: Wed, 9 Feb 2011 16:35:33 -0800 (PST)
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.
.
- Follow-Ups:
- Re: How do I write directly to a memory address?
- From: Hyman Rosen
- Re: How do I write directly to a memory address?
- References:
- How do I write directly to a memory address?
- From: Syntax Issues
- Re: How do I write directly to a memory address?
- From: Dmitry A. Kazakov
- Re: How do I write directly to a memory address?
- From: Hyman Rosen
- Re: How do I write directly to a memory address?
- From: Shark8
- Re: How do I write directly to a memory address?
- From: Hyman Rosen
- Re: How do I write directly to a memory address?
- From: Shark8
- Re: How do I write directly to a memory address?
- From: Hyman Rosen
- Re: How do I write directly to a memory address?
- From: Shark8
- Re: How do I write directly to a memory address?
- From: Hyman Rosen
- Re: How do I write directly to a memory address?
- From: Shark8
- Re: How do I write directly to a memory address?
- From: Hyman Rosen
- Re: How do I write directly to a memory address?
- From: Shark8
- Re: How do I write directly to a memory address?
- From: Hyman Rosen
- Re: How do I write directly to a memory address?
- From: Shark8
- Re: How do I write directly to a memory address?
- From: Hyman Rosen
- How do I write directly to a memory address?
- Prev by Date: Re: How do I write directly to a memory address?
- Next by Date: Re: Questions on new John McCormick book
- Previous by thread: Re: How do I write directly to a memory address?
- Next by thread: Re: How do I write directly to a memory address?
- Index(es):
Relevant Pages
|