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.9 required=5.0 tests=BAYES_00,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8c424d8135e68278 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-12 10:14:45 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.direct.ca!look.ca!wn1feed!wn3feed!worldnet.att.net!204.127.198.204!attbi_feed4!attbi_feed3!attbi.com!rwcrnsc54.POSTED!not-for-mail From: "Mark Lundquist" Newsgroups: comp.lang.ada References: <9v4jsj$bd1$1@infosun2.rus.uni-stuttgart.de> <9v7f26$qn2$1@infosun2.rus.uni-stuttgart.de> <3C1754BA.C4560423@informatik.uni-jena.de> <9v7q8r$1f5$1@infosun2.rus.uni-stuttgart.de> Subject: Re: Ada2005 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Message-ID: Date: Wed, 12 Dec 2001 18:14:44 GMT NNTP-Posting-Host: 204.127.202.211 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc54 1008180884 204.127.202.211 (Wed, 12 Dec 2001 18:14:44 GMT) NNTP-Posting-Date: Wed, 12 Dec 2001 18:14:44 GMT Organization: AT&T Broadband Xref: archiver1.google.com comp.lang.ada:17853 Date: 2001-12-12T18:14:44+00:00 List-Id: "Ted Dennison" wrote in message news:nxKR7.58838$xS6.95364@www.newsranger.com... > In article <9v7q8r$1f5$1@infosun2.rus.uni-stuttgart.de>, Peter Hermann says... > > > >Carsten Freining wrote: > >> Best example is the object oriented part, because it is not possible to have > >> constants as components. > > > >Compiler maintainers may insert the already existing keywork "constant" > >in coffee break time. It'd be better if others would study RM 3.7 during their coffee break time :-) > > Why would anyone want to? Isn't it rather stupid to allocate space in several > objects to a field that will always be the same? I understand why C++ does this: > they don't have packages to put their constants into. So if one wants to > associate a constant with a class, there is no choice but to do it this way and > waste the space. No... you can do this in Foo.h: class Foo { static int i; . . in Foo.C (typically): int Foo::i = something; It's kind of wack, but we do have this in C++. I think what the OP means is something like a const data member in C++. If so, he should learn about discriminants. > >> And there is still the fixed length String. I don't think it is neccessary. > > > >The fixed length string is a core requirement for > >bread_and_butter_softworkers. > > I don't think the poster has much experience with Ada strings. Anyone who truly > understood Ada strings would never say something like this. In fact, its almost > the *opposite* of what is true. Its fairly rare that I ever need to use > Ada.Strings.* (well...some of the stuff in Ada.Strings.Fixed comes in handy > fairly often :-) ). > > >> compatibility they both can still be available, but I think it is an ancient > >> thing to still have a fixed length String were only String with exactly the > >> same length can be assigned. > > This is part of the core misunderstanding here. Its unusual that one ever needs > to "modify" a string, once its initial value is set. Most of what others may > consider "modifications" are actually dynamicly arriving at the initial value, > or building new strings using old ones as a base. Both of these situations can > usually be handled just fine with Ada's "old-fashioned" fixed strings. Yes to all of the above. > > I think part of the stumbling block here for beginners is that one of the > exceptions to this is one of the first things they will try to do: Ada.Text_IO. > Perhaps there should be a revision in there to include a version of Get_Line > implemented as a function. ...such as GNAT's Ada.Strings.Unbounded.Text_IO.Get_Line. I think it would be great if that were added to the standard in a language revision. > That would allow beginners to get off on the right > foot with string manipulation. This seems to be a legitimate problem. > Agreed! -- mark