Skip to content

Conversation

treeman
Copy link
Contributor

@treeman treeman commented Jul 20, 2014

Examples for Deque, Bitv and BitvSet. Normalize documentation style and some source code reorganization.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not "bit vectors"?

@treeman
Copy link
Contributor Author

treeman commented Jul 20, 2014

That's interesting. I moved some functions to group them more logically, but it appears github renders them as if I rewrote them. I'll see if I can split up the commits.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above. I'm also not quite sure whether #[inline] should live above comments, probably not.

@errordeveloper
Copy link

I know it's a bit laborious, but would makes it easier to review and blame or bisect 👍

@treeman
Copy link
Contributor Author

treeman commented Jul 20, 2014

Yes I totally understand, no worries.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// mark all multiples of i as non-prime (any multiples below i * i 
// will have been marked as non-prime previously)
for j in iter::range(i * i, max_prime, i) { bv.set(j, false) }

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is false divided by 0? :P

Maybe just false (with backticks) is enough?

treeman added 2 commits July 20, 2014 14:32
So all comes in the order union, intersection, difference and
symmetric_difference.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, you can efficiently implement a stack with just Vec (via .push and .pop), no need for Deque or RingBuf. Maybe this could be moved to after the queue example?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example and those below don't have the closing

```

@huonw
Copy link
Contributor

huonw commented Jul 20, 2014

Awesome docs! Thanks so much for this.

@treeman
Copy link
Contributor Author

treeman commented Jul 20, 2014

I think I've got the commits sorted out and I've simplified most examples.

Thanks for the good eyes and tips!

@treeman treeman deleted the deque-bitv-doc branch July 22, 2014 05:31
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

Successfully merging this pull request may close these issues.

4 participants