»ö« 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:02 w_richard_w left 00:07 lizmat joined, p6bannerbot sets mode: +v lizmat 00:10 Sound left 00:11 random_yanek left 00:16 kurahaupo left, kurahaupo joined, kurahaupo left 00:17 kurahaupo joined, p6bannerbot sets mode: +v kurahaupo 00:18 albongo left 00:20 ryn1x joined 00:21 p6bannerbot sets mode: +v ryn1x 00:24 albongo joined, p6bannerbot sets mode: +v albongo 00:33 lizmat left 00:36 ryn1x left 00:37 lizmat joined, p6bannerbot sets mode: +v lizmat 00:50 cydf left 01:07 random_yanek joined 01:08 p6bannerbot sets mode: +v random_yanek 02:08 notable6 left, benchable6 left, bloatable6 left, squashable6 left, nativecallable6 left, quotable6 left, releasable6 left, statisfiable6 left, reportable6 left, committable6 left, undersightable6 left, bisectable6 left, evalable6 left, greppable6 left, shareable6 left, coverable6 left, unicodable6 left, nativecallable6 joined, ChanServ sets mode: +v nativecallable6, bloatable6 joined, quotable6 joined, ChanServ sets mode: +v quotable6, evalable6 joined, ChanServ sets mode: +v evalable6, notable6 joined, ChanServ sets mode: +v notable6, coverable6 joined, ChanServ sets mode: +v coverable6, greppable6 joined, ChanServ sets mode: +v greppable6, unicodable6 joined, bisectable6 joined, committable6 joined, ChanServ sets mode: +v committable6, benchable6 joined, ChanServ sets mode: +v benchable6, reportable6 joined, releasable6 joined, ChanServ sets mode: +v reportable6, ChanServ sets mode: +v releasable6, undersightable6 joined, shareable6 joined, shareable6 left, undersightable6 left, unicodable6 left, bisectable6 left, bloatable6 left 02:09 p6bannerbot sets mode: +v nativecallable6, p6bannerbot sets mode: +v quotable6, p6bannerbot left, p6bannerbot joined, ChanServ sets mode: +o p6bannerbot 02:13 lizmat left 02:37 lizmat joined, p6bannerbot sets mode: +v lizmat 02:52 mattp_ left 03:01 mattp_ joined 03:02 p6bannerbot sets mode: +v mattp_ 03:09 bisectable6 joined, unicodable6 joined, bloatable6 joined, p6bannerbot sets mode: +v bisectable6, p6bannerbot sets mode: +v unicodable6 03:10 p6bannerbot sets mode: +v bloatable6 03:11 undersightable6 joined, p6bannerbot sets mode: +v undersightable6, ufobat_ joined 03:12 p6bannerbot sets mode: +v ufobat_ 03:15 ufobat___ left 03:18 leont left 03:20 MasterDuke left 03:22 w_richard_w joined 03:23 p6bannerbot sets mode: +v w_richard_w, w_richard_w left 03:24 w_richard_w joined, p6bannerbot sets mode: +v w_richard_w 03:38 khisanth_ left 03:58 aindilis left 04:00 aindilis joined 04:01 p6bannerbot sets mode: +v aindilis, khisanth_ joined 04:02 p6bannerbot sets mode: +v khisanth_ 04:06 w_richard_w left 04:08 kurahaupo_ joined 04:09 p6bannerbot sets mode: +v kurahaupo_ 04:10 kurahaupo left 04:26 avar left, Bucciarati left 04:42 molaf joined 04:43 p6bannerbot sets mode: +v molaf 04:52 El_Che left, Bucciarati joined, avar joined, avar left, avar joined, p6bannerbot sets mode: +v avar 04:53 warriors joined, p6bannerbot sets mode: +v warriors, p6bannerbot sets mode: +v Bucciarati, p6bannerbot sets mode: +v avar 04:55 kurahaupo_ left 04:56 kurahaupo joined, molaf left, p6bannerbot sets mode: +v kurahaupo 05:17 Bucciarati left 05:18 kdr21 joined 05:19 p6bannerbot sets mode: +v kdr21, Bucciarati joined 05:20 p6bannerbot sets mode: +v Bucciarati 05:21 kdr2 left 05:53 curan joined, p6bannerbot sets mode: +v curan 05:55 Sgeo joined 05:56 p6bannerbot sets mode: +v Sgeo, Sgeo_ left 05:59 Xliff left 06:13 statisfiable6 joined 06:14 p6bannerbot sets mode: +v statisfiable6, jmerelo joined 06:15 p6bannerbot sets mode: +v jmerelo
jmerelo Just a reminder that we *need* articles for the Perl 6 advent Calendar: github.com/perl6/mu/blob/master/mi...8/schedule 06:15
The schedule is virtually empty. So really, really, please, think about some topic and request one day github.com/perl6/mu/blob/master/mi...8/schedule 06:16
06:24 sauvin joined, p6bannerbot sets mode: +v sauvin
holyghost .tell Xliff I would like to have public_html in my home dir working (e.g. /etc/httpd.rc) 06:29
yoleaux holyghost: I'll pass your message to Xliff.
holyghost .tell Xliff Then you should point to the $HOME local directories in and html file (index.html) with "serverip/~holyghost" in /var/www/index.tml instead of the default apache page 06:34
yoleaux holyghost: I'll pass your message to Xliff.
holyghost .tell Xliff If you like, I'll give you a nice index.html file with CSS and everything, so we have a nice main website 06:37
yoleaux holyghost: I'll pass your message to Xliff.
06:58 kudzo_ left
holyghost .tell Xliff they should find me on the main website with e.g. in html <a href="/~holyghost/">The Holy Ghost software</a> IIRC 07:01
yoleaux holyghost: I'll pass your message to Xliff.
07:15 dct joined, p6bannerbot sets mode: +v dct 07:18 domidumont joined 07:19 p6bannerbot sets mode: +v domidumont 07:28 ZzZombo left 07:36 jmerelo left
Geth mu: b745ffb483 | (Naoum Hankache)++ (committed using GitHub Web editor) | misc/perl6advent-2018/schedule
Update schedule
07:50
07:58 Bucciarati left, Bucciarati joined 07:59 p6bannerbot sets mode: +v Bucciarati 08:05 Actualey` joined, p6bannerbot sets mode: +v Actualey` 08:06 Actualeyes left 08:19 warriors left 08:36 agentzh left 08:37 El_Che joined 08:38 p6bannerbot sets mode: +v El_Che
El_Che That +r freenode thingie is crap. Oh well, my irssi config is 2 channels less 08:42
masak El_Che: is the +r thingie what keeps the spam bots at bay. why is it crap? 09:04
s/\./?/
09:05 Actualey` left 09:14 zakharyas joined, rindolf joined 09:15 p6bannerbot sets mode: +v zakharyas, p6bannerbot sets mode: +v rindolf
El_Che because I can't log in 09:26
coffee time
Altreus Is there a perl6y way of removing one array of items from another in some magically efficient manner? 09:27
moritz splice 09:31
09:34 cydf joined 09:35 p6bannerbot sets mode: +v cydf
Altreus this appears to remove a range rather than a subset 09:44
@array.remove(@subset) 09:45
something like this but that actually exists
moritz if you want to remove several indexes, it's usually more efficient to keep the others 09:46
@array = @array[@indexes_to_keep]
my \indexes_to_remove = set(@indexes_to_remove); my @indexes_to_keep = @array.keys.grep(none(indexes_to_remove)) 09:47
09:48 agentzh joined, agentzh left, agentzh joined, p6bannerbot sets mode: +v agentzh 09:49 p6bannerbot sets mode: +v agentzh 09:50 dogbert11 joined 09:51 p6bannerbot sets mode: +v dogbert11, reppie joined, odyniec__ joined 09:52 SCHAPiE left, p6bannerbot sets mode: +v reppie, p6bannerbot sets mode: +v odyniec__ 09:53 timeless left, odyniec left
Altreus OK so basically, figure out which indices they are and invert that set 09:53
cool :)
09:53 dogbert17 left, x[LGWs4x4i]uG2N0 left 09:55 reppie is now known as x[LGWs4x4i]uG2N0, timeless joined, p6bannerbot sets mode: +v timeless
Geth mu: 9a5485e3bf | (Ramiro Encinas)++ (committed using GitHub Web editor) | misc/perl6advent-2018/schedule
Update schedule
09:56
09:59 SCHAPiE joined, p6bannerbot sets mode: +v SCHAPiE 10:03 nwellnhof joined, p6bannerbot sets mode: +v nwellnhof
nwellnhof p6: say (1,2,3; 4,5,6; 7,8,9)[{0,1}] 10:03
camelia ((1 2 3) (4 5 6))
nwellnhof p6: say (1,2,3; 4,5,6; 7,8,9)[*;0,1]
camelia (1 2 4 5 7 8)
nwellnhof p6: say (1,2,3; 4,5,6; 7,8,9)[*;{0,1}]
camelia (3 6 9)
nwellnhof The last result seems like a bug. 10:04
jnthn m: say {0,1}.elems # This will be numified, I think? So it's like [*;2] 10:13
camelia 1
jnthn Oh...it won't 'cus it's a code object 10:14
It will be passed the target, and then return a list, which will probably then be numified
Though I see in the first case we re-dispatch on what the thing returns. Hmm. 10:15
Yeah, it should be consistent one way or the other.
10:16 sena_kun joined
jnthn I'd suggest to file an issue. 10:17
Or patch :)
10:17 p6bannerbot sets mode: +v sena_kun 10:26 Xliff joined 10:27 p6bannerbot sets mode: +v Xliff
Xliff Anyone awake? 10:27
yoleaux 06:29Z <holyghost> Xliff: I would like to have public_html in my home dir working (e.g. /etc/httpd.rc)
06:34Z <holyghost> Xliff: Then you should point to the $HOME local directories in and html file (index.html) with "serverip/~holyghost" in /var/www/index.tml instead of the default apache page
06:37Z <holyghost> Xliff: If you like, I'll give you a nice index.html file with CSS and everything, so we have a nice main website
07:01Z <holyghost> Xliff: they should find me on the main website with e.g. in html <a href="/~holyghost/">The Holy Ghost software</a> IIRC
Geth mu: 3c0b3cb9c0 | Altai-man++ (committed using GitHub Web editor) | misc/perl6advent-2018/schedule
Update schedule
Xliff .tell holyghost Sorry. This is a git server. I am using it to serve HTTP. If you want that, please get a webhost 10:28
yoleaux Xliff: I'll pass your message to holyghost.
holyghost Xliff: ok 10:29
yoleaux 10:28Z <Xliff> holyghost: Sorry. This is a git server. I am using it to serve HTTP. If you want that, please get a webhost
holyghost Xliff: I'll publish in priv git then 10:30
Xliff Yes. Please do.
holyghost I have to make a script to update my files 10:31
Anyone, can git be used locally with an ip just as cvs ? 10:32
Xliff Yes. It can. I am out, now. Just priv me if you have questions. 10:33
Please... not too many though. It's been a day.
holyghost ok, take care
Geth mu: c1607089d0 | (Nigel Hamilton)++ (committed using GitHub Web editor) | misc/perl6advent-2018/schedule
Provide another topic
10:51
10:55 nige joined 10:56 p6bannerbot sets mode: +v nige
nige could someone please point me to the github ticket that we are waiting on Larry to weigh in on - regarding raku? 10:57
lizmat I assume you mean github.com/perl6/user-experience/issues/31 ? 11:02
11:03 nwellnhof left
nige thanks lizmat - yes I think that's the one 11:10
11:11 titsuki joined 11:12 p6bannerbot sets mode: +v titsuki
Xliff \o lizmat and nige 11:13
11:44 scimon joined 11:45 p6bannerbot sets mode: +v scimon 11:51 kdr21 left 11:57 molaf joined 11:58 p6bannerbot sets mode: +v molaf 12:01 angelds joined 12:02 p6bannerbot sets mode: +v angelds
buggable New CPAN upload: Object-Delayed-0.0.4.tar.gz by ELIZABETH modules.perl6.org/dist/Object::Dela...:ELIZABETH 12:07
12:10 koto joined 12:11 p6bannerbot sets mode: +v koto 12:12 pecastro joined 12:13 sena_kun left, p6bannerbot sets mode: +v pecastro 12:18 kdr21 joined 12:19 p6bannerbot sets mode: +v kdr21 12:21 zakame joined, p6bannerbot sets mode: +v zakame 12:23 zakharyas left 12:36 sno left 12:38 zakame_ joined, p6bannerbot sets mode: +v zakame_
lizmat hmmm.... so *where* do we document "start { }" ? 12:38
somewhere hidden in the Promise.start docs: This is considered to be such a commonly required pattern that it is also provided as a keyword: 12:39
12:40 zakame left
masak we don't have a list of statement prefixes somewhere? 12:41
I saw we have a list of phasers, but this is slightly different
`once` is documented under "Control flow" -- this feels similar 12:42
lizmat ok, I'll add it there
Geth doc: a7845c0085 | (Elizabeth Mattijsen)++ | doc/Language/concurrency.pod6
Add mention that only one whenever block runs at a time
12:43
synopsebot Link: doc.perl6.org/language/concurrency
12:47 angelds left, lizmat left
ufobat_ !seen sena-kun 12:48
12:49 lizmat joined, p6bannerbot sets mode: +v lizmat 12:51 jcallen left, jcallen joined, p6bannerbot sets mode: +v jcallen
timotimo .seen sena_kun 12:58
yoleaux I saw sena_kun 14 Nov 2018 19:31Z in #perl6: <sena_kun> pmurias, I hope so. Numbers of FF users are decreasing every year, which is sad to see. But, well, disregard that, if you ask me, I'd +1 on polyfill usage.
koto timotimo, I'm here. 12:59
12:59 koto is now known as sena_kun
sena_kun ufobat_, cro bugs, yes? 12:59
ufobat_ openapi::model issues :D 13:00
sena_kun there are ones I know to exist, yes... let's move to #cro if you don't mind and I'm ready to look into things. 13:01
ufobat_ aye 13:03
13:06 jmerelo joined 13:07 p6bannerbot sets mode: +v jmerelo 13:11 leont joined
timotimo m: say term:<now>() 13:11
camelia Instant:1542373945.973841
timotimo m: say term:<now>(:test)
camelia Unexpected named argument 'test' passed
in block <unit> at <tmp> line 1
13:11 p6bannerbot sets mode: +v leont
timotimo &term:<now>.wrap(-> |, :$set-mock-time { state $mock-time; $mock-time = $_ with $set-mock-time; $mock-time // callsame }); say now; term:<now>(set-mock-time => 12345); 13:12
m: &term:<now>.wrap(-> |, :$set-mock-time { state $mock-time; $mock-time = $_ with $set-mock-time; $mock-time // callsame }); say now; term:<now>(set-mock-time => 12345);
camelia Potential difficulties:
Useless use of 'now' in sink context
at <tmp>:1
------> 3 now; term:<now>(set-mock-time => 12345)7⏏5;
Instant:1542373978.510927
timotimo ^- hum?
ufobat_ can someone point me out what i need to read in order to understand this: github.com/croservices/openapi-mod...1148-L1160 13:17
the `does Role[ ...quite a lot of code... ]` thingy
it looks like a different kind of inheritance?
timotimo it puts a value into the role's argument 13:18
jnthn Roles can take parameters
m: role R[$v] { method m { $v } }; class C does R[42] { }; C.m
camelia ( no output )
jnthn m: role R[$v] { method m { $v } }; class C does R[42] { }; say C.m
camelia 42
ufobat_ thats basically the same as javas Collection<Type> thingy? 13:20
but in more flexible
timotimo it's similar, but the arguments to roles don't just disappear 13:21
13:21 pmurias joined, p6bannerbot sets mode: +v pmurias
SmokeMachine m: my %a := :{}; my %b; %b<bla> = 1; %a{%b.clone} = 1; say %a; %b<bla> = 2; %a{%b.clone} = 2; say %a # why is this happening if im cloning b? 13:23
camelia {(bla => 1) => 1}
{(bla => 2) => 2, (bla => 2) => 1}
ufobat_ maybe it is a stupid question, but when do you use that? I've never needed or used that in my perl5 code
timotimo SmokeMachine: it's not the same object any more, so it's a different key 13:25
SmokeMachine I was thinking to use `.Map` instead of `.clone` but it stringifies the key...
timotimo "the" key?
jnthn ufobat_: When you want to factor something out into a role, but make it configurable in some way.
SmokeMachine timotimo: yes, that's what I want, but the problem is: `{(bla => 2) => 2, (bla => 2) => 1}` its changing... 13:26
timotimo my %a := :{}; my %b; %b<bla> = 1; %a{%b.Map} = 1; say %a; %b<bla> = 2; %a{%b.Map} = 2; say %a.perl
evalable6 {(bla => 1) => 1}
:{(:bla(1)) => 1, (:bla(2)) => 2}
timotimo my %a := :{}; my %b; %b<bla> = 1; %a{%b.Map} = 1; say %a.perl; %b<bla> = 2; %a{%b.Map} = 2; say %a.perl
evalable6 :{(:bla(1)) => 1}
:{(:bla(1)) => 1, (:bla(2)) => 2}
SmokeMachine m: my %bla = :{42 => 1}; say %bla.keys.head.^name; say %bla.Map.keys.head.^name
camelia Potential difficulties:
Useless use of hash composer on right side of hash assignment; did you mean := instead?
at <tmp>:1
------> 3my %bla = :{42 => 1}7⏏5; say %bla.keys.head.^name; say %bla.Map
Str
Str
timotimo i don't see it stringify keys
SmokeMachine m: my %bla := :{42 => 1}; say %bla.keys.head.^name; say %bla.Map.keys.head.^name 13:27
camelia Int
Str
SmokeMachine timotimo: ^^ 13:28
timotimo oh
m: my %bla := :{42 => 1}; say %bla.keys.head.^name; say %bla.Map.^roles
camelia Int
((Associative) (Iterable))
timotimo m: my %bla := :{42 => 1}; say %bla.keys.head.^name; say %bla.Map.^roles[0].^parameters
camelia Int
No such method 'parameters' for invocant of type 'Perl6::Metamodel::ParametricRoleGroupHOW'. Did you mean 'parameterize'?
in block <unit> at <tmp> line 1
tobs "A Map is an immutable mapping from string keys to values of arbitrary types."
timotimo m: my %bla := :{42 => 1}; say %bla.keys.head.^name; say %bla.Map.^roles[0].^params
camelia Int
No such method 'params' for invocant of type 'Perl6::Metamodel::ParametricRoleGroupHOW'
in block <unit> at <tmp> line 1
timotimo m: my %bla := :{42 => 1}; say %bla.keys.head.^name; say %bla.Map.^roles[0].^arguments 13:29
camelia Int
No such method 'arguments' for invocant of type 'Perl6::Metamodel::ParametricRoleGroupHOW'
in block <unit> at <tmp> line 1
timotimo ...
m: my %bla := :{42 => 1}; say %bla.keys.head.^name; say %bla.Map.^roles[0].arguments
camelia Int
No such method 'arguments' for invocant of type 'Associative'
in block <unit> at <tmp> line 1
timotimo m: my %bla := :{42 => 1}; say %bla.keys.head.^name; say %bla.Map.^roles[0].parameters
camelia Int
No such method 'parameters' for invocant of type 'Associative'
in block <unit> at <tmp> line 1
timotimo m: my %bla := :{42 => 1}; say %bla.keys.head.^name; say %bla.Map.^roles[0].^role_arguments 13:31
camelia Int
No such method 'role_arguments' for invocant of type 'Perl6::Metamodel::ParametricRoleGroupHOW'
in block <unit> at <tmp> line 1
timotimo huh.
13:32 sno joined, p6bannerbot sets mode: +v sno
SmokeMachine this works, but is there a better solution? 13:33
m: my %a := :{}; my %b; %b<bla> = 1; %a{%b.kv.map(-> $k, $v { $k.clone => $v })} = 1; say %a; %b<bla> = 2; %a{%b.kv.map(-> $k, $v { $k.clone => $v })} = 2; say %a
camelia {(bla => 1) => 1}
{(bla => 1) => 1, (bla => 2) => 2}
SmokeMachine timotimo: ^^ 13:34
13:34 sno left
timotimo it probably shouldn't stringify those keys. 13:34
SmokeMachine tobs: ^^
timotimo oh
Map is supposed to be strings to objects, then?
SmokeMachine timotimo: but Hash also does...
m: my %bla := :{42 => 1}; say %bla.keys.head.^name; say %bla.Hash.keys.head.^name
camelia Int
Int
timotimo well, hash's default role parameters are Str(Any) iirc
tobs SmokeMachine: I can only imagine that the clone issue has something to do with it making shallow copies...
SmokeMachine sorry... not Hash on a Hash... 13:35
13:35 sno joined 13:36 lizmat left, p6bannerbot sets mode: +v sno
timotimo s: :{42 => 1}, 'Hash', \() 13:36
SourceBaby timotimo, Ehhh... I'm too scared to run that code.
SmokeMachine tobs: yes, that's what I was wandering... that probable would be "fixed" if `.Map` didn't stringily...
timotimo s: Hash, 'Hash', \()
SourceBaby timotimo, Sauce is at github.com/rakudo/rakudo/blob/21f1...ash.pm6#L8
timotimo that would explain why .Hash on a Hash doesn't do anything :) 13:37
tobs m: my %a := :{}; my %b; %b<bla> = 1; %a{(my Any %{Any} = %b)} = 1; say %a; %b<bla> = 2; %a{(my Any %{Any} = %b.clone)} = 2; say %a
camelia {(bla => 1) => 1}
{(bla => 1) => 1, (bla => 2) => 2}
SmokeMachine yes, that just returns self...
tobs %)
13:38 zag joined, p6bannerbot sets mode: +v zag
tobs this is what you expected right? (forgot to remove the last .clone) 13:38
13:38 zag left
SmokeMachine m: my %a := :{}; my %b; %b<bla> = 1; %a{my %{Any} = %b.clone} = 1; say %a; %b<bla> = 2; %a{my %{Any} = %b.clone} = 2; say %a 13:40
camelia {(bla => 1) => 1}
{(bla => 1) => 1, (bla => 2) => 2}
SmokeMachine m: my %a := :{}; my %b; %b<bla> = 1; %a{my %{Any} = %b} = 1; say %a; %b<bla> = 2; %a{my %{Any} = %b} = 2; say %a
camelia {(bla => 1) => 1}
{(bla => 1) => 1, (bla => 2) => 2}
SmokeMachine tobs: that's it! thanks!
tobs SmokeMachine: it could look nicer though. (I learned that last week while doing something similar and looking at .perl outputs.) 13:41
13:41 sno left 13:42 lizmat joined, p6bannerbot sets mode: +v lizmat 13:43 sno joined
SmokeMachine tobs: thanks! 13:43
13:43 p6bannerbot sets mode: +v sno
SmokeMachine timotimo: Now I have to find a way to transfer this into a Red::AST... :P www.irccloud.com/pastebin/Cz0Aeet5/ 13:44
13:53 zakharyas joined 13:54 p6bannerbot sets mode: +v zakharyas
SmokeMachine timotimo: www.irccloud.com/pastebin/jk9eqzHy/ 13:58
timotimo i like it 14:00
would you tunr that right into a piece of the SQL so that stuff that would immediately .next won't appear in the first place, or would that screw with code that actually does something useful before calling .next? 14:01
14:04 zakharyas left 14:07 zakharyas joined 14:08 p6bannerbot sets mode: +v zakharyas, jmerelo left
SmokeMachine timotimo: the idea is to translate that to sql... 14:11
do `.map: { next unless .b; .a }` will write the same sql as `.grep({so .b}).map: {.a}` 14:12
select a from table_name where b is not null and b != 0 14:14
timotimo: for example... 14:15
Altreus is it kosher to use a promise to sort of signal that something else is happening? I will explain my example
SmokeMachine timotimo: but it's not on Red master yet... its on a branch... 14:16
Altreus I have a "bulk delete messages" operation on a Channel object. This first sends an API request and, on success, finds those messages in the object's @.messages and removes them. This whole thing happens in a Promise so someone could read @.messages after the method was called but before they are removed from the list
SmokeMachine timotimo: if some one like to help... (would you?)
Altreus Would it make sense to hide @.messages behind a Promise, so that I can keep that promise when people are allowed to see the message array? 14:17
as a sort of lock
or can I just straight up lock something and force a blocking operation?
I was thinking something like method messages { $!message-lock.then({ @!messages }) } 14:18
moritz there are locks, yes
docs.perl6.org/type/Lock
Altreus cor
moritz use them with care :-) 14:19
Altreus ah this recommends higher-level constructs
I suspect the promise-lock might be less dangerous
14:27 shareable6 joined 14:28 p6bannerbot sets mode: +v shareable6, nige_ joined 14:29 nige left, p6bannerbot sets mode: +v nige_
Geth doc: 6165d4362a | (Elizabeth Mattijsen)++ | doc/Language/control.pod6
Add start { } to control flow
14:33
synopsebot Link: doc.perl6.org/language/control
buggable New CPAN upload: ModelDB-0.0.3.tar.gz by HANENKAMP cpan.metacpan.org/authors/id/H/HA/...0.3.tar.gz 14:37
14:37 curan left, reportable6 left 14:38 reportable6 joined, squashable6 joined, ChanServ sets mode: +v squashable6, p6bannerbot sets mode: +v reportable6, p6bannerbot sets mode: +v squashable6
jnthn Altreus: Yes, using the Promise there sounds better. 14:38
14:43 dhn joined, p6bannerbot sets mode: +v dhn 14:45 ONDIE joined 14:46 ONDIE left
El_Che robe pike's diss about Perl: youtu.be/RIvL2ONhFBI?t=150 14:50
SmokeMachine timotimo: my "Red::AST optimizer" is not optimising anything yet... but it looks that the `next if` is working... www.irccloud.com/pastebin/7oqzHGSQ/ 14:53
lizmat
.oO( go Rob, go! :-)
SmokeMachine timotimo: I mean the optimizer will transform `not not X` into `X` 14:54
14:57 abraxxa left
Altreus jnthn: thanks, this means I'm getting the hang of stuff 14:57
:D
15:00 dhn left 15:01 warriors joined, p6bannerbot sets mode: +v warriors 15:06 zakharyas left, molaf left 15:09 zakharyas joined 15:10 p6bannerbot sets mode: +v zakharyas
SmokeMachine timotimo: github.com/FCO/Red/wiki/Better-map-grep 15:14
15:22 zakame_ left 15:25 warriors_ joined, p6bannerbot sets mode: +v warriors_, warriors_ left
lizmat SmokeMachine: { next unless .b; .a } perhaps better written as { .a if .b } ? 15:32
SmokeMachine lizmat: but it won’t next, right? It will return Nil... 15:53
lizmat m: dd (^10).map: $_ if $_ == 5 15:54
camelia Use of uninitialized value of type Any in numeric context
in block <unit> at <tmp> line 1
lizmat m: dd (^10).map: { $_ if $_ == 5 }
camelia (5,).Seq
lizmat map is smarter than that :-)
15:54 PavelB joined, p6bannerbot sets mode: +v PavelB
timotimo it returns Empty, doesn't it? 15:55
SmokeMachine lizmat: thanks!
PavelB Does perl6 have repl?
SmokeMachine lizmat: I’ll add that to my code! Thanks!
timotimo PavelB: yes, just run "perl6" and the repl should greet you 15:56
PavelB :O
timotimo other than that we have a kernel that can be used with the jupyter notebook, or ipython console
SmokeMachine m: say ^10 .map: { $_ if %% 2 }
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3say ^10 .map: { $_ if %%7⏏5 2 }
expecting any of:
infix
infix stopper
PavelB *and* it has line editing
woah
SmokeMachine m: say ^10 .map: { $_ if $_ %% 2 } 15:57
camelia (0 2 4 6 8)
timotimo it has some very strange behaviours sometimes, though
the repl, i mean
operators defined on one line aren't available outside that same line, for example
and using native lexicals, like "my int $foo" instead of "my Int $foo" can cause strange issues, too
SmokeMachine m: say { $_ if $_ %% 2 }.(3) 15:58
camelia ()
PavelB So, I'm coming from Perl 5 and I noticed that `say (1, 2, 3)`, `say 1, 2, 3`, and `say [1, 2, 3]` are causing different outputs. What's the difference? 15:59
timotimo the first one you pass a list to say, the second one you pass three arguments, the third one you pass an array
SmokeMachine m: say { if False {}}.()
camelia ()
SmokeMachine m: say { do if False {}}.()
camelia ()
PavelB So perl6 doesn't have the auto-list-splatting thing? 16:00
lizmat PavelB: could you express that in Perl 5 code ?
SmokeMachine m: say |(1, 2, 3)
camelia 123
timotimo yeah, arguments are only expanded ("slipped") if you use the | operator 16:01
PavelB Perl 5 has `(1, (2, (3), 4, (5)), 6), 7` as the same thing to `(1, 2, 3, 4, 5, 6, 7)`
timotimo you can slip an array to pass positional arguments or a hash to pass named arguments
SmokeMachine PavelB: in perl6 it isn’t... 16:02
lizmat m: dd ((1, (2, (3), 4, (5)), 6), 7).flat # PavelB
camelia (1, 2, 3, 4, 5, 6, 7).Seq
lizmat m: say ((1, (2, (3), 4, (5)), 6), 7).flat
camelia (1 2 3 4 5 6 7)
PavelB I'm starting to doubt this language is actually similar to Perl 5 16:03
lizmat PavelB: everything in Perl 6 is an object
and so are arrays and lists
PavelB Like, reasonable representations of lists? Wuuuuut? 16:04
16:04 zakharyas left
lizmat PavelB: perhaps this could be of interest to you: opensource.com/article/18/8/containers-perl-6 16:05
</plug>
16:05 zakharyas joined
PavelB lizmat: So I'm reading that and I'm not sure I'm seeing the purpose of having an @ sigil if you can just stick lists in $scalars and it works fine 16:06
16:06 p6bannerbot sets mode: +v zakharyas
lizmat the @ indicates how you want to look at it 16:08
m: my $l := 1,2,3,4; for $l { say $_ }
camelia 1
2
3
4
ufobat_ m: my $a = (foo => 1, bar => 2); say $a<foo> 16:10
camelia Type List does not support associative indexing.
in block <unit> at <tmp> line 1
ufobat_ m: my $a = (foo => 1, bar => 2).Hash; say $a<foo> 16:11
camelia 1
lizmat afk&
16:13 molaf joined, p6bannerbot sets mode: +v molaf
ufobat_ ha :D 16:14
16:20 curan joined, p6bannerbot sets mode: +v curan 16:22 trnh joined, p6bannerbot sets mode: +v trnh
scimon Zoffix: Jsut to say. Looking at the Color module. Importing the Color::Operators only added .5 seconds on my machine today :) 16:24
16:29 curan left 16:30 trnh left 16:31 curan joined, p6bannerbot sets mode: +v curan 16:32 Sgeo_ joined, molaf left, p6bannerbot sets mode: +v Sgeo_ 16:34 zakharyas left, Sgeo left 16:38 domidumont left 16:44 kurahaupo left, kurahaupo joined 16:45 p6bannerbot sets mode: +v kurahaupo 16:52 curan left 16:55 domidumont joined 16:56 p6bannerbot sets mode: +v domidumont 17:06 domidumont left 17:08 Bucciarati left, avar left, avar joined, Bucciarati joined, avar left, avar joined, p6bannerbot sets mode: +v avar
SmokeMachine lizmat: thanks! www.irccloud.com/pastebin/ynCHwfn4/ 17:09
17:09 p6bannerbot sets mode: +v avar, p6bannerbot sets mode: +v Bucciarati 17:16 PavelB left 17:23 kerframil joined, p6bannerbot sets mode: +v kerframil 17:24 scimon left 17:36 robertle left 18:31 Manifest1 joined, p6bannerbot sets mode: +v Manifest1 18:34 domidumont joined, p6bannerbot sets mode: +v domidumont 18:37 domidumont left 18:45 dct left 18:53 rindolf left 18:54 ryn1x joined, p6bannerbot sets mode: +v ryn1x 18:59 leont left 19:07 ryn1x left 19:14 rindolf joined 19:15 p6bannerbot sets mode: +v rindolf 19:24 sauvin left 19:30 Bucciarati left 19:31 Bucciarati joined, p6bannerbot sets mode: +v Bucciarati 19:36 ferreira left
SmokeMachine m: say "bla (ble, bli, blo) blu".subst(/"(" ~ ")" (<-[)]>+)/, -> $/ is copy { "( { $0.Str.split(/\s*,\s*/).sort.join(", ") } )" }, :g) 19:39
camelia 5===SORRY!5===
Unrecognized regex metacharacter , (must be quoted to match literally)
at <tmp>:1
------> 3, -> $/ is copy { "( { $0.Str.split(/\s*7⏏5,\s*/).sort.join(", ") } )" }, :g)
Unable to parse regex; couldn't find final '/'
SmokeMachine what's wrong here? ^^
sena_kun SmokeMachine, `,` symbol. If you want to literaly match it, wrap it with `,`. That's a wild guess though based on what I see, I am not a regex wizard. 19:42
m: say "bla (ble, bli, blo) blu".subst(/"(" ~ ")" (<-[)]>+)/, -> $/ is copy { "( { $0.Str.split(/\s* ',' \s*/).sort.join(", ") } )" }, :g)
camelia bla ( ble, bli, blo ) blu
sena_kun SmokeMachine, ^
SmokeMachine right! thanks sena_kun !
sena_kun Phew, glad I was able to help. :) .oO ( Though Comma did it ). 19:43
20:11 sena_kun left 20:12 rudo joined, p6bannerbot sets mode: +v rudo 20:13 sena_kun joined, p6bannerbot sets mode: +v sena_kun 20:15 rindolf left 20:32 rudo left 20:37 rindolf joined, kst left, p6bannerbot sets mode: +v rindolf 20:43 molaf joined 20:44 p6bannerbot sets mode: +v molaf, kst joined 20:45 p6bannerbot sets mode: +v kst 20:46 ferreira joined 20:47 p6bannerbot sets mode: +v ferreira 20:56 patrickb joined 20:57 p6bannerbot sets mode: +v patrickb, molaf left 21:01 movl joined, p6bannerbot sets mode: +v movl 21:19 kerframil left 21:22 pmurias left 21:27 pmurias joined, p6bannerbot sets mode: +v pmurias 21:32 avar left 21:33 avar joined, avar left, avar joined, p6bannerbot sets mode: +v avar 21:34 p6bannerbot sets mode: +v avar 21:39 random_yanek left 21:51 random_yanek joined, p6bannerbot sets mode: +v random_yanek 21:58 kdr21 left 21:59 kudzo_ joined, kdr21 joined 22:00 p6bannerbot sets mode: +v kudzo_, p6bannerbot sets mode: +v kdr21 22:26 molaf joined 22:27 sena_kun left, p6bannerbot sets mode: +v molaf 22:46 nige joined 22:47 nige left, nige_ left 22:49 nige joined 22:50 p6bannerbot sets mode: +v nige 22:52 pmurias left 23:08 El_Che left, El_Che joined, p6bannerbot sets mode: +v El_Che 23:15 cydf left
Altreus I have an array of objects that all exist in another array. Is there an efficient way of turning this subset into the indices from the superset? 23:16
the perl5 way is a nested loop 23:17
23:21 [Sno] joined, p6bannerbot sets mode: +v [Sno]
SmokeMachine m: my @a = <a e i o u>; my @b = "a" .. "z"; my %b = @b.kv.reverse; say %b{@a} # Altreus: do you mean something like this? 23:23
camelia (0 4 8 14 20)
23:24 sno left 23:26 thundergnat joined, warriors left, p6bannerbot sets mode: +v thundergnat
jnthn `my %b = @b.antipairs` will be a bit more efficient 23:27
SmokeMachine jnthn: thanks!
23:37 kensanata joined, p6bannerbot sets mode: +v kensanata 23:38 patrickb left, cydf joined 23:39 p6bannerbot sets mode: +v cydf
Altreus yes except they're objects so I ... I dunno, can I use them as keys? 23:40
23:42 oodani left, oodani joined 23:43 p6bannerbot sets mode: +v oodani
jnthn Yes, but declare the hash my %b{Any} 23:47
Altreus okay I shall try this 23:49
dunno how long before I can actually run this code :P
23:53 kensanata left