-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Add API docs for StaticArray #6404
Add API docs for StaticArray #6404
Conversation
src/static_array.cr
Outdated
@@ -1,4 +1,26 @@ | |||
# A fixed-size, stack allocated array. | |||
# | |||
# `StaticArray` is a generic type with type argument `T` specifying the type of | |||
# it's elements and `N` the fixed size. For example `StaticArray(Int32, 3)` |
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 think "its" instead of "it's" is correct here.
fba921f
to
c2aa4a9
Compare
@@ -1,4 +1,26 @@ | |||
# A fixed-size, stack allocated array. | |||
# | |||
# `StaticArray` is a generic type with type argument `T` specifying the type of | |||
# its elements and `N` the fixed size. For example `StaticArray(Int32, 3)` |
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.
Shouldn't it be
its elements and
N
is the fixed size.
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.
This is a deliberate omission. The second part of the sentence contains an elliptical construction (it would be specifying
).
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.
@straight-shoota Thanks for explanation. TIL.
src/static_array.cr
Outdated
# ``` | ||
# | ||
# The generic argument type `N` is a special case in the type grammar as it | ||
# doesn't specify a type but a size. It's value can be an `Int32` literal or |
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.
Its
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.
Damn 🔥
15d9068
to
512964f
Compare
Added an example for use with `uninitialized`
512964f
to
7996cd5
Compare
No description provided.