From: Jean Privat Date: Tue, 22 Jul 2014 03:17:01 +0000 (-0400) Subject: Merge: understand writable as an annotation X-Git-Tag: v0.6.7~32 X-Git-Url: http://nitlanguage.org Merge: understand writable as an annotation ~~~.rb class Toto var x: Int writable = 5 # before var y: Int = 5 is writable # after ~~~ This should become the new way, so while an active migration is not needed yet, once this PR is merger, new code should use the new notation. Bonus: writable accepts an optional agrument that is the name of the writer. This allows the reserve the name `foo=` for high-level setters. Eg. ~~~.rb class Toto var x: Int is private writable(set_x) # generates `set_x` instead of `x=` fun x=(v: Int) do # `x=` is feee, so I can use it for a distinct method assert x >= 0 set_x(v) # I use the generated `set_x` as a private internal setter end end ~~~ Pull-Request: #601 Reviewed-by: Lucas Bajolet Reviewed-by: Alexandre Terrasa --- 6f907facf0708d90a8f589370dc44cd5d7ce89a3