[Request] standard library BitVector container #118
Locked
sa-
started this conversation in
Show and tell
Replies: 1 comment 7 replies
-
Mojo should be really great at at this. I'd recommend implementing a new BitVector (you pick the name) type, instead of overloading DynamicVector (there are analogies to C++ |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Edit: look at the comments for the updated version
To implement the Apache Arrow spec, one of the components that you need is a validity bitmap. This function is a stepping stone to implement one, and seeing as no one has posted here yet I thought I would do the honours :D
This outputs
255
, as one might expect.Of course, it might be the case that DynamicVector[Bool] is already bitpacked, but this function could be used with other sorts of iterables.
Any feedback or comments are always welcome. Happy Friday!
Beta Was this translation helpful? Give feedback.
All reactions