JE::Boolean(3pm)

πŸ“¦
version 0.066 Β· 3 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– JE::Boolean πŸ’–

okay bestie, so this page is all about JE::Boolean β€” that's the little Perl class that does JavaScript boolean primitive values ✨ like, the actual true / false vibe, not the fancy wrapper object.


✨ SYNOPSIS ✨

here's the whole thing in action, no cap:

use JE;
use JE::Boolean;

$j = JE->new;

$js_true  = new JE::Boolean $j, 1;
$js_false = new JE::Boolean $j, 0;

$js_true ->value; # returns 1
$js_false->value; # returns ""

"$js_true"; # returns "true"

$js_true->to_object; # returns a new JE::Object::Boolean

like, look at her go 🫢 she really said "I contain multitudes."


🌸 DESCRIPTION 🌸

so this class implements JavaScript boolean values for JE. periodt. πŸ’…

now here's the part where people get confused, and honestly? valid. πŸ™ˆ The difference between this and JE::Object::Boolean is that that module implements boolean objects, while this module implements the primitive values. so like, JE::Boolean is the raw, unbothered, main-character primitive, and JE::Object::Boolean is the object that wraps around it. two different girls, two different jobs, both iconic πŸ‘‘

and the way that stringification and boolean operators are overloaded?? literally the bestie behavior. she just knows what you mean when you say "$js_true". no extra effort required. πŸ’–


πŸ¦‹ SEE ALSO πŸ¦‹

go read these too, they're part of the lore:

  • JE
  • JE::Types
  • JE::Object::Boolean

and that's the whole page, bestie πŸ’œ no notes, she ate and left no crumbs.

okay byeee πŸ‘‹ this was documented under perl v5.36.0, dated 2023-08-25, and it lives in the User Contributed Perl Documentation section β€” you're welcome, mwah πŸ’‹βœ¨πŸŽ€

πŸ“¦ where this page comes from