comp.lang.ada
 help / color / mirror / Atom feed
From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Re: SPARK syntax and “use type” : lack of feature ?
Date: Tue, 25 May 2010 22:16:02 +0200
Date: 2010-05-25T22:16:02+02:00	[thread overview]
Message-ID: <op.vc92k0f0ule2fv@garhos> (raw)
In-Reply-To: 2ad2886d-3d2c-44b2-bcfe-59172f76436d@q8g2000vbm.googlegroups.com

Le Tue, 25 May 2010 09:29:43 +0200, Rod Chapman  
<roderick.chapman@googlemail.com> a écrit:

>> On May 25, 12:01 am, Phil Thornley <phil.jpthorn...@googlemail.com>  
>> wrote:
>
> Phil is basically correct.
>
> "use type" is only permitted in the language definition in two places:
>
> 1) As a context clause
>
> 2) Directly following an embedded package specification.
>
> BUT...
>
> 1) is fully implemented.
>
> 2) is NOT implemented by any version of the Examiner.
>
> This is documented (somewhat briefly) in section 11.1.1 of
> the toolset release note, and page 402 of the book.
>  - Rod
Unfortunately, I've understood the documentation is somewhat incorrect or  
at least is missing some stuffs, so I'm not always referring to it.

As an example, the SPARK 95 reference states that renames clause can be  
use to drop parent part of package path only and the package have to be  
renamed using its original name exactly ; so, Parent.Child should only be  
renamed as Child to be able to refer to it without having to write the  
“Parent.” every where.

But I could rename some package using other names. The same with  
procedures renaming.

The same with generics. The SPARK reference say the only generic  
instantiation allowed is instantiation of Unchecked_Conversion. However, I  
have some generic packages instantiation, and the syntax checker do not  
complain at all about it. Well, may be it will fail later at the semantic  
analysis, I hope not, or else I will have to drop SPARK... I believe it  
will be OK, as I saw some words somewhere stating SPARK now support  
generic.

Time to say I've also encountered strange things with generic  
instantiation. I can instantiate a generic package only if the package  
name has no prefix and trying to instantiate something like “is new  
Parent.Child (Formal_Parameter => ...)” fails, and “is new Child  
(Formal_Parameter => ...)” is accepted.

-- 
There is even better than a pragma Assert: a SPARK --# check.



  reply	other threads:[~2010-05-25 20:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-24 18:41 SPARK syntax and “use type” : lack of feature ? Yannick Duchêne (Hibou57)
2010-05-24 23:01 ` Phil Thornley
2010-05-25  7:29   ` Rod Chapman
2010-05-25 20:16     ` Yannick Duchêne (Hibou57) [this message]
2010-05-25 20:05   ` Yannick Duchêne (Hibou57)
2010-05-25 23:18     ` Phil Thornley
2010-05-26  7:38       ` Rod Chapman
2010-05-26 10:28         ` Yannick Duchêne (Hibou57)
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox