Deutsch   English   Français   Italiano  
<a98095df-01d5-45ef-8bd3-ac2968e0a344n@googlegroups.com>

View for Bookmarking (what is this?)
Look up another Usenet article

X-Received: by 2002:ac8:5b03:0:b0:410:a9dd:9fe4 with SMTP id m3-20020ac85b03000000b00410a9dd9fe4mr15355qtw.1.1693520329827;
        Thu, 31 Aug 2023 15:18:49 -0700 (PDT)
X-Received: by 2002:a05:620a:8b0e:b0:76f:cd2:8583 with SMTP id
 qw14-20020a05620a8b0e00b0076f0cd28583mr13083qkn.4.1693520329488; Thu, 31 Aug
 2023 15:18:49 -0700 (PDT)
Path: ...!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: fr.comp.lang.ada
Date: Thu, 31 Aug 2023 15:18:49 -0700 (PDT)
In-Reply-To: <ucql7j$vn3$1@shakotay.alphanet.ch>
Injection-Info: google-groups.googlegroups.com; posting-host=2a02:1210:2e90:8100:8d30:dcc5:34eb:37a6;
 posting-account=gRqrnQkAAAAC_02ynnhqGk1VRQlve6ZG
NNTP-Posting-Host: 2a02:1210:2e90:8100:8d30:dcc5:34eb:37a6
References: <uclnsh$fii$1@shakotay.alphanet.ch> <c3d74ebf-7153-4eb2-a22d-72b7c77ecf0bn@googlegroups.com>
 <uco7u8$156$1@shakotay.alphanet.ch> <26366041-5cd3-4ccf-b1ac-a937a1c53f3en@googlegroups.com>
 <ucql7j$vn3$1@shakotay.alphanet.ch>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <a98095df-01d5-45ef-8bd3-ac2968e0a344n@googlegroups.com>
Subject: =?UTF-8?B?UmU6IFF1ZXN0aW9uIGRlIGfDqW7DqXJpY2l0w6k=?=
From: Gautier write-only address <gautier_niouzes@hotmail.com>
Injection-Date: Thu, 31 Aug 2023 22:18:49 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Bytes: 2808
Lines: 31

> >> Je ne comprends pas "nul : Item_Type" dans les param=C3=A8tres g=C3=A9=
n=C3=A9riques. A=20
> >> quoi sert cette ligne ?=20
> > Enl=C3=A8ve-la et essaie de compiler!
> Oui, =C3=A7a compile pas. Mais =C3=A7a ne r=C3=A9pond pas =C3=A0 ma quest=
ion ;)

Sans cette ligne, le compilateur ne sait pas du tout ce que peut signifier =
ce truc qui s'appelle "nul", l=C3=A0 o=C3=B9 il y a ":=3D nul;"
=C3=89videmment, dans l'instanciation particuli=C3=A8re que tu as en t=C3=
=AAte, ce "nul" est bien un octet de valeur 0, et m=C3=AAme provenant de In=
terfaces.C, surtout qu'il porte par hasard le m=C3=AAme nom.
Mais c'est une co=C3=AFncidence et ton intuition fait son travail.
Tu pourrais avoir dans le code g=C3=A9n=C3=A9rique "terminator" au lieu de =
"nul".
Result (Index_Type (Item'Length + 1)) :=3D terminator;
Dans ce cas, que signifie ou vaut "terminator"? Valeur ? Fonction?...

Tu peux avoir n'importe quel type comme Item_Type.
Un exemple simple:
type U32 is mod 2**32;

type Float_Array is array (U32 range <>) of aliased Float;

function To_Float (c : Character) return Float is (Float (Character'Pos (c)=
));

function To_TW_Float is new To_TW_STR (Float, 3.1415927, U32, Float_Array, =
To_Float);

Tu peux avoir qqch d'un peu plus compliqu=C3=A9:
type My_Item is record a, b, c : Float; d: Positive; end record;