comp.lang.ada
 help / color / mirror / Atom feed
From: Ted Dennison <dennison@telepath.com>
Subject: Re: FIXED vs BOUNDED strings in Ada 95
Date: 2000/01/21
Date: 2000-01-21T00:00:00+00:00	[thread overview]
Message-ID: <86aght$jft$1@nnrp1.deja.com> (raw)
In-Reply-To: 20000119161944.5261.qmail@web207.mail.yahoo.com

In article <20000119161944.5261.qmail@web207.mail.yahoo.com>,
  comp.lang.ada@ada.eu.org wrote:
> Could someone please provide a paragraph or two
> explaining the difference between
> fixed and bounded strings?

Bascily bounded strings prevent you from having to keep an extra
variable around to keep track of the current number of valid characters
in the string.

But 9 times out of 10 you can initialize a (fixed) String object with
the contents it needs to have and not have to bother with modifying it.
Its rare that an Ada programmer really needs to modify a string object.
When you do, its usually more convienent to use Unbounded strings.
Unfortunately, Text_IO.Get_Line is an exception.

> ... so far it seems like Ada's use of
> strings(all of them), is quite awkward.

The Ada way is actually a great way to deal with strings, once you get
used to it. The trick is to do everything you can with constants
(which in Ada can be declared in any scope you choose). To bone up, I
suggest looking through some of the examples in the Ada Source Code
Treasury at http://www.adapower.com/source.html

> Oracle's PL/SQl which is structured after Ada,
> provided a much easier and way more functional way.

I haven't used PL/SQl. Only C, Pascal, Fortran, Lisp, Basic, various
assemblers, TCL, Modula-2, Java, Ada, AHPL, Rexx, Ratfor, Concurrent-C,
and Oberon. So for all I know I'm missing out on some great paridigm
that will make Ada strings look pathetic by comparison. But I haven't
seen it yet.

--
T.E.D.

http://www.telepath.com/~dennison/Ted/TED.html


Sent via Deja.com http://www.deja.com/
Before you buy.




      parent reply	other threads:[~2000-01-21  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-19  0:00 FIXED vs BOUNDED strings in Ada 95 MaryAnn Atkinson
2000-01-19  0:00 ` Robert C. Leif, Ph.D.
2000-01-21  0:00 ` Ted Dennison [this message]
replies disabled

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