txt: ## attributecontainer.md
  role Metamodel::AttributeContainer
  
  Metaobject that can hold attributes
  
  ```raku
  role Metamodel::AttributeContainer {}
  ```
  
  *Warning*: this role is part of the Rakudo implementation, and is not a part of the language specification.
  
  Classes, roles and grammars can have attributes. Storage and introspection of attributes is implemented by this role.
  
  # [Methods](#role_Metamodel::AttributeContainer "go to top of document")[§](#Methods "direct link")
  
  ## [method add\_attribute](#role_Metamodel::AttributeContainer "go to top of document")[§](#method_add_attribute "direct link")
  
  ```raku
  method add_attribute($obj, $attribute)
  ```
  
  Adds an attribute. `$attribute` must be an object that supports the methods `name`, `type` and `package`, which are called without arguments. It can for example be of [type Attribute](/type/Attribute).
  
  ## [method attributes](#role_Metamodel::AttributeContainer "go to top of document")[§](#method_attributes "direct link")
  
  ```raku
  method attributes($obj)
  ```
  
  Returns a list of attributes. For most Raku types, these will be objects of [type Attribute](/type/Attribute).
  
  ## [method set\_rw](#role_Metamodel::AttributeContainer "go to top of document")[§](#method_set_rw "direct link")
  
  ```raku
  method set_rw($obj)
  ```
  
  Marks a type whose attributes default to having a write accessor. For example in
  
  ```raku
  class Point is rw {
      has $.x;
      has $.y;
  }
  ```
  
  The `is rw` trait on the class calls the `set_rw` method on the metaclass, making all the attributes implicitly writable, so that you can write;
  
  ```raku
  my $p = Point.new(x => 1, y => 2);
  $p.x = 42;
  
  ```
  
  ## [method rw](#role_Metamodel::AttributeContainer "go to top of document")[§](#method_rw "direct link")
  
  ```raku
  method rw($obj)
  ```
  
  Returns a true value if [method set\_rw](#method_set_rw) has been called on this object, that is, if new public attributes are writable by default.
  