-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revise and add to Attribute's documentation #3441
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to finish now, but can you please check the comments? Also #2745 is probably the issue you want to target
doc/Type/Attribute.pod6
Outdated
For instance, the names of all the attributes of a type can be introspected | ||
using its L<name|#method_name> method: | ||
|
||
=begin code :solo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why :solo? This would compile correctly, right? And it does not need its own file.
doc/Type/Attribute.pod6
Outdated
|
||
Because of C<Attribute>, a type containing attributes, such as this: | ||
|
||
=for code :solo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand this is still a work in progress, right?
since Attribute is at the level of the metaclass, all is fair game. | ||
=head2 method new | ||
|
||
=for code :skip-test<too long a method signature for one line> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In principle, there should be no problem with so many lines, as long as you use =for code or =begin code
|
||
Creates a new attribute. The following named arguments are required: | ||
|
||
- C<$name> contains the attribute's name, which should always be a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use =item here?
|
I don't think we need "Declared as:" going forward - having the signature as the first line seems obvious enough. Looks like Mu is the only place this was used. |
The problem
Attribute
is documented as being something you normally shouldn't use directly. I think this is useful to do when working with the MOP though, and I useAttribute
like this in an example in the revision of one of the role HOWs' type pages (#3353).Solution provided
Attribute
's type page somewhat and remove some unnnecessary "Defined as:" before each method signature.Attribute
can be used when working with the MOP.Attribute.new
, along withAttribute.is_bound
, andAttribute.is_built
.:bind
with theis built
trait, as this is referred to by the new documentation forAttribute.new
.