From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!cleanfeed1-a.proxad.net!nnrp1-1.free.fr!not-for-mail Subject: Re: How to check class type ? Newsgroups: comp.lang.ada References: <60805c0e$0$12690$426a74cc@news.free.fr> From: DrPi <314@drpi.fr> Date: Wed, 21 Apr 2021 19:33:30 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Message-ID: <608061f1$0$21614$426a74cc@news.free.fr> Organization: Guest of ProXad - France NNTP-Posting-Date: 21 Apr 2021 19:33:37 CEST NNTP-Posting-Host: 82.65.30.55 X-Trace: 1619026417 news-3.free.fr 21614 82.65.30.55:52533 X-Complaints-To: abuse@proxad.net Xref: reader02.eternal-september.org comp.lang.ada:61889 List-Id: Le 21/04/2021 à 19:26, AdaMagica a écrit : > DrPi schrieb am Mittwoch, 21. April 2021 um 19:08:32 UTC+2: >> if var'Tag = Leaf1'Tag then >> ... >> elsif var'Tag = Leaf2'Tag then >> ... >> end if; >> >> It works. But is this correct ? > > Why not? > > if Var in Leaf1 then > ... > elsif Var in Leaf2 then > > But normally you would use dispatching. > Why do you need this? > I have a Vector which contains pointers to Leaf1/Leaf2 instances. At some point, I need to know what the cursor points to.