Mutable Struct with property macro
examples/struct/mutable_struct_with_property_macro.cr
struct Person property name : String property email : String def initialize(@name, @email) end end foo = Person.new("Foo", "me@foo.bar") p! foo p! foo.name p! foo.email foo.email = "new@foo.bar" p! foo.email
foo # => Person(@name="Foo", @email="me@foo.bar") foo.name # => "Foo" foo.email # => "me@foo.bar" foo.email # => "new@foo.bar"