🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

ne plus utiliser les arrays

#80
From: letocha
Date: Sun, 10 Feb 2013 19:52
29 lines
2317 bytes
Bonjour,

Je bidouille en Ada , et donc ça ne rentre pas facilement.
Bref, voilà, encore des "stack overflows"

J'ai remplacé mes tableaux unidimensionnels par des containers,
formidable plus d'erreurs.
Et puis j'ai eu besoin de tableau 2D dont chaque élément est un containers.
Et là, dès que la "surface" dudit array passe un seuil : paf...stack overflow
Alors j'ai fait des tableaux de pointeurs...mais je m'emberlificote un tantinet le code.
Donc je veux me passer de ces array, sans passer par les pointeurs.

J'ai trouvé cette information : 
>>>
Access types should be used rarely in Ada. In a lot of circumstances where pointers are used in other languages, there are other ways without pointers. If you need dynamic data structures, first check whether you can use the Ada Container library. Especially for indefinite record or array components, the Ada 2012 package Indefinite_Holders (RM A.18.18) can be used instead of pointers.
<<<

Mais j'aimerais un exemple simple, une implémentation d'un tableau à deux dimensions sur des entiers, par exemple.

Thanks bcp
Technical Details
Message-ID: <8d81b575-b5cf-4034-8173-cd0b01fa8a4f@googlegroups.com>
Path: arc1-ca.pugleaf.net!k2ni21154qap.0!nntp.google.com!p13no7306379qai.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 43d0c745c,de734a879f8e95c8,start
X-Google-Attributes: gid43d0c745c,public,usenet
X-Google-NewGroupId: yes
X-Google-Language: FRENCH,ASCII
X-Received: by 10.224.76.198 with SMTP id d6mr7751848qak.8.1360525928693;
        Sun, 10 Feb 2013 11:52:08 -0800 (PST)
X-Received: by 10.49.116.135 with SMTP id jw7mr807945qeb.10.1360525928628;
 Sun, 10 Feb 2013 11:52:08 -0800 (PST)
Path: arc1-ca.pugleaf.net!k2ni21154qap.0!nntp.google.com!p13no7306379qai.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: fr.comp.lang.ada
Date: Sun, 10 Feb 2013 11:52:08 -0800 (PST)
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2a01:e35:2e51:de10:21e:2aff:feb8:2031;
 posting-account=W5WOAwoAAADKJf0Mwbqw2yIGrYsfxIlw
NNTP-Posting-Host: 2a01:e35:2e51:de10:21e:2aff:feb8:2031
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <8d81b575-b5cf-4034-8173-cd0b01fa8a4f@googlegroups.com>
Subject: ne plus utiliser les arrays
From: letocha <faustogone@gmail.com>
Injection-Date: Sun, 10 Feb 2013 19:52:08 +0000
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable