From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,614f6d018cd52b0f X-Google-Attributes: gid103376,public From: Ted Dennison Subject: Re: FIXED vs BOUNDED strings in Ada 95 Date: 2000/01/21 Message-ID: <86aght$jft$1@nnrp1.deja.com>#1/1 X-Deja-AN: 575841760 References: <20000119161944.5261.qmail@web207.mail.yahoo.com> X-Http-Proxy: 1.0 x40.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Fri Jan 21 20:45:54 2000 GMT X-MyDeja-Info: XMYDJUIDtedennison Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.7 [en] (WinNT; I) Date: 2000-01-21T00:00:00+00:00 List-Id: 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.