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,38c827f7e800d317 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-27 07:27:49 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!diablo.theplanet.net!newspeer1-gui.server.ntli.net!ntli.net!news-hub.cableinet.net!blueyonder!internal-news-hub.cableinet.net!news-binary.blueyonder.co.uk.POSTED!53ab2750!not-for-mail User-Agent: Microsoft-Entourage/10.1.1.2418 Subject: Re: conversion From: Bill Findlay Newsgroups: comp.lang.ada Message-ID: References: Mime-version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Date: Fri, 27 Jun 2003 15:26:36 +0100 NNTP-Posting-Host: 80.195.75.181 X-Complaints-To: abuse@blueyonder.co.uk X-Trace: news-binary.blueyonder.co.uk 1056724068 80.195.75.181 (Fri, 27 Jun 2003 14:27:48 GMT) NNTP-Posting-Date: Fri, 27 Jun 2003 14:27:48 GMT Organization: blueyonder (post doesn't reflect views of blueyonder) Xref: archiver1.google.com comp.lang.ada:39815 Date: 2003-06-27T15:26:36+01:00 List-Id: On 27/6/03 13:37, in article uznk3u258.fsf@nasa.gov, "Stephen Leake" wrote: > "Andrew" writes: >> A fixed string in Ada (to me) is like declaring a char [], you must >> specify a size at compile time. > > Yes. Actually, no. The size of a fixed string is determined when its declaration is elaborated. You specify the index subtype bounds (and hence the size) at run time. The bound values need not be known at compile time, although they may be. I'm not being pedantic, this is a surprise to many C* programmers. In the case of a local string variable, it may take a different size each time its scope is entered, e.g.: function f (n : positive) return String is s : String(1..n) := (others => ' '); begin if n > 1 then return s & f(n-1); end if; return s; end f; This returns a blank string of length n(n+1)/2. -- Bill-Findlay chez blue-yonder.co.uk ("-" => "")