🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.lang.ada
Article #45

Re: clause with

#45
From: Yannick DuchĂŞne (Hibou57)
Date: Wed, 10 Oct 2012 14:23
47 lines
2741 bytes
Le Wed, 03 Oct 2012 13:59:42 +0200, Frédéric Praca  
<frederic.praca@free.fr> a écrit:

> On Wed, 03 Oct 2012 01:54:52 -0700, philippe.torgue wrote:
>
>> bonjour.
> Bonjour
>
>> Ă  quoi sert la clause with dans le cas suivant :
>>
>> main.adb :
>> with montype;
>> procedure main is var1 : natural := 1;
>> .........
>> .........
>> end main;
> Si on ne lit que cela, le but du with est de rendre visible les types et
> fonctions définis dans montype.ads.

Plus précisement, à rendre visible le type et ses opérateurs. Ça ne rend  
pas visible les autres sous‑programmes.

Dans le cas où on ne souhaite pas “with P; use P;”, mais seulement “with  
P;”, si un type T est défini dans P, que P re‑défini certains opérateurs  
standard pour T, comme l’opérateur “+”, alors faire “use P.T;” permet de  
pouvoir écrire “x := t + t;” au lieu d’écrire un encombrant “x := P."+"  
(t1, t2); ”.

-- 
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: Epigrams on Programming — Alan J. — P. Yale University
Technical Details
Message-ID: <op.wlyvk7ceule2fv@douda-yannick>
Path: arc1-ca.pugleaf.net!q10ni65138338wif.0!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.139.MISMATCH!xlned.com!feeder7.xlned.com!multikabel.net!newsfeed10.multikabel.net!feed.xsnews.nl!border-2.ams.xsnews.nl!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news.panservice.it!aioe.org!.POSTED!not-for-mail
References: <4d952fa8-552e-4b34-abac-84899bfbb381@googlegroups.com> <506c28ae$0$1841$426a74cc@news.free.fr>

Show Full Headers
Complete Article Headers
X-Google-Thread: 43d0c745c,69c67130386736b0
X-Google-Attributes: gid43d0c745c,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: FRENCH,UTF8
Received: by 10.14.204.3 with SMTP id g3mr13945515eeo.7.1350353800663;
        Mon, 15 Oct 2012 19:16:40 -0700 (PDT)
Path: arc1-ca.pugleaf.net!q10ni65138338wif.0!nntp.google.com!feeder1.cambriumusenet.nl!feed.tweaknews.nl!85.12.40.139.MISMATCH!xlned.com!feeder7.xlned.com!multikabel.net!newsfeed10.multikabel.net!feed.xsnews.nl!border-2.ams.xsnews.nl!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news.panservice.it!aioe.org!.POSTED!not-for-mail
From: Yannick DuchĂŞne (Hibou57)
 <yannick_duchene@yahoo.fr>
Newsgroups: fr.comp.lang.ada
Subject: Re: clause with
Date: Wed, 10 Oct 2012 16:23:21 +0200
Organization: Ada @ Home
Lines: 47
Message-ID: <op.wlyvk7ceule2fv@douda-yannick>
References: <4d952fa8-552e-4b34-abac-84899bfbb381@googlegroups.com>
 <506c28ae$0$1841$426a74cc@news.free.fr>
NNTP-Posting-Host: xsjFW93iF5s7HVoHhttjrg.user.speranza.aioe.org
Mime-Version: 1.0
X-Complaints-To: abuse@aioe.org
User-Agent: Opera Mail/12.02 (Linux)
X-Notice: Filtered by postfilter v. 0.8.2
Bytes: 2264
Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes
Content-Transfer-Encoding: Quoted-Printable