From: Jean Privat Date: Fri, 31 Oct 2014 11:17:49 +0000 (-0400) Subject: Merge: Attribute block X-Git-Tag: v0.6.10~4 X-Git-Url: http://nitlanguage.org 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 --- 070e1b057608034e4907e023f0fec6004b5fdfe9