🦋 Welcome to Raku! raku.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: colabti.org/irclogger/irclogger_log/raku
Set by ChanServ on 14 October 2019.
cj okay. I've got the latest perl6. 00:23
$ perl6 --version
This is Rakudo version 2019.07.1 built on MoarVM version 2019.07.1
[DBIish] # Connect failed with error Cannot locate symbol 'mysql_init' in native library ''
still erroring out
vrurg cj: if you're still around... Looks like it can't find libmysqlclient 01:38
tyil according to github.com/perl6/advent/issues/16 I have to ask someone with access to the advent calendar to grant me access so I can schedule my advent articles on there 01:49
ZzZombo m: for ^4 { say ++$_ } 04:33
camelia Cannot resolve caller prefix:<++>(Int:D); the following candidates
match the type but require mutable arguments:
(Mu:D $a is rw)
(Int:D $a is rw --> Int:D)

The following do not match for other reasons:
(Bool $a is rw)
(M…
ZzZombo m: for ^4 -> $_ is rw{ say ++$_ } 04:34
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed parameter
at <tmp>:1
------> 3for ^4 -> $_ is rw{ say ++$_ }7⏏5<EOL>
expecting any of:
constraint
ZzZombo m: for ^4 -> $_ is rw { say ++$_ }
camelia Parameter '$_' expected a writable container, but got Int value
in block <unit> at <tmp> line 1
ZzZombo m: for my $a -> $_ is rw { say ++$_ } 04:35
camelia 1
ZzZombo m: for my $a -> $_ { say ++$_ }
camelia Cannot resolve caller prefix:<++>(Any:U); the following candidates
match the type but require mutable arguments:
(Mu:U $a is rw)

The following do not match for other reasons:
(Bool $a is rw)
(Int:D $a is rw --> Int:D)
(M…
Xliff_ m: for ^4 -> $_ is raw { say ++$_ } 04:36
camelia Cannot resolve caller prefix:<++>(Int:D); the following candidates
match the type but require mutable arguments:
(Mu:D $a is rw)
(Int:D $a is rw --> Int:D)

The following do not match for other reasons:
(Bool $a is rw)
(M…
Xliff_ m: for ^4 { say ++$ }
camelia 1
2
3
4
Xliff_ ^^ ZzZombo ?
m: for ^4 { say $++ }
camelia 0
1
2
3
Xliff_ m: for ^4 { say ++1 } 04:37
camelia Cannot resolve caller prefix:<++>(Int:D); the following candidates
match the type but require mutable arguments:
(Mu:D $a is rw)
(Int:D $a is rw --> Int:D)

The following do not match for other reasons:
(Bool $a is rw)
(M…
hythm How can I add array type in signature? 05:14
tellable6 2019-11-14T22:54:43Z #raku <lizmat> hythm maybe the Tuple module is what you need ?
hythm m: multi s ( Int @a ) { say 'Int' }; multi s ( Str @a ) { say 'Str' }; my @a = 1, 2; s @a
camelia Cannot resolve caller s(Array:D); none of these signatures match:
(Int @a)
(Str @a)
in block <unit> at <tmp> line 1
Xliff_ Hmmm... 05:15
m: multi s ( @a where *.all ~~ Int) { say 'Int' }; multi s ( @a where *.all ~~ Str) { say 'Str' }; my @a = 1, 2; s @a
camelia Cannot resolve caller s([1 2]); none of these signatures match:
(@a where { ... })
(@a where { ... })
in block <unit> at <tmp> line 1
Xliff_ m: multi s ( @a where *.all ~~ Int) { say 'Int' }; multi s ( @a where *.all ~~ Str) { say 'Str' }; my @a = (1, 2); s @a
camelia Cannot resolve caller s([1 2]); none of these signatures match:
(@a where { ... })
(@a where { ... })
in block <unit> at <tmp> line 1
Xliff_ m: multi s ( @a where { .all ~~ Int }) { say 'Int' }; multi s ( @a where *.all ~~ Str) { say 'Str' }; my @a = (1, 2); s @a 05:16
camelia Int
Xliff_ m: multi s ( @a where { .all ~~ Int }) { say 'Int' }; multi s ( @a where { .all ~~ Str }) { say 'Str' }; my @a = (1, 2); s (1, 2); s (<a b>)
camelia Int
Str
Xliff_ hythm ^^
hythm Thanks Xliff, that worked :) 05:17
Xliff_ yw :)
ZzZombo m: multi s ( Int @a ) { say 'Int' }; multi s ( Str @a ) { say 'Str' }; my Int @a = 1, 2; s @a 05:57
camelia Int
ZzZombo Xliff_ ^^ 05:58
m: multi s ( Int @a ) { say 'Int' }; multi s ( Str @a ) { say 'Str' }; my Int:D @a = 1, 2; s @a
camelia Int
Xliff_ Ah. Forget you can do without the where if you type the array. 06:00
ZzZombo m: say ^10.pick ~~ * %% 2 | 0 | *.is-prime 06:01
camelia Potential difficulties:
Precedence of ^ is looser than method call; please parenthesize
at <tmp>:1
------> 3say ^107⏏5.pick ~~ * %% 2 | 0 | *.is-prime
Too few positionals passed; expected 2 arguments but got 1
in block <u…
ZzZombo m: say (^10).pick ~~ * %% 2 | 0 | *.is-prime
camelia Too few positionals passed; expected 2 arguments but got 1
in block <unit> at <tmp> line 1
Xliff_ ZzZombo: But mine has the benefit of using literals, even if it is slower.
s (1, 2); s (<a b>)
m: say ^10.pick ~~ (* %% 2 | 0 | *.is-prime) 06:02
camelia Potential difficulties:
Precedence of ^ is looser than method call; please parenthesize
at <tmp>:1
------> 3say ^107⏏5.pick ~~ (* %% 2 | 0 | *.is-prime)
Too few positionals passed; expected 2 arguments but got 1
in block …
Xliff_ m: say (^10).pick ~~ (* %% 2 | 0 | *.is-prime)
camelia Too few positionals passed; expected 2 arguments but got 1
in block <unit> at <tmp> line 1
Xliff_ m: say (^10).pick ~~ do { $_ %% 2 | 0 | .is-prime }
camelia True
Xliff_ m: say (^10).pick ~~ { $_ %% 2 | 0 | .is-prime }
camelia any(False, 0, True)
Xliff_ m: say (^10).pick ~~ { $_ %% 2 | 0 | .is-prime }
camelia any(True, 0, True)
Xliff_ m: say (^10).pick ~~ { $_ %% 2 | 0 | .is-prime }
camelia any(True, 0, False)
Xliff_ m: say (^10).pick ~~ { $_ %% 2 | 0 | .is-prime }
camelia any(False, 0, True)
Xliff_ m: say (^10).pick ~~ { $_ %% 2 | 0 | .is-prime }
camelia any(False, 0, False)
Xliff_ m: say (^10).pick ~~ { $_ %% 2 | 0 | .is-prime }
camelia any(False, 0, False)
Xliff_ m: say (^10).pick ~~ do { .say; $_ %% 2 | 0 | .is-prime } 06:03
camelia 6
True
Xliff_ m: say (^10).pick ~~ do { .say; $_ %% 2 | 0 | .is-prime }
camelia 7
True
Xliff_ m: say (^10).pick ~~ do { .say; $_ %% 2 | 0 | .is-prime }
camelia 3
True
Xliff_ m: say (^10).pick ~~ do { .say; $_ %% 2 | 0 | .is-prime }
camelia 2
True
Xliff_ m: say (^10).pick ~~ do { .say; $_ %% 2 | 0 | .is-prime }
camelia 5
True
Xliff_ m: say (^10).pick ~~ do { .say; $_ %% 2 | 0 | .is-prime }
camelia 5
True
Xliff_ m: say (^10).pick ~~ do { .say; $_ %% 2 | 0 | .is-prime }
camelia 9
False
ZzZombo How's it parsed in the failing case?
Xliff_ \o/
ZzZombo: Which failing case? 06:04
ZzZombo The one what doesn't compile?
Xliff_ Oh. As a block with two whatevers, so it needs two arguments.
If you want * to repeat itself, it can't be WhateverCode 06:05
ZzZombo Huh, well, okay.
I'd think `|` breaks that in parts.
Xliff_ * %% 2 | 0 | *.is-prime
Two asterisks, so two arguments necessary
ZzZombo You don't need `do` there, do you? 06:06
m: say (^10).pick ~~ { .say; $_ %% 2 | 0 | .is-prime }
camelia 9
any(False, 0, False)
Xliff_ Yeah. That returns a proper junction, so that one is better. 06:07
say 0 ~~ { .say; $_ %% 2 | 0 | .is-prime }
evalable6 0
any(True, 0, False)
Xliff_ say 0 ~~ { .say; $_ %% 2 | .so | .is-prime } 06:08
evalable6 0
any(True, False, False)
Xliff_ say 0 ~~ { .say; $_ %% 2 | 0 | .is-prime }
evalable6 0
any(True, 0, False)
Xliff_ You don't need the 0, either. Will never match.
ZzZombo m: say 0 ~~ 0
camelia True
ZzZombo m: say 0 ~~ any 0 06:09
camelia True
Xliff_ m: say 0 ~~ { 1 | 0 }
camelia any(1, 0)
Xliff_ ^^ Always true
m: say 0 ~~ (1 | 0 )
camelia True
Xliff_ m: say 2 ~~ (1 | 0 )
camelia False
Xliff_ m: say 2 ~~ ( 1 | 0 )
camelia False 06:10
Xliff_ m: say 1 ~~ ( 1 | 0 )
camelia True
Xliff_ That's better.
m: say 1 ~~ ( $_ %% 2 | 0 )
camelia False
Xliff_ m: say 2 ~~ ( $_ %% 2 | 0 )
camelia True
Xliff_ m: say 0 ~~ ( $_ %% 2 | 0 )
camelia True
ZzZombo m: say (^10).pick ~~ (* %% 2) | 0 | .is-prime
camelia any(True, 0, False)
Xliff_ m: say 0 ~~ ( $_ %% 3 | 0 )
camelia True
Xliff_ m: say 0 ~~ ( ($_ + 1) %% 3 | 0 )
camelia True
ZzZombo m: say (^10).pick ~~ (* %% 2) | 0 | .is-prime 06:11
camelia any(True, 0, False)
Xliff_ m: say 0 ~~ ($_ + 1) %% 3 | 0 )
camelia 5===SORRY!5=== Error while compiling <tmp>
Unexpected closing bracket
at <tmp>:1
------> 3say 0 ~~ ($_ + 1) %% 3 | 0 7⏏5)
Xliff_ m: say 0 ~~ ($_ + 1) %% 3 | 0
camelia True
Xliff_ m: say 0 ~~ $_ %% 3 | 0
camelia True
Xliff_ m: say (0, 5) ~~ $_ %% 3 | 0
camelia False
Xliff_ Hrmph. I never use 0 or 1 in junctions precisely due to this ambiguity 06:12
ZzZombo m: say (^10).pick ~~ $_ %% 2 | 0 | .is-prime
camelia True
ZzZombo m: say (^10).pick ~~ (* %% 2) | 0 | .is-prime
camelia any(True, 0, False)
ZzZombo WTF
Xliff_ Heh. 06:13
OK. Good night!
ZzZombo GN
m: say (^10).pick ~~ (* %% 2) | 2 - 2 | .is-prime 06:14
camelia any(True, 0, True)
ZzZombo m: say (^10).pick ~~ (* %% 2) | 0 | *.is-prime 06:14
camelia Too few positionals passed; expected 2 arguments but got 1
in block <unit> at <tmp> line 1
Xliff_ *sigh* -- my $dayjob has gone from Raku to PHP... *sob*
ZzZombo m: my $a;for $a, 1 { .VAR.say } 06:24
camelia (Any)
1
ZzZombo m: my $a;for $a, 1 { .VAR.WHAT.say }
camelia (Scalar)
(Int)
Xliff_ m: my $a;for $a, 1 { .VAR.name.say } 06:26
camelia $a
No such method 'name' for invocant of type 'Int'. Did you mean any of these?
base
none
note
take

in block <unit> at <tmp> line 1
Xliff_ m: my $a;for $a, 1 { say .VAR.^can('name').elems ?? .VAR.name !! .VAR } 06:26
camelia $a
1
stoned75 :w 06:42
rindolf hi all! is there going to be a redirect? 07:04
AlexDaniel rindolf: redirect for what exactly? 09:10
rindolf AlexDaniel: from #perl6 to #raku 09:12
AlexDaniel I think there will be a bot soon to help people get off the channel 09:16
SmokeMachine m: say (^10).pick %% (2 | 0 | .is-prime) 09:38
camelia No such method 'is-prime' for invocant of type 'Any'
in block <unit> at <tmp> line 1
rindolf AlexDaniel: ah 10:32
tbrowder .tell jmerelo shooting for 19 nov for advent gist or else give my slot (swap ok) to someone else if not acceptable 11:14
tellable6 tbrowder, I'll pass your message to jmerelo
bazzaar m: multi s (Str @) {'Str'}; multi s (Int @) {'Int'}; my @a = 1, 2; my @b = <a b>; s @a; s @b; 12:42
camelia Cannot resolve caller s(Array:D); none of these signatures match:
(Str @)
(Int @)
in block <unit> at <tmp> line 1
bazzaar .... lost in a sea of multi's :-) 12:50
moritz ... all alike :D 12:55
ZzZombo m: role StrIdx { also does Positional;method AT-POS($i) is rw { self.substr-rw($i, 1) }; };my $s = 'asd' does StrIdx;say $s[0];$s[0] = 'b';say $s 13:44
camelia a
Cannot modify an immutable Str+{StrIdx} (asd)
in block <unit> at <tmp> line 1
ZzZombo Why? 13:45
bazzaar m: multi m_x ( Str @ ) {'Str'}; multi m_x ( Int @ ) {'Int'}; my Str:D @b = <a b>; my Int:D @c = 1, 2; say m_x @b|@c 13:49
camelia any(Str, Int)
tyil according to github.com/perl6/advent/issues/16 I have to ask someone with access to the advent calendar to grant me access so I can schedule my advent articles on there 14:35
is someone with such privileges around?
bazzaar m: multi m_x ( @ where {.all ~~ Str}) {'Str'}; multi m_x ( @ where {.all ~~ Int}) {'Int'}; my @b = <a b>; my @c = 1, 2; my @z = 1, "text"; say m_x @b|@c; say m_x @z 15:09
camelia any(Str, Int)
Cannot resolve caller m_x([1 text]); none of these signatures match:
(@ where { ... })
(@ where { ... })
in block <unit> at <tmp> line 1
tyil sergot: your Encode module is still using META.info, but there's been a PR to change this to META6.json, which is the current recommended name for this file, can this PR be merged? 16:46
frayoyo hello 18:38
Altai-man_ frayoyo, hi! 18:40