Path: utzoo!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!sunic!enea!sommar From: sommar@enea.se (Erland Sommarskog) Newsgroups: comp.lang.eiffel Subject: Re: Eiffel cleanup #1: The creation mechanism Message-ID: <667@enea.se> Date: 20 Jan 90 23:53:35 GMT References: <226@eiffel.UUCP> Organization: Enea Data AB, Sweden Lines: 31 Bertrand Meyer (bertrand@eiffel.UUCP) writes: >There is only one creation instruction. Its most general form is > > x !D! f (...) > >where x is a read-write entity of some type C and D is a descendant of >C; f must be a creation procedure of D. This creates an instance of >D, applies the default initializations, calls f with the actual arguments >given, and attaches the resulting object to x. While I have nothing against the concept as such, rather the opposite, I am not appealed of the syntax. I have the opinion that artificial symbols should be avoided, particulary if they are not commonly used elsewhere. If you don't know Eiffel and looks at a piece of code and sees "x !!" it will take some time until you understand what is going on. (It is possible that !! is common in this meaning. It is new to me, however.) Maybe I have had a too big exposure to Cobol, but I would propose create x as D using f(...) with "as D" and "using f(...)" being optional as in Dr. Meyer's article. This would require a new keyword "using" and that "create" would remain being one. Whether "using" is a common identifier, I don't know, but I wouldn't expect it to be. This not only has the advantage to allievate the readability, but also it gives a better understanding of what you are doing. -- Erland Sommarskog - ENEA Data, Stockholm - sommar@enea.se Unix is a virus.