SPVM::Point(3)

πŸ“¦ version 0.990125, in alpine 3.24

πŸ’– NAME πŸ’–

Hey bestie, welcome to the SPVM::Point(3) page from the User Contributed Perl Documentation. The manual name is SPVM::Point, and the actual name is SPVM::Point - Point β€” it’s giving tiny point-class main character energy. ✨

🫢 USAGE 🫢

Use it like this, no cap:

use Point;

my $point = Point->new;
my $point = Point->new(1, 2);

my $x = $point->x;
my $y = $point->y;

my $point_string = $point->to_string;

πŸ¦‹ DESCRIPTION πŸ¦‹

Point is a class for a point. That’s the whole vibe. πŸ’…

🌈 INTERFACES 🌈

The Point class has the following interfaces, periodt:

  • Stringable
  • Cloneable
  • EqualityCheckable

🌸 FIELDS 🌸

x

The declaration is exactly this, bestie:

has x : protected ro int;

This field is x.

y

Same energy, different coordinate:

has y : protected ro int;

This field is y.

πŸ‘‘ CLASS METHODS πŸ‘‘

new

static method new : Point ($x : int = 0, $y : int = 0);

Creates a new Point object with $x and $y. Slay. ✨

🧚 INSTANCE METHODS 🧚

init

protected method init : Point ($x : int = 0, $y : int = 0)

Initializes x and y.

clear

method clear : void ();

Sets x and y to 0.

clone

method clone : Point ();

Creates a new Point object that clones myself.

to_string

method to_string : string ();

Stringifies a Point object as the following format:

(1,2)

eq

method eq : int ($a : Point, $b : Point);

If $a is equal to $b, returns 1, otherwise returns 0.

Implementation:

  • If $a and $b is defined and x, y, and z fields in $a are equals to x, y, and z fields in $b, returns 1.
  • If only $a is not defined, returns 0.
  • If only $b is not defined, returns 0.
  • If both $a and $b is not defined, returns 1.
Keeping that z mention exactly as written, bestie β€” facts are facts. πŸ’€

Copyright (c) 2023 Yuki Kimoto

MIT License


Catch you later, bestie β€” this page is from perl v5.42.2, dated 2026-02-03. πŸ«ΆπŸ’–

πŸ“¦ where this page comes from