SPVM::I...ringList(3)

πŸ“¦ version 0.990125, in alpine 3.24

okay bestie, welcome to the SPVM::I...ringList(3) page β€” it’s the User Contributed Perl Documentation for SPVM::Immutable::StringList, and it’s giving immutable string array realness. every detail is coming with us. πŸ’…

πŸ’– Name πŸ’–

SPVM::Immutable::StringList β€” Immutable string array. periodt.

✨ Usage ✨

use Immutable::StringList;

# Create a string list
my $list = Immutable::StringList->new;
my $list = Immutable::StringList->new(["abc", "def", "ghi"]);

# Create a string list
my $list = Immutable::StringList->new_len(10);

# Get list length
my $length = $list->length;

# Get string value.
my $element = $list->get(2);

# Convert Immutable::StringList to string array.
my $array = $list->to_array;

πŸ¦‹ Description πŸ¦‹

The Immutable::StringList class has methods to manipulate an immutable string array. no cap, it’s literally an immutable list of strings, and the methods are the whole vibe. 🫢

🌸 Fields 🌸

length

has length : ro int;

Gets the length field.

This field is the length of the elements of the list. so if you need to know how many strings are in there, this is your girl. ✨

πŸ‘‘ Class Methods πŸ‘‘

new

static method new : Immutable::StringList ($array : string[] = undef);

Creates a new Immutable::StringList object using new_len. The length passed to new_len is the length of the array. If the array is undef, the length is 0.

Every string in the array gets copied into each value of the created array, and every string is made read-only. iconic behavior, honestly. πŸ’…

Examples:

my $list = Immutable::StringList->new;
my $list = Immutable::StringList->new(["abc", "def", "ghi"]);

new_len

static method new_len : Immutable::StringList ($length : int);

Creates a new Immutable::StringList object with $length.

Exceptions:

  • $length must be greater than or equal to 0. Otherwise an exception is thrown. so no negative lengths, bestie β€” that’s a one-way ticket to exception city. 😭

🧚 Instance Methods 🧚

get

method get : string ($index : int);

Gets the element at the position of $index.

If $index is a negative value, $index is set to length plus $index. yes, the source spells it β€œnetative” β€” we’re keeping the chaotic energy. πŸ™ˆ

Exceptions:

  • $index must be greater than or equal to 0. Otherwise an exception is thrown.
  • $index must be less than the length of $list. Otherwise an exception is thrown.

to_array

method to_array : string[] ();

Converts the list to an array. that’s it, that’s the method. slay. πŸ”₯

Copyright (c) 2023 Yuki Kimoto

MIT License


mwah πŸ’‹ this page is from perl v5.42.2, dated 2026-02-03, and it’s the SPVM::I...ringList(3) man page. bye bestie, go manipulate those immutable strings responsibly 🫢

πŸ“¦ where this page comes from