From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9e5d694241060c24,start X-Google-Attributes: gid103376,public From: Tobias Ritzau Subject: Tagged types and static dispatching Date: 1996/12/02 Message-ID: <32A2E972.28AF@masda.hv.se>#1/1 X-Deja-AN: 201880675 content-type: text/plain; charset=us-ascii organization: Vaxjo University mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 3.0Gold (X11; I; SunOS 5.5 sun4m) Date: 1996-12-02T00:00:00+00:00 List-Id: Hi everyone! I have some trouble understanding some featers of Ada 95. I wrote a small package with a linked list and a list iterator. Of course I wanted the types to be tagged so that I could expand them later on. When I compiled my package I got an error message saying: operation can be displatching in only one type The error was on the restart procedure below. package list is type List is tagged private; type ListIt is tagged private; procedure insert(l : in out List; el : in T); function length(l : in List) return Natural; procedure restart(li : in out ListIt; l : in List); procedure next(li : in out ListIt); function atend(li : in ListIt) return Boolean; function item(li : in ListIt) return T; private ... I removed the tagged keyword from the iterator and then everything compiled ok. Then I reinserted the tagged word and replaced the parameter types by ListIt'Class and List'Class and again everything compiled ok. If I have understood things correctly the Class attributes enables dynamic binding and I don't want to use dynaimc binding. Why can't I use two tagged types as parameters to a sub-program? What is the correct way to do this? Thank you for helping me Tobias Ritzau