Re: Eiffel syntax and the ';'
Matt Francomb <[email protected]> 19 Aug 2005 22:41:51 +0100
| Newsgroups | gmane.comp.lang.eiffel.smalleiffel |
|---|---|
| Message-ID | <[email protected]> |
On Fri, 2005-08-19 at 12:26, alan lamer wrote: > > > > Here, the compiler is confronted by two possible > > interpretations: > > x.f; > > (x + x).f; > > or x.f(x + x).f; [...] > . > > Well, beyond the fact the first interpretation was of > course intended, the second interpretation is always > false since Eiffel doesn't allow function polymophism. > So as long as > class X > [...] > feature > f is do .... end > f (x: Y) is do .... end > [...] > end > is forbidden, there can't be any ambiguity. > [...] > > Again, as long as overloading is not allowed in Eiffel > for function prototypes (such as in C++), the code i > wrote was definitively not a mistake since there is no > ambiguity. [...] Both interpretations are /syntactically/ legal and therefore there is syntactical ambiguity which may be resolved in the syntax-analysis phase by the use of a semicolon, quite possibly before any definition of class X has been seen, and certainly before any semantic analysis of it has been done. The /semantic/ point that you make is irrelevant to a discussion of syntax. > > And according to the response of Berend de Boer, i > will consider this as a compiler bug. You are, of course, at liberty to consider it so if you choose to, but it most definitely is not. This is the way the syntax of the language is defined. -- Matt Francomb