comp.lang.ada
 help / color / mirror / Atom feed
* Questions
@ 1991-11-05 12:58 Hugh Dunne
  0 siblings, 0 replies; 13+ messages in thread
From: Hugh Dunne @ 1991-11-05 12:58 UTC (permalink / raw)


I am "posting" indirectly and can't actually read this group, so please 
email to me if you can answer the following:

Are there any sites that archive this newsgroup and provide mail server 
facilities for retrieving articles.

Also, do any TLD people read this newsgroup. If so, send an email address. 
You will soon be getting a nasty fax from us in any case. We have had 
ferocious problems with the linker version 2.0.3. Anyone else who's had 
problems and developed workarounds, please drop me a line.

=======================================================================

  "The Civil Service is like an octopus
   spreading its testicles all over the country" - Irish politican.

Hugh Dunne, Captec Ltd, Malahide, Ireland    Phone +353-1-450921
Internet:   dunne@captec.ie                  Fax   +353-1-450136
UUCP:       try something like mcsun!dec4ie.ieunet.ie!cs.tcd.ie!captec.ie!dunne

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

* Questions
@ 1999-11-11  0:00 Nobat
  1999-11-11  0:00 ` Questions Tucker Taft
  0 siblings, 1 reply; 13+ messages in thread
From: Nobat @ 1999-11-11  0:00 UTC (permalink / raw)


Hi,

Please forgive my ignorance. I am new in ADA and I have three questions:

I would like to know if ADA95

1) has some STL-like facilities? (are they ISO standard?)
2) has Design by Contract approach (like Eiffel) (or can it be easily
emulated)?
3) will there be a new ADA standard in future? (is there an active team of
experts who are working to add new features to the actual standard?)

I checked AdaPower FAQs, Adahome website and deja news for older
discussions...(I found partial answers to my questions, but they are not
clear)

I appreciate if you point me to appropriate references...
(if my questions are in wrong forum please ignore them)

Nobat

PS: I have no intention to start any language war, my motivation is only to
know more about the ADA95 approach.








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

* Re: Questions
  1999-11-11  0:00 Questions Nobat
@ 1999-11-11  0:00 ` Tucker Taft
  1999-11-11  0:00   ` Questions nobat
                     ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Tucker Taft @ 1999-11-11  0:00 UTC (permalink / raw)


Nobat wrote:
> 
> Hi,
> 
> Please forgive my ignorance. I am new in ADA and I have three questions:
> 
> I would like to know if ADA95
> 
> 1) has some STL-like facilities? (are they ISO standard?)

The ISO standard includes some standard libraries, but none that
directly match STL.  However, there are libraries available that
address much of the same problems as STL including the "Booch components"
and various others.  Some of these are commercially available; most
are open source.  See:

    http://www.acm.org/sigada/

and look under "components."  You might also want to check out
other links there.

There is also a new group which had its kick-off meeting at the
recent SIGAda '99 conference in LA with the explicit purpose of
creating a standard Ada Component Library.  Presumably they
will use some of the existing component libraries as inspiration
and/or starting points.

> 2) has Design by Contract approach (like Eiffel) (or can it be easily
> emulated)?

Ada has a strong "contract" model embodied in package specifications
and generic specifications.  For package specifications,
these include possibly constrained subtypes
for the parameters and the result of each operation.  For
generic specifications, they include a number of constrained
parameterization mechanisms.

The built in kinds of subtype constraints are range constraints for scalars,
index constraints for arrays, and discriminant constraints for records.
A pragma "Assert" is available for imposing other kinds of arbitrary
constraints.

> 3) will there be a new ADA standard in future? (is there an active team of
> experts who are working to add new features to the actual standard?)

Yes, the Ada Rapporteur Group (ARG) meets 2 to 3 times a year to review
language issues, both clarifications on the existing standard,
and proposed amendments to the standard.  The ARG is part of the ISO
Working Group 9 (WG9) which is responsible for the development and
evolution of the Ada standard.

> I checked AdaPower FAQs, Adahome website and deja news for older
> discussions...(I found partial answers to my questions, but they are not
> clear)
> 
> I appreciate if you point me to appropriate references...
> (if my questions are in wrong forum please ignore them)
> 
> Nobat
> 
> PS: I have no intention to start any language war, my motivation is only to
> know more about the ADA95 approach.

-- 
-Tucker Taft   stt@averstar.com   http://www.averstar.com/~stt/
Technical Director, Distributed IT Solutions  (www.averstar.com/tools)
AverStar (formerly Intermetrics, Inc.)   Burlington, MA  USA




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

* Re: Questions
  1999-11-11  0:00 ` Questions Tucker Taft
@ 1999-11-11  0:00   ` nobat
  1999-11-11  0:00   ` Questions David Botton
  1999-11-11  0:00   ` Questions nobat
  2 siblings, 0 replies; 13+ messages in thread
From: nobat @ 1999-11-11  0:00 UTC (permalink / raw)



Hi;
Thank you for explanations,
Nobat






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

* Re: Questions
  1999-11-11  0:00 ` Questions Tucker Taft
  1999-11-11  0:00   ` Questions nobat
  1999-11-11  0:00   ` Questions David Botton
@ 1999-11-11  0:00   ` nobat
  2 siblings, 0 replies; 13+ messages in thread
From: nobat @ 1999-11-11  0:00 UTC (permalink / raw)



Hi;
Thank you for explanations,
Nobat








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

* Re: Questions
  1999-11-11  0:00 ` Questions Tucker Taft
  1999-11-11  0:00   ` Questions nobat
@ 1999-11-11  0:00   ` David Botton
  1999-11-11  0:00   ` Questions nobat
  2 siblings, 0 replies; 13+ messages in thread
From: David Botton @ 1999-11-11  0:00 UTC (permalink / raw)


A fairly complete and up to date listing of available Ada components can be
found at:

http://www.adapower.com/reuse under the heading Component Libraries

You may also be interested in the book:

Data Structures and Algorithms an Object Oriented Approach Using Ada 95
by John Beidler


the Booch components can be found at:

http://www.adapower.com/booch

David Botton

Tucker Taft wrote in message <382B19D7.34D01018@averstar.com>...

Some of these are commercially available; most
>are open source.  See:
>
>    http://www.acm.org/sigada/
>
>and look under "components."  You might also want to check out
>other links there.








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

* Questions
@ 2003-04-22 17:20 Jakub Zawadzki
  2003-04-22 19:59 ` Questions Stephen Leake
  2003-04-22 21:47 ` Questions Robert A Duff
  0 siblings, 2 replies; 13+ messages in thread
From: Jakub Zawadzki @ 2003-04-22 17:20 UTC (permalink / raw)


It's guestions from my friend
Emaix>I have a question. Does a String(1..X) occupy X bytes always, no
Emaix> matter what actual length the string has got? Second: do
Emaix>To_String and To_Unbounded_String conversions copy strings
Reply to that questions please forward to : pmax@interia.pl
...
{Jakub Zawadzki   darkjames
 GG: 1058968  UIN: 97320776}



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

* Re: Questions
  2003-04-22 17:20 Questions Jakub Zawadzki
@ 2003-04-22 19:59 ` Stephen Leake
  2003-04-22 21:47 ` Questions Robert A Duff
  1 sibling, 0 replies; 13+ messages in thread
From: Stephen Leake @ 2003-04-22 19:59 UTC (permalink / raw)


Jakub Zawadzki <darkjames@poczta.onet.pl> writes:

> It's guestions from my friend
> Emaix>I have a question. Does a String(1..X) occupy X bytes always, no
> Emaix> matter what actual length the string has got? 

In this case, X is the "actual length" of the string, so one of us is not
understanding something.

> Emaix> Second: do To_String and To_Unbounded_String conversions copy
> Emaix>strings 

yes, if you are talking about the functions from Ada.Strings.Unbounded.

-- 
-- Stephe



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

* Re: Questions
  2003-04-22 17:20 Questions Jakub Zawadzki
  2003-04-22 19:59 ` Questions Stephen Leake
@ 2003-04-22 21:47 ` Robert A Duff
  2003-04-25 16:57   ` Questions Nick Roberts
  1 sibling, 1 reply; 13+ messages in thread
From: Robert A Duff @ 2003-04-22 21:47 UTC (permalink / raw)
  Cc: pmax

Jakub Zawadzki <darkjames@poczta.onet.pl> writes:

> It's guestions from my friend
> Emaix>I have a question. Does a String(1..X) occupy X bytes always, no
> Emaix> matter what actual length the string has got? 

Heh?  The length of the string *is* X.  So yes, it occupies X bytes
(plus whatever dope is necessary).

>...Second: do
> Emaix>To_String and To_Unbounded_String conversions copy strings

Probably.

> Reply to that questions please forward to : pmax@interia.pl
> ...
> {Jakub Zawadzki   darkjames
>  GG: 1058968  UIN: 97320776}



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

* RE: Questions
       [not found] <mailman.0.1051099700.13478.comp.lang.ada@ada.eu.org>
@ 2003-04-23 17:18 ` tmoran
  0 siblings, 0 replies; 13+ messages in thread
From: tmoran @ 2003-04-23 17:18 UTC (permalink / raw)


> But, if you are passing a slice of the array into a subprogram, then it
> is only passing the slice.  At least, none of the compilers I've ever=20
> used have passed the entire string when I only wanted a slice.
  To avoid confusion, it should be mentioned that normally only pointers
and bound information is passed - it doesn't make a copy of the 50
bytes of string data.



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

* Re: Questions
  2003-04-22 21:47 ` Questions Robert A Duff
@ 2003-04-25 16:57   ` Nick Roberts
  2003-04-27 16:02     ` Questions Robert A Duff
  0 siblings, 1 reply; 13+ messages in thread
From: Nick Roberts @ 2003-04-25 16:57 UTC (permalink / raw)


"Robert A Duff" <bobduff@shell01.TheWorld.com> wrote in message
news:wcc7k9mi4rb.fsf@shell01.TheWorld.com...

> Jakub Zawadzki <darkjames@poczta.onet.pl> writes:
>
> > It's guestions from my friend
> > Emaix>I have a question. Does a String(1..X) occupy X bytes always, no
> > Emaix> matter what actual length the string has got?
>
> Heh?  The length of the string *is* X.  So yes, it occupies X bytes
> (plus whatever dope is necessary).

Sometimes a srting such as, for example, defined by String(1..10), will
occupy 20 or 40 bytes (plus 'dope information'), unless pragma Pack is
applied to it. This is because normally the compiler will allocate one
'storage element' per character (so as to maximise speed of access to it)
and on some target machines storage elements are 16 or 32 bits in size.
(Some unusual machines have other sizes of storage element.)

The 'dope' information effectively includes the bounds of the array (the 1
and the 10 in my example), but not necessarily in that form. Sometimes dope
the information has to be stored in memory, sometimes it doesn't. Often the
dope information is not stored in the same place as the array contents (the
characters), and often things are done with the dope information which are
not done with the contents. I'm afraid the full story about dope information
is very complex.

A string such as defined by String(1..10) is called a 'fixed-length' string.
Generally it is considered to have the bounds 1 and 10 (and so length 10)
permanently. However, sometimes the 'actual length' of a fixed-length string
is considered to be all the characters in the string minus any trailing
spaces (or NULs). In which case the answer, in essence, to the original
question is "yes": if I declare

   My_Name:  String(1..10) := "Nick      ";
   His_Name: String(1..10) := "Robert    ";

then the contents of My_Name will normally occupy the same amount of space
in memory as His_Name, even though the actual length (as just defined) of
My_Name is 4 and of His_Name is 6. The compiler simply stores the trailing
spaces as ordinary characters.

> >...Second: do
> > Emaix>To_String and To_Unbounded_String conversions copy strings
>
> Probably.

To expand on that reply a little, for both operations
(Ada.Strings.Unbounded_Strings.To_String and
Ada.Strings.Unbounded_Strings.To_Unbounded_String):

* Some implementations may only copy a pointer (and may also need to update
certain internal counters), but this will be rare.

* Most of the time there will be a simple copy of all the contents (the
characters) of the source string.

* In some cases it may be necessary to do more than just copying. For
example, sometimes it will be necessary to 'pack' or 'unpack' the
characters, as well as copying them.

For To_Unbounded_String, most implementations will need to do two things:
firstly, allocating a space on 'the heap' (and updating a pointer to it);
secondly, copying the contents (characters) of the source string into that
space.

I hope this is of some help!

--
Nick Roberts
Jabber: debater@charente.de [ICQ: 159718630]






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

* Re: Questions
  2003-04-25 16:57   ` Questions Nick Roberts
@ 2003-04-27 16:02     ` Robert A Duff
  2003-04-28 14:20       ` Questions Nick Roberts
  0 siblings, 1 reply; 13+ messages in thread
From: Robert A Duff @ 2003-04-27 16:02 UTC (permalink / raw)


"Nick Roberts" <nickroberts@blueyonder.co.uk> writes:

> "Robert A Duff" <bobduff@shell01.TheWorld.com> wrote in message
> news:wcc7k9mi4rb.fsf@shell01.TheWorld.com...
> 
> > Jakub Zawadzki <darkjames@poczta.onet.pl> writes:
> >
> > > It's guestions from my friend
> > > Emaix>I have a question. Does a String(1..X) occupy X bytes always, no
> > > Emaix> matter what actual length the string has got?
> >
> > Heh?  The length of the string *is* X.  So yes, it occupies X bytes
> > (plus whatever dope is necessary).
> 
> Sometimes a srting such as, for example, defined by String(1..10), will
> occupy 20 or 40 bytes (plus 'dope information'), unless pragma Pack is
> applied to it. This is because normally the compiler will allocate one
> 'storage element' per character (so as to maximise speed of access to it)
> and on some target machines storage elements are 16 or 32 bits in size.
> (Some unusual machines have other sizes of storage element.)

First, I'm willing to bet that the OP is not interested in such
machines.

Second, pragma Pack applies to type String, in all implementations of
Ada, and the requirements on Pack mean 4-chars-per-word on a
32-bit-word-addressable machine.

I think you (Nick) and I have both missed what the OP is getting at.
Perhaps he should clarify the question, perhaps with an example that
illustrates the point...

- Bob



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

* Re: Questions
  2003-04-27 16:02     ` Questions Robert A Duff
@ 2003-04-28 14:20       ` Nick Roberts
  0 siblings, 0 replies; 13+ messages in thread
From: Nick Roberts @ 2003-04-28 14:20 UTC (permalink / raw)


"Robert A Duff" <bobduff@shell01.TheWorld.com> wrote in message

> First, I'm willing to bet that the OP is not interested in such
> machines.
>
> Second, pragma Pack applies to type String, in all implementations of
> Ada, and the requirements on Pack mean 4-chars-per-word on a
> 32-bit-word-addressable machine.

Oops. The famous 'Roberts effect' strikes again. Sorry.

> I think you (Nick) and I have both missed what the OP is getting at.
> Perhaps he should clarify the question, perhaps with an example that
> illustrates the point...

Agreed.

--
Nick Roberts
Jabber: debater@charente.de [ICQ: 159718630]






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

end of thread, other threads:[~2003-04-28 14:20 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.0.1051099700.13478.comp.lang.ada@ada.eu.org>
2003-04-23 17:18 ` Questions tmoran
2003-04-22 17:20 Questions Jakub Zawadzki
2003-04-22 19:59 ` Questions Stephen Leake
2003-04-22 21:47 ` Questions Robert A Duff
2003-04-25 16:57   ` Questions Nick Roberts
2003-04-27 16:02     ` Questions Robert A Duff
2003-04-28 14:20       ` Questions Nick Roberts
  -- strict thread matches above, loose matches on Subject: below --
1999-11-11  0:00 Questions Nobat
1999-11-11  0:00 ` Questions Tucker Taft
1999-11-11  0:00   ` Questions nobat
1999-11-11  0:00   ` Questions David Botton
1999-11-11  0:00   ` Questions nobat
1991-11-05 12:58 Questions Hugh Dunne

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