Merge: Attribute block
authorJean Privat <jean@pryen.org>
Fri, 31 Oct 2014 11:17:49 +0000 (07:17 -0400)
committerJean Privat <jean@pryen.org>
Fri, 31 Oct 2014 11:17:49 +0000 (07:17 -0400)
commit070e1b057608034e4907e023f0fec6004b5fdfe9
tree80e83fbd5f9e0f2e66b5f47a823cf0eb19c492fe
parentafceecbf6dd2d924ef63c33be2c27bf19ce92822
parent2fff99f94cd6f5bba93578fe176ad64e82f32dae
Merge: Attribute block

As promised in #832, here the attribute initialized with a block instead of a simple expression.

The syntax is quite strange but nobody complained in #832.
The final value is returned with a `return` and the `do` block follows optional annotation to look like the definition of methods.

`lazy` and all other annotations on attributes should works as expected.

~~~
class A
   var foo: String do return "Hello"
   var bar: String is lazy do
      return foo + ", world!"
   end
end
var a = new A
print a.bar # => hello, world!
~~~

Pull-Request: #858
Reviewed-by: Alexandre Terrasa <alexandre@moz-code.org>