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)
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>


Trivial merge