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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,da9f9995bafb51df,start X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.236.170 with SMTP id uv10mr7640805pbc.4.1333745381758; Fri, 06 Apr 2012 13:49:41 -0700 (PDT) MIME-Version: 1.0 Path: r9ni26456pbh.0!nntp.google.com!news2.google.com!news.glorb.com!feeder.erje.net!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: deuteros Newsgroups: comp.lang.ada Subject: Assigning a "subclass" instance to a "superclass" variable Date: Fri, 6 Apr 2012 20:49:41 +0000 (UTC) Organization: A noiseless patient Spider Message-ID: Injection-Date: Fri, 6 Apr 2012 20:49:41 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="QF15JMfcBFrmxWoj0L/Q9g"; logging-data="9266"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ysBafz9WWygA3xxy9bNFH/kJThCfrQ8w=" User-Agent: Xnews/2009.05.01 X-Antivirus-Status: Clean X-Antivirus: avast! (VPS 120406-1, 04/06/2012), Outbound message Cancel-Lock: sha1:v5pHDUhTj/EZFxylTVHEUyH8tZU= Date: 2012-04-06T20:49:41+00:00 List-Id: I'm still trying to understand how Ada does object orientation. In Java I could do this: Class Animal { String color; public Animal(String color) { this.color = color; } } Class Dog extends Animal { public Dog(String color) { super(color); } } So in Ada I'm trying to achieve something similar with my Statement package: package Statements is type Statement is abstract tagged record tokens : Vector; executedtokens : Vector; end record; type Statement_Access is access all Statement'Class; function execute(skip: in Boolean; S: in Statement) return Integer is abstract; end Statements; So when I create a child of Statement, how to I set up the .ads file?