Path: utzoo!attcan!uunet!lll-winken!csd4.milw.wisc.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!ucsd!ucsbcsl!eiffel!bertrand From: bertrand@eiffel.UUCP (Bertrand Meyer) Newsgroups: comp.lang.eiffel Subject: Re: Multi-branch instructions and unique values (Version 2.2 preview) Message-ID: <130@eiffel.UUCP> Date: 23 Mar 89 03:18:14 GMT References: <122@eiffel.UUCP> <4377@enea.se> Organization: Interactive Software Engineering, Santa Barbara CA Lines: 36 From <4377@enea.se>, sommar@enea.se (Erland Sommarskog): > I object to [...] the comparison to Ada and Pascal. > [... Discussion of Pascal and Ada mechanism ..] I checked my original message and I don't think anything it said contradicted Mr. Sommarskog's discussion of the Pascal and Ada mechanisms. My only precise reference to these languages in the description of the multi-branch choice <122@eiffel.UUCP> was: >> The test instruction (as its Pascal and Ada counterparts) is >> potentially dangerous because it reflects the programmer's >> expectation that the value of e will be one of the stated test values. I think this statement is correct; in particular, the Pascal and Ada techniques described by Mr. Sommarskog in his message do not invalidate it. I also considered in detail Mr. Sommarskog's arguments in favor of an optional ``else'' clause and I think he is right. The mechanism will be emended accordingly. An exception will still be raised if no ``else'' clause is present and the value of the discriminant matches none of the values listed in the ``when'' clause. There will also be one minor other change: the keyword for the multi-branch instruction will be something else than ``test''. It occurred to me that at least one out of every three new users is bound to write a first trial class called TEST, implying that his first encounter with the Eiffel tools would now be some message of the form ``test is a reserved word and cannot be used as a class name''. Better choose a less obvious keyword. I am grateful to Mr. Sommarskog for his observations. -- -- Bertrand Meyer bertrand@eiffel.com