Bit::V...inimal(3pm)

πŸ“¦
version 1.3 Β· 2 versions
  • 1.3 Β· debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking (latest)
  • 1.3 Β· ubuntu jammy
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Bit::Vector::Minimal β€” okay bestie, let's talk bits πŸ’–

So this is Bit::Vector::Minimal, straight out of the User Contributed Perl Documentation corner of the Perl world. It's a whole little module and it is, no cap, the object-oriented wrapper around vec() that your Perl brain has been waiting for. πŸ¦‹


✨ NAME ✨

Bit::Vector::Minimal β€” an object-oriented wrapper around vec(). That's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

Here's you, living your best life:

use Bit::Vector::Minimal;
my $vec = Bit::Vector->new(size => 8, width => 1, endianness => "little");
# These are the defaults

$vec->set(1); # $vec's internal vector now looks like "00000010"
$vec->get(3); # 0

Yes bestie, those are the defaults, I said what I said. ✨


πŸŽ€ DESCRIPTION πŸŽ€

This is the much simplified, lightweight version of Bit::Vector β€” think of it like Bit::Vector's chill younger sibling who still gets the job done. It wraps Perl's vec function (which is, let's be honest, sometimes confusing πŸ™ˆ) inside an object-oriented abstraction, so you get to touch bits without crying. Iconic behavior, honestly. πŸ‘‘


πŸ’… METHODS πŸ’…

🧚 new

Makes you a brand new bit vector. By default you get a one-byte vector with 8 one-bit "slots", and bit zero lives on the right of the bit pattern. Cozy.

Wanna change things up? Pass some parameters to the constructor, queen:

  • size β€” this alters the size in bits of the vector. πŸ“
  • width β€” this alters the width of the slots. πŸ“
  • endianness β€” this controls whether the zeroth place sits on the right or the left of the bit vector. πŸ”„
⚠️ Heads up bestie: the module will die if width is not an integer divisor of size. It is not playing. Do the math first. πŸ’€

πŸ“ set(POS[, VALUE])

Sets the bit or slot at position POS to value VALUE. If you don't hand over a VALUE, it goes "all bits on" instead. It's giving generous. πŸ’–

🌈 get(POS)

Returns the bit or slot sitting pretty at position POS. Just the one. No extras. Periodt. ✨

πŸ”₯ display

Displays the vector. It's for debugging purposes, so like, don't make it your whole UI aesthetic or anything. πŸ‘€


πŸ‘‘ AUTHOR πŸ‘‘

  • Current maintainer: Tony Bowden
  • Original author: Simon Cozens

Two legends, one module. We stan. 🫢


πŸ’€ BUGS and QUERIES πŸ’€

Got beef? Got questions? Got a bug that's living rent-free in your head? Direct all correspondence regarding this module to:

bug-Bit-Vector-Minimal@rt.cpan.org

They're waiting. Be nice. 🌸


🌟 SEE ALSO 🌟

  • Bit::Vector β€” the big one, the original, the blueprint. Go look if you need more than the minimal moment. πŸ’œ

Copyright 2003, 2004 by Kasei.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Slay, legally speaking. βš–οΈβœ¨


perl v5.36.0 Β· 2022-11-20 Β· Bit::V...inimal(3pm)

Okay bestie that's the whole page, every last bit (literally πŸ¦‹) β€” this was documented way back on 2022-11-20, running under perl v5.36.0, filed under that adorable truncated name Bit::V...inimal(3pm). Go forth and vec responsibly. Mwah. πŸ’…πŸ’–πŸŽ€

πŸ“¦ where this page comes from