🦋 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.
00:24 pubwrk left 00:26 patrickb left
SmokeMachine gist.github.com/FCO/a684907e94c79d...748688ce7f 00:49
ZzZombo m: say 41, 42 01:07
m: 41 [&say] 42
camelia 4142
WARNINGS for <tmp>:
4142
Useless use of &say in sink context (line 1)
ZzZombo Any explanation for this one?
m: quietly 41 [&say] 42 01:10
camelia 4142
01:19 veesh left
SmokeMachine m: $ = 41 [&say] 42 01:29
camelia 4142
SmokeMachine ZzZombo: ^^
ZzZombo I know how to silence it. I don't understand why it happens.
m: say 41, 42
m: 41 [&say] 42
camelia 4142
WARNINGS for <tmp>:
4142
Useless use of &say in sink context (line 1)
ZzZombo No difference for me there ^^.
SmokeMachine m: 1 + 1 01:30
camelia WARNINGS for <tmp>:
Useless use of "+" in expression "1 + 1" in sink context (line 1)
SmokeMachine being infix?
does infix implies you should use the return for something? 01:31
01:33 veesh joined, hythm joined 01:37 wildtrees left
SmokeMachine m: sub bla($a) { $a * 2 }; bla 21 01:45
camelia ( no output )
SmokeMachine m: sub bla($a) is pure { $a * 2 }; bla 21
camelia WARNINGS for <tmp>:
Useless use of "bla 21" in expression "bla 21" in sink context (line 1)
SmokeMachine ZzZombo: one of the reasons for this warning... 01:46
ZzZombo `&say` isn't pure though? 01:47
SmokeMachine ZzZombo: here is where your example is dyeing: github.com/rakudo/rakudo/blob/mast....nqp#L2705 01:48
ZzZombo: I know... I was just showing a reason for that error msg...
ZzZombo: I think it's because of the sigil... 01:51
m: my \sss = &say; 41 [sss] 42
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing infix inside []
at <tmp>:1
------> 3my \sss = &say; 41 [7⏏5sss] 42
expecting any of:
bracketed infix
infix
infix stopper
SmokeMachine :(
ZzZombo m: &say(4,1) 01:52
camelia 41
SmokeMachine [&say] and + gives the warning in different lines... 01:54
ZzZombo: I've added the line number on each "Useless use of" warn message on Optimizer file... www.irccloud.com/pastebin/llTxMzWN/ 01:55
ZzZombo I'll take a look, thanks. 01:56
02:56 reportable6 left, notable6 left, unicodable6 left, bloatable6 left, greppable6 left, shareable6 left, nativecallable6 left, releasable6 left, benchable6 left, coverable6 left, committable6 left, quotable6 left, squashable6 left, statisfiable6 left, coverable6 joined, unicodable6 joined 02:57 reportable6 joined, greppable6 joined, statisfiable6 joined, bloatable6 joined, notable6 joined, nativecallable6 joined 02:58 quotable6 joined, squashable6 joined, releasable6 joined, committable6 joined, shareable6 joined 02:59 benchable6 joined 03:59 benchable6 left, shareable6 left, bloatable6 left, unicodable6 left, notable6 left, committable6 left, notable6 joined 04:00 benchable6 joined, wtwt5237 joined, committable6 joined, unicodable6 joined, shareable6 joined 04:02 bloatable6 joined
wtwt5237 hello, folks! may I have your suggestions regarding how to best handle math (stat, machine learning, etc) in Raku? I am aware of math::vector and math::matrix and a few other packages. But compared to python, R and matlab, scientific computing in Raku still seems to be preliminary? Would like to know what other people think here. thx 04:02
vrurg wtwt5237: Maybe a module for the purpose? 04:06
wtwt5237 I am thinking that if there is any possibility, could the raku team build the capability of scientific computing into the core of it? right now, we already have a number of packages. And to do some simple math, we have to load a lot of packages. To do something more dfificult, such as build a ML or DL model, things will be ten times harder. If a 04:09
centralized solution exists (such as R and matlab), it can easily out-compete these languages. my two cents
vrurg wtwt5237: The problem with such approach that same way we could consider built-in AI engine, for example. Or accounting tools. 04:16
R and matlab are specifially targeted at this area, I don't think it makes sense to compete with them. 04:18
And, to my view, installing a module with zef is as simple as it only could be.
wtwt5237: but if you volunteer and find an elegant way of implemenenting the thing – it could be accepted. 04:20
wtwt5237: more than that, I'm positive it'd be welcomed! 04:21
vrurg is afk&
wtwt5237 en.. not directly computing with R/matlab would make sense. but i still feel it would help raku catch the current hype of data science, in some way, if we have something that is more convenient 04:23
haha, I am sorry, I sound like someone who is only complaining but not really doing anything. but my day job now is to run a bioinformatics lab in a medical school. i would love to, but really cannot find any time to learn and do any such implementation now. but i do hope raku could be improved to some extent towards that goal, so I can persuade my 04:27
students to learn raku. now they all learn python...
ZzZombo m: role :: { COMPOSE { $?CLASS.say } } 04:30
camelia ( no output )
ZzZombo This should leave a NYI message perhaps? 04:31
also 04:39
m: class :: { COMPOSE { $?CLASS.say } }
camelia ( no output ) 04:40
ZzZombo Is this legal at all?
hm
m: class C does Int {}
camelia 5===SORRY!5=== Error while compiling <tmp>
Int is not composable, so C cannot compose it
at <tmp>:1
04:45 wtwt52371 joined 04:48 wtwt52371 left 04:49 wtwt5237 left 04:54 Xliff joined
Xliff \o 04:57
tellable6 2019-11-09T11:47:58Z #raku <SmokeMachine> Xliff: if we are going to create aliases for `.^all.grep` and `.^all.map`, why not call they `.^grep` and `.^map`? 04:58
2019-11-09T11:51:16Z #raku <SmokeMachine> Xliff: and, update is just one of the uses of `.^all.map`...
Xliff Does anyone know if the routines from github.com/LLFourn/p6-CompUnit-Util still work?
05:58 shareable6 left, benchable6 left, bloatable6 left, notable6 left, committable6 left, unicodable6 left, squashable6 left, coverable6 left, greppable6 left, releasable6 left, statisfiable6 left, nativecallable6 left, reportable6 left, quotable6 left, committable6 joined 05:59 greppable6 joined, squashable6 joined, reportable6 joined, releasable6 joined, bloatable6 joined, statisfiable6 joined 06:00 unicodable6 joined, shareable6 joined, coverable6 joined, notable6 joined 06:01 nativecallable6 joined, benchable6 joined, quotable6 joined 06:22 hythm left
ZzZombo m: class SortedArray does Positional { has @!a handles <elems AT-POS EXISTS-POS STORE>;method iterator {@!a.sort.iterator};submethod BUILD(:@!a) {};method new(**@a){return self.bless: :@a}};.say for SortedArray.new: 3,2,1,4; 06:43
m: class SortedArray does Positional { has @!a handles <elems AT-POS EXISTS-POS STORE>;has Iterator $!it handles <iterator>;submethod BUILD(:$!it, :@!a) {};method new(**@a){return self.bless: :@a, :it(@a.sort.iterator)}};.say for SortedArray.new: 3,2,1,4;
camelia 1
2
3
4
Rakudo::Iterator::ReifiedListIterator.new
ZzZombo Why does the second case not work? 06:44
07:44 bloatable6 left, releasable6 left, quotable6 left, benchable6 left, squashable6 left, greppable6 left, coverable6 left, committable6 left, unicodable6 left, nativecallable6 left, statisfiable6 left, reportable6 left, shareable6 left, notable6 left 07:45 quotable6 joined, unicodable6 joined, shareable6 joined, squashable6 joined, AlexDaniel left 07:46 greppable6 joined, bloatable6 joined, committable6 joined, nativecallable6 joined, coverable6 joined, statisfiable6 joined, releasable6 joined, benchable6 joined, notable6 joined 07:47 reportable6 joined
ZzZombo m: class A {method m {gather {take ^20[++$]}}};A.new.m.say;A.new.m.say for ^2 07:54
camelia 5===SORRY!5=== Error while compiling <tmp>
Unsupported use of $] variable; in Perl 6 please use $*PERL.version or $*PERL.compiler.version
at <tmp>:1
------> 3class A {method m {gather {take ^20[++$]7⏏5}}};A.new.m.say;A.new.m.say for ^2
ZzZombo m: class A {method m {gather {take ^20[my ++$]}}};A.new.m.say;A.new.m.say for ^2
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed my
at <tmp>:1
------> 3class A {method m {gather {take ^20[my7⏏5 ++$]}}};A.new.m.say;A.new.m.say for ^2
ZzZombo m: class A {method m {take (^20)[$++]}};dd gather {A.new.m};dd gather A.new.m for ^2 07:59
camelia (0,).Seq
(1, 2).Seq
ZzZombo m: class A {method m {take (^20)[++$]}};dd gather {A.new.m};dd gather A.new.m for ^2
camelia 5===SORRY!5=== Error while compiling <tmp>
Unsupported use of $] variable; in Perl 6 please use $*PERL.version or $*PERL.compiler.version
at <tmp>:1
------> 3class A {method m {take (^20)[++$]7⏏5}};dd gather {A.new.m};dd gather A.new.m
ZzZombo Please w0rk. 08:00
So, how can I have separate `gather/take` per instance? 08:01
Xliff m: class A {method m {state $a; take (^20)[++$a]}};dd gather {A.new.m};dd gather A.new.m for ^2 08:02
camelia (1,).Seq
(2, 3).Seq
Xliff ^^ ZzZombo 08:03
08:07 kktt left 08:08 kktt joined 08:18 xinming_ left 08:19 xinming_ joined 08:28 ZzZombo_ joined 08:30 ZzZombo left, ZzZombo_ is now known as ZzZombo
SmokeMachine m: role :: { $?CLASS.say } 08:34
camelia ( no output )
SmokeMachine m: role R { $?CLASS.say }; class C does R {} 08:36
camelia 5===SORRY!5=== Error while compiling <tmp>
Could not instantiate role 'R':
No such method 'say' for invocant of type 'C'
at <tmp>:1
SmokeMachine m: role R { say $?CLASS.^name }; class C does R {} 08:37
camelia C
ZzZombo m: .say($_) given &say ∘ &say 08:43
camelia Cannot resolve caller say(Block+{FakeSignature[Int,Num,Mu]}:D: Block+{FakeSignature[Int,Num,Mu]}:D); none of these signatures match:
(Mu: *%_)
in block <unit> at <tmp> line 1
ZzZombo m: .say(~$_) given &say ∘ &say 08:44
camelia Block+{FakeSignature[Int,Num,Mu]} object coerced to string (please use .gist or .perl to do that)
in block at <tmp> line 1
Cannot resolve caller say(Block+{FakeSignature[Int,Num,Mu]}:D: Str:D); none of these signatures match:
(Mu: *%_)
…
09:06 sena_kun joined 09:15 finanalyst joined
ZzZombo Xliff: I mean, if `$++` is allowed, then `++$` should be too? 09:19
m: say $?FILE.io.lines 09:24
camelia No such method 'io' for invocant of type 'Str'. Did you mean 'so'?
in block <unit> at <tmp> line 1
ZzZombo m: say $?FILE.IO.lines
camelia (say $?FILE.IO.lines)
Xliff ZzZombo: It's a parser error, so the use of the variable is a workaround. 09:28
ZzZombo Is it filed? 09:29
Xliff No, I don't think so.
ZzZombo Can you remind me where do bugs go now into? 09:30
Xliff github.com/rakudo/rakudo/issues
ZzZombo Thank you! 09:35
09:38 mid_laptop left 09:57 xinming_ left 09:58 xinming_ joined 10:14 ilogger2 joined 10:25 chloekek joined
chloekek gonna work on using Raku with Nix again. 10:27
Xliff Nix? 10:38
chloekek Nix the package manager. 10:42
10:42 cpan-raku joined, cpan-raku left, cpan-raku joined
chloekek Writing a package for the latest MoarVM, NQP, Rakudo, and adding a function for making packages for Raku distributions. 10:43
Xliff Ah! chloekek++
chloekek Precompiling and PERL6LIB are a pain but I figured out most of it last time.
11:07 Altai-man_ joined
chloekek What are the *-j and *-m files in the bin directory of a distribution? 11:20
Ok, that's just different Rakudo backends. 11:40
ZzZombo m: say False but True 12:01
camelia True
ZzZombo m: say True but True 12:02
camelia True
ZzZombo m: say True but False
camelia False
ZzZombo Why is all this allowed?
m: 1 does True 12:04
camelia ( no output )
ZzZombo m: dd 1 does True
camelia 1
ZzZombo m: say 1 does True
camelia 1
ZzZombo m: say so 1 does False 12:05
camelia False
Some exceptions were thrown in END blocks:
Unhandled exception: No exception handler located for warn
at <unknown>:1 (/home/camelia/rakudo-m-inst-2/share/perl6/runtime/CORE.c.setting.moarvm:)
from SETTING::src/core.c/control.pm6:190…
ZzZombo Whoops!
m: say so 1 but False
camelia False
ZzZombo m: say 1 but False
camelia 1
ZzZombo So this allows to make a C++ equivalent of `#define true false` in Raku. 12:06
m: say so True but False 12:07
camelia False
ZzZombo In the whole program as well, BTW.
lizmat ZzZombo: you can "but" a value of an enum on any object
ZzZombo I figured as much, but why?? 12:08
lizmat it will override the method with the name of the enum for that object and return the given value
because it can be very handy ?
like returning 0 from a routine, but it still being accepted as True ? 12:09
ZzZombo m: say 1 but 2
camelia 1
ZzZombo ??
lizmat 2 is not an enum
ZzZombo But what does that even do to the `1`?
lizmat m: say (1 but 2).Int 12:10
camelia 2
lizmat it overrides the Int method... interesting :-)
guess it's more general than I thought :)
ZzZombo Why did it display as 1 then? 12:11
lizmat because "say" calls .gist on the value
tobs ($a but $b) adds a method $b.^name to $a which returns $b I thought
ZzZombo m: say so 1 does False
camelia False
Some exceptions were thrown in END blocks:
Unhandled exception: No exception handler located for warn
at <unknown>:1 (/home/camelia/rakudo-m-inst-2/share/perl6/runtime/CORE.c.setting.moarvm:)
from SETTING::src/core.c/control.pm6:190…
ZzZombo What's up with this though?
lizmat m: say ("foo" but 2).Int 12:12
camelia 2
lizmat m: say +("foo" but 2)
camelia Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5foo' (indicated by ⏏)
in block <unit> at <tmp> line 1
tobs m: say ("foo" but 2).Numeric
camelia Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5foo' (indicated by ⏏)
in block <unit> at <tmp> line 1
tobs I think prefix:<+> calls .Numeric
ZzZombo m: say 'str' but Nil 12:15
camelia Cannot mix in non-composable type Any into object of type Str
in block <unit> at <tmp> line 1
ZzZombo m: say 'str' but 123
camelia str
ZzZombo m: say 'str' but m//
camelia 5===SORRY!5=== Error while compiling <tmp>
Null regex not allowed
at <tmp>:1
------> 3say 'str' but m/7⏏5/
ZzZombo m: say 'str' but m/asd/
camelia Use of uninitialized value of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
in block <unit> at <tmp> line 1
Cannot mix in non-composable type Any into object of type Str…
ZzZombo m: say 'str' but -> {} 12:16
camelia str
ZzZombo m: say -> {} but &say
camelia -> { #`(Block+{<anon|1>}|59422520) ... }
tobs m: &say.wrap: &exit 12:17
camelia ( no output )
ZzZombo m: say 'str' but Failure 12:18
camelia Cannot mix in non-composable type Failure into object of type Str
in block <unit> at <tmp> line 1
ZzZombo m: say 'str' but Any
camelia Cannot mix in non-composable type Any into object of type Str
in block <unit> at <tmp> line 1
ZzZombo m: say 'str' but Array
camelia Cannot mix in non-composable type Array into object of type Str
in block <unit> at <tmp> line 1
ZzZombo m: use NativeCall;say 'str' but Pointer
camelia Cannot mix in non-composable type NativeCall::Types::Pointer into object of type Str
in block <unit> at <tmp> line 1
ZzZombo So what defines whether a type can be composed as a role like that? 12:19
12:28 thundergnat joined
thundergnat ZzZombo: but is useful when you want to mix a role into an _instance_. If you want to apply it to a whole class, use does. 12:30
ZzZombo: See rosettacode.org/wiki/Peano_curve#Perl_6 - Mixes the Lindenmeyer role into the string 'L'. 12:34
Sorry that I keep bringing up Rosettacode. I'm an admin there so am very familiar with the code examples on there. 12:35
Xliff thundergnat: Ooh! I was trying to think of that name for the last day or so. Thanks for reminding me! :) 12:41
Question tho...for the $peano... what are the 'L' and 'R' for?
12:42 pubwrk joined
thundergnat Xliff: they don't mean anything specific, they just are keys to point to the "expansion" applied by the Lindenmeyer system. 12:43
Xliff Ah.
thundergnat They could be anything.
They just happen to be named L and R in this example. 12:44
tobs m: say .file, ':', .line with &infix:<but> 12:47
camelia SETTING::src/core.c/operators.pm6:65
Xliff Still trying to figure out how the rules are set up.
tobs ZzZombo: according to that ^ you can always do it with .DEFINITE things. For indefinites, like type objects, that apparently goes into metaobject land which I don't understand 12:48
m: say 123 but Pointer.new
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
Pointer used at line 1
tobs m: use NativeCall; say 123 but Pointer.new
camelia 123
thundergnat Xliff: for 'L' and 'R', replace where they occur in the string by their expansion. All other characters get processed when you comb through the string. 12:49
Xliff No. I HOW it expands. I just didn't know about that particular way to invoke a role with a parameter. 12:51
timotimo first taught me about Lindenmayer and I was using tr///! 12:52
thundergnat Oh. Sorry. It overrides the .succ method and use $var++ to do each step. 12:55
Xliff s/HOW/know HOW/
The thing that was getting me was "Lindenmayer(%!rules)" 12:56
I didn't know that was a shortcut to initialize the only PUBLIC attribute of a role. Heh
thundergnat There's a lot of pretty cool examples of Raku (Perl 6) code on Rosettacode. 12:59
Xliff Yep!
thundergnat > 1100 different task examples.
Xliff I love RosettaCode 13:00
thundergnat FWIW, we (The active Perl 6 contributors) have elected to not start changing the name over at least until there is a Rakudo release with a "raku" compiler. 13:01
to cut down on confusion.
Xliff Yeah. That makes sense.
ZzZombo m: say &say xor &warn 13:03
camelia WARNINGS for <tmp>:
&say
Useless use of &warn in sink context (line 1)
thundergnat At this moment, Perl 6 is one task entry away from being tied for second for the most task entries. (hint, hint if anybody wants to do some Perl 6 coding)
ZzZombo m: say(&say xor &warn) 13:04
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> 3say(&say7⏏5 xor &warn)
expecting any of:
infix
…
ZzZombo What's wrong?
Xliff thundergnat: Where is that listing? 13:05
thundergnat rosettacode.org/wiki/Reports:Tasks_..._in_Perl_6
ZzZombo m: dd &warn 13:06
camelia Sub warn = proto sub warn (|) {*}
ZzZombo m: m $a = &say xor &warn;dd $a 13:09
camelia 5===SORRY!5===
Unrecognized regex metacharacter = (must be quoted to match literally)
at <tmp>:1
------> 3m $a7⏏5 = &say xor &warn;dd $a
Couldn't find terminator $ (corresponding $ was at line 1)
at <tmp>:1
------> 3m $a =7⏏…
ZzZombo m: my $a = &say xor &warn;dd $a
camelia WARNINGS for <tmp>:
Useless use of &warn in sink context (line 1)
Sub $a = proto sub say (|) {*}
ZzZombo WTF 13:10
13:10 Altai-man_ left
Xliff thundergnat: rosettacode.org/wiki/Use_another_la...a_function --> NativeCall? 13:11
lizmat weekly: twitter.com/raku_cpan_new
notable6 lizmat, Noted! (weekly)
ZzZombo m: my $a = &say xor 0;dd $a 13:12
camelia WARNINGS for <tmp>:
Useless use of constant integer 0 in sink context (line 1)
Sub $a = proto sub say (|) {*}
ZzZombo m: my $a = 1 xor 0;dd $a
camelia WARNINGS for <tmp>:
Useless use of constant integer 0 in sink context (line 1)
Int $a = 1
ZzZombo m: my $a = 1 xor $;dd $a
camelia WARNINGS for <tmp>:
Useless use of unnamed $ variable in sink context (line 1)
Int $a = 1
ZzZombo m: 1 xor 1 13:13
camelia WARNINGS for <tmp>:
Useless use of constant integer 1 in sink context (line 1)
Xliff thundergnat: Oops! No, it's the other way around. Want to call rakudo code from another language.
thundergnat Xliff: yeah, that is a little tougher.
lizmat Xliff: something with cro maybe ? 13:23
tobs ZzZombo: xor has extremely loose precedence, like and and or. `my $a = &say xor 0` turns out to be `(my $a = &say) xor (0)` which gives you sink context warning for the second expression. 13:34
but I'm very unsure about if it should be looser than parentheses in a function call 13:37
ZzZombo m: my $a = (1 xor $);dd $a 13:39
camelia Int $a = 1
ZzZombo hm
tbrowder ref: rosetta code. what about having a raku repo for the solutions so anyone can contribute? 13:40
afk&
thundergnat tbrowder: It's a wiki, anyone CAN contribute. 13:41
13:54 chloekek left
Xliff lizmat: What did you mean by Cro? 13:58
Is there a good Perl6 module for parsing HTML, yet? 14:03
I've generally been using Mojo::DOM:from<Perl5>
thundergnat Xliff: Gumbo has worked very well for me. A lot of the early crashing problems seem to have been cured. 14:04
Xliff Hmmm.... installing it now 14:09
And it's broken... :( 14:11
thundergnat <feebly> well... it works for me... 14:12
Xliff Heh. Looks like a forking issue. I've cloned it.
So it's fixed in git and not through zef. Weird. 14:13
14:13 xinming_ joined
thundergnat Xliff: Sigh, yeah I run into that a bunch. Things get fixed on github but a updated version doesn't get pushed to CPAN. 14:14
14:21 stoned75 joined 14:23 lucasb joined
lucasb m: say((0 or 10)); say (0 or 10) 14:30
camelia 10
10
lucasb m: say(0 or 10)
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> 3say(07⏏5 or 10)
expecting any of:
infix
…
lucasb yeah, it's a little strange that the parentheses from the function call doesn't work. dunno what are the syntatic limitations.... 14:31
14:35 chloekek joined 14:38 patrickb joined
uzl[m] m: sub f(Str @a) { say @a }; my @a = <a b>; f @a; 15:05
camelia Type check failed in binding to parameter '@a'; expected Positional[Str] but got Array ($["a", "b"])
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
tellable6 2019-11-06T18:00:21Z #raku-dev <[Coke]> uzl[m] command-tab is mac "switch between windows"
uzl[m] m: sub f(Str @a) { say @a }; my @a = Array[Str].new('a', 'b'); f @a; 15:07
camelia Type check failed in binding to parameter '@a'; expected Positional[Str] but got Array ($["a", "b"])
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
uzl[m] m: sub f(Str @a) { say @a }; my Str @a = <a b>; f @a; 15:09
camelia [a b]
15:12 MasterDuke joined 15:18 pmurias joined
Xliff thundergnat: Looks like Yahoo has modified its search page to prevent automated searches. 15:20
Oh, but the old form still works. Hah. 15:21
thundergnat Xliff: yeah, some of the remaining tasks are based on apis that have changed since the task was written. 15:23
Xliff Ah, but I'm pulling search results down, now. ;) 15:26
ZzZombo m: my $*a = True; -> $? where CALLER::<$*a> {}() 15:28
m: my $*a = True; -> $? where $*a {}()
camelia Constraint type check failed in binding to parameter '<anon>'; expected anonymous constraint to be met but got Mu (Mu)
in block <unit> at <tmp> line 1
( no output )
ZzZombo Why does the first case not work?
SmokeMachine Xliff: github.com/FCO/Red/issues/406 15:29
guys, would you guys mind of helping on a Red's API decision? github.com/FCO/Red/issues/406#issue-520615433 15:30
15:31 mid_home joined
tobs m: my $*a = True; -> $? where CALLERS::<$*a> {}() 15:32
camelia ( no output )
tobs ZzZombo: I suppose the where clause check happens somewhere in the guts, not inside the pointy block. 15:33
SmokeMachine twitter.com/smokemachine/status/11...2272766976
tobs not directly inside, anyway
lucasb m: my $*a = True; -> $? where DYNAMIC::<$*a> {}() 15:34
camelia ( no output )
ZzZombo m: my $*a = True; -> $? where DYNAMIC('$*a') {}() 15:35
camelia ( no output )
ZzZombo More, more!
SmokeMachine Xliff: have you seen the survey?
ZzZombo m: my $*a = True; dd DYNAMIC::
camelia PseudoStash.new(("!UNIT_MARKER" => !UNIT_MARKER,"\$!" => Nil,"\$*a" => Bool::True,"\$/" => Nil,"\$=finish" => Mu,"\$=pod" => [],"\$?PACKAGE" => GLOBAL,"\$_" => Any,"\$¢" => Nil,"::?PACKAGE" => GLOBAL,:EXPORT(EXPORT),:GLOBALish(GLOBAL)))
Xliff SmokeMachine: Yes. Commented 15:36
SmokeMachine Xliff: and I've also added a comment on your PR... there is 1 ")" missing there... 15:42
Xliff 'k
SmokeMachine vrurg: what dp you think? github.com/FCO/Red/issues/406 16:31
Xliff thundergnat: gist.github.com/Xliff/5fb6df9f353c...bf15e59755 16:35
chloekek p6: grammar G { rule TOP { '(' <TOP>* ')' } }; G.parse('(()()(()))', actions => G); 16:38
camelia Too many positionals passed; expected 1 argument but got 2
in regex TOP at <tmp> line 1
in block <unit> at <tmp> line 1
tbrowder ref rosetta code: is it "fair" to use native call on a c or c++ version of, say, an avl tree? 16:46
moritz I don't think it's instructive
the point of the site is to show how stuff is implemented in different languages
tbrowder i see other langs doing similar, but, as moritz says, not as instructive. 16:47
moritz and if for example the task is to compute pi, shelling out the the pi (1) command line tool doesn't show how to calculate pi in Raku
16:50 pmurias left
tbrowder that's why i asked about a repo, say start out with a translation of another lang's version of a known algorithm, then iteratively improve it with community involvement and rakudoisms before putting it on rosetta 16:51
or throw up a gist and let the shots begin? 16:52
Xliff Heh. I just did that.
tbrowder Xliff, cool. i've tried p6, er, raku xml a bit and had problems with one of the xml mods, but i found a little workaround. let me look... 16:56
17:00 jmerelo joined 17:03 Voldenet joined, Voldenet left, Voldenet joined
tbrowder hm, i see where i use module XML successfully. but you're starting with html, not actual xml... 17:08
Xliff Nope. Using Gumbo and they convert that to an XML::Document 17:09
thundergnat tbrowder: "ref rosetta code: is it "fair" to use native call..." Somewhat discouraged, though, create a nativecall module and push it to the ecosystem and you're gold. 17:18
tbrowder what probs are you seeing with XML? 17:19
Xliff: ^^^ 17:20
thundergnat: maybe two versions: one native call and one pure raku? 17:21
Xliff At least with Gumbo created XML::Document, it's not finding certain nodes by class.
Having problems extracting the text via XML::Element.contents 17:22
XML::Element.lookfor() should be recursive, but it is returning wrong counts for certain tags.
thundergnat I'd be delighted to get task solutions, even if it is calling external libraries. A bunch of the image manipulation task do that, and while it isn't pure Perl, it is instructive about _how_ a task may be approached. 17:25
tbrowder it would be handy to have some raku translators to-from xml <-> json or yaml or some other non-brain-hurting format
thundergnat: thnx 17:26
17:27 pubwrk left 17:31 stoned75 left 17:57 sena_kun joined
sena_kun how do I have printf without "print" part? 17:58
Grinnz sprintf
sena_kun hmm, really... need to check 17:59
docs say "Formats and outputs a string"
17:59 pubwrk joined
sena_kun docs seem wrong 17:59
thundergnat Well, it _does_ output a formatted string, it just returns it to the caller rather than printing it to $*OUT. 18:07
brass I have a question about Red, why are operations like save handled with the model metaclass instead of the class? 18:14
timotimo so that custom methods on the model objects are free to be named whatever you like perhaps 18:15
or maybe to stand out more
brass Also is there a page that goes more into depth about how metaclasses and the MOP than this docs.perl6.org/language/mop?
Hm I see 18:16
Xliff It's more of the first 18:18
A little of the latter
brass The way the meta* stuff works in raku is very cool :)
Although a little hard to understand 18:19
Xliff It kinda is until you get the hang of it.
18:21 Tirifto joined
Xliff Think I've got it. 18:34
Yup. Got it. 18:39
thundergnat: About to be one away, now... ;)
thundergnat Xliff: Cool! 18:41
Xliff Someone wanna try to cut this down a bit? 18:43
gist.github.com/Xliff/5fb6df9f353c...bf15e59755
Otherwise will need help getting this to RC
chloekek One of my blocks is printed like this: -> ;; $_? is raw { #`(Block|86836928) ... } 18:50
What does ;; $_? is raw mean? I haven’t seen it before.
timotimo that's for "parameters following this don't have a say in multi dispatch resolution" 18:51
not really interesting for anonymous blocks, though
chloekek m: sub f(;; $_?) { } 18:52
camelia ( no output )
CIAvash Xliff: There is also DOM::Tiny but it can be slow because grammars are slow I think modules.raku.org/dist/DOM::Tiny:cpan:HANENKAMP 19:05
Xliff CIAvash: Ah! Thanks.
xkr47 the comma IDE is great! except the typical IDE <-> emacs tabs vs spaces & tab size fighting :) 19:06
19:07 Altai-man_ joined 19:10 sena_kun left
thundergnat Xliff: That looks fine to me as you have it, although I would truncate the output. For reusable code I would have .results just return an array and let the calling code decide whether to print it or not, but for an example it looks fine. 19:10
Xliff thundergnat: Yeah, well... hindsight and all. The solution is up... 19:11
Still WIP. Working out how to make pages for the libraries used.
thundergnat Woot!
I'm going to fix up a bit of the markup though. (minor) 19:12
Xliff OK. Well, that's up, plus library pages. 19:16
thundergnat Xliff: Thanks! Awesome. 19:19
Xliff :) 19:20
Was a fun little task. Thanks for the suggestion!
Now I go nap.
19:20 patrickb left
cpan-raku New module released to CPAN! Time::localtime (0.0.4) by 03ELIZABETH 19:23
New module released to CPAN! Time::gmtime (0.0.5) by 03ELIZABETH
New module released to CPAN! Tie::StdHash (0.0.5) by 03ELIZABETH 19:24
New module released to CPAN! Tie::StdArray (0.0.4) by 03ELIZABETH
New module released to CPAN! Tie::Hash (0.0.5) by 03ELIZABETH
New module released to CPAN! Tie::Array (0.0.5) by 03ELIZABETH
New module released to CPAN! Sub::Name (0.0.7) by 03ELIZABETH
New module released to CPAN! P5times (0.0.7) by 03ELIZABETH
New module released to CPAN! P5substr (0.0.5) by 03ELIZABETH
New module released to CPAN! P5study (0.0.4) by 03ELIZABETH
New module released to CPAN! P5sleep (0.0.8) by 03ELIZABETH
New module released to CPAN! P5shift (0.0.5) by 03ELIZABETH
19:24 cpan-raku left
chloekek p6: my %xs = 1 => 2, 3 => 4; (%xs.valuesÂť.sqrt).perl.say; 19:26
camelia (2e0, 1.4142135623730951e0)
19:27 cpan-raku joined, cpan-raku left, cpan-raku joined
chloekek p6: my %xs = 1 => [2, 3], 3 => [4, 5]; (%xs.valuesÂť.IntÂť.sqrt).perl.say; 19:27
camelia ($[1.4142135623730951e0, 1.7320508075688772e0], $[2e0, 2.23606797749979e0])
cpan-raku New module released to CPAN! P5seek (0.0.3) by 03ELIZABETH
New module released to CPAN! P5reverse (0.0.6) by 03ELIZABETH
New module released to CPAN! P5reset (0.0.4) by 03ELIZABETH
New module released to CPAN! P5ref (0.0.5) by 03ELIZABETH
New module released to CPAN! P5readlink (0.0.6) by 03ELIZABETH
tyil hmm
chloekek Why does this create a list of arrays? Is Âť right-associative?
cpan-raku New module released to CPAN! P5readlink (0.0.5) by 03ELIZABETH
New module released to CPAN! P5quotemeta (0.0.4) by 03ELIZABETH
New module released to CPAN! P5push (0.0.5) by 03ELIZABETH
New module released to CPAN! P5print (0.0.4) by 03ELIZABETH
New module released to CPAN! P5pack (0.0.9) by 03ELIZABETH
chloekek p6: my %xs = 1 => [2, 3], 3 => [4, 5]; ((%xs.valuesÂť.Int)Âť.sqrt).perl.say;
camelia ($[2e0, 2.23606797749979e0], $[1.4142135623730951e0, 1.7320508075688772e0])
cpan-raku New module released to CPAN! P5pack (0.0.8) by 03ELIZABETH 19:28
New module released to CPAN! P5math (0.0.3) by 03ELIZABETH
New module released to CPAN! P5localtime (0.0.7) by 03ELIZABETH
New module released to CPAN! P5length (0.0.5) by 03ELIZABETH
19:28 cpan-raku left
tyil clearly it was lacking behind, but I'm not sure if spamming like this is the solution 19:28
19:29 rindolf joined
rindolf hi all 19:30
chloekek p6: my %xs = 1 => [2, 3], 3 => [4, 5]; ((%xs.valuesÂť.Int).ListÂť.sqrt).perl.say;
camelia ($[1.4142135623730951e0, 1.7320508075688772e0], $[2e0, 2.23606797749979e0])
chloekek p6: my %xs = 1 => [2, 3], 3 => [4, 5]; ((%xs.valuesÂť.Int)Âť.ListÂť.sqrt).perl.say;
camelia ($(1.4142135623730951e0, 1.7320508075688772e0), $(2e0, 2.23606797749979e0))
chloekek p6: my %xs = 1 => [2, 3], 3 => [4, 5]; ((%xs.valuesÂť.Int)Âť.flatÂť.sqrt).perl.say;
camelia ($[(2e0,), (2.23606797749979e0,)], $[(1.4142135623730951e0,), (1.7320508075688772e0,)])
chloekek p6: my %xs = 1 => [2, 3], 3 => [4, 5]; (%xs.valuesÂť.sqrt).perl.say; 19:31
camelia ($[2e0, 2.23606797749979e0], $[1.4142135623730951e0, 1.7320508075688772e0])
chloekek Oh, Âť descends into nested lists -_-
Wondering if there's a shorter way to write this (.key returns Int): $e.body.basic-blocks.values.map(*.instructions.map(*.key)).flat 19:35
$e.body.basic-blocks.values.map(*.instructions.Âť.key).flat is already better. :) 19:38
$e.body.basic-blocks.values.map(|*.instructionsÂť.key), amazing
19:43 lucasb left 19:44 jmerelo left
lizmat tyil: well, updating modules at about 1 / minute, doesn't happen very often 19:49
19:56 cpan-raku joined, cpan-raku left, cpan-raku joined
rindolf .seen TimToady 20:00
tellable6 rindolf, I saw TimToady 2019-07-22T20:38:55Z in #perl6-dev: * TimToady had the power company swapping his electric meter, and it broke my / key
cpan-raku New module released to CPAN! P5-X (0.0.4) by 03ELIZABETH
xkr47 m say (447/7).Str.ords.map({ chr($_ < 48 ?? 8228 !! $_ - 48 + 8320) }).join("") 20:07
m: say (447/7).Str.ords.map({ chr($_ < 48 ?? 8228 !! $_ - 48 + 8320) }).join("")
camelia ₆₃․₈₅₇₁₄₃
cpan-raku New module released to CPAN! Attribute::Predicate (0.0.2) by 03ELIZABETH
20:14 tejr joined
SmokeMachine brass: because of that timotimo has said and also because as what’s your classe’s attributes and methods isn’t your classes job, knowing your columns and handling with the database shouldn’t be your model’s job... but its meta class’ job... 20:17
Has anyone had a chance to take a look at this? github.com/FCO/Red/issues/406 20:20
21:08 sena_kun joined 21:09 Altai-man_ left
brass SmokeMachine: Thanks for the answer :) 21:33
SmokeMachine brass: and did it make sense? 21:34
brass Sort of, I'm still not entirely sure how metaclasses work so I'm reading the red source 21:38
21:39 rindolf left
brass Red is the first raku module I've seen so far where the metaclass is used to much 21:41
21:47 chloekek left
cpan-raku New module released to CPAN! Tie::StdArray (0.0.5) by 03ELIZABETH 21:53
New module released to CPAN! Tie::Hash (0.0.6) by 03ELIZABETH
New module released to CPAN! Tie::StdHash (0.0.6) by 03ELIZABETH
New module released to CPAN! Tie::Array (0.0.6) by 03ELIZABETH
brass SmokeMachine: I have a question, why is github.com/FCO/Red/blob/master/exa...dex.p6#L41 using .^create but github.com/FCO/Red/blob/master/exa...dex.p6#L44 is just using .create? 21:55
SmokeMachine brass: `Person` is a model, a “class” everything that access db on that is done by its meta-class. `$p.posts` is a relationship, that returns a `ResultSeq`. `ResultSeq`s have a `.create` method that creates a row that would be part of that `ResultSeq`. In that case it will create a post that was authored by the person `$p`... 22:01
brass: got it? 22:03
brass SmokeMachine: Does the ResultSeq call .^create on Post model then? 22:05
SmokeMachine brass: `$p.posts` returns a `ResultSeq` that represents all posts where `.author-id == $p.id` 22:06
brass I meant when you call .create on the ResultSeq 22:07
SmokeMachine brass: probably... I don’t remember if ResultSeq.create calls Model.^create or the opposite...
brass Ok, got it
SmokeMachine brass: the first option: github.com/FCO/Red/blob/master/lib...q.pm6#L403 22:09
brass: but Model.^create also can call ResultSeq.create depending on what arguments have you passed to it... 22:14
22:33 pubwrk left 22:41 Doc_Holliwood joined 22:52 tobs joined 23:07 Altai-man_ joined 23:09 sena_kun left 23:53 Altai-man_ left