🦋 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:32 Voldenet left 00:37 Voldenet joined, Voldenet left, Voldenet joined 01:37 squashable6 left, greppable6 left, notable6 left, bisectable6 left, unicodable6 left, releasable6 left, bloatable6 left, reportable6 left, nativecallable6 left, committable6 left, statisfiable6 left, quotable6 left, sourceable6 left, shareable6 left, benchable6 left, coverable6 left 01:38 shareable6 joined, greppable6 joined, benchable6 joined, quotable6 joined, committable6 joined, unicodable6 joined, reportable6 joined 01:39 nativecallable6 joined, releasable6 joined, bloatable6 joined 01:40 sourceable6 joined, coverable6 joined, squashable6 joined, bisectable6 joined, notable6 joined, statisfiable6 joined 01:47 kalkin-- joined 01:51 kalkin- left 01:53 Tirifto left 01:55 Doc_Holliwood left 02:31 wildtrees left 03:15 socomm joined
socomm going through on of the raku books trying to figure out how to use say and concat a string. 03:16
So something like "say 'x' x 60 . 'word';" 03:17
guess concat is now tilda instead of dot :/ 03:20
03:20 socomm left 04:20 quotable6 left, committable6 left, coverable6 left, shareable6 left, reportable6 left, sourceable6 left, nativecallable6 left, greppable6 left, bloatable6 left, benchable6 left, releasable6 left, notable6 left, bisectable6 left, unicodable6 left, squashable6 left, statisfiable6 left, benchable6 joined, releasable6 joined, quotable6 joined 04:21 squashable6 joined, greppable6 joined, statisfiable6 joined, bloatable6 joined, bisectable6 joined 04:22 notable6 joined, committable6 joined, sourceable6 joined, shareable6 joined, unicodable6 joined 04:23 nativecallable6 joined, reportable6 joined, coverable6 joined
cpan-raku New module released to CPAN! CSS (0.0.3) by 03WARRINGD 04:32
04:55 mahmudov left 05:04 RobRaku joined 06:04 releasable6 left, bisectable6 left, benchable6 left, reportable6 left, unicodable6 left, quotable6 left, statisfiable6 left, bloatable6 left, nativecallable6 left, coverable6 left, notable6 left, shareable6 left, sourceable6 left, squashable6 left, greppable6 left, committable6 left 06:05 coverable6 joined, quotable6 joined, squashable6 joined, committable6 joined, unicodable6 joined, sourceable6 joined, greppable6 joined, shareable6 joined 06:06 bisectable6 joined, nativecallable6 joined, statisfiable6 joined, benchable6 joined 06:07 notable6 joined, releasable6 joined, bloatable6 joined, reportable6 joined 06:27 sauvin joined 07:18 AlexDaniel joined 07:19 AlexDaniel left, AlexDaniel joined 07:52 jmerelo joined 07:56 RobRaku left 08:04 sena_kun joined 08:15 gabiruh_ joined 08:18 gabiruh left 08:19 rindolf joined 08:24 sena_kun left 08:28 Doc_Holliwood joined 08:45 wamba joined 08:57 veesh left 09:18 veesh joined 09:37 Xliff left
Poohman m: Date.^attributes.map(*.type) 09:47
camelia ( no output )
Poohman m: say Date.^attributes.map(*.type)
camelia ((Int) (Int) (Int) (Int) (Callable))
Poohman Hello all - what is the type of the List shown above? 09:48
do we have a type for types - I just what to send the type as a parameter 09:49
09:52 wamba left
jmerelo Poohman: say again? The type will be actually a meta-type, depending on how it's built 10:23
Poohman: types can be smart-matched, for instance 10:24
m: say Date.^mro 10:25
camelia ((Date) (Any) (Mu))
jmerelo m: my $a-class = Date; say $a-class.^mro
camelia ((Date) (Any) (Mu))
jmerelo m: my $a-class = Date; say $a-class.^mro[0]
camelia (Date)
jmerelo m: my $a-class = Date; say $a-class.^mro[0] ~~ Date
camelia True
jmerelo m: my $a-class = Date; say $a-class.^mro.first ~~ Date 10:26
camelia True
jmerelo Poohman: is that what you're looking for?
Poohman m: my $as = Int; $bs = 10; say ($bs ~~ $as) 10:27
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$bs' is not declared. Did you mean '$as'?
at <tmp>:1
------> 3my $as = Int; 7⏏5$bs = 10; say ($bs ~~ $as)
Poohman m: my $as = Int; my $bs = 10; say ($bs ~~ $as)
camelia True
Poohman m: my $as = Int; my $bs = 10; say $as.^mro 10:28
camelia ((Int) (Cool) (Any) (Mu))
Poohman jmerelo: What types are these now (Int) (Cool) etc? 10:30
are they Str?
What if I want to send only default types as a parameter for a function? I mean, the parameter will be Str or Int or Numeric 10:31
do we have a enum of some sort for types? 10:32
m: my $as = Int; my $bs = 10.111; say $bs.$as; 10:34
camelia 10
Poohman m: my $as = Int; my $bs = 10.111; say $bs.$as; say $as.^mro 10:35
camelia 10
((Int) (Cool) (Any) (Mu))
10:37 RobRaku joined
Poohman m: my $as = Int; my $bs = 10.111; say $bs.$as; say $as.WHAT 10:38
camelia 10
Poohman m: say 10.WHAT
camelia (Int)
Poohman jmerelo: Is (Int) a meta-type?? 10:48
10:50 chloekek joined
lizmat Poohman: in Raku, it's a type like any other type 10:50
10:50 mahmudov joined
lizmat m: class A { }; my $a = A; say $a.WHAT 10:50
camelia (A)
lizmat it just happens to be made very early in the bootstrap process
Poohman ok thanks 10:55
11:12 kalkin-- left 11:13 stoned75 joined, chloekek left 11:29 RobRaku left
nine Poohman: I think you mean Any:U 11:30
m: sub foo(Any:U $type) { }; foo(Int); foo(2);
camelia Parameter '$type' of routine 'foo' must be a type object of type 'Any', not an object instance of type 'Int'. Did you forget a 'multi'?
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
nine m: sub foo(Any:U $type) { }; foo(Int);
camelia ( no output )
nine Poohman: if you want to restrict the allowed types, you may want to use multi candidates for that 11:31
m: multi foo(Int:U) { return 2; }; multi foo(Str:U) { return "2"; }; dd foo(Str)
camelia "2"
nine m: multi foo(Int:U) { return 2; }; multi foo(Str:U) { return "2"; }; dd foo(Rat) 11:32
camelia 5===SORRY!5=== Error while compiling <tmp>
Calling foo(Rat) will never work with any of these multi signatures:
at <tmp>:1
------> 3}; multi foo(Str:U) { return "2"; }; dd 7⏏5foo(Rat)
11:32 BlackChaosNL[m] left, unclechu left, uzl[m] left, matiaslina left, EuAndreh[m] left, Demos[m] left, CIAvash left, AlexDaniel` left, rba[m] left 11:33 Nasrudin left 11:35 chloekek joined 11:36 holyghost left 11:38 kalkin-- joined
Poohman nine: Im trying to avoid mutliple implementations as the only change is the type which Iwant to give as a parameter 11:40
I want to write one method with parameter being an array of all the types of data members in my class 11:42
the function will not only get the user data but make sure it is of the correct type
chloekek p6: .say for 1, 2, IterationEnd, 3; 12:10
camelia 1
12:11 sena_kun joined
lizmat chloekek: that's a case of DIHWIDT 12:12
chloekek It could be useful!
lizmat yeah, but it's fragile, as in using an implementation detail 12:13
12:14 RobRaku joined
chloekek I wish :D and :U were shortcuts for ::?CLASS:D and ::?CLASS:U 12:15
12:20 Doc_Holliwood left 12:21 wamba joined
lizmat m: sub a(:D $a) { } # I guess they could be since it is currently a parse error 12:21
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3sub a(:7⏏5D $a) { } # I guess they could be sinc
chloekek m: class C { method bla(:U: --> :D) { self.new } } 12:27
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3class C { method bla(:7⏏5U: --> :D) { self.new } }
12:29 BlackChaosNL[m] joined, unclechu joined, AlexDaniel` joined, rba[m] joined, EuAndreh[m] joined, Demos[m] joined, matiaslina joined, Nasrudin joined, uzl[m] joined, CIAvash joined 12:37 rindolf left, chloekek left 12:42 benjif left 12:44 benjif joined 12:47 rindolf joined 12:50 mahmudov left, chloekek joined 12:59 stoned75 left 13:03 mahmudov joined
nine Poohman: the multi candidates can each just call the actual (private) implementation 13:04
13:06 jmerelo left 13:07 Doc_Holliwood joined 13:09 kalkin-- left 13:31 mahmudov left 13:35 chloekek left 13:50 sena_kun left, chloekek joined 13:51 sena_kun joined 13:57 veesh_ joined 13:58 veesh left 13:59 veesh_ is now known as veesh 14:09 mahmudov joined 14:13 markldevine joined, sena_kun left
markldevine At the office, I need to find a way to `zef` without internet connectivity (intranet only). Is there info on mirroring rakumods locally? Point me in the right direction if you can. 14:15
14:17 vividsnow left
markldevine [zef locally question]: Maybe pick an internet-connected server, for everything in `zef list`, upgrade any existing & install any not installed yet, then copy ~/.zef/store/* around? 14:19
14:23 RobRaku left 14:28 RobRaku joined 14:30 sena_kun joined, chloekek left 14:31 stoned75 joined 14:39 vividsnow joined 15:09 Doc_Holliwood left 15:14 cpan-raku left 15:15 cpan-raku joined, cpan-raku left, cpan-raku joined 15:21 Doc_Holliwood joined 15:25 wamba left 15:31 RobRaku left 15:33 RobRaku joined 16:14 sena_kun left 16:18 marinin[t] joined 16:30 sena_kun joined, RobRaku left 17:12 Doc_Holliwood left
Geth_ doc: 2b52179364 | (Stoned Elipot)++ | doc/Language/containers.pod6
xref to type captures
17:41 wildtrees joined 17:45 vividsnow left 17:52 jmerelo joined 17:58 RobRaku joined 17:59 vividsnow joined 18:00 jmerelo left 18:12 wamba joined 18:15 sena_kun left 18:21 wamba left 18:23 frithnanth joined 18:28 sena_kun joined 19:05 Tirifto joined
Tirifto Hello all! Is there a common file extension for Pod6? 19:06
(.pod6, I guess?)
moritz you guessed correctly :D 19:07
Tirifto Neat! :D 19:18
El_Che markldevine: can you use a proxy? 19:25
markldevine El_Che The customer has a gateway solution for virtually every internet-based update requirement. No HTTP proxies. 19:27
19:28 sauvin left
markldevine El_Che I'll ask if they can go with a proxy. More elegant. 19:28
moritz markldevine: I think the rakudo star installer does some magic to use zef locally to install the modules; maybe take a look at that? 19:29
markldevine El_Che Okay, I'll scan there. Thanks for the lead. 19:30
El_Che a quick and dirsty socks proxy through ssh may be an easy option
ssh -D 8080 jumhost
markldevine El_Che Govt institution... Nothing is ever quick.
19:31 RobRaku left
El_Che :) 19:43
19:51 Poohman left
[Coke] . 20:06
20:14 sena_kun left
frithnanth moritz shouldn't that be .rakudoc, as stated here: github.com/perl6/problem-solving/b...extensions 20:18
20:26 RobRaku joined 20:28 sena_kun joined
moritz frithnanth: it looks like I'm no longer on top of things 20:48
20:55 rindolf left 21:00 chloekek joined
Tirifto frithnanth: Noted! 21:02
21:02 cpan-raku left 21:04 cpan-raku joined, cpan-raku left, cpan-raku joined 21:11 markldevine left
cpan-raku New module released to CPAN! Gnome::Gtk3 (0.21.1) by 03MARTIMM 21:16
21:26 frithnanth left, dakkar joined
dakkar hello again, I'm back with weird questions 😜 21:26
feeding a 18k email message to that code, I get suprising timings 21:27
dakkar adds times to the gist
doing the whole grammar parsing takes 0.02 seconds, while `~~ /@separators/` takes 1.2 seconds 21:28
lizmat dakkar: are those separators not essentially "\n\n" ? 21:30
with Raku's automatic line-ending logic ?
dakkar not really, I'm parsing email messages, so I have to handle all four forms 21:31
lizmat but that would be my point: in Raku "\n\n" should be handle all of those
dakkar and in the actual program I'm reading from a Socket (via its .Supply), and Supply::lines seems weird to me 21:32
in particular, I can't redefine its :in-nl
lizmat I see...hhmmm 21:33
dakkar (should I raise a bug somewhere about making Supply::lines behave more closely to IO::lines ?)
lizmat yes, that seems appropriate 21:34
dakkar where would be the best place? toast, rakudo, somewhere else? 21:36
lizmat rakudo, I'd say
dakkar submits
lizmat dakkar++ 21:40
dakkar github.com/rakudo/rakudo/issues/3384 21:43
cpan-raku New module released to CPAN! Gnome::Gtk3 ( by 03MARTIMM 21:46
dakkar has fixed his git web view 21:51
so, the original code for that weird timing: www.thenautilus.net/cgit/MaildirIn...=bayes#n84
the program gets an email on a socket, and needs to parse the headers 21:52
(it doesn't care about the body)
a few lines above, there's the method that parses from file, and there I use `.lines(:nl-in(@separators))`, and it indeed works fast and correctly 21:53
the weirdness of a "simple" match being sometimes much slower than a full grammar parse, remains 21:54
lizmat have you tried not using the array, but just putting the delimiters into the token? 21:55
could be the interpolation that's really the issue
dakkar tries 21:56
oh, you're right 21:57
more weird: `/<Message::separator>/` is still slow 21:58
21:58 Xliff joined
dakkar is still confused 21:59
lizmat grammars are still in the stage "make them work" rather than "make them work fast" :( 22:00
dakkar the weirdness is that the full grammar is much faster than the /@thing/ 22:01
even if I pre-build the regex object (`my $regex = /@separators/` or `my $regex = /<Message::separator>/`) 22:02
bah 22:03
lizmat I'm pretty sure moritz or jnthn would have an idea why
dakkar what's the easiest way to bring this to their attention (bar just happening to be online at the same time)? 22:05
(do we need a manpage for all the bots here?) 22:06
Xliff dakkar: Use .tell 22:07
dakkar .tell moritz you may be interested in a case of strange slowness in regex matching: colabti.org/irclogger/irclogger_lo...12-27#l326 22:08
tellable6 dakkar, I'll pass your message to moritz
dakkar Xliff: thank you!
Xliff dakkar: np! :) 22:09
dakkar (the bot manpage exists: raku.org/community/irc, should it be in the topic?) 22:11
xkr47 just tried "zef install SDL2" and during installation, I got failure messages from testing like: 22:12
===> Installing: SDL2::Raw:ver<0.3> 22:13
===> Installing: SDL2:ver<0.0.1>:auth<github:azawawi>
===> Install [FAIL] for SDL2:ver<0.0.1>:auth<github:azawawi>: ===SORRY!===
Could not find SDL2::Raw:ver<0.2> at line 7 in:
ah, it installed (depended?) on ver 0.3 but verification tried to load ver 0.2 of SDL2::Raw?
lizmat looks like a META6.json issue in the distribution 22:14
it's installing SDL2::Raw 0.3, and then SDL2 wants SDL2::Raw .2 ?
22:14 sena_kun left
xkr47 sounds like that yeah 22:14
what can I do ? 22:15
22:15 wamba joined
xkr47 here.. modules.raku.org/dist/SDL2:cpan:AZ...nderer.pm6 22:16
lizmat I guess someone will need to make a PR to have azawawi fix it :-) 22:17
xkr47 so metafile depends on just "SDL2::Raw" (i.e. does not specify a version?) but the renderer depends on explict version 0.2?
lizmat yes, that's what the code says
you could try removing ':ver(0.2)' 22:18
xkr47 so either it does not work with 0.3 or the 0.2 explicit version requirement was forgotten there by accident..
lizmat yes, that is what it looks like to me
xkr47 how do I install it from a local checkout?
Xliff zef install . 22:19
lizmat zef install .
Xliff heh
lizmat Xliff++ :-)
Xliff lizmat++ :)
xkr47 Xliff++ 22:20
22:20 dakkar left
xkr47 ah, fixed already in repo but no release... github.com/azawawi/perl6-sdl2 22:22
lizmat suggests making an issue to have azawawi make a release :-)
xkr47 someone did :D 22:24
or well they just reported the error two days ago
and the fix is 4 months old
buut hmm zef install completed without error but my program still can't find SDL2, hmm
`zef install .` I mean
===> Testing: SDL2:ver<0.0.2>:auth<github:azawawi>
===> Testing [OK] for SDL2:ver<0.0.2>:auth<github:azawawi> 22:25
===> Installing: SDL2:ver<0.0.2>:auth<github:azawawi>
aha, because SDL2:ver<0.0.1> is apparently.. also installed 22:26
lizmat yeah, installing a newer version of a distribution does *not* remove older ones 22:27
xkr47 ok removed, still complains
zef list --installed|grep SDL2 22:28
===> Found via /home/xkr47/s/rakudo/share/perl6
===> Found via /home/xkr47/s/rakudo/share/perl6/site
perl6 /tmp/foo.p6
Could not find SDL2 at line 4 in:
< same list as pasted earlier >
22:29 ToddAndMargo joined
ToddAndMargo anyone on newbie duty today? 22:30
tellable6 2019-11-23T10:12:22Z #raku <AlexDaniel> ToddAndMargo: .rotor(3) ?
22:30 sena_kun joined
ToddAndMargo Question on native call. When a C++ call to Kernel32.dll wants a reserved word of NULL, how do I define it on the native line? And is a null a 32 bit word full of zeros? 22:32
Cannot unbox a type object (int32) to int 22:37
22:39 RobRaku left
ToddAndMargo Cannot unbox a type object (int) to int. 22:45
Xliff ToddAndMargo: What type are you trying to pass? 22:48
Can you paste the native call def you are using?
Generally you pass the type object of that parameter to represent NULL. 22:49
sub a (Str $a) is native { * }; a(Str) # ...for example 22:50
sub a (uint32 $a is rw) is native { * }; a(uint32) # ...another example
ToddAndMargo constant WCHAR := uint16; constant DWORD := int32; constant CPOINTER := int32; sub RegQueryValueExW( DWORD, WCHARS, DWORD, CPOINTER, DWORD is rw, DWORD is rw ) is native("Kernel32.dll") returns DWORD { * }; $RtnCode = RegQueryValueExW( $Handle, $lpValueName, 0, REG_DWORD, $lpData, $lpcbData ); 22:54
can't figure out how to do pretty lines. Would vpaste work better?
if I use 1 for CPOINTER, I get error 87 ( ERROR_INVALID_PARAMETER). If I use 0, the program just terminates with no error message. If I use int32 for the sub and anything in the call, I get the unbox errors 22:59
Xliff ToddAndMargo: OK, so is CPOINTER a pointer? 23:04
Doesn't look like it from your def
ToddAndMargo: docs.microsoft.com/en-us/windows/w...ryvalueexw 23:06
LPDWORD is basically DWORD*
So try this: "sub RegQueryValueExW( DWORD, WCHARS, DWORD, CPOINTER is rw, DWORD is rw, DWORD is rw)" and then pass CPOINTER (which is int32) 23:07
ToddAndMargo Well, I clearly don't know what I am doing. The parameter is called a reserved NULL. I asked the C++ guys and they said that a NULL is a pointer to 0. This is the function I am calling: docs.microsoft.com/en-us/windows/w...ryvalueexw and for reserved, "This parameter is reserved and must be zero." 23:09
changing it to DWORD and 0, the program just exits on me 23:10
would a vpaste of the whole thing help? 23:11
Xliff Sure
23:13 wamba left
ToddAndMargo firefox is giving me a bad time 23:15
vpaste.net/z14VG 23:16
lines 130 and 132 are the offenders 23:17
xkr47 ToddAndMargo, correct me if I'm wrong but doesn't LPDWORD mean actually a pointer to a DWORD and not a DWORD 23:20
Xliff xkr47: Yes. It does. 23:21
ToddAndMargo How do I define LPDWORD for use in my run line? 23:22
xkr47 anyway I coded windows apis like 22 years ago so I'm not up to speed :D
but my guess would be lpReserved is fine, and the other parameters are incorrect or something 23:23
sorry this is just a hunch
ToddAndMargo Do I at least have the syntax for $lpData, $lpcbData correct? 23:29
xkr47 that I don't know :) 23:34
but maybe those are the prime suspects :) 23:35
23:40 vividsnow left
Xliff Gimme a sec and I will look over it. 23:40
ToddAndMargo I just foundh that I had $lpSubKey and $lpValueName backwards. now I am getting error 6 "The handle is invalid". I am using the $Handle from the return of the RegOpenKeyExW 23:46
Xliff vpaste.net/FAoFE 23:48
ToddAndMargo Dang! K:\Windows\NtUtil>perl6 -I. -e "use WinMount :GetLUA; say GetLUA();"RegOpenKeyExWRegOpenKeyExW RtnCode 2RegQueryValueExW1Native call expected argument that references a native integer, but got P6int in method CALL-ME at C:\rakudo\share\perl6\sources\947BDAB9F96E0E5FCCB383124F923A6BF6F8D76B (NativeCall) line 587 in sub GetLUA at 23:51
K:\Windows\NtUtil\WinMount.pm6 (WinMount) line 150 in block <unit> at -e line 1
what is a P6int error? 23:52
Xliff Crap. 23:53
OK. So using "is rw" didn't work as expected. The next thing to try is a CArray; 23:54
Honestly, that SHOULD work and should probably be bugged as an LTA.
ToddAndMargo What is an LTA? 23:56
Xliff Less Than Awesome
"uint32 is rw" should allow you to pass in the uint32 type object to represent NULL 23:57
m: use NativeCall; say CArray[uint32].new(1).gist.say
camelia NativeCall::Types::CArray[uint32].new
Xliff m: use NativeCall; say CArray[uint32].new(1).gist
camelia NativeCall::Types::CArray[uint32].new
Xliff m: use NativeCall; my $a = CArray[uint32].new(1); $a[0].say
camelia 1
ToddAndMargo taking out the rw on the reserved ford give "Cannot unbox a type object (int32) to int."
Xliff m: use NativeCall; my $a = CArray[uint32].new(12345); $a[0].say
camelia 12345
Xliff ToddAndMargo: One sec.... 23:58
ToddAndMargo is okay. I am confused anyway on the CArray thing
Xliff Well... Arrays are basically pointers. 23:59
By using a CArray I am saying I want an integer pointer.
You will only set the first value, though.
It's non-intuitive, but it works.