++ed by:
ILUX XYF KRAUTCAT DMOL AZJADFTRE
7 non-PAUSE users
Author image Yuki Kimoto

NAME

SPVM::EqualityChecker::SameObject - EqualityChecker::SameObject in SPVM | a callback implementation of EqualityChecker to check if the memory addresses of the two objects are equal.

SYNOPSYS

  use EqualityChecker::SameObject;
  
  my $equality_checker = EqualityChecker::SameObject->new;
  
  my $point1 = Point->new(1, 2);
  my $point2 = $point1;
  my $point3 = Point->new(1, 2);
  
  # Equals
  my $is_equal = $equality_checker->($point1, $point2);
  
  # Not equals
  my $is_equal = $equality_checker->($point1, $point3);

DESCRIPTION

EqualityChecker::SameObject is a callback implementation of EqualityChecker to check if the memory addresses of the two objects are equal.

CLASS METHODS

new

  static method new : EqualityChecker::SameObject ()

Create a new EqualityChecker::SameObject object.

CALLBACK METHOD IMPLEMENTATION

  method : int ($object1 : object, $object2 : object)

If the address of the two objects are equal, return 1, otherwise return 0.