Skip to content
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

Refresh inline documentation #135

Open
lexidor opened this issue May 6, 2020 · 0 comments
Open

Refresh inline documentation #135

lexidor opened this issue May 6, 2020 · 0 comments

Comments

@lexidor
Copy link
Contributor

lexidor commented May 6, 2020

Some of the docblocks have drifted away from the implementation.
The most common cause of this drift is functions that have been changed to take Containers instead of Traversables.

/**
 * Returns a new vec containing the subsequence of the given Traversable
 * determined by the offset and length.
 *
 * If no length is given or it exceeds the upper bound of the Traversable,
 * the vec will contain every element after the offset.
 *
 * - To take only the first `$n` elements, see `Vec\take()`.
 * - To drop the first `$n` elements, see `Vec\drop()`.
 *
 * Time complexity: O(n), where n is the size of the slice
 * Space complexity: O(n), where n is the size of the slice
 */
<<__Rx>>
function slice<Tv>(
  Container<Tv> $container, // I am Container<T>, not Traversable<T>
  int $offset,
  ?int $length = null,
): vec<Tv>;

I will have a look at this later, when I have some time to kill.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant