Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!think.com!mintaka!bloom-beacon!eru!hagbard!sunic!enea!sommar From: sommar@enea.se (Erland Sommarskog) Newsgroups: comp.lang.eiffel Subject: Multiple creation routines. Message-ID: <2295@enea.se> Date: 8 Dec 90 22:11:55 GMT References: <4106@tantalum.UUCP> <1045@tetrauk.UUCP> <4212@tantalum.UUCP> Organization: Enea Data AB, Sweden Lines: 37 Also sprach Tom H. Meyer (tom@ozmium.UUCP): (he is also >>>) >In article <1045@tetrauk.UUCP> Rick Jones (rick@tetrauk.UUCP) writes: >>>I dislike this on the grounds that it would *require* that 'Create' be a >>>keyword. I hope to see the day when classes can have more than one >>>creation routine and this seems to disallow it. >> >>Of course Create currently IS a keyword in effect. The idea of multiple >>creates is interesting, but if you needed them, would they not be >>differentiated by their parameters? > >Not necessarily. It's easy for me to envision two different creation routines >that had identical interfaces. Wait guys! Dr. has Meyer already announced this as a coming change in Eiffel 3.0. I just dug up the article in my binder. In short there is first a new clause: CREATION f, g, h .... listing all routines which can create an object. You create an object with x !D! f(...); where x is of type C and D is a descendant of C. f is a creation procedure of D. D is optional, the default being C. If D contains no creation statement breaks down to x !! (I have to admit that I don't like this syntax. I prefer words instead of symbols, but it's not me who is the langauge designer, and I know that Dr. Meyer has another opinion.) -- Erland Sommarskog - ENEA Data, Stockholm - sommar@enea.se