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=2.9 required=5.0 tests=BAYES_50,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,953e1a6689d791f6 X-Google-Attributes: gidfac41,public X-Google-Thread: fdb77,953e1a6689d791f6 X-Google-Attributes: gidfdb77,public X-Google-Thread: f79bb,953e1a6689d791f6 X-Google-Attributes: gidf79bb,public X-Google-Thread: 103376,953e1a6689d791f6 X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,953e1a6689d791f6 X-Google-Attributes: gid1108a1,public From: mbk@caffeine.engr.utk.edu (Matt Kennel) Subject: Re: Eiffel and Java Date: 1996/11/01 Message-ID: <55ditr$pnh@gaia.ns.utk.edu>#1/1 X-Deja-AN: 193749991 references: <55562c$nkd@mulga.cs.mu.OZ.AU> <1996Oct31.162218.8386@schbbs.mot.com> followup-to: comp.lang.eiffel,comp.lang.ada,comp.lang.sather,comp.lang.java.advocacy,comp.object organization: University of Tennessee, Knoxville and Oak Ridge National Laboratory reply-to: %%spam repellent: remove this prefix%%kennel@msr.epm.ornl.gov newsgroups: comp.lang.eiffel,comp.lang.ada,comp.lang.sather,comp.lang.java.advocacy,comp.object Date: 1996-11-01T00:00:00+00:00 List-Id: David L. Shang (shang@corp.mot.com) wrote: : In article <55562c$nkd@mulga.cs.mu.OZ.AU> fjh@mundook.cs.mu.OZ.AU (Fergus : Henderson) writes: : > Suppose I have two existing library classes (perhaps supplied by different : > vendors) which have some commonality, but don't inherit from a common : > base class. In Sather, one can simply create a new interface and : > declare these classes to be instances of this interface, without : > modifying the existing code. : > : > (Is that possible in Java?) : > : No. Java supports only top-down class hierarchy construction : (from superclass to subclasses), but not bottom-up: from : subclasses to superclass. : But Sather's superclass construction is limited to non-parametrerized : classes only. This isn't true, at least in 1.1. The following compiles and executes. ------------------------------------------------------- -- demonstrate abstract superclass over a parameterized type. ------------------------------------------------------- abstract class $OVER{T} > $P{T} is feature1(arg:T); end; abstract class $P{T} is feature1(arg:T); feature2(arg:T); end; class CONCRETE{T} < $OVER{T} is feature1(arg:T) is #OUT + "In feature\n"; end; create:SAME is return new; end; end; class MAIN is main is #OUT + "Hello World.\n"; ob :$OVER{INT} := #CONCRETE{INT}; ob.feature1(42); end; end; -------------------------------- : Transframe provides a more powerful superclass construction that : can support parameterized classes. : Suppose we have two existing classes : .... I believe that Sather could express the same concept. : David Shang : -- Matthew B. Kennel/mbk@caffeine.engr.utk.edu/I do not speak for ORNL, DOE or UT Oak Ridge National Laboratory/University of Tennessee, Knoxville, TN USA/ I would not, could not SAVE ON PHONE, |================================== I would not, could not BUY YOUR LOAN, |The US Government does not like I would not, could not MAKE MONEY FAST, |spam either. It is ILLEGAL! I would not, could not SEND NO CA$H, |USC Title 47, section 227 I would not, could not SEE YOUR SITE, |p (b)(1)(C) www.law.cornell.edu/ I would not, could not EAT VEG-I-MITE, | /uscode/47/227.html I do *not* *like* GREEN CARDS AND SPAM! |================================== M A D - I - A M!