🦋 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:10 approaching236 joined, rbtca left 00:11 rbtca joined
rypervenche Why would this test not work?: is first(Int, (1..10)), 1; 00:13
codesections m: use Test; is first(Int, (1..10)), 1; 00:15
camelia ok 1 -
codesections It passes, but the problem with it is that it's using string comparison (`eq`) to compare 00:16
00:19 Tirifto left
rypervenche Ahhh, my module was causing the test to do something strange. Welp, good thing I'm writing tests. :D 00:22
00:24 rbtca left 00:29 approaching236 left 00:36 zacts joined 00:41 lucasb left
timotimo codesections: yes, is uses string comparison, there's a couple of other comparison tests like is-deeply, or cmp-ok 00:57
codesections yep 00:58
01:02 approaching236 joined 01:07 approaching236 left 01:09 tejr left, mowcat left, zacts left 01:10 tejr joined 01:11 abraxxa left 01:14 abraxxa joined 02:07 MasterDuke left 02:27 daxim left 02:28 aluaces joined 02:30 ensamvarg3 joined 02:35 daxim joined 03:27 xelxebar left 03:28 xelxebar joined 03:37 zacts joined 04:02 xelxebar left, xelxebar joined 04:06 cpan-raku left 04:07 cpan-raku joined, cpan-raku left, cpan-raku joined 04:38 exnihilo joined 04:41 exnihilo is now known as ex_nihilo 04:46 aborazmeh joined, aborazmeh left, aborazmeh joined, ex_nihilo left 04:52 ex_nihilo joined 05:10 parabolize left 05:33 billN1VUX left 05:37 bocaneri joined 05:56 jmcgnh left 05:58 leont left 06:01 jmcgnh joined 06:07 kerframil left 06:10 andrzejku joined 06:11 zacts left 06:21 sjaveed left, sjaveed joined 06:22 sena_kun joined 06:25 billN1VUX joined, billN1VUX left 06:26 sjaveed left 06:37 aluaces left 06:38 epony left 06:42 stoned75 joined 06:43 approaching236 joined 06:53 sjaveed joined 07:02 sjaveed left, sena_kun left 07:06 sena_kun joined, pecastro joined 07:10 aluaces joined 07:16 andrzejku left 07:18 skids left 07:19 andrzejku joined 07:24 Altai-man joined 07:26 sena_kun left 07:30 camelCaser left 07:31 camelCaser joined 07:37 Sgeo left 07:43 andrzejku left 07:45 dakkar joined 07:46 aluaces left 07:47 epony joined 07:51 MasterDuke joined 07:53 andrzejku joined 07:56 sjaveed joined 08:00 sjaveed left 08:09 aborazmeh left 08:10 sno left 08:13 sno joined, erdic left 08:20 rindolf joined 08:22 domidumont joined 08:41 maggotbrain left 08:48 rindolf left 08:50 aborazmeh joined, aborazmeh left, aborazmeh joined 08:55 maggotbrain joined 09:06 rindolf joined 09:20 Skarsnik joined
Skarsnik Hello, I am super confused, I have some code like that (in a loop): say $arg.raku, $arg.WHAT; 09:27
say "I am a list" if $arg ~~ List; but it never input I am a list, even when WHAT is (List)
Altai-man Skarsnik, can you reproduce it here? 09:30
Skarsnik No because, it works properly in a one liner x)
Altai-man :Z
Not sure it can be helped without much info, alas. 09:31
What if you try `if $arg<> ~~ List`? (just a wild guess)
09:31 aluaces joined, zacts joined
Skarsnik m:my @foo = ((1, 2), Buf.new(4 09:32
0)); for @foo -> $a {say $a.raku, $a.WHAT; say "I am a list" if $a ~~ List };
evalable6 (exit code 1) 04===SORRY!04=== Er…
Skarsnik, Full output: gist.github.com/4074de9a742479b391...f3f59b8a61
Skarsnik m: my @foo = ((1, 2), Buf.new(40)); for @foo -> $a {say $a.raku, $a.WHAT; say "I am a list" if $a ~~ List };
camelia $(1, 2)(List)
I am a list
Buf.new(40)(Buf)
09:34 cpan-raku left 09:35 cpan-raku joined, cpan-raku left, cpan-raku joined
Skarsnik The same thing in my code ouput : $(16056400, 4)(List) $(16056404, 2)(List) Buf.new(1,2,3,4)(Buf) Buf.new(5,6)(Buf) 09:35
Altai-man () is redundant 09:36
m: my @foo = (1, 2), Buf.new(40); for @foo -> $a { say $a.raku, $a.WHAT; say "I am a list" if $a ~~ List }
camelia $(1, 2)(List)
I am a list
Buf.new(40)(Buf)
09:37 ex_nihilo left
Skarsnik that does not tell me why my ~~ Type check never work in my module xD 09:38
Altai-man Yes, but still. :P 09:39
Skarsnik, what if you try =:= instead of ~~? 09:40
Skarsnik (also I mess up a fix in one of the Test method x)
09:42 aborazmeh left
Skarsnik No luck x) 09:42
09:45 MasterDuke left
Skarsnik say "I am a list" if $arg.WHAT.raku eq "List"; work xD 09:45
dakkar eww 09:46
m: my @a;say @a.WHAT
camelia (Array)
dakkar that's the string representation of a metaclass instance, right?
m: my @a;say @a.WHAT.WHAT
camelia (Array)
dakkar is now confused
Skarsnik m: say ().WHAT.raku 09:47
camelia List
moritz no, that's the typ object
*type
the meta class is accessbile through HOW
m: my @a; say @a.HOW
camelia No such method 'gist' for invocant of type
'Perl6::Metamodel::ClassHOW+{<anon>}'. Did you mean 'isa'?
in block <unit> at <tmp> line 1
moritz m: my @a; say @a.HOW.name
camelia Too few positionals passed; expected 2 arguments but got 1
in block <unit> at <tmp> line 1
moritz m: my @a; say @a.HOW.^name
camelia Perl6::Metamodel::ClassHOW+{<anon>}
dakkar oh, right
moritz m: say 42.HOW.^name
camelia Perl6::Metamodel::ClassHOW
dakkar m: ().WHAT ~~ List
camelia ( no output )
dakkar m: say "ok" if ().WHAT ~~ List 09:48
camelia ok
dakkar Skarsnik: something like that?
Skarsnik this did not work etheir
dakkar I think we need more context then
09:52 maggotbrain left
Skarsnik the code boil down to 09:52
m: class A { multi method foo(**@args) {for @args -> $arg {say "I am a list" if $arg ~~ List}}}; my $a = A.new; $a.foo((1, 2), (2, 3), Buf.new(<1 2>))
camelia I am a list
I am a list
Skarsnik but this work 09:53
dakkar then there's something weird in the parts you boiled away ☺ 09:54
like, that `multi` is useless here, but maybe you have other candidates in your actual code? 09:55
Skarsnik gist.github.com/Skarsnik/fb0674aa1...9db1aba582 (not the whole module) 09:57
dakkar womm 09:59
gist.github.com/dakkar/1af4796894f...925924fa6f 10:00
(of course @datas is empty because Buf !~~ Blob) 10:01
10:01 k-man joined
dakkar uh… 10:01
no, that's wrong
m: say Buf ~~ Blob
camelia True
dakkar ah, `.push:` eats the rest of the line 10:02
Skarsnik: the slightly modified version at my gist seems to work 10:03
Skarsnik this alone works for me too
dakkar so the problem is somewhere else, keep digging
10:04 k-man left
dakkar notice how I had to change `@datas.push:$arg if…` to `@datas.push($arg) if…` 10:05
Skarsnik yeah @datas get properly filled now with this change, but still no luck with List check 10:06
10:11 k-man joined 10:13 roguelazer left, El_Che left 10:21 El_Che joined, aluaces left 10:23 roguelazer joined 10:24 hvxgr joined 10:25 MasterDuke joined
Skarsnik I need to go to work sadly x) 10:27
10:28 maggotbrain joined
Skarsnik code is here if you want to play around xD github.com/usb2snes/usb2snes-tests...raku-tests (in lib/Usb2Snes.pm and the test 07) 10:34
10:40 Skarsnik left 10:46 approaching236 left, approaching236 joined 10:52 zacts left 10:55 Black_Ribbon left
timotimo what do i run to see the thing happen? 10:55
.tell Skarsnik have you considered that it could be a bad idea to have an enum value named List :) :) 10:56
tellable6 timotimo, I'll pass your message to Skarsnik
timotimo m: enum Aaaaa <Array List>; say (1, 2, 3) ~~ List 10:57
camelia False
timotimo m: enum Aaaaa <Array List>; say (1, 2, 3) ~~ SETTING::List
camelia True
11:01 MasterDuke left
Geth doc: fa599f1b2a | timo++ (committed using GitHub Web editor) | doc/Language/performance.pod6
replace mentions of #perl6 with #raku (irc channel)
11:11
linkable6 Link: docs.raku.org/language/performance
11:13 timo joined 11:14 timo is now known as Guest97478 11:15 Guest97478 is now known as timotimo 11:25 sena_kun joined 11:27 Altai-man left 11:51 parabolize joined 11:56 aluaces joined 11:59 MasterDuke joined 12:03 zacts joined 12:15 leont joined
dakkar timotimo: ouch! I'd never have spotted that 12:27
(do we need a warning like p5's "Ambiguous call resolved as CORE::%s()"?) 12:29
codesections Today I Learned that this syntax exists in Raku: 12:36
m: my regex word { \w+ }; 'foo bar' ~~ /<new-name=.&word>/; say $<new-name>
camelia 「foo」
codesections (or without the & inside a grammar) 12:37
I should probably add that to the docs 12:39
dakkar that is calling the &word sub/regex on the current cursor(?) 12:51
if you're not in a grammar, you can just <new-name=word>
12:53 ccamel joined
dakkar codesections: isn't this already documented at docs.raku.org/language/regexes#Subrules ? 12:53
12:54 camelCaser left
codesections oh, I guess it is! I'd missed the «To give the capture a different name from the regex, use the syntax <capture-name=named-regex>.» sentence 12:54
thanks!
13:00 rypervenche left 13:04 rypervenche joined 13:15 _jrjsmrtn left 13:16 __jrjsmrtn__ joined 13:34 zacts left 13:37 andrzejku left 13:57 Celelibi left 14:07 Sgeo joined 14:09 Celelibi joined 14:33 sftp left 14:37 MasterDuke left, epony left 14:40 epony joined 14:43 MasterDuke joined 14:57 molaf joined 15:03 epony left 15:04 molaf left 15:07 sjaveed joined 15:21 epony joined 15:24 Altai-man joined 15:27 sena_kun left, approaching236 left 15:28 sjaveed left, sjaveed joined 15:34 sjaveed left 15:36 nebuchadnezzar left 15:37 Guest65602 joined
timotimo committable6: releases for lines() { FIRST my %foo is MixHash; %foo{$_}++; END dd %foo }; 15:45
committable6 timotimo, gist.github.com/77e172ce96cdd536b3...008036ff02
timotimo hum. i guess i'm glad this never worked?! 15:46
15:55 skids joined 16:04 natrys joined 16:09 Guest65602 is now known as nebuchadnezzar` 16:11 nebuchadnezzar` is now known as nebuchadnezzar, sjaveed joined 16:15 billN1VUX joined
codesections I have a data structure that, conceptually, is a tree of Hashes/Arrays (think JSON). But, in practice, many of the Arrays have ended up being Seqs instead. Is there any good reason to convert them back to Arrays, or should I just leave them as Seqs? 16:16
16:16 billN1VUX left 16:17 billN1VUX joined
Altai-man codesections, it depends on who will stream them down the line. Seqs cannot be iterated twice without a `.cache` call which might be really annoying if you are getting "Seq cannot be iterated" exception somewhere deep in eval code (think Cro::WebApp). Converting to an array is less perf, of course. 16:18
So think in terms of what API you want to have.
timotimo i have a snippet that can help you debug "has already been consumed" error messages 16:19
codesections Altai-man: yeah, that's actually how I noticed the issue: working with the data structure, I noticed that I'm needing to add `.cache`. So now I'm trying to decide if I should deal with that as the consumer of the API
or tweak the data structure to convert to Arrays after each map, etc 16:20
16:21 orinthe left 16:22 orinthe joined 16:31 domidumont left 16:32 orinthe left, orinthe joined 16:38 dakkar left 16:43 Black_Ribbon joined 16:49 a3r0 left, a3r0 joined 17:09 aluaces left 17:11 MasterDuke left 17:19 approaching236 joined 17:23 andrzejku joined 17:26 approaching236 left 17:28 Altai-man left 17:31 Altai-man joined, sjaveed left 17:34 Altai-man left, aluaces joined 17:37 dataangel left 17:42 stoned75 left 17:46 ensamvarg3 left 17:47 patrickb joined 17:48 stoned75 joined 17:49 approaching236 joined 17:58 stoned75 left, sjaveed joined 18:04 stoned75 joined 18:25 bocaneri left 18:37 colomon_ joined
colomon_ Argh. Hit one of those things I always forget how to do. for @a.rotor(2) -> [$a, $b] { } isn’t right, but how do you do that — unpack the results of rotor into individual variables? 18:40
spent twnety minutes now searching through docs, but I don’t know how to ask the question well enough to find the answer.
timotimo m: for <a b c d>.rotor(2) -> ($a, $b) { say "a is $a, b is $b" } 18:41
camelia a is a, b is b
a is c, b is d
timotimo m: for <a b c d> -> $a, $b { say "a is $a, b is $b" } 18:42
camelia a is a, b is b
a is c, b is d
timotimo ^- might not need rotor, though
colomon_ Huh. First one isn’t working for me in my actual code. 18:43
timotimo something something itemization? 18:44
m: my $stuff = <a b c d>.rotor(2); for $stuff -> ($a, $b) { say "a is $a, b is $b" }
camelia a is a b, b is c d
timotimo m: my $stuff = <a b c d>.rotor(2); for $stuff<> -> ($a, $b) { say "a is $a, b is $b" }
camelia a is a, b is b
a is c, b is d
colomon_ m: dd <a b c d>.rotor
camelia Type check failed in binding to parameter '<anon>'; expected Any but got Mu (IterationEnd)
in block <unit> at <tmp> line 1
colomon_ _: m: dd <a b c d>.rotor(2)
18:45
m: dd <a b c d>.rotor(2)
camelia (("a", "b"), ("c", "d")).Seq
colomon_ m: dd <a b c d>.rotor(2 => -1)
camelia (("a", "b"), ("b", "c"), ("c", "d")).Seq
colomon_ m: <a b c d>.rotor( 2 => -1).map(-> ($a, $b) { say 18:46
camelia 5===SORRY!5===
Argument to "say" seems to be malformed
at <tmp>:1
------> 3d>.rotor( 2 => -1).map(-> ($a, $b) { say7⏏5<EOL>
Missing block
at <tmp>:1
------> 3d>.rotor( 2 => -1).map(-> ($a, $b) { say7⏏5<EOL>
expecting …
colomon_ m: <a b c d>.rotor( 2 => -1).map(-> ($a, $b) { say “$a to $b” })
camelia a to b
b to c
c to d
18:46 raku-bridge joined, raku-bridge left, raku-bridge joined
timotimo don't forget about :partial and $b? 18:47
18:48 ex_nihilo joined
patrickb rba: Still no new versions uploaded. :-( 18:48
colomon_ timotimo: actual error I’m getting is Too few positionals passed to '<anon>'; expected 2 arguments but got 0 in sub-signature 18:49
timotimo oh, zero? i could have expected 1
m: <>.rotor(2 => -1).map(-> ($a, $b) { say "$a <-> $b, " }) 18:50
camelia 5===SORRY!5=== Error while compiling <tmp>
Unsupported use of <>. In Raku please use: lines() to read input, ('')
to represent a null string or () to represent an empty list.
at <tmp>:1
------> 3<7⏏5>.rotor(2 => -1).map(-> ($a, $b) {…
timotimo m: ().rotor(2 => -1).map(-> ($a, $b) { say "$a <-> $b, " })
camelia ( no output )
timotimo m: ("a").rotor(2 => -1).map(-> ($a, $b) { say "$a <-> $b, " })
camelia ( no output )
timotimo m: ("a", "b").rotor(2 => -1).map(-> ($a, $b) { say "$a <-> $b, " })
camelia a <-> b,
timotimo m: ("a", "b").rotor(2 => -1, :partial).map(-> ($a, $b) { say "$a <-> $b, " })
camelia a <-> b,
Too few positionals passed to '<anon>'; expected 2 arguments but got 1 in sub-signature
in block <unit> at <tmp> line 1
timotimo m: ("a", "b").rotor(2 => -1, :partial).map(-> ($a, $b?) { say "$a <-> $b, " })
camelia a <-> b,
Use of uninitialized value element of type Mu in string context.
Methods .^name, .raku, .gist, or .say can be used to stringify it to something meaningful.
b <-> ,
in block at <tmp> line 1
18:50 sjaveed left
timotimo m: ("a", "b").rotor(2 => -1, :partial).map(-> ($a, $b?) { quietly say "$a <-> $b, " }) 18:50
camelia a <-> b,
b <-> ,
18:51 sjaveed joined
colomon_ right, I’m not using partial… and rotor should never return an empty list, should it? 18:51
timotimo it could
m: <a b c d e>.rotor(2=>2, 0=>1).map(&dd)
camelia ("a", "b")
Rotorizing sublist length is out of range. Is: 0, should be in 1..^Inf
in block <unit> at <tmp> line 1
timotimo oh
well
colomon_ huh. Well, at least the problem wasn’t that I forgot the syntax… 18:53
18:54 donaldh joined 18:56 sjaveed left 18:59 melezhik joined 19:01 sjaveed joined 19:05 raku-bridge left, raku-bridge joined 19:07 sjaveed left 19:09 Geth left
[Coke] raku-bridge: help 19:16
19:16 Skarsnik joined
[Coke] (anyone know where the other end of the bridge is?) 19:17
Skarsnik in the other side of the river
tellable6 2020-09-16T10:56:03Z #raku <timotimo> Skarsnik have you considered that it could be a bad idea to have an enum value named List :) :)
melezhik .tell FCO: I've fixed Red/PG test on rakudist. Every time rakudist worker change it's IP I need to update pghba.conf file, sigh ... I don't have quick solution for that 19:19
tellable6 melezhik, I haven't seen FCO around, did you mean CQ?
Skarsnik timotimo, that's actually... interesting but I think there is still an issue somewhere, etheir raku should complain of a redefinition of type or the ~~ operator should complain that you offer it 2 type that match List 19:20
melezhik .tell SmokeMachine: I've fixed Red/PG test on rakudist. Every time rakudist worker change it's IP I need to update pghba.conf file, sigh ... I don't have quick solution for that
tellable6 melezhik, I'll pass your message to SmokeMachine
melezhik .tell SmokeMachine this one fails - rakudist.raku.org/sparky/report/debian/686 but now because of unit test errors 19:21
tellable6 melezhik, I'll pass your message to SmokeMachine
timotimo Skarsnik: lexical scoping means overriding stuff in an "inner" scope is fine :P 19:26
19:29 melezhik left 19:38 approaching236 left 19:43 sjaveed joined 19:50 andrzejku left 19:53 sjaveed left 19:55 natrys left 20:01 dataangel joined 20:08 molaf joined 20:14 stoned75 left
Skarsnik hm, I dunno, an enum value should not be a type? 20:22
but that a nice oops hard to see xD 20:23
timotimo we don't have separate namespaces for types and other things 20:24
20:27 MasterDuke joined 20:28 sjaveed joined 20:29 MasterDuke left
timotimo github highlights it differently from the other entries in the list though :D 20:32
20:32 patrickb left, guifa joined
SmokeMachine . 20:35
tellable6 2020-09-16T19:20:30Z #raku <melezhik> SmokeMachine: I've fixed Red/PG test on rakudist. Every time rakudist worker change it's IP I need to update pghba.conf file, sigh ... I don't have quick solution for that
2020-09-16T19:21:18Z #raku <melezhik> SmokeMachine this one fails - rakudist.raku.org/sparky/report/debian/686 but now because of unit test errors
guifa Has anyone else recently gotten Rakudo to run in the browser with webperl? I’m trying to do it to make some interactive tools for Raku but I keep getting a Raku.eval doesn’t exist error 20:36
SmokeMachine .tell melezhik thanks! I’ll take a look as soon as possible 20:37
tellable6 SmokeMachine, I'll pass your message to melezhik
SmokeMachine guifa: fco.github.io/MemoizedDOM/todo6.html 20:38
github.com/FCO/MemoizedDOM
guifa SmokeMachine++ 20:40
(I figured with exceptions messages being code, having a web interface that can show results of sample exceptions and their messages would be a good idea :-) ) 20:41
Skarsnik Comma defaut hl color make it the same hm 20:53
timotimo because comma knows it's a string-list literal
lol
Skarsnik I mean there is a ~~ Blob bellow and it's the same 20:54
timotimo oh, right
20:54 rindolf left
timotimo what do you get when you ctrl-click it? 20:54
20:54 ex_nihilo left
Skarsnik ah yeah the enum 20:54
I don't remember, there is no Core:: to get the 'core' type? 20:55
timotimo comma could totally highlight stuff that shadows stuff from the core
there is, it's spelled SETTING:: i believe
m: say CORE::.keys
camelia (&infix:<^…> NFD &trim StringyEnumeration &prefix:<--> SocketType &rmdir &cos &WHAT &infix:<cmp> &infix:<Z> &infix:<(cont)> Metamodel &infix:<(==)> Rational QuantHash &infix:<=~=> &infix:<le> True &atomic-fetch-inc &infix:<^..^> Baggy SOCK_MAX Proxy…
20:55 approaching236 joined
timotimo m: say SETTING::.keys 20:55
camelia (&infix:«(>+)» $¢ &await $=pod CORE-SETTING-REV &infix:<≽> $/ &infix:<≼> &infix:«(<+)» $! $_)
timotimo ah, you will want CORE, SETTING will give you the innermost setting, which will have d "stacked" inside of c 20:56
Skarsnik m: say () ~~ CORE::List
camelia True
21:04 approaching236 left 21:05 Geth joined, approaching236 joined 21:13 MasterDuke joined 21:38 ex_nihilo joined 21:46 ex_nihilo left 22:08 mowcat joined
Xliff How can I look at the symbol table of a loaded module that does not have the "unit package" declarator in it? 22:23
22:32 donaldh left, donaldh joined 22:33 ex_nihilo joined 22:37 donaldh left
Skarsnik is should have a Module keyword somewhere still? 22:51
22:56 DetroitDan joined
DetroitDan I need help getting Raku going on Windows. I used Perl6 for many years 22:57
oops. Have to run. Will try again later. 22:58
23:08 donaldh joined 23:15 donaldh left 23:29 DetroitDan left 23:41 pecastro left 23:55 ex_nihilo left