FIXED vs BOUNDED strings in Ada 95 
Author Message
 FIXED vs BOUNDED strings in Ada 95

Could someone please provide a paragraph or two
explaining the difference between
fixed and bounded strings?

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

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

MAA
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://www.*-*-*.com/



Sun, 07 Jul 2002 03:00:00 GMT  
 FIXED vs BOUNDED strings in Ada 95
From: Robert C. Leif, Ph.D.
To: MaryAnn Atkinson et al.

Fixed strings contain a constant number of characters; the length of the
string. Bounded strings contain a maximum number of characters. The actual
number of characters is also available as a function. Thus a
Line_Bounded_String could contain from 0 to 80 characters. Bounded strings
are a very efficient and useful construct.

Quote:
-----Original Message-----

Sent: Wednesday, January 19, 2000 8:20 AM

Subject: FIXED vs BOUNDED strings in Ada 95

Could someone please provide a paragraph or two
explaining the difference between
fixed and bounded strings?

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

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

MAA
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com



Sun, 07 Jul 2002 03:00:00 GMT  
 FIXED vs BOUNDED strings in Ada 95

Quote:

> 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.

Quote:
> ... 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

Quote:
> 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.



Tue, 09 Jul 2002 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Java vs Ada 95 (Was Re: Once again, Ada absent from DoD SBIR solicitation)

2. Java vs Ada 95 (Was Re: Once again,Ada absent from DoD SBIR

3. Renaming Fixed Point Mutiplicative operator in Ada 95

4. LGL Seminar: GNU Ada 95 and Mixed Language Programming with Ada 95

5. LGL Seminar: GNU Ada 95 and Mixed Language Programming with Ada 95

6. Lower bound of result of Ada.Strings.Unbounded.Slice

7. Design of Ada.Strings.Bounded

8. Ada.strings.bounded problems?

9. OO vs Reality: An Ada 95 Solution?

10. Fast locking (Was Re: Java vs Ada 95)

11. Java vs Ada 95

12. ADA 95 vs. JAVA

 

 
Powered by phpBB® Forum Software