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,744136b4fae1ff3e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-11 02:52:13 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!syros.belnet.be!news.belnet.be!feed.news.nacamar.de!newsfeed.vmunix.org!news-FFM2.ecrc.net!news.iks-jena.de!not-for-mail From: Lutz Donnerhacke Newsgroups: comp.lang.ada Subject: Re: [Spark] Converting Arrays Supersedes: Date: Tue, 11 Mar 2003 10:52:12 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: NNTP-Posting-Host: taranis.iks-jena.de X-Trace: branwen.iks-jena.de 1047379932 13131 217.17.192.37 (11 Mar 2003 10:52:12 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Tue, 11 Mar 2003 10:52:12 +0000 (UTC) User-Agent: slrn/0.9.7.4 (Linux) Xref: archiver1.google.com comp.lang.ada:35176 Date: 2003-03-11T10:52:12+00:00 List-Id: * Rod Chapman wrote: > A common trick in this case is to use a local, > hidden procedure to initialise the out parameter: Cool idea. I read the book yesterday evening till midnight and came to the conclusion, that I have to replace Fullpath by a large constraint array. This was obviosly wrong. You can always switch off Spark checkings when running into trouble. :-/ But how can I write the required pre conditions? ******************************************************* Listing of SPARK Text SPARK95 Examiner with VC and RTC Generator Release 6.3 / 11.02 Demonstration Version ******************************************************* DATE : 11-MAR-2003 11:49:13.68 Line 1 with Kernel.Linux_i86; 2 --# inherit Kernel, Kernel.Linux_i86; 3 4 package Kernel.IO is 5 pragma Pure; 6 7 subtype long is Linux_i86.long; 8 9 type Fullpath is array(Positive range <>) of Character; 10 procedure To_Fullpath (s : String; path : out Fullpath); 11 --# derives path from s; 12 --# pre s'Length < path'Length; ^1 *** ( 1) Semantic Error:322: Only imports may be referenced in pre-conditions or return expressions. 13 pragma Inline (To_Fullpath); 14 pragma Inline_Always (To_Fullpath); [...] 5 summarised warning(s), comprising: 5 pragma(s)* (*Note: the above warnings may affect the validity of the analysis.)