comp.lang.ada
 help / color / mirror / Atom feed
From: spiegel@bruessel.informatik.uni-stuttgart.de (Andre Spiegel)
Subject: Re: Flags in Ada?
Date: Wed, 26 Oct 1994 15:54:17 GMT
Date: 1994-10-26T15:54:17+00:00	[thread overview]
Message-ID: <SPIEGEL.94Oct26165417@oslo.bruessel.informatik.uni-stuttgart.de> (raw)
In-Reply-To: ncohen@watson.ibm.com's message of 25 Oct 1994 16:19:40 GMT    [ 25 Oct 1994 17:19:40 MET ]

[referring to Norman H. Cohen's article <38jb6s$tsr@watnews1.watson.ibm.com>]

Thanks for the flag example. I had missed the section in the RM which
says that boolean operators can also be applied to boolean arrays. 
I suppose that compilers also recognize that what I want is bit
arithmetic, and therefore won't generate loops to apply the operator
to the arrays elementwise, which would of course be ridiculously slow.

Thanks also for the explanations on address clauses. This is the way
in which I have been doing it in my program, too. I was just wondering
about efficiency, because those `declare' statements "look" somewhat
expensive. For example, if UNIX fills a buffer with data items of
varying length (talking about ethernet packets, actually), and I want
to scan that buffer in an Ada loop, there has to be a declare
statement *within* the loop, in order to, sort of, "move" the record
pattern over the buffer.  

This seems a little counter-intuitive, because it's so different from
what you would do in C, for example -- simply declare a pointer to a
struct, and increment that pointer accordingly. I have found,
meanwhile, that in Ada 9X the generic package Interfaces.C.Pointers
will provide precisely that. But from what you wrote, I conclude that
the declare statement solution does not translate into anything
different at the machine level. It probably even looks more Ada-like.

--
Andre Spiegel                     |  This life is a test. It is only a test.
                                  |  Had this been an actual life, you would
University of Stuttgart, Germany  |  have received further instructions as to
Computer Science                  |  where to go and what to do.
                                                            -- Author unknown

	   email: spiegel@bruessel.informatik.uni-stuttgart.de



  parent reply	other threads:[~1994-10-26 15:54 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1994-10-25 10:36 Flags in Ada? Andre Spiegel
1994-10-25 10:07 ` David Emery
1994-10-25 16:19 ` Norman H. Cohen
1994-10-26  3:19   ` tmoran
1994-10-26  9:59     ` David Emery
1994-10-26 22:32       ` Robert Dewar
1994-10-27 13:24         ` Norman H. Cohen
1994-10-27 15:15         ` John Volan
1994-10-31  9:29         ` David Emery
1994-10-27 22:34       ` Henry G. Baker
1994-10-26 14:33     ` Robert Dewar
1994-10-26 17:43     ` Norman H. Cohen
1994-10-26 15:54   ` Andre Spiegel [this message]
1994-10-26  0:36 ` Dale Stanbrough
1994-10-26 11:01   ` Robert Dewar
1994-10-27  8:23 ` Henri Altarac
1994-10-27 23:00   ` Robert Dewar
1994-10-31  9:32     ` David Emery
  -- strict thread matches above, loose matches on Subject: below --
1994-10-25 16:22 tmoran
1994-10-27  5:05 tmoran
1994-10-27 13:29 ` Robert Dewar
1994-10-27 17:15 ` Norman H. Cohen
1994-10-28  3:51   ` Robert Dewar
1994-10-27  5:06 tmoran
1994-10-27 13:47 ` Robert Dewar
1994-10-28  2:41   ` Tucker Taft
1994-10-30 13:31     ` Robert Dewar
1994-10-28  3:59 tmoran
1994-10-28 13:43 ` Robert Dewar
1994-10-31 14:19   ` Norman H. Cohen
1994-11-02 14:06     ` Mats Weber
1994-11-03 23:08       ` Robert Dewar
1994-11-03 11:26     ` Robert Dewar
replies disabled

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