🦋 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:18 benjif joined
cpan-raku New module released to CPAN! Failable (0.1.1) by 03KAIEPI 00:21
01:09 reportable6 left, reportable6 joined 01:32 benjif left
vrurg AlexDaniel: I think you're mostly right. But how much sense would it make spending time on changing those? 02:25
AlexDaniel vrurg: sorry, what exactly?
vrurg AlexDaniel: .gist :)
Sorry, I didn't even noticed the time when you made the comment. :) 02:26
AlexDaniel vrurg: well… I don't know. But we can at least acknowledge the problem and not contribute to it more
vrurg: but, eh, imagine writing your compiler and having to comply to .gist just because some existing compiler does it the way it does
vrurg Sure. I don't mean we must not do it. But this is better be postponed until at least most of the renaming tasks are done. 02:27
AlexDaniel sure, yea
I simply wasn't aware of the problem 02:28
therefore my surprise
vrurg But added it to my roast todos.
AlexDaniel thank you
vrurg I didn't see any until grepped a few minutes ago. Don't like most of what I see.
AlexDaniel yep :( 02:29
if I see it right, some of them are not testing .gist but just using the way it stringifies to validate the data 02:30
probalby should be replaced with is-deeply or similar 02:31
vrurg AlexDaniel: some are subject for isa, some for is-deeply. Mostly, yeah. 02:33
AlexDaniel weekly: gist.github.com/AlexDaniel/81af50d...a290bcf51e 02:37
notable6 AlexDaniel, Noted! (weekly)
AlexDaniel weekly:
notable6 AlexDaniel, 2 notes: 2019-10-18T11:20:24Z <lizmat>: raku.online/2019/10/18/raku-one-li...free-book/ ; 2019-10-20T02:37:48Z <AlexDaniel>: gist.github.com/AlexDaniel/81af50d...a290bcf51e
AlexDaniel weekly: gist.githubusercontent.com/AlexDan...5f/foo.txt 02:38
notable6 AlexDaniel, Noted! (weekly)
AlexDaniel weekly: OK, it doesn't work that way! Nevermind!
notable6 AlexDaniel, Noted! (weekly)
02:47 ggoebel left
Doc_Holliwood
.oO( Nōdo means Node in japanese )
03:14
03:24 benjif joined 04:20 marcusr left 04:21 marcusr joined 04:25 benjif left 04:50 Kaiepi left 04:56 Doc_Holliwood left 04:57 Kaiepi joined
discord6 <Aearnus> what's the current weekly challenge? 05:06
05:19 marcusr left, marcusr joined 05:44 warriors left 06:30 benjif joined, benjif left 06:31 benjif joined 06:59 benjif left 07:13 squashable6 left 07:16 squashable6 joined 09:01 sena_kun joined 09:05 xinming joined 09:08 xinming_ left 09:15 cpan-raku left 09:16 cpan-raku joined, cpan-raku left, cpan-raku joined
squashable6 🍕 niner++ wrote a comment on “Weird issue in epoll module”: github.com/rakudo/rakudo/issues/32...-544235303 09:22
🍕 niner++ closed issue “Weird issue in epoll module”: github.com/rakudo/rakudo/issues/3244
09:36 bob24 joined 09:38 bob24 left 09:49 gdonald left 09:51 gdonald joined 09:54 [Coke]_ joined, [Coke]_ left, [Coke]_ joined, pmurias joined 09:55 [Coke] left 09:56 ilogger2 left 09:58 ilogger2 joined
cpan-raku New module released to CPAN! Algorithm::LibSVM (0.0.8) by 03TITSUKI 10:01
10:08 tony-o left 10:09 tony-o joined 10:13 Doc_Holliwood joined
Doc_Holliwood good morning u beautiful people 10:42
10:54 chloekek joined
squashable6 🍕 niner++ wrote a comment on “NativeCall regression in Math::FFT::Libfftw3”: github.com/rakudo/rakudo/issues/32...-544241679 10:58
🍕 niner++ closed issue “NativeCall regression in Math::FFT::Libfftw3”: github.com/rakudo/rakudo/issues/3237
🍕 niner++ wrote a comment on “Regression in Cro (fetching a json file eats RAM)”: github.com/rakudo/rakudo/issues/32...-544242279 11:07
🍕 niner++ wrote a comment on “Regression in Cro (fetching a json file eats RAM)”: github.com/rakudo/rakudo/issues/32...-544242822 11:15
🍕 niner++ closed issue “Regression in Cro (fetching a json file eats RAM)”: github.com/rakudo/rakudo/issues/3223
11:18 pmurias joined 11:30 pmurias left 11:41 pmurias joined
squashable6 🍕 niner++ wrote a comment on “Windows precompilation regression”: github.com/rakudo/rakudo/issues/31...-544244970 11:47
Doc_Holliwood is there an opposite of `require`? 12:06
pmurias Doc_Holliwood: what would it do? 12:07
tellable6 2019-10-19T01:11:01Z #raku-dev <vrurg> pmurias When jvm backend serialize closures does it serialize their respective core setting too?
Doc_Holliwood as in, is it possible to unload / unreqire a CompUnit, freeing memory
nine Doc_Holliwood: MoarVM will actually garbage collect code, too. Bytecode files are mmaped, not copied into memory. 12:12
Doc_Holliwood and when does the code become eligible for garbollection= 12:14
?
nine When it's not referenced anymore by anything. And that's the key: there are just so many ways an object can become referenced in non-obvious ways (e.g. as part of the lexical scope of the closure of an if-block). 12:16
Doc_Holliwood oh, require is lexically scoped
nine Doc_Holliwood: anyway, why're you asking about this in the first place? Code is usually not that large?
lizmat just about everything is in Raku :-)
Doc_Holliwood so, i can put a loaded comp unit into a scalar, put it in a cache of some sort and once the cache decides to, it will get forgotten? 12:17
nine Why bother? 12:19
Doc_Holliwood I'm thinking about a concept of a "everything is a node" like framework (like permonks), where each node would just be a piece of raku code 12:21
timotimo sounds like an object oriented database :) 12:37
like that zope one
nine Oh please not Zope...\ 12:38
timotimo plones nine
12:44 lucasb joined 12:46 pmurias left 13:07 go|dfish joined 13:54 warriors joined
lizmat can anybody come up with names of people that previously have done the Perl 6 Weekly ? 13:55
I have so far: Ann Barcomb, Piers Cawley, Timo Paulssen
please let me know if you think I'm forgetting someone 13:56
14:13 ZzZombo_ joined, ZzZombo_ is now known as ZzZombo
AlexDaniel squashable6: status 14:23
squashable6 AlexDaniel, The date for the next SQUASHathon is not set
14:25 Kaiepi joined
Doc_Holliwood sighs slightly annoyed 14:27
my fingers just can't get used to the new ternary. i am always typing " something ?? value : other value " and then have to go back and change the colon to !!
maybe not always but most of the time 14:28
tobs for me it's the opposite now :D 14:31
El_Che Doc_Holliwood: I tend to write ternary stuff in 3 lines,it helps for me 14:35
14:37 Kaiepi left 14:38 Kaiepi joined, softmoth joined 14:39 Kaiepi left, Kaiepi joined 14:40 ggoebel joined 14:52 Altai-man_ joined 15:19 dotdotdot joined
AlexDaniel did anybody ever use .samemark? 15:29
Doc_Holliwood m: sub foo { my $x = 1; return with $x { $_ }; return 99; }; foo.say
camelia 5===SORRY!5=== Error while compiling <tmp>
Unexpected block in infix position (missing statement control word before the expression?)
at <tmp>:1
------> 3sub foo { my $x = 1; return with $x7⏏5 { $_ }; return 99; }; foo.say
expect…
Doc_Holliwood m: sub foo { my $x = 1; with $x { return $_ }; return 99; }; foo.say
camelia 1
Doc_Holliwood m: sub foo { my $x = 0; with $x { return $_ }; return 99; }; foo.say 15:30
camelia 0
Doc_Holliwood m: sub foo { my $x; with $x { return $_ }; return 99; }; foo.say
camelia 99
Doc_Holliwood m: sub foo { my $x = 0; if $x { return $_ }; return 99; }; foo.say
camelia 99
Doc_Holliwood i guess there is no statement that tests for truth AND topicalizes? 15:32
15:43 pmurias joined 15:46 Xliff joined
Xliff \o 15:46
m: my $pi = Pointer.^parameterize(Int); $pi.say 15:47
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared name:
Pointer used at line 1
Xliff m: use NativeCall; my $pi = Pointer.^parameterize(Int); $pi.say
camelia (NativeCall::Types::Pointer[Int])
Xliff m: use NativeCall; sub A (Pointer $p) { say $p.^WHAT }; class CS is repr<CStruct> { has uint64 $.csm; method p { my $pp = Pointer.^parameterize(self.WHAT); nativecast($pp, self) }; }; 15:50
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot use .^ on a non-identifier method call
at <tmp>:1
------> 3eCall; sub A (Pointer $p) { say $p.^WHAT7⏏5 }; class CS is repr<CStruct> { has uint
expecting any of:
method a…
Xliff m: use NativeCall; sub A (Pointer $p) { say $p.^WHAT; }; class CS is repr<CStruct> { has uint64 $.csm; method p { my $pp = Pointer.^parameterize(self.WHAT); nativecast($pp, self) }; };
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot use .^ on a non-identifier method call
at <tmp>:1
------> 3eCall; sub A (Pointer $p) { say $p.^WHAT7⏏5; }; class CS is repr<CStruct> { has uin
expecting any of:
method a…
Xliff m: use NativeCall; sub A (Pointer $p) { say $p.WHAT; }; class CS is repr<CStruct> { has uint64 $.csm; method p { my $pp := Pointer.^parameterize(self.WHAT); nativecast($pp, self) }; };
camelia ( no output )
Xliff m: use NativeCall; sub A (Pointer $p) { say $p.WHAT; }; class CS is repr<CStruct> { has uint64 $.csm; method p { my $pp := Pointer.^parameterize(self.WHAT); nativecast($pp, self) }; }; A(CS.new.p) 15:51
camelia (NativeCall::Types::Pointer[CS])
15:59 sumanstats joined
sumanstats Why is this code not working 16:00
cpan-raku New module released to CPAN! Failable (0.1.2) by 03KAIEPI
sumanstats sub odds_from_prob($x) {
say odds_from_prob(0.3); 16:01
It throws:
Cannot look up attributes in a Rat type object
Xliff sumanstats: Can you paste your code somewhere and share a link? 16:03
lizmat sumanstats: could you run the code with m: here so that we can look closer as to what the problem is?
sumanstats p6: sub odds_from_prob($x) { 16:04
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3sub odds_from_prob($x) {7⏏5<EOL>
lizmat sumanstats: please, on a single line, or make a paste of your code 16:05
sumanstats Find the code here glot.io/snippets/fh2xfiz6ba 16:09
lizmat sumanstats: "my Foo $a" fills the variable $a with the Foo type object 16:11
m: say Rat.new(3,7).perl # sumanstats 16:12
camelia <3/7>
lizmat does that help? 16:13
sumanstats m: say Rat.new(3,7).perl.WHAT 16:14
camelia (Str)
sumanstats @lizmat Yes it helps. I want to output as Rat so that I can use it in Testing, Currently output is string <<Str>>
Is it possible? 16:19
moritz uhm, .perl always returns a Str 16:29
if you don't want that, don't call .perl
just use the object directly
lizmat what moritz said :-) 16:30
afk for a few hours&
Xliff sumanstats: Did you know that: (numeric value 1) / (numeric value 2) will always return a Rat? 16:34
So you don't need to explicitly create the Rat object. Raku does that for you. 16:35
So....
m: sub odds_from_prob($x) { my $a = ($x / (1 - $x)); $a.nude[0] / $a.nude[1] }; say odds_from_prob(0.3).WHAT 16:36
camelia (Rat)
Xliff m: sub odds_from_prob($x) { my $a = ($x / (1 - $x)); $a.nude[0] / $a.nude[1] }; say odds_from_prob(0.3).perl
camelia <3/7>
16:38 softmoth left
sumanstats @xliff Agreed the output is Rat but I wanted fraction as it is rather than the calculated value. This is my code 16:39
#Calculating odds ratio from probability and probability from odds ratio
For testing I have these
ok prob_from_odds(3/7) == 0.3; 16:40
Xliff sumanstats: So you want it to return "0.3 / 0.7"
m: sub odds_from_prob($x) { my $a = ($x / (1 - $x)); $a.nude[0] / $a.nude[1] }; say odds_from_prob(3/7).perl
camelia 0.75
Xliff ah... that might be a bit of a tickle. 16:41
I think Rat will simplify,.
m: sub odds_from_prob($x) { my $a = ($x / (1 - $x)); $a.nude[0] / $a.nude[1] }; say odds_from_prob(3/7).Num 16:42
camelia 0.75
Xliff sumanstats: Can you write up what you expect and what is happening on glot.io?
That way I can play with things and see if I can help you get what you are looking for.
m: my $a = 3.75 / 2.05; $a.WHAT.say 16:44
camelia (Rat)
Xliff m: my $a = 3.75 / 2.05; $a.perl.say
camelia <75/41>
Xliff m: say 41 / 2.05 16:45
camelia 20
Xliff m: my $a = 3.75 / 2.12345; $a.perl.say 16:46
camelia <75000/42469>
Xliff m: say 42469 / 2.12345 16:47
camelia 20000
Xliff m: my $a = 3.77 / 2.12345; $a.perl.say
camelia <75400/42469>
16:49 Altai-man_ left 16:55 Tirifto joined 17:08 softmoth joined 17:19 Tirifto left 17:27 sumanstats left 17:30 xinming joined
Geth doc: uzluisf++ created pull request #3066:
Wrap inline code examples with C<>, remove unneeded capitalization, ...
17:30
18:01 chloekek left
cpan-raku New module released to CPAN! XML::Actions (0.4.5) by 03MARTIMM 18:50
Doc_Holliwood so i have a bunch of roles and a bunch of methods in an 1 : 1 relationship. is it better to "does" them all in the class declaration, or to use the (self but SomeRole).someMethod pattern? 18:55
guifa I would just put the does in the class declaration 18:58
I find when I get > 2 classes/roles it becomes easier to use “also does Foo” as the first line after the declaration 18:59
Or to put the “also does Foo” right above any methods being implemented for Foo (for example, if I need custom handling for Associative/Positional) 19:00
m: class Language { enum (English => ‘en’, Spanish => ‘es’); say Language::English; say Language::Spanish eq ‘es’; # :D :D :D 19:02
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3ay Language::Spanish eq ‘es’; # :D :D :D7⏏5<EOL>
guifa class Language { enum (English => ‘en’, Spanish => ‘es’) } ; say Language::English; say Language::Spanish eq ‘es’; # :D :D :D
evalable6 English
True
guifa I assume the above won’t recreate the enum for each instance, so this is a pretty slick solution to get readable language code (Language::Foo) that coexist with the Language class. 19:03
19:08 Kaiepi left 19:11 thundergnat joined, Kaiepi joined
thundergnat <Doc_Holliwood i guess there is no statement that tests for truth AND topicalizes?> I think you are looking for with. 19:12
m: for 1, Nil, 'foo' -> $t { $t.say; with $t { .say } }
camelia 1
1
Nil
foo
foo
thundergnat Doc_Holliwood: ^^^ 19:13
Doc_Holliwood thundergnat: with tests for definedness
thundergnat Hmm. so it does. Nevermind. 19:14
guifa ^^ I’ve run into that before. That seems like a good opportunity to right a slang. ifgiven $a { #`(topicalize $a, but skip if $a is false) } 19:15
19:21 pmurias left 19:23 pmurias joined
discord6 <noelsken> isn't that andthen? 19:25
tejr and then? 19:26
discord6 <noelsken> m: for 1, Nil, "foo" -> $x { $x andthen .say } # no idea if this works across the bridge
evalable6 1
foo
discord6 <noelsken> ah wait that doesn't even show what I wanted to 19:28
<noelsken> yeah reading the docs it seems like andthen is more a chainable statement with or somesuch 19:29
AlexDaniel somesuch sounds like another operator :) 19:36
19:40 thundergnat left
Xliff m: use NativeCall; sub A (Pointer $p) { say $p.WHAT; }; class CS is repr<CStruct> { has uint64 $.csm; method BUILD { $!csm = 1 }; method p { my $pp := Pointer.^parameterize(self.WHAT); nativecast($pp, self) }; }; 19:44
camelia ( no output )
Xliff m: use NativeCall; sub A (Pointer $p) { say $p.WHAT; }; class CS is repr<CStruct> { has uint64 $.csm; method BUILD { $!csm = 1 }; method p { my $pp := Pointer.^parameterize(self.WHAT); nativecast($pp, self) }; }; A.new.csm.say 19:45
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling A() will never work with declared signature (NativeCall::Types::Pointer $p)
at <tmp>:1
------> 3self.WHAT); nativecast($pp, self) }; }; 7⏏5A.new.csm.say
Xliff m: use NativeCall; sub A (Pointer $p) { say $p.WHAT; }; class CS is repr<CStruct> { has uint64 $.csm; method BUILD { $!csm = 1 }; method p { my $pp := Pointer.^parameterize(self.WHAT); nativecast($pp, self) }; }; CS.new.csm.say
camelia 1
20:00 Xliff left
Geth doc/seq-elems-cache-note: a2ac522229 | Altai-man++ | doc/Type/Seq.pod6
Document elems on Seq
20:33
guifa I can kind of see why If doesn’t topicalize (if I say “if $a == 4” what is the topic set to? OTOH, if $_ were set to True, it wouldn’t interfere too much either because presumably in that case no one would use it, but topicalizing may be expensive enough to not do it (or not, I haven’t looked at the internals) 20:34
Geth doc: Altai-man++ created pull request #3067:
Document elems on Seq
20:35
Doc_Holliwood this language never seems to amaze me 20:45
i just put this in a role: has $.initialized = self.init-config; 20:46
and it worked
20:49 Kaiepi left 20:50 Kaiepi joined 20:53 chloekek joined 21:03 sena_kun joined
sena_kun m: use Test; is-deeply (1,2,3).all, (1,2,3).all; 21:03
camelia not ok 1 -
# Failed test at <tmp> line 1
# expected: all(1, 2, 3)
# got: all(1, 2, 3)
sena_kun ok, so how do we... you know, do this thing?
hmm, maybe just `ok ~~`... 21:04
m: use Test; ok (1,2,3).all ~~ (1,2,3).all; 21:05
camelia not ok 1 -
# Failed test at <tmp> line 1
sena_kun ok...
Doc_Holliwood m: use Test; is-deeply (1,2,3).all.eager, (1,2,3).all.eager;
camelia not ok 1 -
# Failed test at <tmp> line 1
# expected: all((1,), (2,), (3,))
# got: all((1,), (2,), (3,))
Doc_Holliwood m: use Test; is-deeply (1,2,3).all.Array, (1,2,3).all.Array;
camelia not ok 1 -
# Failed test at <tmp> line 1
# expected: all([1], [2], [3])
# got: all([1], [2], [3])
Doc_Holliwood m: use Test; is-deeply (1,2,3).Array, (1,2,3).Array;
camelia ok 1 -
sena_kun hmm, I wonder if coercing a junction to array is consistent all the time 21:06
Doc_Holliwood m: use Test; ok (1,2,3).all equiv (1,2,3).all; 21:07
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3use Test; ok (1,2,3).all7⏏5 equiv (1,2,3).all;
expecting any of:
infix
infix stopper
postfix
statement end…
Doc_Holliwood m: use Test; ok (1,2,3).all eqv (1,2,3).all;
camelia not ok 1 -
# Failed test at <tmp> line 1
Doc_Holliwood m: use Test; ok (1,2,3).all.perl eq (1,2,3).all.perl;
camelia ok 1 -
Doc_Holliwood tada :D
sena_kun .perl is not ok for roast tests, I think. :( 21:08
Doc_Holliwood m: (1,2,3).all.perl.say
camelia all(1, 2, 3)
Doc_Holliwood m: use Test; ok (1,2,3).all ~~ (1,2,3).all; 21:09
camelia not ok 1 -
# Failed test at <tmp> line 1
Doc_Holliwood m: say (1,2,3).all - (1,2,3).all; 21:10
camelia all(all(0, -1, -2), all(1, 0, -1), all(2, 1, 0))
Doc_Holliwood o.... k.
m: say (1,2,3).all ~ (1,2,3).all; 21:11
camelia all(11, 12, 13, 21, 22, 23, 31, 32, 33)
sena_kun junctions...
21:13 tellable6 joined
sena_kun m: use Test; say 1|2|3 ~~ (1,2,3).all 21:14
camelia True
sena_kun yay
21:16 ggoebel left 21:23 sena_kun left
Doc_Holliwood writing tests for the language in itself must be like walking on swimming logs 21:30
m: sub foo { fail }; with foo { say 1 } 21:43
camelia 5===SORRY!5===
Function 'foo' needs parens to avoid gobbling block
at <tmp>:1
------> 3sub foo { fail }; with foo { say 1 }7⏏5<EOL>
Missing block (apparently claimed by 'foo')
at <tmp>:1
------> 3sub foo { fail }; with foo { say…
Doc_Holliwood m: sub foo { fail }; with foo() { say 1 }
camelia ( no output )
Doc_Holliwood m: sub foo { 1 }; with foo() { .say }
camelia 1
Doc_Holliwood m: sub foo { 1 }; .say with foo() 21:49
camelia 1
Doc_Holliwood m: sub foo { 1 }; say with foo() ?? 1 !! 0; 21:52
camelia 5===SORRY!5=== Error while compiling <tmp>
Unsupported use of bare "say"; in Perl 6 please use .say if you meant to call it as a method on $_, or use an explicit invocant or argument, or use &say to refer to the function as a noun
at <tmp>:1…
go|dfish 1
Doc_Holliwood m: sub foo { 1 }; .say with foo() or 22 21:54
camelia 1
Doc_Holliwood m: sub foo { fail }; .say with foo() or 22
camelia 22
Doc_Holliwood that's it
overly clever?
should i use an if and two returns?
discord6 <noelsken> that with ... or ... construct still needs an if to handle the sentinel value doesn't it? 22:03
<noelsken> I had had "with $x and .so { ... }" as an idea but with hasn't topicalized there yet 22:05
Geth ecosystem: hythm7++ created pull request #470:
Add Pakku to ecosystem
22:06
discord6 <noelsken> anyway I'd suggest "do it minimally clever"
Geth ecosystem: ec6e8b7b3e | (Haytham Elganiny)++ | META.list
Add Pakku to ecosystem

  github.com/hythm7/Pakku
22:34
ecosystem: 7d162e5438 | (Aleks-Daniel Jakimenko-Aleksejev)++ (committed using GitHub Web editor) | META.list
Merge pull request #470 from hythm7/add-pakku-meta

Add Pakku to ecosystem
AlexDaniel weekly: non-cpan modules are sometimes not mentioned in weeklies, so just making sure. Meet Pakku! github.com/hythm7/Pakku 22:42
notable6 AlexDaniel, Noted! (weekly)
AlexDaniel that's a lot of emojis in the source code :) 22:46
22:49 k-man joined
Doc_Holliwood sentinel value? 22:50
discord6 <noelsken> Doc_Holliwood: I understood the 22 as placeholder value for "the LHS of the or was falsey" 22:52
22:53 pmurias left 22:54 pmurias joined, lucasb left
Doc_Holliwood yes 22:54
the "real code" was more like sub f { ...; return $_ with from-json($json) or {} } 22:56
22:56 chloekek left
Doc_Holliwood where from json might fail and that gets elegantly caught by the with 22:56
discord6 <noelsken> ah, that makes sense 22:58
23:17 marcusr joined 23:56 pmurias left 23:59 Kaiepi left, Kaiepi joined