Xref: utzoo comp.object:1476 comp.lang.eiffel:1011 Path: utzoo!attcan!uunet!bu.edu!rpi!zaphod.mps.ohio-state.edu!samsung!know!slug!wex From: wex@dali.pws.bull.com (Buckaroo Banzai) Newsgroups: comp.object,comp.lang.eiffel Subject: Re: Should a constructor do "work"? Message-ID: Date: 18 Jul 90 16:07:47 GMT References: <55236@microsoft.UUCP> <519@tetrauk.UUCP> <364@eiffel.UUCP> Sender: troot@pws.bull.com Followup-To: comp.object Organization: Bull Worldwide Information Systems Inc. Lines: 26 Nntp-Posting-Host: dali.pws.bull.com In-reply-to: bertrand@eiffel.UUCP's message of 12 Jul 90 19:23:03 GMT In article <364@eiffel.UUCP> bertrand@eiffel.UUCP (Bertrand Meyer) writes: If invariants are checked and a creation operation raises an exception, the target of the Create should remain void, excluding any creation of an inconsistent object. I don't understand why this is so. I agree that it's one way to specify a language, but surely it's not the only way. For example, let's say that I create an object, and as part of that creation, I wish to initialize some of its slots (oops, my CLOS is showing :-). Suppose then that some of the initialization fails. Can't I write a specification that says "the value will be a list of numbers or NULL"? Then when the initialization fails, I can return an object with that particular slot having a NULL value. This would fulfill the specification; are you saying that this would not "raise an exception" in the sense that you mean it above? -- --Alan Wexelblat Bull Worldwide Information Systems internet: wex@pws.bull.com phone: (508) 294-7485 (new #) Usenet: spdcc.com!know!wex "The aim of life, its only aim, is to be free. Free of what? Free to do what? Only to be free, that is all."