Path: utzoo!attcan!uunet!mcsun!ukc!pyrltd!root44!hrc63!mrcu!paj From: paj@mrcu (Paul Johnson) Newsgroups: comp.lang.eiffel Subject: Re: Lack of Enumerated types (was Storing C pointers in Eiffel code) Message-ID: <755@puck.mrcu> Date: 14 Dec 90 09:16:26 GMT References: <1039@tetrauk.UUCP> <1990Dec5.171420.22935@bony1.uucp> <1047@tetrauk.UUCP> <18527@rasp.eng.cam.ac.uk> <1054@tetrauk.UUCP> Reply-To: paj@uk.co.gec-mrc (Paul Johnson) Organization: GEC-Marconi Research Centre, Great Baddow, UK Lines: 22 Summary: Expires: Sender: Followup-To: As I understand it, the reason Eiffel does not have enumerated types and did not originally have an `inspect' statement is that if you are using these facilities then you are doing it wrong. Your inspect clauses should be split up into separate classes which inherit their interface from one base class. The dynamic types of the object instances then replace the values of the enumeration. This is what distinguishes OO programming from structured programming. The only time inspect statements are needed is when doing things like processing input or interfacing to C code written with case statements in mind. On the other language design points, I think a type ADDRESS would be a Good Thing. OK, its dangerous, but no more so than INTEGER, and some more elegant interface to C which does not require external libraries for trivial jobs would be a good idea too. Paul. -- Paul Johnson UUCP: !mcvax!ukc!gec-mrc!paj --------------------------------!-------------------------|------------------- GEC-Marconi Research is not | Telex: 995016 GECRES G | Tel: +44 245 73331 responsible for my opinions. | Inet: paj@uk.co.gec-mrc | Fax: +44 245 75244