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 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,133de21eb82605b X-Google-Attributes: gid103376,public From: Rod Chapman Subject: Re: How do functions return unbounded arrays? Date: 1998/06/17 Message-ID: <35879C27.634A3E0@praxis-cs.co.uk>#1/1 X-Deja-AN: 363476049 Content-Transfer-Encoding: 7bit References: <358444BA.757121D8@cl.cam.ac.uk> <1998061518584100.OAA28557@ladder01.news.aol.com> <35865075.9D7DCBD@cl.cam.ac.uk> <6m80o6$9st$1@erlang.praxis-cs.co.uk> Content-Type: text/plain; charset=us-ascii Organization: Praxis plc, U.K. Mime-Version: 1.0 Newsgroups: comp.lang.ada Date: 1998-06-17T00:00:00+00:00 List-Id: > They are in general forbidden in SPARK. > However, the "&" operator is allowed on string literals as you would expect a > compiler to handle this case statically. Your mileage varies... In Ada83, things which you "expect the compiler to handle statically" often aren't. Some compilers are better at spotting static expressions above-and-beyond what is strictly required by the Ada83 LRM (e.g. XD-Ada). Some stick more closely to the letter of the law and generate more dynamic code for expressions even if they _could_ be evaluated statically (e.g. the "old" Alsys technology) In Ada95 (and thus SPARK95), things are much better, since the definition of "static" covers a much larger set of expressions, and the RM's implementation advice gives you a pretty clear idea of what to expect. For critical and real-time work, I _always_ check with the compiler vendor and/or read the generated code for these bits of the language. - Rod Chapman rod@praxis-cs.co.uk