gauthier wrote:what if :
...
you could also use
- Code: Select all
.foo is private = anotherParameterName
with multiple constructor overloads:
- it will grab up every found member
- the compiler should fail if non nil members (for references) are not properly initialized over all available constructors
what do you think?
I can't say that I like the idea of having class members generated inside an implementation which could be further into the declaration:
cue init(x as int, y as int)
require
x >= 0 and x < 100
y >= 0 and y < 100
ensure
.x == x and .y == y
body
.x, .y = x, y # <-- in your proposal, this line generates class members
So far the shortcut syntax that we have is still based on declarations like:
I like that there will be a "pro x" or "get x" line that you see in the class declaration, can search for, possibly jump to with an editor key (next declaration, previous declaration).
Also, if we were to put these in the implementation, it would make it very awkward to have doc strings, contracts, modifiers, etc.