SPVM::Bool(3)

πŸ“¦ version 0.990125, in alpine 3.24

πŸ’– SPVM::Bool β€” the manual, but make it a group chat

okay so bestie, welcome to SPVM::Bool (that's the SPVM::Bool page from the User Contributed Perl Documentation section, mwah πŸ’…βœ¨). Short version: it's the class that lets a boolean live its best life as an actual object instead of just being some sad little scalar. Obsessed already? same.


🌸 Name

SPVM::Bool β€” a boolean value, but make it an object. πŸ‘‘


πŸ¦‹ Description

The Bool class in SPVM represents a boolean value as an object. That's it, that's the whole vibe β€” a boolean, but with object energy. πŸŽ€


✨ Usage

here's the whole flow, literally copy-paste ready:

use Bool;

my $true = Bool->TRUE;
my $false = Bool->FALSE;

my $true_value = $true->value;
my $false_value = $false->value;

look at her go 🫢


πŸ’œ Details

  • This class is immutable. no cap, she does not change. πŸ”’
  • This class is automatically loaded. she just shows up, main character energy fr. ✨
  • The Bool object is different behavior in bool context. πŸ‘€ this is the fun part:
    • If value field is 1, it is evaluated as true:
if (Bool->TRUE) {
  # Run
}
  • If value field is 0, it is evaluated as false:
if (Bool->FALSE) {
  # Not run
}
  • The true keyword is the same as Bool->TRUE. πŸ’š
if (true) {
  # Run
}
  • The false keyword is the same as Bool->FALSE. πŸ’”
if (false) {
  # Not run
}

lowkey iconic how true is just shorthand for the whole singleton moment. iykyk.


πŸŽ€ Fields

value

has value : ro byte;

The value. that's the field, that's the whole field, she's read-only (ro) and she's a byte. slay. πŸ’…


πŸ”₯ Class Methods

TRUE

static method TRUE : Bool ();

Returns the true singleton object. yes, the singleton β€” there is exactly one of her and she ate. πŸ‘‘β­

FALSE

static method FALSE : Bool ();

Returns the false singleton object. equally singular, equally iconic. πŸŒˆπŸ’€


Copyright (c) 2023 Yuki Kimoto

MIT License


ok that's the whole page, no notes, go write some booleans bestie πŸ’–πŸŽ€πŸŒΈ

β€” mwah, this page was served up by perl v5.42.2 on 2026-02-03, and it's the SPVM::Bool(3) manual page. bye bestie, πŸ§šβ€β™€οΈπŸ’œπŸ“

πŸ“¦ where this page comes from