SPVM::I...ubleList(3)
π¦ NAME π¦
okay so welcome to the SPVM::Immutable::DoubleList(3) manual page β bestie, this is a User Contributed Perl Documentation page for SPVM::Immutable::DoubleList, aka an Immutable double Array. periodt. π
π DESCRIPTION π
The Immutable::DoubleList class has methods to manipulate an immutable double array. that's the vibe: doubles, list-style, and immutable. no cap. β¨
πΈ USAGE πΈ
use Immutable::DoubleList;
# Create a double list
my $list = Immutable::DoubleList->new;
my $list = Immutable::DoubleList->new([(double)1, 2, 3]);
# Create a double list with array length
my $list = Immutable::DoubleList->new_len(10);
# Get list length
my $length = $list->length;
# Get value.
my $element = $list->get(2);
# Convert list to array.
my $array = $list->to_array;
π FIELDS π
π length π
has length : ro int;
Gets the "length" field.
This field is the length of the elements of the list. slay. π«Ά
π₯ CLASS METHODS π₯
π new π
static method new : Immutable::DoubleList ($array : double[] = undef);
Create a new Immutable::DoubleList object using new_len.
The passed length to new_len is the length of the array. If the array is undef, the length is 0.
The elements of the array are copied to the elements of the created array.
Examples:
my $list = Immutable::DoubleList->new;
my $list = Immutable::DoubleList->new([(double)1, 2, 3]);
π new_len π
static method new_len : Immutable::DoubleList ($length : int);
Creates a new Immutable::DoubleList object with $length and $capacity.
Exceptions:
$lengthmust be greater than or equal to0. Otherwise an exception is thrown.
π INSTANCE METHODS π
π get π
method get : double ($index : int);
Gets the element of the position of $index.
If $index is a negative value, $index is set to "length" plus $index.
Exceptions:
$indexmust be greater than or equal to0. Otherwise an exception is thrown.$indexmust be less than the length of$list.
π to_array π
method to_array : double[] ();
Converts the list to an array. iconic. π¦
π COPYRIGHT & LICENSE π
Copyright (c) 2023 Yuki Kimoto
MIT License
that's the whole page, bestie! mwah π β source/version: perl v5.42.2 Β· date: 2026-02-03 Β· footer page: SPVM::I...ubleList(3) β¨
π¦ 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