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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,45b47ecb995e7a3 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-14 01:50:04 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-FFM2.ecrc.net!news.iks-jena.de!lutz From: lutz@iks-jena.de (Lutz Donnerhacke) Newsgroups: comp.lang.ada Subject: Re: Ada Idioms Progress Preview Date: Tue, 14 Aug 2001 08:49:41 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: <3B6F1B2F.4FC3C833@gsde.hou.us.ray.com> <5ee5b646.0108071819.6e84e33d@posting.google.com> <3_Xc7.45$NM5.84779@news.pacbell.net> NNTP-Posting-Host: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 997778981 28497 217.17.192.37 (14 Aug 2001 08:49:41 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Tue, 14 Aug 2001 08:49:41 +0000 (UTC) User-Agent: slrn/0.9.6.3 (Linux) Xref: archiver1.google.com comp.lang.ada:11896 Date: 2001-08-14T08:49:41+00:00 List-Id: * Ole-Hjalmar Kristensen wrote: >One thing which can be said in favour of having a terminator character is >that it frees you from having to store the length explicitly. This requires an out-of-band terminator, which does not exists in C. Instead they prefer to use a valid character they do not need at the moment. But the real problem of a terminator character is creating a view: In order to reference a substring you have to create a full copy of the substring because you have to insert the terminal character. Inserting it directly into the main version would cause serve damage. Dealing with copies: - is time inefficient. - is semantical different modulo modifications. - is space inefficient. - requires heap space instead of stack space. >The length of a string is usually different from the size of the array >used to store the string. It's not necessary to provide a buffer to hold any possible string of a given type if you can pass complex objects to or from a function. C can only pass primitive types and therefore switched to passing pointers of implicit terminated arrays.