|
|
|
|
|
by nemetroid
4360 days ago
|
|
I don't see the similarity. The Ceylon feature I find awkard is that class definitions have two parts (initializer/declaration) with different semantics, without explicit demarcation. In the example above, this code: class Point() {
Float x => y;
Float y => x;
}
is fine, because both declarations are parsed as being in the declaration section. However, when you add another line after that: class Point() {
Float x => y; //compiler error: y is not referenceable
Float y => x;
Float->Float xy = x->y;
}
The original two declarations are now part of the initializer section, because the third line is a statement that is not allowed in the declaration section. This changes the semantics of the first two lines. |
|