22 Oct 2025
[Coke] ok, I was only paying attention from the code samples, what's the actual issue, sorry? 16:28
jubilatious1_98524 m: my $a = Nil; say !!$a; 18:59
Raku eval False
jubilatious1_98524 m: use v6.e; my $a = Nil; say //$a; 19:00
Raku eval Exit code: 1 ===SORRY!=== Error while compiling /home/glot/main.raku Raku v6.e requires PREVIEW modifier at /home/glot/main.raku:1 ------> use v6.e⏏; my $a = Nil; say //$a;
jubilatious1_98524 m: use v6.e.* my $a = Nil; say //$a; 19:02
Raku eval False
jubilatious1_98524 m: use v6.e.* my $a = Nil; say !!$a; 19:03
Raku eval False
jubilatious1_98524 I'm not seeing a difference between the new //boolean coercer, and the classic !! "bang-bang" (or not-not) double boolean method. 19:06
m: use v6.e.* my $a = 1; say !!$a; 19:09
Raku eval True
jubilatious1_98524 m: use v6.e.* my $a = 0; say !!$a;
Raku eval False
librasteve_ [Coke] earlier today we had these three examples of prefix `//` 19:19
m: use v6.*; dd //Nil 19:20
#True
m: use v6.*; dd //1
#True
m: use v6.*; dd //0
#True
arggh - the first one is False of course 19:21
then the idea arose to use `//` as a modifier on the test in a ternary like
m: my $x = Nil; say //$x ?? 'yo' !! 'no'; 19:22
as you saw above this errors, shame
the question is, is the compiler too eager to pick `//` up and error as an empty regex in this case 19:23
[btw Camelia is dead for me]
[Coke] You need to have v6.e.PREVIEW enabled, I think 19:29
which v6.* does
camelia doesn't work in here, but does in #raku 19:30
yah, just tested that line with v6.* in #raku, it works. 19:31
so if you want the experimental stuff, you'll need to scope it for the entire file (script or module) 19:32
librasteve tx! 19:37
m_zero @librasteve - surely there is a difference between Nil and the state of being undefined. Hence, it makes sense to me that //Nil should indeed return True 21:56
@jubilatious1_98524 - // is a test for definedness, not "truthiness" 21:58
m: use v6.*; my $n = Nil; dd //$n; dd !!$n; 21:59
Raku eval Bool::False Bool::False
m_zero Gah! does Nil mean the same as undefined? Surely that isn't so....
Nevermind - it indeed does let you undefine a variable. Okay then.... 22:01
librasteve m: use v6.*; my $n; dd //$n; 22:25
Raku eval Bool::False
librasteve yeah assign Nil just resets a var to its default, in this case (Any)
[Coke] you can see the difference with a typed var declaration. 22:44
cokebot9000 m: my Int $a = 3; $a=Nil; dd $a 22:47
Raku eval Int $a = Int
SmokeMachine Boolean coerced? Shouldn’t it be ? Or so?
m: say ?42 22:48
[Coke] ? is boolean, // is "defined", I think
cokebot9000 m: use v6.*; dd ?False; dd //False; 22:49
Raku eval Bool::False Bool::True
cokebot9000 ^^
23 Oct 2025
jubilatious1_98524 m: use v6.*; dd ?False; dd !!False; 00:41
Raku eval Bool::False Bool::False