»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
00:13 lizmat left, graphene left 00:14 lizmat joined, [Sno] joined 00:15 p6bannerbot sets mode: +v lizmat, p6bannerbot sets mode: +v [Sno] 00:26 mcmillhj joined, Kaiepi left, p6bannerbot sets mode: +v mcmillhj 00:27 Kaiepi joined 00:28 p6bannerbot sets mode: +v Kaiepi 00:37 aborazmeh joined, aborazmeh left, aborazmeh joined, p6bannerbot sets mode: +v aborazmeh 00:38 p6bannerbot sets mode: +v aborazmeh 00:40 ToddAndMargo joined, p6bannerbot sets mode: +v ToddAndMargo
ToddAndMargo Hi All, I am confused over "defined". `$ p6 'my Real $x; if $x.defined {say "Defined"}else{say "Undefined"};'` Undefined Didn't I just define it with `my Real`? 00:41
timotimo it's holding an undefined value, which is what was sometimes called "null" or "a nil" on the mailing list 00:42
m: my Real $x; dd $x 00:43
camelia Real $x = Real
timotimo m: my Real $x; say $x
camelia (Real)
timotimo m: my Real $x; print $x
camelia Use of uninitialized value of type Real 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
timotimo there you can see "uninitialized value"
i'm going to bed right now, but i hope that helped a little already
maybe the important bit is that .defined works on values, not on variables 00:44
in fact, you can't even "talk" about a variable that wasn't declared with a "my" or something similar
m: say $doesnotexist.defined
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$doesnotexist' is not declared
at <tmp>:1
------> 3say 7⏏5$doesnotexist.defined
timotimo it's already a syntax error
on top of that, you can ask literal values if they are defined
m: say 1.defined; say "".defined; say Str.defined; say Nil.defined 00:45
camelia True
True
False
False
timotimo good night!
ToddAndMargo Oh man!
Thank you
00:51 ToddAndMargo left 01:13 chenyf_ left, atweiden-air_ joined 01:16 atweiden-air_ left 01:18 mcmillhj left 01:21 molaf left 01:29 epony left 01:31 chenyf_ joined 01:32 p6bannerbot sets mode: +v chenyf_ 01:34 molaf joined 01:35 p6bannerbot sets mode: +v molaf 01:40 mcmillhj joined, p6bannerbot sets mode: +v mcmillhj 01:43 rocket_fly joined, p6bannerbot sets mode: +v rocket_fly
rocket_fly Hello 01:43
Perl6 does not support 'use warnings'... does anyone know why?
01:44 ZzZombo left, mcmillhj left
MasterDuke rocket_fly: it's on by default. docs.perl6.org/language/5to6-nutshell#warnings 01:47
rocket_fly O, thanks. I got it 01:49
if $name (elem) @names : this syntax seems really cool! Anyone know its academic name? 01:51
01:59 mcmillhj joined 02:00 p6bannerbot sets mode: +v mcmillhj 02:03 mcmillhj left 02:05 rocket_fly left 02:08 mahafyi left, kurahaupo left 02:09 kurahaupo joined, p6bannerbot sets mode: +v kurahaupo 02:24 mcmillhj joined, p6bannerbot sets mode: +v mcmillhj 02:28 mcmillhj left 02:30 hamhu3_ left 02:31 hamhu3 joined 02:32 p6bannerbot sets mode: +v hamhu3 02:33 ZzZombo joined, p6bannerbot sets mode: +v ZzZombo, atweiden-air joined 02:34 p6bannerbot sets mode: +v atweiden-air 02:40 mcmillhj joined 02:41 p6bannerbot sets mode: +v mcmillhj, vrurg left
lucs To declare a type synonym, for example to have a Name be like a Str, I can do 「subset Name of Str;」 02:42
Is that the idiomatic way? 02:43
02:45 mcmillhj left
[Coke] m: subset Name of Str; my Name $a = "Guillermo"; say $a; say $a.^name; 02:46
camelia Guillermo
Str
[Coke] Aye.
m: subset Name of Str; my Name $a = "Guillermo"; say $a; say $a.^name; say $a.VAR.of; 02:47
camelia Guillermo
Str
(Name)
Geth doc: 79ab0d7929 | Coke++ | doc/Language/101-basics.pod6
whitespace
synopsebot Link: doc.perl6.org/language/101-basics
03:08 mcmillhj joined 03:09 p6bannerbot sets mode: +v mcmillhj
labster m: say Real.new() 03:13
camelia MoarVM panic: Memory allocation failed; could not allocate 122576 bytes
03:13 mcmillhj left
labster I've also seen SIGSEGV and SIGBUS 03:13
m: say Real.new() 03:14
camelia (signal SEGV)
03:15 defterade20 joined, |oLa| joined, defterade20 left 03:16 p6bannerbot sets mode: +v |oLa| 03:21 mcmillhj joined, p6bannerbot sets mode: +v mcmillhj 03:23 |oLa| left 03:25 mcmillhj left
labster rakudobug filed ^ 03:28
03:28 aborazmeh left 03:31 notdaniel25 joined 03:33 molaf left 03:35 notdaniel25 left 03:37 alexcf9 joined
labster Man, this is fun, I haven't found a segfault in MoarVM in like 5 years! 03:39
03:42 alexcf9 left 03:48 mcmillhj joined 03:49 p6bannerbot sets mode: +v mcmillhj 03:53 mcmillhj left 04:02 mcmillhj joined 04:03 p6bannerbot sets mode: +v mcmillhj, hamhu3_ joined 04:04 p6bannerbot sets mode: +v hamhu3_ 04:06 mcmillhj left, hamhu3 left 04:08 hamhu3_ left, hamhu3 joined 04:09 p6bannerbot sets mode: +v hamhu3 04:27 atweiden-air left 04:36 rindolf joined 04:37 p6bannerbot sets mode: +v rindolf 04:38 mcmillhj joined 04:39 p6bannerbot sets mode: +v mcmillhj 04:43 mcmillhj left 04:47 hamhu3 left 04:49 kerframil left 04:53 jmerelo joined, p6bannerbot sets mode: +v jmerelo 04:58 robertle left 05:05 mcmillhj joined 05:06 p6bannerbot sets mode: +v mcmillhj, ufobat joined 05:07 p6bannerbot sets mode: +v ufobat 05:10 mcmillhj left 05:11 hamhu3 joined, hamhu3 left 05:19 mcmillhj joined
Geth doc: 70a123af53 | (JJ Merelo)++ | 3 files
Improving presence of escape characters in the documentation

Suggestion for a new section has not been considered, since escape characters are standard and they behave in the standard way. However, some indexing and a list of all escape characters has been added. This closes #2313.
05:19
05:20 p6bannerbot sets mode: +v mcmillhj 05:23 mcmillhj left 05:29 psychoslave joined, p6bannerbot sets mode: +v psychoslave 05:36 noganex joined, psychoslave left 05:37 p6bannerbot sets mode: +v noganex 05:38 psychoslave_ joined 05:39 p6bannerbot sets mode: +v psychoslave_ 05:45 AlexDaniel left 05:47 mcmillhj joined 05:48 p6bannerbot sets mode: +v mcmillhj 05:50 psychoslave_ left 05:52 mcmillhj left 06:00 zakharyas joined 06:01 p6bannerbot sets mode: +v zakharyas 06:09 hamhu3 joined, p6bannerbot sets mode: +v hamhu3 06:10 TisonKun joined, p6bannerbot sets mode: +v TisonKun 06:23 psychoslave joined 06:24 p6bannerbot sets mode: +v psychoslave
Geth doc: 0888dcc54f | (JJ Merelo)++ | doc/Language/objects.pod6
Re-indexing of new as new (method)

I couldn't think of a better way to address #2309. Generated pages don't have an intro, and adding one by hacking the generator would be a slippery slope. Order can probably be changed, but once again, this is not going to satisfy everyone; if it's hacked, same problem as above. If we want to define an order for generated routine pages, this ... (11 more lines)
06:24
synopsebot Link: doc.perl6.org/language/objects
06:27 sulvone5 joined 06:32 sulvone5 left 06:33 sena_kun joined 06:34 p6bannerbot sets mode: +v sena_kun 06:38 sena_kun left, sena_kun joined 06:39 p6bannerbot sets mode: +v sena_kun, mcmillhj joined 06:40 p6bannerbot sets mode: +v mcmillhj, jmerelo left 06:44 mcmillhj left, Guest7570 joined 06:49 Guest7570 left 06:55 abraxxa joined 06:56 p6bannerbot sets mode: +v abraxxa, robertle joined 06:57 abraxxa left, p6bannerbot sets mode: +v robertle 06:58 abraxxa joined 06:59 p6bannerbot sets mode: +v abraxxa, epony joined, p6bannerbot sets mode: +v epony 07:10 mcmillhj joined, zakharyas left 07:11 p6bannerbot sets mode: +v mcmillhj 07:15 mcmillhj left 07:20 z32324 joined 07:25 z32324 left 07:37 AlexDaniel joined, p6bannerbot sets mode: +v AlexDaniel, iLogic0 joined 07:42 iLogic0 left 07:45 mcmillhj joined, p6bannerbot sets mode: +v mcmillhj 07:46 avar left, avar joined, avar left, avar joined, p6bannerbot sets mode: +v avar 07:47 p6bannerbot sets mode: +v avar 07:49 mcmillhj left 07:52 goksie joined, p6bannerbot sets mode: +v goksie
lizmat weekly: domm.plix.at/perl/2018_09_ctrl_alt_del_yef.html 07:55
notable6 lizmat, Noted!
08:00 mcmillhj joined 08:01 p6bannerbot sets mode: +v mcmillhj 08:04 goksie left, mcmillhj left 08:06 dakkar joined 08:07 p6bannerbot sets mode: +v dakkar 08:17 B_RAD5 joined 08:18 B_RAD5 was kicked by timotimo (B_RAD5))
rindolf lizmat: hi 08:22
lizmat: sup?
lizmat almost awake
rindolf lizmat: ah 08:23
08:25 Ven` joined 08:26 p6bannerbot sets mode: +v Ven` 08:30 furrymcgee26 joined 08:31 furrymcgee26 left 08:32 mcmillhj joined, p6bannerbot sets mode: +v mcmillhj 08:33 kurahaupo left, kurahaupo joined 08:34 p6bannerbot sets mode: +v kurahaupo 08:35 zakharyas joined 08:36 p6bannerbot sets mode: +v zakharyas, mcmillhj left 08:44 scimon joined, p6bannerbot sets mode: +v scimon 09:03 mcmillhj joined 09:04 p6bannerbot sets mode: +v mcmillhj 09:05 zakharyas left 09:08 mcmillhj left 09:23 mcmillhj joined 09:24 p6bannerbot sets mode: +v mcmillhj 09:27 mcmillhj left 09:30 Shadowcrit4 joined 09:33 Shadowcrit4 left 09:37 sarna joined, p6bannerbot sets mode: +v sarna
sarna hey, how can I split an array into smaller ones? ie <1 2 3 4 5 6>foo(3) -> [[1,2,3],[4,5,6]] 09:38
forgot a period :(
found it! it's called batch :^) 09:40
TisonKun sure, it is a wrapper of rotor 09:46
m: <1 2 3 4 5 6>.rotor: 3
camelia ( no output )
TisonKun m: say <1 2 3 4 5 6>.rotor: 3
camelia ((1 2 3) (4 5 6))
TisonKun blogs.perl.org/users/zoffix_znet/20...ation.html 09:47
but I wonder if there is a partition such as LIST.partition(COND) like <1 2 3>.partition: * > 1 # => ((2, 3), (1,))
sarna thanks TisonKun 09:52
09:53 mcmillhj joined, p6bannerbot sets mode: +v mcmillhj
buggable New CPAN upload: Array-Agnostic-0.0.3.tar.gz by ELIZABETH modules.perl6.org/dist/Array::Agnos...:ELIZABETH 09:54
09:57 mcmillhj left
jnthn TisonKun: See categorize and classify 09:57
10:02 ggoebel left, domidumont joined 10:03 p6bannerbot sets mode: +v domidumont
ZzZombo TisonKun: try `classify` or the related method. 10:03
10:04 ZzZombo left
TisonKun say <1 2 3 4 5 6>.classify: * > 3 10:04
evalable6 {False => [1 2 3], True => [4 5 6]}
TisonKun powerful ^_^, thanks jnthn ZzZombo 10:05
10:09 lizmat left 10:11 mcmillhj joined, psychoslave left, hamhu3_ joined 10:12 p6bannerbot sets mode: +v mcmillhj, p6bannerbot sets mode: +v hamhu3_ 10:15 hamhu3 left 10:16 mcmillhj left 10:17 ggoebel joined 10:18 p6bannerbot sets mode: +v ggoebel
sarna is there something like .map but eager? 10:19
I know there's a good old for loop but
TisonKun ask for the value would eagerly do it, I think 10:20
10:21 lizmat joined
jnthn Just call .eager on the result of map 10:21
Though if it's in sink (void) context it'll be eagerly evaluated anyway
In fact, in that case it just discards the results, so it's better than eager, which would have to remember them
10:22 p6bannerbot sets mode: +v lizmat
sarna oh! 10:23
TisonKun forget our .eager XD 10:25
10:26 dogbert11 joined
sarna I love these p6 niceties 10:26
10:26 p6bannerbot sets mode: +v dogbert11
TisonKun agree. part of the passion and fun of play p6 is that when you get gradually familiar with it, things become awesome and works become elegant. 10:28
sarna :D 10:30
10:33 TisonKun left
sarna what if I want to split a list into x smaller lists? 10:36
10:36 mcmillhj joined
sarna is there an elegant solution to that? I doubt it, but it's p6 after all 10:37
lizmat sarna: batch by .elems / x ?
10:37 p6bannerbot sets mode: +v mcmillhj
sarna lizmat: I have "trailing" elements because it doesn't divide evenly 10:40
lizmat (.end / x ) + 1 10:41
10:41 mcmillhj left
sarna well yeah, but then the last group is like 2 elements, while the others are 5+ 10:42
lizmat well, that's not a programming issue, but a logic issue :-) 10:43
sarna :D fair enough
lizmat of mathematical I guess
buggable New CPAN upload: Array-Sparse-0.0.2.tar.gz by ELIZABETH modules.perl6.org/dist/Array::Spars...:ELIZABETH 10:44
10:48 daxim left, mcmillhj joined 10:49 p6bannerbot sets mode: +v mcmillhj 10:52 mcmillhj left 10:53 daxim joined, p6bannerbot sets mode: +v daxim 10:54 pyrimidi_ joined, p6bannerbot sets mode: +v pyrimidi_ 10:56 psychoslave joined, p6bannerbot sets mode: +v psychoslave 10:58 MasterDuke left 11:04 mcmillhj joined 11:05 p6bannerbot sets mode: +v mcmillhj
sarna m: say (0..1).pick; 11:05
camelia 1
sarna m: say 0..1.pick; 11:06
camelia 0..1
sarna why is the second one like this?
11:06 Ulrar23 joined
sena_kun precedence 11:07
second one is, in reality, 0..(1.pick), which is `0..1`.
sarna, docs.perl6.org/language/traps#Rang...precedence 11:08
11:09 mcmillhj left
sarna oh! thanks sena_kun 11:09
sena_kun np 11:10
lizmat m: say 0..1 .pick # another way to get around this precedence issue
camelia 0..1
lizmat huh?
guess not
m: say for 0..1 .pick 11:11
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…
lizmat m: .say for 0..1 .pick
camelia 0
1
11:11 Ulrar23 left
lizmat ok, forget about that :-) 11:11
11:18 mcmillhj joined, p6bannerbot sets mode: +v mcmillhj 11:21 albertferrico joined, p6bannerbot sets mode: +v albertferrico
albertferrico good afternoon everyone 11:21
11:22 mcmillhj left
sarna o/ 11:23
lizmat: haha, ok
11:23 ZzZombo joined, p6bannerbot sets mode: +v ZzZombo 11:27 sarna left 11:28 DeSigna18 joined, DeSigna18 left 11:36 araraloren joined 11:37 p6bannerbot sets mode: +v araraloren
araraloren o| 11:37
11:44 mcmillhj joined 11:45 p6bannerbot sets mode: +v mcmillhj 11:46 Zoffix joined, p6bannerbot sets mode: +v Zoffix, Zoffix left 11:49 mcmillhj left 11:50 albertferrico left
buggable New CPAN upload: Array-Agnostic-0.0.4.tar.gz by ELIZABETH modules.perl6.org/dist/Array::Agnos...:ELIZABETH 11:54
12:03 mcmillhj joined 12:04 Summertime left, p6bannerbot sets mode: +v mcmillhj 12:05 Summertime joined, p6bannerbot sets mode: +v Summertime 12:08 mcmillhj left 12:14 hamhu3_ left 12:15 hamhu3 joined 12:16 p6bannerbot sets mode: +v hamhu3 12:20 DarthGandalf joined, p6bannerbot sets mode: +v DarthGandalf, molaf joined 12:21 p6bannerbot sets mode: +v molaf 12:22 robertle left
buggable New CPAN upload: Array-Sparse-0.0.3.tar.gz by ELIZABETH modules.perl6.org/dist/Array::Spars...:ELIZABETH 12:24
12:33 pmurias joined, p6bannerbot sets mode: +v pmurias, sauvin is now known as Sauvin 12:35 TisonKun joined, p6bannerbot sets mode: +v TisonKun, mcmillhj joined 12:36 p6bannerbot sets mode: +v mcmillhj 12:40 mcmillhj left 12:41 AlexDaniel left 12:54 mcmillhj joined, p6bannerbot sets mode: +v mcmillhj 12:58 mcmillhj left 13:00 mcmillhj joined, p6bannerbot sets mode: +v mcmillhj 13:01 hamhu3 left 13:02 hamhu3 joined 13:03 p6bannerbot sets mode: +v hamhu3, hamhu3 left, hamhu3 joined
TisonKun it might be naughty 0..1 .pick different from 0..1.pick 13:04
13:04 p6bannerbot sets mode: +v hamhu3
TisonKun people always think whitespace is no significant :-) 13:04
timotimo there are multiple cases in perl6 where whitespace actually is significant 13:07
m: sub if($a) { say "this is if" }; if(1)
camelia this is if
timotimo m: sub if($a) { say "this is if" }; if (1)
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3sub if($a) { say "this is if" }; if (1)7⏏5<EOL>
expecting any of:
block or pointy block
13:11 molaf left 13:12 dogbert11 left, robertle joined 13:13 p6bannerbot sets mode: +v robertle 13:15 vrurg joined
sena_kun m: my regex escaped { '\"' }; say '"foo\"bar"' ~~ / '"' (<escaped> | <-["]>)+ '"' / 13:16
camelia 「"foo\"bar"」
0 => 「f」
0 => 「o」
0 => 「o」
0 => 「\"」
escaped => 「\"」
0 => 「b」
0 => 「a」
0 => 「r」
13:16 p6bannerbot sets mode: +v vrurg
sena_kun is there a better approach if I want to get a line in double quotes but with `\"` escaping? 13:16
m: my regex escaped { '\"' }; say '"foo\"bar"' ~~ / '"' [<escaped> | <-["]>]+ '"' / 13:18
camelia 「"foo\"bar"」
escaped => 「\"」
13:23 Sauvin left
TisonKun m: "foo\"bar".perl 13:25
camelia ( no output )
TisonKun m: say "foo\"bar".perl
camelia "foo\"bar"
13:25 TisonKun left, Sauvin joined, p6bannerbot sets mode: +v Sauvin, TisonKun joined, p6bannerbot sets mode: +v TisonKun
sena_kun oh, sorry, I meant "match it from raw text as a valid single line" instead of abstract "get" I've used. 13:26
TisonKun say '"foo\"bar"' ~~ / \".*\" / 13:29
evalable6 「"foo\"bar"」
13:30 Sauvin left 13:31 psychoslave left
sena_kun m: say '"foo"bar"' ~~ / \".*\" / 13:31
camelia 「"foo"bar"」
sena_kun no escaping. :S
13:32 APic joined
TisonKun is there a true negative example to make topic clearly? 13:32
13:33 mahafyi joined
TisonKun '"foo"bar"' ~~ REGEX should give "foo\"bar" ? 13:33
13:33 p6bannerbot sets mode: +v APic
sena_kun give me a second... 13:33
jnthn See JSON::Tiny
And how it matches strings with escapes
sena_kun oh!
jnthn And do something like that :)
13:33 p6bannerbot sets mode: +v mahafyi
sena_kun stops to abuse irc 13:33
TisonKun jnthn you know the background :) 13:34
sena_kun TisonKun, just ignore me next time. :)
araraloren It's fine, sometime we may don't understand the question 13:35
13:39 Sauvin joined, p6bannerbot sets mode: +v Sauvin 13:57 chenyf_ left
samcv i'm having an issue catching an exception 14:01
here it is throwing gist.github.com/samcv/0a76f1d5b2ef...e1-txt-L13 but the try block doesn't seem to allow the script to keep running 14:02
Roamer` samcv, are you sure that it's the .slurp that is throwing the exception and not the open itself? If it's open, then in the CATCH block $fh is not a file, but a Failure, and you can't really call $fh.close or even $fh.opened 14:09
samcv Roamer`: yeah i am 14:12
14:12 hamhu3_ joined
samcv i tried lives-ok instead now, and that seems to work 14:12
though i woud like to know what's going on that is making the try not work
14:12 p6bannerbot sets mode: +v hamhu3_
samcv Roamer`: this works gist.github.com/fdab5d5b1d0a11ccd5...fc529337de 14:13
14:13 Zoffix joined, p6bannerbot sets mode: +v Zoffix
Zoffix samcv: what's the exception that isn't being caught? 14:13
14:14 hamhu3 left
Zoffix Roamer`: `try` fatalizes Failures 14:15
(or more precisely: it enables `use fatal` pragma, but you can turn it off if you want)
samcv: you're missing the `default` branch in your CATCH
So the exeption keeps on trucking 14:16
samcv ah ok
14:16 chenyf_ joined
Zoffix samcv: also parse-names is deprecated. It's called uninames now 14:17
14:17 araraloren left, p6bannerbot sets mode: +v chenyf_, hamhu3_ left, araraloren joined 14:18 hamhu3 joined, p6bannerbot sets mode: +v araraloren, p6bannerbot sets mode: +v hamhu3 14:20 Zoffix left, kensanata joined 14:21 p6bannerbot sets mode: +v kensanata, chenyf_ left
kensanata I want to write code where the user can pick a storage backend using an environment variable. My idea: all the modules use a Storage module; this is an object which as a private attribute with value Storage::File handling get-page and put-page. What's the idiomatic way of doing this? I found design.perl6.org/S12.html#Delegation but that doesn't seem to work. 14:31
Where "doesn't work" means "perl6 -Ilib -c lib/Storage.pm6" gives me an error at the "handles" keyword. 14:32
[Coke] those design docs are not current. 14:36
docs.perl6.org/routine/handles is more likely to work. 14:37
kensanata Yeah, I saw the note at the top.
Yeah, this looks good. Will give it a try! 14:38
14:38 chenyf_ joined 14:39 p6bannerbot sets mode: +v chenyf_
robertle unlink() on IO::Path apparently only came in around 2014.10, does anyone know whether there was a good way to delete a file before that? 14:45
moritz robertle: unlink as a function, with a string argument? 14:51
[Coke] that's already before christmas. 14:52
robertle moritz: thanks, I did not know that existed! 14:59
15:01 Actualeyes joined 15:02 p6bannerbot sets mode: +v Actualeyes
kensanata Is there a way to specify a class using a string? Something to put around the environment variable in here: class A {method m(){say "m"}}; class C {has $.delegate handles <m> = %*ENV<STORAGE>.new()}; C.new.m; 15:03
Or a better way to do this, of course.
15:05 jmerelo joined
robertle kensanata: I ahve done stuff like "require ::($module-name)" 15:05
15:05 p6bannerbot sets mode: +v jmerelo
[Coke] m: my $a = "Int"; ::($a).new.^name.say 15:06
camelia Int
kensanata Thanks! 15:07
pmurias does it make sense to call the rakudo.js executable the npm package will install something other than perl6-js? 15:09
consistency and calling the perl6-js seems like the sanest option but know is the time to make the choice ;) 15:10
Geth doc: 1be2f24de8 | (Will "Coke" Coleda)++ | doc/Language/objects.pod6
whitespace
15:17
synopsebot Link: doc.perl6.org/language/objects
[Coke] lizmat: some docs test failures: A few things like "method STORE (::?CLASS:D: values, :$initialize)" where values isn't defined 15:19
$ xt/examples-compilation.t doc/Type/Positional.pod6 doc/Language/subscripts.pod6 doc/Type/Associative.pod6 # this shows the current errors
15:26 qiqi joined 15:27 p6bannerbot sets mode: +v qiqi 15:31 c_smith4 joined 15:32 diakopter sets mode: +b *!*c_smith@112.197.201.*, c_smith4 was kicked by diakopter (c_smith4)) 15:35 qiqi left, lizmat left 15:39 TisonKun left 15:50 Kaypie joined, Kaiepi left 15:51 p6bannerbot sets mode: +v Kaypie 15:56 abraxxa left 16:08 araraloren left, chenyf_ left 16:11 Ven` left 16:18 SHODAN joined, p6bannerbot sets mode: +v SHODAN 16:19 chenyf_ joined 16:20 p6bannerbot sets mode: +v chenyf_ 16:29 Welcome joined, scimon left 16:31 dakkar left
tyil what would be a nice solution to change a single character in a string at a given position? 16:32
16:34 Welcome left
tobs tyil: there's substr-rw (but I don't think it looks too nice) 16:38
m: ($_ = "tyil").substr-rw(1,1) = pick 1, 'a'..'z' and .say
camelia tuil
16:40 kurahaupo left 16:41 kurahaupo joined, p6bannerbot sets mode: +v kurahaupo 16:42 robertle left
tyil not bad at all 16:46
my solution was heading into an s/// regex 16:47
16:52 Zoffix joined, p6bannerbot sets mode: +v Zoffix
Zoffix .tell [Coke] FYI the "grant ideas" is 404 link on this page: news.perlfoundation.org/2018/09/cal...pte-2.html might be this page is what it's meant to be: www.perlfoundation.org/grant-ideas.html 16:53
yoleaux Zoffix: I'll pass your message to [Coke].
Zoffix m: say "--------------------".subst: /.**12 <( ./, "Z"
camelia ------------Z-------
16:53 Zoffix left 16:54 ExtraCrispy left
tyil hmm, this is less neat, if I put `substr-rw($string, $position, 1) = $character` as the sub body, its return value is $character, not the updated string 16:55
timotimo yeah, that's the return value of assignment
ofperfection[m] Not sure if this is what you're looking to do 16:56
timotimo otherwise you wouldn't be able to do something like substr-rw($string, $position, 1) .= uc for example
tyil I am sure I'm looking to replace a character at a given position :p
timotimo: ah, that makes sense 16:57
timotimo m: "foobarbaz".comb.splice(3,1,"X").join.say
camelia Cannot resolve caller splice(Seq, Int, Int, Str); Routine does not have any candidates. Is only the proto defined?
in block <unit> at <tmp> line 1
timotimo m: "foobarbaz".comb.list.splice(3,1,"X").join.say
camelia Cannot resolve caller splice(List, Int, Int, Str); Routine does not have any candidates. Is only the proto defined?
in block <unit> at <tmp> line 1
timotimo m: "foobarbaz".comb.Array.splice(3,1,"X").join.say
camelia b
ofperfection[m] my $string = "banana"; my@seq = $string.comb; @seq[0] = "z"; say @seq [z a n a n a]
timotimo ah, that also returns the parts cut out
ofperfection[m] you could encapsulate that in a subroutine and run it against $_ 16:58
unless I'm wrong, since I'm a big 'ol noob
timotimo i've wanted an operator for a while that signifies a return value for the outer parenthesis or something 16:59
m: my $stash; sub store($a) { $stash = $a; $a }; sub recall($a) { $stash }; "foobarbaz".comb.Array.&store.splice(3,1,"X").&recall.join.say 17:00
camelia fooXarbaz
timotimo hmm 17:01
m: sub store($a, $b is rw) { $b = $a; $a }; sub recall($a, $b) { $b }; "foobarbaz".comb.Array.&store(my $x).splice(3,1,"X").&recall($x).join.say
camelia fooXarbaz
timotimo cool.
a little postcircumfix operator would be neat for that 17:04
m: sub postcircumfix:<⎡ ⎤>($a, $b is rw) { $b = $a; $a }; sub postcircumfix:<⎣ ⎦>($a, $b) { $b }; "foobarbaz".comb.Array⎡my $x⎤.splice(3,1,"X")⎣$x⎦.join.say 17:06
camelia fooXarbaz
timotimo that's not even half bad
i wish i could omit the "my", but that'd require a full-on slang
or perhaps actually a macro as we currently have it would do?! 17:07
masakro?
aha, i've got one better 17:08
m: sub postcircumfix:<⦑ ⦒>($a, &code) { $b = $a; code($a); $b }; "foobarbaz".comb.Array⦑*.splice(3,1,"X")⦒.join.say 17:09
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$b' is not declared
at <tmp>:1
------> 3sub postcircumfix:<⦑ ⦒>($a, &code) { 7⏏5$b = $a; code($a); $b }; "foobarbaz".com
timotimo m: sub postcircumfix:<⦑ ⦒>($a, &code) { my $b = $a; code($a); $b }; "foobarbaz".comb.Array⦑*.splice(3,1,"X")⦒.join.say 17:10
camelia fooXarbaz
timotimo hell yeah
ofperfection[m], tyil, how do you like this? 17:11
17:11 chenyf_ left 17:12 Possum left
timotimo i wonder why i didn't think of this the last time i wanted this 17:13
17:13 mcmillhj left, di0_27 joined, diakopter sets mode: +b *!*di0_@*.hokkaido.ocn.ne.jp, di0_27 was kicked by diakopter (di0_27))
ofperfection[m] How do i like what? 17:14
tobs that single operator form is indeed cool 17:15
ofperfection[m] The last solutoin?
sub postcircumfix i mean
timotimo yeah 17:19
i'm a little proud of it
ofperfection[m] I always enjoy learning new things in solutions, I'm reading up on circumfixes
tobs I have a multi sub f($x) that supports multiple algorithms. Is `multi sub f($x, :$algo1 where *.so)` the most declarative way to write the signature? I tried `:$algo1!` first but that is, of course, eligible for f($x, :!algo1) 17:22
it's the tiniest of issues but I thought I ask anyway
timotimo m: multi sub one($a, :flag!) { say "flag is set" }; multi sub one($a, :other!) { say "other is set" }; multi sub one($a) { say "fallback" }; one(1, :flag); one(2, :other); one(3) 17:23
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed parameter
at <tmp>:1
------> 3multi sub one($a, :7⏏5flag!) { say "flag is set" }; multi sub
[Coke] zoffix, even better, *all* those links are dead now after the site refresh. *sigh*
yoleaux 16:53Z <Zoffix> [Coke]: FYI the "grant ideas" is 404 link on this page: news.perlfoundation.org/2018/09/cal...pte-2.html might be this page is what it's meant to be: www.perlfoundation.org/grant-ideas.html
timotimo m: multi sub one($a, :flag(True)!) { say "flag is set" }; multi sub one($a, :other(True)!) { say "other is set" }; multi sub one($a) { say "fallback" }; one(1, :flag); one(2, :other); one(3)
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed parameter
at <tmp>:1
------> 3multi sub one($a, :flag(7⏏5True)!) { say "flag is set" }; multi sub
timotimo well, not like that, clearly 17:24
17:24 kurahaupo left
timotimo so yeah, it hink the "where *.so" is the right one if you want to allow passing False for that, too 17:24
tobs alright, having written it a few times, it already looks intuitive to me 17:27
[Coke] zoffix, fixed 'em, thanks for catching that 17:29
tobs Signatures have surprisingly many features. I'd buy a small, say apress, book about them if one were being considered to be written :-)
17:43 Rhonda16 joined 17:45 Rhonda16 left 17:50 mcmillhj joined, notwa9 joined, notwa9 was kicked by timotimo (notwa9)), p6bannerbot sets mode: +v mcmillhj 17:51 epony left
timotimo weekly: twitter.com/loltimo/status/1041746891426463744 17:53
notable6 timotimo, Noted!
timotimo i hope i'm not too late with this :)
ofperfection[m] The comments really helped clarify for me 17:55
timotimo \o/ 17:57
17:59 pecastro joined 18:00 p6bannerbot sets mode: +v pecastro 18:09 lizmat joined 18:10 p6bannerbot sets mode: +v lizmat 18:14 domidumont left 18:21 molaf joined 18:22 p6bannerbot sets mode: +v molaf 18:30 pyrimidi_ is now known as pyrimidine 18:31 ccc joined 18:32 p6bannerbot sets mode: +v ccc
ccc I'd like to go into perl6 REPL and require a file that is not a module (or a unit of any kind)and be able to use it's definitions and bindings. Do these get put into a special namespace? 18:35
tyil timotimo: thats nice (sorry, was afk for a bit) 18:36
timotimo <3 18:37
tyil I like it more than the other solutions I had so far
18:37 uzl joined
timotimo if you find a better unicode character, maybe one that's in typical compose files for example, that'd be cool 18:37
i could imagine an up arrow and a down arrow
maybe even an up-right and a down-right arrow
18:37 p6bannerbot sets mode: +v uzl
timotimo experts will make it a whole ballistic curve using a comment line above the code that connects both arrows 18:38
18:38 sotona joined, p6bannerbot sets mode: +v sotona 18:40 jmerelo left
ccc The REPL is nice; it's helping me try out of p6 concepts, but I have to type out or paste everything in it. 18:43
buggable New CPAN upload: Image-Libexif-0.0.3.tar.gz by FRITH modules.perl6.org/dist/Image::Libexif:cpan:FRITH 18:44
uzl hi, #perl6! 18:46
m: (Array.^methods.gist).words.grep: 'sum'
camelia ( no output )
uzl m: say (Array.^methods.gist).words.grep: 'sum'
camelia (sum)
ccc m: say CORE::.keys 18:47
camelia (FileChanged Signally &signal &RETURN-LIST &tan Stash &prompt &sin &postfix:<--> &prefix:<not> &atomic-fetch-inc SIGPROF &roots &infix:<+&> 𝑒 &sleep-until Macro &prefix:<so> &infix:<≤> Exception &infix:<~|> &asin &callframe &prefix:<temp> Cursor …
ccc m: say MY::.keys
camelia ($! $=pod $_ $¢ $=finish !UNIT_MARKER GLOBALish EXPORT $?PACKAGE ::?PACKAGE $/)
uzl m: say (Array.^methods.gist).words.grep: 'push'
camelia (push)
uzl Is there a more elegant way to find out if a type has a certain method? I'm struggling to come with something nicer. 18:48
ccc uzl: Do you use the perl6 REPL a lot? 18:49
jnthn m: say ?Array.can('push') 18:50
camelia True
uzl ccc: whenever I'm testing out small code snippets
[Coke] ccc: EVALFILE lets you run a file.
ccc EVALFILE? 18:51
[Coke] but it just runs it, I don't think it'll make those items available at the REPL scope
ccc is that a command or sub?
[Coke] m: EVALFILE "foo.p6"
camelia Failed to open file /home/camelia/foo.p6: No such file or directory
in block <unit> at <tmp> line 1
ccc That's a real bummer because perl-debug-m doesn't work for me 18:52
and to test certain ideas requires a lot of typing before you get to the punch line
it would be nice to have an custom set of definitions pre-loaded into the REPL 18:53
like some option the the perl6 command like --include=startup.p6 that only works in REPL mode that acts like you just typed all that was in startup.p6 18:55
El_Che ccc: you actually want a step by step debugger?
like "perl -d" in perl 5? 18:56
ccc While perl -d was a full, very useful debugger, I used it frequently like a REPL
timotimo ccc: have you tried the jupyter notebook for perl6 yet?
there's a free online one, too 18:57
ccc timotimo: If I did, then I'd have to LEARN it too. Let easy things be easy
Just load the damn file
and if you want to put it in a special namespace fine 18:58
but tell me what that namespace is!
timotimo why are you loading it with "require", if i may ask? 18:59
ccc What I'm loading is NOT a module class role or any other kind of library 19:00
but unadorned, unpacked perl6 code
that I'd rather not have to type all over again (or paste) the next time I'm fiddling with an idea 19:01
uzl timotimo: sorry to interrupt. Any easy way to find out (in the REPL) if a function can be invoked as a function, a method or both?
ccc If the debugger worked for me the I'd use that
timotimo uzl: i think the only requirement for something to be used as a method is that it has to take one positional argument at least 19:02
ccc: to be honest, i'm the opposite of fond of the REPL as it is currently, so i barely ever even use it
ccc Well it's great for people learning the language, although I can't load any initial stuff into it other than by pasting or typing 19:04
timotimo the difference between an unordered piece of perl6 code and a module is putting either "our" in front of subs (to access them with ModuleName::the-sub) or "is export" after the signature
ccc I think it was the perl -d that allowed me to come up to speed on perl6 rather quickly 19:05
19:05 mcmillhj left
ccc tried that 19:05
[Coke] what if there was a way to have a batch of perl 6 code that dumped you into the repl when it was done, would that be better than nothing?
19:05 mcmillhj joined
ccc I could use that 19:05
[Coke] asked, not remember if that worked at all. 19:06
timotimo well, you can get at Perl6::Compiler with nqp::getcomp("perl6") at the very least
19:06 p6bannerbot sets mode: +v mcmillhj
timotimo m: use Perl6::Compiler 19:06
camelia ===SORRY!===
Could not find Perl6::Compiler at line 1 in:
/home/camelia/.perl6
/home/camelia/rakudo-m-inst-1/share/perl6/site
/home/camelia/rakudo-m-inst-1/share/perl6/vendor
/home/camelia/rakudo-m-inst-1/share/perl6
Co…
timotimo m: use Perl6::Compiler:from<nqp>
camelia ===SORRY!===
Could not find Perl6::Compiler at line 1 in:
/home/camelia/.perl6
/home/camelia/rakudo-m-inst-1/share/perl6/site
/home/camelia/rakudo-m-inst-1/share/perl6/vendor
/home/camelia/rakudo-m-inst-1/share/perl6
Co…
ccc And where does it put the subs and variables it finds there
timotimo m: use Perl6::Compiler:from<NQP>
camelia ( no output )
ccc What namespace are we in inside REPL? 19:07
timotimo eval has options to set a context to use 19:08
but interactive doesn't
ccc If I say to REPL sub foo {say "bar"}
where is it getting put? Into a lexical pad or a package?
[Coke] stackoverflow.com/questions/452904...-from-file
timotimo lexical pad; "sub foo" is lexical
"our sub foo" gets put into the packag
ccc what package?
timotimo the current package 19:09
m: our sub foo() {}; say ::?PACKAGE.perl
camelia GLOBAL
timotimo m: our sub foo() {}; say ::?PACKAGE::.keys
camelia 5===SORRY!5=== Error while compiling <tmp>
Confused
at <tmp>:1
------> 3our sub foo() {}; say ::?PACKAGE:7⏏5:.keys
expecting any of:
colon pair
timotimo m: our sub foo() {}; say ::?PACKAGE.keys
camelia ()
ccc perl6 says $?CURRENT is not declared
timotimo m: our sub foo() {}; say ::?PACKAGE.WHO.keys
camelia (&foo)
timotimo there it is 19:10
19:10 Sauvin left
ccc ::?PACKAGE.WHO.keys in perl6 says: () ; (after I defined sub foo) 19:11
timotimo did you put "our" before it? 19:12
19:12 hamhu3_ joined
ccc Is each line in REPL a different lexical scope? 19:12
timotimo yes 19:13
they are stacked into each other
{ line 1; { line 2; { line 3; { line 4; ... } } } }
19:13 p6bannerbot sets mode: +v hamhu3_
timotimo the package.who.keys thing works on my machine 19:14
ccc Then how come it runs foo?
timotimo how do you mean?
ccc I define it in REPL on one line then I say foo on another it says bar
timotimo if foo is defined to return "bar", then that matches my expectation? 19:15
ccc It matches my expectation
19:16 sauvin_ joined, p6bannerbot sets mode: +v sauvin_, hamhu3 left
timotimo then i don't understand the question :) 19:16
19:16 sauvin_ is now known as Bocaneri
ccc It's not found in ::?PACKAGE, so where is it getting it from? 19:16
(And I didn't put an our in front of it either) 19:17
19:17 hamhu3_ left
timotimo it gets it from MY:: 19:17
19:18 hamhu3 joined
ccc perl6 says No such symbol '::?MY' 19:18
timotimo m: sub foo() {}; say MY::.keys
camelia ($_ EXPORT ::?PACKAGE !UNIT_MARKER $=finish $?PACKAGE $=pod $/ GLOBALish $¢ $! &foo)
timotimo there it is
ccc > MY::.keys
($?PACKAGE GLOBALish $=pod $_ ::?PACKAGE EXPORT !UNIT_MARKER)
timotimo well, yeah
19:18 p6bannerbot sets mode: +v hamhu3
timotimo if you put it on a new line, that's the current line's scope 19:19
ccc No foo there either
timotimo you'll want OUTER:: for the previous line or OUTERS:: for every previous line
ccc > foo
bar
What happened to let easy things be easy?
timotimo the repl is one giant terrible hack 19:20
ccc Why not have SOME way to jus insert a file in place
as if you had typed it
19:20 mcmillhj left
timotimo sounds like a cool first contribution :) 19:20
er, unless of course you already contributed 19:21
in which case i apologize for not knowing about that
ccc Ha! If I know enough about rakudo, I'd consider it.
19:21 mcmillhj joined
timotimo let me whip something up 19:21
do you have a local rakudo that you compiled yourself? 19:22
19:22 p6bannerbot sets mode: +v mcmillhj
ccc No just downloaded the latest version of rakudo star on Sep 4, 2018 19:22
19:22 Jaguar2_19 joined, diakopter sets mode: +b *!*Jaguar2_@201.131.244.*, Jaguar2_19 was kicked by timotimo (Jaguar2_19)), chenyf_ joined
diakopter double tap 19:23
19:23 p6bannerbot sets mode: +v chenyf_, Bocaneri left
timotimo in that case it'll be a bit more difficult to apply the patch 19:24
was that a binary release or sources?
ccc As I said here a couple of days ago, I'm working on a pedagogical module for abstract algebra : groupid, semigroups, groups
Calling it Math::Algebra 19:25
s/groupoid/groupid/
timotimo ok, i don't think i can actually write that patch right now 19:26
i need to rest my wrist for a while
ccc Keep getting sidetracked though chasing an idea down some rabbit hole or trying to learn several things at once
19:27 chenyf_ left
ccc (I'm using Atom now for my perl6 project, but my fingers still think in Emacs!) 19:27
19:28 sauvin joined, p6bannerbot sets mode: +v sauvin, sauvin left
ofperfection[m] Yeah I've been using atom specifically for the dearth of perl6 plugins 19:29
ccc I tried doing my Algebra project to help me learn go (the language), but I gave up on it. I also looked at nim
ofperfection[m] once I added vim mode they transition hasn't been to bad
by dearth i mean opposite of dearth
*abundance 19:30
ccc I've been a perl hacker for a couple of decades and was sad when perl6 did not prosper 19:31
But since I downloaded the current rakudo, I've been very impressed with what it can do 19:32
ofperfection[m] Hey Timo, in that snippet you linked on twitter, is that a ligature on the postcircumfix 19:33
Nevermind, found the symbol in the docs 19:34
How does one even type that
diakopter ccc: nobody's come up with a killer app for Perl 6, where it's definitely easier/awesomer to do in Perl 6 than all other [far more widespread] environments, except for of course the application of: Implementing Perl 6
timotimo .u ⦓ ⦔
yoleaux U+0020 SPACE [Zs] ( )
U+2993 LEFT ARC LESS-THAN BRACKET [Ps] (⦓)
U+2994 RIGHT ARC GREATER-THAN BRACKET [Pe] (⦔)
diakopter I like those brackets 19:35
timotimo .u ⦕ ⦖
yoleaux U+0020 SPACE [Zs] ( )
U+2995 DOUBLE LEFT ARC GREATER-THAN BRACKET [Ps] (⦕)
U+2996 DOUBLE RIGHT ARC LESS-THAN BRACKET [Pe] (⦖)
kensanata Do we have something quick and simple like B::hash in Perl 6? 19:36
19:37 uzl left
kensanata Basically what I want is to turn strings like IP numbers into four digit octals and in a Perl 5 app, this is what I used: get 32bit int, turn to octal, take first four characters, color code them... 19:38
ccc IP addresses are written in decimal 255.255.255.255 19:39
kensanata ccc: Also IPv6
ccc Assume I'm Rip Van Winkle: is IPv6 finally taking over? 19:40
silly question 19:41
I still see the xxx.xxx.xxx.xxx everywhere 19:42
19:42 diakopter joined
kensanata I'm still interested in a quick and easy solution to the question of how to turn any string into four octal digits. 19:43
19:43 p6bannerbot sets mode: +v diakopter
ccc kensanata: I'm still learning but I thought I saw an example of exactly that in the perl6 docs 19:43
kensanata: Trouble is I can't remember where but you could do a site search 19:44
sena_kun m: say 225.base(8); say 'a'.ord.base(8); say 'Musk'.comb>>.ord>>.base(8); 19:45
camelia 341
141
(115 165 163 153)
sena_kun like that?
19:46 ggoebel left
sena_kun I am not really sure about "four" octal digits. 19:46
the question is how do you want to turn strings into numbers. 19:47
ccc I think he wants to do the reverse
sena_kun m: '225.225.225.225'.split('.').map(*.Int).map(*.base(8)) 19:48
camelia ( no output )
sena_kun m: '225.225.225.225'.split('.').map(*.Int).map(*.base(8)).say
camelia (341 341 341 341)
sena_kun m: '225.225.225.225'.split('.').map(*.Int).map(*.base(8)).map(*.Str).join[0..4].say 19:50
camelia Index out of range. Is: 1, should be in 0..0
in block <unit> at <tmp> line 1
jnthn .map(*.Int.base(8)) # saves 2 maps
sena_kun oh, indeed.
I am too pampered with point-free notation. :S
diakopter such composable 19:51
sena_kun m: say '225.225.225.225'.split('.').map(*.Int.base(8).Str).join.substr(0, 4)
camelia 3413
sena_kun m: say '225.225.225.225'.split('.').>>(*.Int.base(8).Str).join.substr(0, 4) 19:52
camelia Too many positionals passed; expected 1 argument but got 2
in block <unit> at <tmp> line 1
sena_kun ok, it doesn't work like that.
ccc m: sub ipaddr(uint32 $a) {my @b; loop (my $i=0; $i < 4;$i++) {@a.unshift($a & 0xff); $a>>=8;} say join('.',@a);} say ipaddr(0xc0a80002); 19:53
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '@a' is not declared. Did you mean '$a'?
at <tmp>:1
------> 3a) {my @b; loop (my $i=0; $i < 4;$i++) {7⏏5@a.unshift($a & 0xff); $a>>=8;} say join
ccc m: sub ipaddr(uint32 $a) {my @b; loop (my $i=0; $i < 4;$i++) {@b.unshift($a & 0xff); $a>>=8;} say join('.',@b);} say ipaddr(0xc0a80002); 19:54
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed postfix
at <tmp>:1
------> 3i < 4;$i++) {@b.unshift($a & 0xff); $a>>7⏏5=8;} say join('.',@b);} say ipaddr(0xc0a
expecting any of:
postfix
ccc okay what's the operator for bit shift right?
sena_kun +& 19:55
oops.
+>>
tobs m: say 256 +> 4
camelia 16
ccc m: sub ipaddr(uint32 $a) {my @b; loop (my $i=0; $i < 4;$i++) {@b.unshift($a & 0xff); $a = >>8;} say join('.',@b);} say ipaddr(0xc0a80002);
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing infix inside HYPER
at <tmp>:1
------> 3 4;$i++) {@b.unshift($a & 0xff); $a = >>7⏏058;} say join('.',@b);} say ipaddr(0xc0a8
expecting any of:
infix
infix stop…
19:55 xinming_ left
ccc m: sub ipaddr(uint32 $a) {my @b; loop (my $i=0; $i < 4;$i++) {@b.unshift($a & 0xff); $a = $a>>8;} say join('.',@b);} say ipaddr(0xc0a80002); 19:55
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed postfix
at <tmp>:1
------> 3;$i++) {@b.unshift($a & 0xff); $a = $a>>7⏏058;} say join('.',@b);} say ipaddr(0xc0a8
expecting any of:
postfix
ccc m: sub ipaddr(uint32 $a) {my @b; loop (my $i=0; $i < 4;$i++) {@b.unshift($a & 0xff); $a = $a +>> 8;} say join('.',@b);} say ipaddr(0xc0a80002); 19:56
camelia 5===SORRY!5=== Error while compiling <tmp>
Preceding context expects a term, but found infix > instead.
at <tmp>:1
------> 3i++) {@b.unshift($a & 0xff); $a = $a +>>7⏏5 8;} say join('.',@b);} say ipaddr(0xc0a
tobs ccc: you also want to use +& instead of & for bitwise ANDing. In P6 the sole & is a junction
ccc m: sub ipaddr(uint32 $a) {my @b; loop (my $i=0; $i < 4;$i++) {@b.unshift($a & 0xff); $a = $a ~> 8;} say join('.',@b);} say ipaddr(0xc0a80002); 19:57
camelia 5===SORRY!5===
Cannot assign to readonly variable $a
at <tmp>:1
------> 3++) {@b.unshift($a & 0xff); $a = $a ~> 87⏏5;} say join('.',@b);} say ipaddr(0xc0a80
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------…
ccc m: sub ipaddr($a) {my @b; loop (my $i=0; $i < 4;$i++) {@b.unshift($a & 0xff); $a = $a ~> 8;} say join('.',@b);} say ipaddr(0xc0a80002); 19:58
camelia 5===SORRY!5=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> 3) {@b.unshift($a & 0xff); $a = $a ~> 8;}7⏏5 say join('.',@b);} say ipaddr(0xc0a8000
ccc m: sub ipaddr($a) {my @b; loop (my $i=0; $i < 4;$i++) {@b.unshift($a & 0xff); $a = $a ~> 8;}; say join('.',@b);}; say ipaddr(0xc0a80002);
camelia Cannot resolve caller infix:«~>»(Int, Int); none of these signatures match:
(Str:D \a, Int:D \b --> Str:D)
(str $a, int $b)
in sub ipaddr at <tmp> line 1
in block <unit> at <tmp> line 1
ccc Hmm - you can tell I'm new at this 20:00
tobs m: sub ipaddr($a) { my @b; loop (my $i=0; $i < 4; $i++) { @b.unshift($a +& 0xff); $a +>= 8 }; say join('.',@b) }; say ipaddr(0xc0a80002) 20:02
camelia Cannot assign to a readonly variable or a value
in sub ipaddr at <tmp> line 1
in block <unit> at <tmp> line 1
tobs m: sub ipaddr($a is copy) { my @b; loop (my $i=0; $i < 4; $i++) { @b.unshift($a +& 0xff); $a +>= 8 }; say join('.',@b) }; say ipaddr(0xc0a80002)
camelia 192.168.0.2
True
tobs and now watch this
m: 0xc0a80002.polymod(256 xx *).reverse.join('.').say
camelia 192.168.0.2 20:03
ccc m: say 6 ~> 1
camelia Cannot resolve caller infix:«~>»(Int, Int); none of these signatures match:
(Str:D \a, Int:D \b --> Str:D)
(str $a, int $b)
in block <unit> at <tmp> line 1
ccc m: say 6 +> 1
camelia 3
20:03 sena_kun left
ccc tobs: that's nifty 20:07
tobs kensanata: as far as turning "any string into four octal digits" goes, djb2 is a simple way of doing that (assuming you want to use that to color strings like IRC nicks?)
m: "any string".comb».ord.reduce(* * 33 +^ *) mod 8**4
camelia WARNINGS for <tmp>:
Useless use of "mod" in expression ".reduce(* * 33 +^ *) mod 8**" in sink context (line 1)
tobs m: say "any string".comb».ord.reduce(* * 33 +^ *) mod 8**4
camelia 2531
kensanata tobs: Basically I want to anonymise IP numbers in log files but make it possible to group actions by the same IP visually using simple color codes, eg. here: campaignwiki.org/wiki/DerTotenfluc...showedit=1 -- two different people but it's hard to guess their IP numbers. 20:09
tobs: Your suggestion sounds very good. 20:10
vrurg Is it possible to make rakudobrew autolink scripts from moar-<num>/install/share/perl6/site/bin? 20:11
20:11 sotona left
vrurg nevermind, found 20:13
ccc what is rakudobrew? 20:14
locally compiled rakudo?
vrurg ccc: yes
20:15 ccc left, xinming joined 20:16 p6bannerbot sets mode: +v xinming
tobs kensanata: oops, my line above is missing the initial hash value from djb2. Not that it matters for turning strings into numbers, but if I call it that, it should be implemented correctly 20:17
m: say [5381, |"any string".comb».ord].reduce(* * 33 +^ *) mod 8**4 # maybe with a mod 2**32 inside the reduce? 20:21
camelia 2342
kensanata tobs: I cannot answer the question in the comment. :) 20:30
20:31 sauvin joined, p6bannerbot sets mode: +v sauvin 20:32 Dhraakellian18 joined
kensanata tobs: I'm trying to understand the answers to stackoverflow.com/questions/157972...-algorithm but I think I should go to bed... 🙂 20:34
20:36 Dhraakellian18 left 20:38 Herby_ joined 20:39 p6bannerbot sets mode: +v Herby_
Herby_ o/ 20:39
\o 20:40
20:44 sauvin left 20:47 dct joined, p6bannerbot sets mode: +v dct 20:48 kensanata left 20:49 Xliff joined 20:50 p6bannerbot sets mode: +v Xliff, johnjohn101 joined, p6bannerbot sets mode: +v johnjohn101
johnjohn101 hi perl 6 20:51
20:51 sauvin joined, p6bannerbot sets mode: +v sauvin
buggable New CPAN upload: Sparrowdo-Cordova-OSx-Build-0.0.4.tar.gz by MELEZHIK modules.perl6.org/dist/Sparrowdo::C...n:MELEZHIK 20:54
Xliff Does perl6 allow re-export of symbols as described in S11
johnjohn101 will perl 6 be targeting the new jvm stuff? 20:56
20:58 sauvin left, mcmillhj left
moritz if somebody makes it so... 20:59
johnjohn101 hmm 21:02
21:04 robertle joined 21:05 p6bannerbot sets mode: +v robertle
geekosaur Xliff, as yet the export machinery's rather unformed. iirc zoffix has a module that can be used to emulate some of what is intended, but not S11-style? 21:12
Xliff geekosaur++ # Thanks 21:15
diakopter export BYOBU_CHARMAP=x ; . ~/.bashrc 21:19
aw jeez
21:22 pmurias left 21:26 pmurias joined, p6bannerbot sets mode: +v pmurias, Herby_ left 21:36 AlexDaniel joined, p6bannerbot sets mode: +v AlexDaniel 21:40 johnjohn101 left 21:43 titsuki_ joined, p6bannerbot sets mode: +v titsuki_ 21:44 titsuki left
lizmat and another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2018/09/17/...ersus-six/ 21:46
21:49 dct left 21:56 atta joined
El_Che releasable6: status 21:57
releasable6 El_Che, Next release will happen when it's ready. 0 blockers. 1 out of 112 commits logged (⚠ 47 warnings)
El_Che, Details: gist.github.com/e20bdbc48d5db6e1fb...3d7b9ff6d6
21:57 p6bannerbot sets mode: +v atta
AlexDaniel El_Che: colabti.org/irclogger/irclogger_log...09-16#l491 21:59
I sorta just woke up so tommorow for me is starting about now :) 22:00
.tell jmerelo what is up with this rejectionism lately in perl6/doc? :) 22:05
yoleaux AlexDaniel: I'll pass your message to jmerelo.
22:05 sauvin joined, p6bannerbot sets mode: +v sauvin 22:10 rindolf left, pmurias left, rindolf joined 22:11 p6bannerbot sets mode: +v rindolf 22:20 asgs21 joined, asgs21 was kicked by timotimo (asgs21)) 22:40 mcmillhj joined 22:41 p6bannerbot sets mode: +v mcmillhj 22:42 MasterDuke joined, p6bannerbot sets mode: +v MasterDuke, MasterDuke left, MasterDuke joined, herbert.freenode.net sets mode: +v MasterDuke, p6bannerbot sets mode: +v MasterDuke 22:46 mcmillhj left 22:58 dct joined 22:59 p6bannerbot sets mode: +v dct 23:00 mcmillhj joined 23:01 p6bannerbot sets mode: +v mcmillhj 23:05 mcmillhj left 23:12 hamhu3_ joined 23:13 p6bannerbot sets mode: +v hamhu3_, mcmillhj joined 23:14 p6bannerbot sets mode: +v mcmillhj 23:15 pecastro left, hamhu3 left 23:18 mcmillhj left 23:21 Zoffix joined, p6bannerbot sets mode: +v Zoffix
Zoffix lizmat++ # good weekly. P.S.: the "Could be simplified by Zoffix Znet." Tweet was from p6org 23:21
23:23 chenyf_ joined, mcmillhj joined, p6bannerbot sets mode: +v chenyf_ 23:24 Zoffix left, p6bannerbot sets mode: +v mcmillhj
buggable New CPAN upload: GraphQL-0.5.8.tar.gz by CTILMES cpan.metacpan.org/authors/id/C/CT/...5.8.tar.gz 23:24
23:28 chenyf_ left 23:33 qiqi joined, p6bannerbot sets mode: +v qiqi 23:39 ZzZombo_ joined, p6bannerbot sets mode: +v ZzZombo_ 23:40 ZzZombo left, ZzZombo_ is now known as ZzZombo 23:44 dct left
ttkp6 Really enjoyed the alexschroeder.ch article. It makes me want to do more work on my own fork of the old Oddmuse codebase. 23:59