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: fac41,b87849933931bc93 X-Google-Attributes: gidfac41,public X-Google-Thread: 1108a1,b87849933931bc93 X-Google-Attributes: gid1108a1,public X-Google-Thread: 114809,b87849933931bc93 X-Google-Attributes: gid114809,public X-Google-Thread: 103376,b87849933931bc93 X-Google-Attributes: gid103376,public From: tiggr@es.ele.tue.nl (Pieter Schoenmakers) Subject: Re: Static vs. Dynamic typing again (was Re: OO, C++, and something much better!) Date: 1997/02/15 Message-ID: #1/1 X-Deja-AN: 219045723 Sender: tiggr@tom.ics.ele.tue.nl References: <32E7E08A.3079@parcplace.com> To: pcg@aber.ac.uk (Piercarlo Grandi) Organization: Eindhoven University of Technology Newsgroups: comp.lang.smalltalk,comp.lang.eiffel,comp.lang.ada,comp.object Date: 1997-02-15T00:00:00+00:00 List-Id: In article pcg@aber.ac.uk (Piercarlo Grandi) writes: Consider: class C // bounded stack ... This defines a class and a type encapsulated within it. Now suppose we just added something like the following two procedures: class C // bounded deque ... void *get(); void put(void *) { .... } is the second 'C' the same type as the first 'C", only updated? To me they are completely different types, for they have different semantics, as well as different interface. Instances of one 'C' are not instances of the other 'C'. There are (many, very) valid examples of adding methods to a class, which do not change the semantics of the object. In the example, only adding a `print' method, with the obvious functionality, would not change the semantics of the existing stack objects. Nor would it create a new class. The stack objects would just be able to print themselves. Objective-C (at least the GNU and NeXT implementations) allows methods to be added to a class in a running program. NeXT's runtime library allows method replacement. Cecil allows (library) classes to be extended. `The Cecil language, specification and rationale' does not specify to what extent this is allowed at run time. TOM allows, both at compile time and at run time, methods to be added and replaced. Since the implementation of such methods may need some state to be maintained in the object, instance variables can be added as well. --Tiggr