SPVM::I...ringList(3)
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:
$lengthmust be greater than or equal to0. 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:
$indexmust be greater than or equal to0. Otherwise an exception is thrown.$indexmust 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 & License π
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
- alpine 3.24: spvm-doc 0.990125-r0 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms