Data::...::Array(3pm)

πŸ“¦
version 0.11 Β· 5 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

πŸ’– Data::Stream::Bulk::Array β€” the manual, but make it cute πŸ’–

okay bestie, so this is the manual page for Data::Stream::Bulk::Array(3pm) β€” yes the header shortens it to Data::...::Array(3pm) bc apparently even the manpage was feeling a little mysterious that day πŸ™ˆ but it's the same girl, promise.


✨ NAME ✨

Data::Stream::Bulk::Array β€” a Data::Stream::Bulk wrapper for simple arrays. that's it, that's the whole job, and she does it flawlessly πŸ’…


🌸 VERSION 🌸

version 0.11 β€” vintage, iconic, still serving πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

the whole vibe in one little snippet:

return Data::Stream::Bulk::Array->new(
        array => \@results,
);

look at her. tiny. efficient. no notes. ✨


πŸ’œ DESCRIPTION πŸ’œ

so this implementation of the Data::Stream::Bulk api wraps an array. that's the entire personality and honestly? relatable.

the use case here β€” and this is the important bit, bestie, don't skip it β€” is to keep the consumer of the data set implementation agnostic, so that it can deal with larger data sets if they are encountered, but still retain most of the simplicity when the current data set easily fits in memory.

translating from manpage-speak: you write your code so it doesn't care whether the data is a cute little array or a whole sprawling thing, and then if the data grows up and gets huge, your code just... keeps working? no rewrite? no meltdown? no cap, that's the dream 🌈


πŸ‘‘ ATTRIBUTES πŸ‘‘

πŸ’– array

the array reference to wrap. literally just the array you're handing over. that's the whole attribute. she's low maintenance. 🫢


🧚 METHODS 🧚

⭐ next

Returns the array reference on the first invocation, and nothing thereafter.

so: call her once, you get the array ref. call her again... she's done. she's moved on. she's not coming back. πŸ’€

⭐ is_done

Returns true if next has been called.

basically the vibe check for "have we already done the thing" βœ…

⭐ list_cat

Squishes adjacent arrays into a new array. πŸ“

squish. that's the technical term. adjacent arrays in, one new array out. satisfying fr fr.

⭐ filter $filter

Immediately applies $filter to the internal array and returns $self.

note the word immediately β€” no waiting around, no queue, she does it right now, and then hands you back $self so you can keep chaining like the main character you are πŸ‘‘

⭐ loaded

Returns true.

that's it. that's the whole method. always true. forever true. a little optimist, honestly πŸ₯Ήβœ¨


🌸 AUTHOR 🌸

Yuval Kogman <nothingmuch@woobling.org> β€” shoutout to the legend πŸ’œ


This software is copyright (c) 2012 by Yuval Kogman.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

so like, yes you can redistribute it, yes you can modify it, just keep the same terms as Perl 5 itself. standard, fair, slay πŸ’…


okay one tiny thing bestie β€” that's all the content, every flag, every method, every copyright line, exactly as written. i didn't invent anything and i didn't drop anything. we keep the facts, we just gave them a glow-up ✨

and that's a wrap!! this page was perl v5.32.0, dated 2021-01-01, and it's still out here being the cutest tiny array wrapper in the whole Data::Stream::Bulk cinematic universe. bye bestie, go wrap an array πŸ¦‹πŸ’–πŸŽ€

πŸ“¦ where this page comes from