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,3ccb707f4c91a5f2 X-Google-Attributes: gid103376,public From: mg@dsd.camb.inmet.com (Mitch Gart) Subject: Re: Java vs Ada 95 (Was Re: Once again, Ada absent from DoD SBIR solicitation) Date: 1996/10/15 Message-ID: #1/1 X-Deja-AN: 189568875 sender: news@inmet.camb.inmet.com (USENET news) x-nntp-posting-host: dsd.camb.inmet.com references: organization: Intermetrics, Inc. newsgroups: comp.lang.ada Date: 1996-10-15T00:00:00+00:00 List-Id: Brian Rogoff (rogoff@sccm.Stanford.EDU) wrote: : Besides GC, which is arguable, no one has : listed any *language* advantages of Java over Ada. Calling superclass methods is easy in Java and hard in Ada: type parent_obj is tagged record ...; type parent_ptr is access all parent_obj; procedure p(param: access parent_obj); type child_obj is new parent_obj with ...; type child_ptr is access all child_obj; procedure p(param: access child_obj); now inside the child's p, to call the parent's p: p(parent_obj(param.all)'access); is the way to do it. Converting the pointer to parent_ptr won't work because the call will dispatch back to the child. This ".all'access" trick is pretty painful. In Java the keyword "super" does what's wanted: super.p(); Calling the parent type's operation is common in OOP and is painful to code, and read, in Ada. - Mitch