IRCloggy #perl6 2018-07-17

Logs Search ←Prev date Next date→ Channels Documentation

Provider of IRC logs since 2005.
WARNING: As Freenode became unjoinable and lost all warnings in topics, we cannot log channels on Freenode anymore.

2018-07-17

Xliff I have two new methods: multi method new (GtkOrientation $orientation, gint $spacing), and multi method new (:$box). When I try and use the first one I get the following error: Default constructor for 'GTK::Box' only takes named arguments.00:08
I thought positionals superseded named arguments.00:09
timotimo i recommend overriding the default "new" method by putting a proto method in there00:10
m: class Test { }; say Test.^find_method("new").^candidates00:12
camelia rakudo-moar 49363d690: OUTPUT: «No such method 'candidates' for invocant of type 'Perl6::Metamodel::ClassHOW'␤ in block <unit> at <tmp> line 1␤␤»00:12
timotimo m: class Test { }; say Test.^find_method("new")[0].^candidates00:12
camelia rakudo-moar 49363d690: OUTPUT: «No such method 'candidates' for invocant of type 'Perl6::Metamodel::ClassHOW'␤ in block <unit> at <tmp> line 1␤␤»00:12
timotimo mhh00:12
m: class Test { }; say Test.^find_method("new")00:12
camelia rakudo-moar 49363d690: OUTPUT: «new␤»00:12
timotimo m: class Test { }; say Test.^find_method("new").^name00:13
camelia rakudo-moar 49363d690: OUTPUT: «Method␤»00:13
timotimo m: class Test { }; say Test.^find_method("new").^methods00:13
camelia rakudo-moar 49363d690: OUTPUT: «(gist <anon> leave <anon> <anon> wrap <anon> <anon> <anon> onlystar <anon> <anon> candidates <anon> package unwrap yada <anon> multi <anon> soft <anon> <anon> <anon> <anon> cando <anon> perl BUILDALL <anon> has-phaser set_why fire_if_phasers of phaser…»00:13
timotimo m: class Test { }; say Test.^find_method("new").perl00:13
camelia rakudo-moar 49363d690: OUTPUT: «proto method new (Mu: |) {*}␤»00:13
timotimo m: class Test { }; say Test.^find_method("new").candidates00:13
camelia rakudo-moar 49363d690: OUTPUT: «(new new)␤»00:13
timotimo m: class Test { }; say Test.^find_method("new").candidates>>.perl00:13
camelia rakudo-moar 49363d690: OUTPUT: «(multi method new (Mu: *%attrinit) { #`(Method|45274992) ... } multi method new (Mu: $, *@, *%_) { #`(Method|45275144) ... })␤»00:13
Xliff Hrm.00:14
timotimo it's got a slurpy positional there00:14
Xliff Can I define two protos?00:14
Yeah. I see that.00:14
timotimo not for the same name00:14
but you can just make its signature maximum free, like proto method new (|) {*}00:15
Xliff That kinda sucks though.00:16
timotimo how so?00:16
Xliff Because I can't do positionals OR named parameters. I have to do both.00:17
timotimo the proto has to accept anything you want to have a candidate for00:17
the union, so to speak00:17
Xliff So new(Int, Int) cannot coexist with new(:$nv) unless proto method new(Int?, Int? |)00:18
timotimo or new(|)00:18
Xliff new(|) won't accept two positionals.00:18
Just named arguments.00:18
lookatme maybe new(:$nv!)00:18
timotimo really?00:19
Xliff Don't want :$nv in case 100:19
Yeah. Tried new(|) and it gave me an error00:19
timotimo m: proto sub blerp(|) {*}; multi blerp($a, $b) { say "two ints" }; multi blerp(:$nv) { say "nv" }; blerp(1, 2); blerp(nv => 99)00:19
camelia rakudo-moar 49363d690: OUTPUT: «two ints␤nv␤»00:19
Xliff Try method00:19
timotimo m: class Floop { proto method blerp(|) {*}; multi method blerp($a, $b) { say "two ints" }; multi method blerp(:$nv) { say "nv" }; }; Floop.blerp(1, 2); Floop.blerp(nv => 99)00:20
camelia rakudo-moar 49363d690: OUTPUT: «two ints␤nv␤»00:20
Xliff m: class Floop { proto new blerp(|) {*}; multi method new($a, $b) { say "two ints" }; multi method new(:$nv) { say "nv" }; }; Floop.new(1, 2); Floop.new(nv => 9900:21
lookatme m: class F { multi method new(:$nv!) { say "nv"; }; multi method new(Int $a?, Int $b?) { say "two"; }; }; say F.new(1, 2);00:21
camelia rakudo-moar 49363d690: OUTPUT: «=== SORRY!=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> class Floop { proto new blerp(|) {*}; multi method new($a, $b) ␤ expecting any of:␤ new name to be defined␤»00:21
rakudo-moar 49363d690: OUTPUT: «two␤True␤»00:21
timotimo you have "proto new" instead of "proto method"00:21
Xliff m: class Floop { proto new blerp(|) {*}; multi method new($a, $b) { say "two ints" }; multi method new(:$nv) { say "nv" }; }; Floop.new(1, 2); Floop.new(nv => 99);00:21
camelia rakudo-moar 49363d690: OUTPUT: «=== SORRY!=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> class Floop { proto new blerp(|) {*}; multi method new($a, $b) ␤ expecting any of:␤ new name to be defined␤»00:21
Xliff OK. I will try mandatory named.00:21
timotimo do you see the problem with "proto new"?00:22
lookatme m: class F { multi method new(:$nv!) { say "nv"; }; multi method new(Int $a?, Int $b?) { say "two"; }; }; F.new(1, 2); F.new(nv => 22);00:22
camelia rakudo-moar 49363d690: OUTPUT: «two␤nv␤»00:22
lookatme m: class F { multi method new(:$nv) { say "nv"; }; multi method new(Int $a?, Int $b?) { say "two"; }; }; F.new(1, 2); F.new(nv => 22);00:22
camelia rakudo-moar 49363d690: OUTPUT: «two␤nv␤»00:22
lookatme m: class F { multi method new(:$nv) { say "nv"; }; multi method new(Int $a?, Int $b?) { say "two"; }; }; F.new();00:22
camelia rakudo-moar 49363d690: OUTPUT: «nv␤»00:22
lookatme :D00:23
timotimo yeah, the nv one is more specific, because it has exactly 0 positionals, whereas the Int? Int? one is for either 0, 1, or 2 ints00:23
lookatme what is 0 ints ?00:24
:(00:24
timotimo "0 parameters, all of them ints"00:24
lookatme I prefer they raise an compile error, or warning00:26
timotimo not possible with regular methods, as they are completely late-bound00:26
lookatme they are all can accept zero parameters obviously00:26
mst left00:27
lookatme oh00:27
timotimo do note that named parameters are only ever used to break ties, and every method has an implicit *% argument00:28
lookatme yeah, I know this recently00:29
mst joined00:34
mst left00:34
mst joined00:34
Xliff Now: class A { multi method new ($a, $b) { say "ab"; }; multi method new (:$box) { say "Box!" }: }; A.new(1, 2); A.new(:box(3);00:38
m: class A { multi method new ($a, $b) { say "ab"; }; multi method new (:$box) { say "Box!" }: }; A.new(1, 2); A.new(:box(3);00:39
camelia rakudo-moar 49363d690: OUTPUT: «=== SORRY!=== Error while compiling <tmp>␤Unexpected closing bracket␤at <tmp>:1␤------> multi method new (:$box) { say "Box!" }: }; A.new(1, 2); A.new(:box(3); ␤»00:39
Xliff m: class A { multi method new ($a, $b) { say "ab"; }; multi method new (:$box) { say "Box!" }; }; A.new(1, 2); A.new(:box(3);00:39
camelia rakudo-moar 49363d690: OUTPUT: «=== SORRY!=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)␤at <tmp>:1␤------> "Box!" }; }; A.new(1, 2); A.new(:box(3); <EOL> ␤ expecting …»00:39
Xliff m: class A { multi method new ($a, $b) { say "ab"; }; multi method new (:$box) { say "Box!" }; }; A.new(1, 2); A.new(:box(3));00:39
camelia rakudo-moar 49363d690: OUTPUT: «ab␤Box!␤»00:39
Ven` joined00:39
Xliff When I try that in my code, it says "Too few positionals passed; expected at least 2 arguments but got only 1"00:40
timotimo any more classes you derive from, roles you include, anything like that?00:42
version difference perhaps?!00:42
committable: releases class A { multi method new ($a, $b) { say "ab"; }; multi method new (:$box) { say "Box!" }; }; A.new(1, 2); A.new(:box(3));00:42
committable6 timotimo, ¦releases (31 commits): «ab␤Box!␤»00:42
timotimo that's probably not it, hmm.00:42
Ven` left00:43
jeromelanteri joined00:44
timotimo anyway, i have to go get sleep00:44
jeromelanteri left00:49
Xliff nn "timo"x200:55
m: ("timo" x 2).say00:55
camelia rakudo-moar 49363d690: OUTPUT: «timotimo␤»00:55
Xliff m: ("timo" xx 2).join.say00:56
camelia rakudo-moar 49363d690: OUTPUT: «timotimo␤»00:56
lookatme timotimo, good night :)00:56
Xliff left00:57
jameslenz joined01:01
jeromelanteri joined01:02
Kaypie left01:04
lizmat left01:05
jameslenz left01:05
subr left01:06
subroot joined01:06
spycrab0 left01:10
atweiden-air joined01:46
atweiden-air Hey you guys; i read in the newsletter something that will break a bunch of my code:the `is required` trait does not make sense on private attributes in a class because private attributes will never be assigned by the default object building logic (aka .new). To avoid confusion, adding is required to a private attribute is now a compilation error.01:48
i take issue with this change: `has $!thing is required` is perfectly reasonable assuming the class has a custom submethod BUILD.01:48
e.g. https://github.com/atweiden/mktxn/blob/8e6516aefbad2454264ed4953ab621c9c65987cf/lib/TXN.pm6#L5601:49
fake_space_whale joined01:51
atweiden-air for me it's a visual aid: i can know with certainty private attributes of a class marked `is required` had to have been derived during a custom instantiation process. it's perfectly self-documenting01:54
molaf left02:02
Zoffix joined02:02
Zoffix atweiden-air: but that's misleading code, because the check is not enforced.02:03
You may as well just make those basic comments.02:03
atweiden-air i suppose this won't affect my code if I provide `has $.thing is required; method thing() {*}` ..?02:03
commit: https://github.com/rakudo/rakudo/commit/1ad34320e091949109523b6457939848aad1e7dd#diff-9e5f9979983fe8296ec533beecd070f1R10402:04
committable6 atweiden-air, I cannot recognize this command. See wiki for some examples: https://github.com/perl6/whateverable/wiki/Committable02:04
Zoffix atweiden-air: then it's not a private attribute02:04
atweiden-air i mean `has $!thing is required`02:04
maybe that would pass the conditional check `$attr.has_accessor`02:04
Zoffix atweiden-air: it doesn't know it's an accessor02:05
atweiden-air m: class ABC { has $!thing is required; }; ABC.new.perl.say;02:05
camelia rakudo-moar 49363d690: OUTPUT: «=== SORRY!=== Error while compiling <tmp>␤'is required' only works on a public attribute $.thing, not a private $!thing␤at <tmp>:1␤»02:05
atweiden-air dunno how to show the error from the current stable release02:06
but it's `The attribute '$!thing' is required, but you did not provide a value for it.`02:06
Zoffix That is the error02:06
atweiden-air Zoffix: so i think this is currently enforced02:06
Zoffix ?02:07
atweiden-air Zoffix: you said earlier "because the check is not enforced."02:07
Zoffix c: 2018.06 class Foo { has $!foo is required; }02:07
committable6 Zoffix, ¦2018.06: «»02:07
Zoffix I meant before the change showing you have a bug in your code, the `is required` check was not enforced02:07
atweiden-air: in either case. Such discussions are better had on the Issue tracker ( https://github.com/rakudo/rakudo/issues/new ), but I doubt you'll have much luck convincing the core devs they should leave in dead, misleading code because you've used it instead of a comment ( https://xkcd.com/1172/ ). You may choose an alternate strategy, such as suggesting making the attribute enforce that the private02:09
attribute, but that runs into an issue of what "some value" really is, since the default default of the container is "some value"02:09
atweiden-air not sure what you mean. 2018.06 throws an error on this: `class ABC { has $!thing is required; }; ABC.new.perl.say;`02:09
the error message is: The attribute '$!thing' is required, but you did not provide a value for it.02:09
Zoffix Ah, I forgot a .new02:09
c: 2018.06 class ABC { has $!thing is required; }; ABC.new.perl.say;02:09
committable6 Zoffix, ¦2018.06: «The attribute '$!thing' is required, but you did not provide a value for it.␤ in submethod BUILDALL at /tmp/f1vpWNHMc8 line 1␤ in block <unit> at /tmp/f1vpWNHMc8 line 1␤␤ «exit code = 1»»02:09
Zoffix c: 2018.06 class ABC { has $!thing is required; submethod BUILD(:$!thing = 42) {} }; ABC.new.perl.say;02:09
committable6 Zoffix, ¦2018.06: «ABC.new␤»02:09
Zoffix c: 2018.06 class ABC { has $!thing is required; submethod BUILD(:$!thing = Any) {} }; ABC.new.perl.say;02:09
committable6 Zoffix, ¦2018.06: «ABC.new␤»02:09
atweiden-air Zoffix: i suppose i could open an issue on GH. i like venting on IRC tho :)02:12
Zoffix atweiden-air: filed an Issue for this: R#208302:12
synopsebot R#2083 [open] : https://github.com/rakudo/rakudo/issues/2083 [LTA][regression] `is required` change removed useful feature 02:12
Zoffix atweiden-air: well, then you may choose to vent on #perl6-dev that has higher chance of being noticed by coredevs :)02:13
atweiden-air attn coredevs02:16
atweiden-air squints, shakes fist02:16
Zoffix :)02:16
Actually, breakage of that module would've shown up on toaster run, and I'd guess the release manager would revert the change. But it's nice to also have an argument for why it was a useful feature to go along with it :)02:17
greppable6: \$\!.+is required02:18
greppable6 Zoffix, 13 lines, 9 modules: https://gist.github.com/c0349a59a74bf4406864c6aa3d89ae0402:18
Zoffix hm, wonder why your module doesn't show up in the list (was the issue of missing modules in all-modules repo fixed?)02:18
Hhahaha02:19
Even my own module is broken by the change: https://github.com/zoffixznet/perl6-WWW-vlc-Remote/blob/cd64c9aef50ea8445717af8df7e72398d3fb165d/lib/WWW/vlc/Remote.pm6#L602:19
Zoffix left02:26
giraffe joined02:48
atweiden-air left02:51
Kaypie joined03:00
jameslenz joined03:01
El_Che left03:04
El_Che joined03:05
jameslenz left03:05
kjk joined03:27
kjk is there an existing method for updating a Hash with another such that if a key exists its value is replaced otherwise the new key value are added?03:29
MasterDuke m: my %orig = :1a, :2b; my %new = :5b, :6c; %orig ,= %new; dd %orig03:32
camelia rakudo-moar 49363d690: OUTPUT: «Hash %orig = {:a(1), :b(5), :c(6)}␤»03:32
aindilis left03:33
MasterDuke kjk: ^^^03:34
kjk MasterDuke: thanks for the solution. Is it optimized behind the scene so that it's not actually creating a new hash from both old and new and then overwrite %orig?03:34
MasterDuke i believe so, but not 100% sure03:36
kjk is that the idiomatic why to do it in perl6? sorry, new to perl6. In python, I'd just use the dict.update method03:37
MasterDuke pretty idomatic. it may or may not be what you want if there are multi-level hashes, depends on your use-case03:38
sleeping &03:44
kjk p6: my %orig = :1a, :2b; my %new = :5b, :6c; for %new.kv { %orig{$^k} = $^v }03:44
camelia rakudo-moar 49363d690: ( no output )03:44
kjk p6: my %orig = :1a, :2b; my %new = :5b, :6c; for %new.kv { %orig{$^k} = $^v }; dd %orig03:44
camelia rakudo-moar 49363d690: OUTPUT: «Hash %orig = {:a(1), :b(5), :c(6)}␤»03:44
subroot left03:50
MasterDuke left03:53
eliasr left03:55
fake_space_whale Is using $?FILE the proper way to construct a path relative to the executing file for loading resources? for example something like my $config = $?FILE.IO.sibling("config.txt").slurp;03:55
Juerd kjk: Why the loop? :)03:56
p6: my %orig = :1a, :2b; my %new = :5b, :6c; %orig{ %new.keys } = %new.values; dd %orig03:56
camelia rakudo-moar 49363d690: OUTPUT: «Hash %orig = {:a(1), :b(5), :c(6)}␤»03:56
sauvin joined03:57
Juerd fake_space_whale: $*PROGRAM.resolve.sibling(...)03:57
kjk Juerd: cool another way to do it03:57
Juerd fake_space_whale: $?FILE is compile-time and could be a module.03:57
kjk Juerd: so, is .keys guarrentee to return the keys in the same order as the their values?03:58
Summertime should do as long as the hash doesn't get mutated inbetween? assuming its like python's old dicts03:59
Juerd kjk: That's missing from the documentation. Would you care to create a github issue for that? I'm about to go to bed (6am here)04:00
https://github.com/perl6/doc/issues04:00
Summertime ? > Note that the order in which keys, values and pairs are retrieved is generally arbitrary, but the keys, values and pairs methods return them always in the same order when called on the same object.04:00
Juerd Good night!04:00
Summertime I'd say that implies it enough04:00
kjk I like MasterDuke's version better: %orig ,= %new but I'm not sure if that's doing it the smart way behind the scene or creating a new hash from %orig and %new04:00
Summertime I'd assume it'd be making a new hash, you'd expect that it wouldn't mutate the original value, much like most other thing= uses04:02
kjk I kinda hope it would mutate the %orig in this case since it's going to reassign it anyway creating a copy, mutate it, and then assign it to %orig would be a waste.04:05
fake_space_whale Juerd: Thank you04:05
kjk Juerd: I'm not sure if you mean no doc on how to update a Hash with another or no doc about the order of .keys and .values04:06
lookatme no docs about the order04:06
kjk ok04:07
Summertime probably just needs some clarification in the third paragraph of the Map class documentation04:08
Ven` joined04:11
Ven` left04:15
curan joined04:50
jameslenz joined05:01
jameslenz left05:06
HaraldJoerg joined05:08
xtreak joined05:15
sno left05:26
troys left05:32
aindilis joined05:44
fake_space_whale left05:44
sarna joined05:46
sarna hey, how do I define a custom destructor?05:48
geekosaur submethod DESTROY() { ... }05:54
sarna thanks :)05:55
rindolf joined05:56
fake_space_whale joined05:58
fake_space_whale left06:12
robertle joined06:25
nebuchadnezzar joined06:25
sno joined06:32
wamba joined06:35
konsolebox left06:39
konsolebox joined06:41
jameslenz joined07:02
jameslenz left07:06
domidumont joined07:10
psychoslave joined07:11
pecastro joined07:14
wamba left07:16
domidumont left07:17
perlawhirl I'm unable to build NQP :(07:17
MoarVM panic: Memory allocation failed; could not allocate 4294967296 bytes07:17
domidumont joined07:18
moritz it tries to allocate 4GB RAM at once?07:20
perlawhirl seems that way.07:21
i might try a reboot first, and failing that, rollback commits on Moar and NQP and retry building07:22
woolfy left07:26
woolfy joined07:27
dakkar joined07:37
lizmat joined07:44
araujo left07:45
wamba joined07:48
lizmat clickbaits https://p6weekly.wordpress.com/2018/07/16/2018-29-cross-pollination/07:48
wamba left07:52
wamba joined07:53
ilogger2 joined07:57
ChanServ set mode: +v07:57
scimon joined08:04
Ven` joined08:15
pmurias joined08:17
El_Che lizmat: you found an antagonist on perlmonks it seems08:20
faraco joined08:21
faraco left08:21
faraco joined08:21
subroot joined08:21
ecocode some software devs are reluctant to change ;)08:22
El_Che this one was rather vexed from somethong of 15y ago08:22
faraco o/08:23
lookatme :)08:23
pmurias left08:29
pmurias joined08:29
faraco left08:36
wamba joined08:48
Woodi joined08:53
sarna joined08:53
subroot left08:55
lizmat El_Che: oddly enough, I didn't recall him being vexed 15 years ago08:55
sarna o/08:58
lizmat I only see a reaction from said person in 200809:00
jameslenz joined09:02
sarna tyil: the link to GTK::Simple on your application programming tutorial 404s :)09:03
jameslenz left09:06
El_Che lizmat: I understand someone not agreeing with you, ar finding your argument false, but there is no discussion there. He's just venting/trolling09:11
xq thanks for that link09:12
lizmat El_Che: yeah, unfortunately :-(09:14
mscha joined09:17
mscha p6: my $t = time; (1..25).race.map({ sleep 0.1 }); say time - $t;09:18
camelia rakudo-moar dd0cea31a: OUTPUT: «3␤»09:18
mscha p6: my $t = now; (1..25).race.map({ sleep 0.1 }); say now - $t;09:18
camelia rakudo-moar dd0cea31a: OUTPUT: «2.55431795␤»09:18
mscha Do race/hyper actually do something yet? It seems not...09:18
pmurias left09:19
pmurias joined09:20
moritz m: my $t = time; (1..25).map({ sleep 0.1 }); say time - $t;09:20
camelia rakudo-moar dd0cea31a: OUTPUT: «2␤»09:20
moritz m: my $t = time; (1..25).race(jobs => 8).map({ sleep 0.1 }); say time - $t;09:20
camelia rakudo-moar dd0cea31a: OUTPUT: «2␤»09:20
jnthn p6: my $t = now; (1..25).race(:batch(1)).map({ sleep 0.1 }); say now - $t;09:21
camelia rakudo-moar dd0cea31a: OUTPUT: «0.73301941␤»09:21
jnthn The default batch size is 64 items09:21
mscha Ah, that explains it, thanks jnthn. :-)09:21
moritz and you can't win chosing a smaller default, because then fast-ish maps become really slow due to the overhead09:21
mscha m: my $t = now; (^128).hyper.map({ sleep 0.01 }); say now - $t;09:23
camelia rakudo-moar dd0cea31a: OUTPUT: «0.73068783␤»09:23
mscha m: my $t = now; (^128).map({ sleep 0.01 }); say now - $t;09:23
camelia rakudo-moar dd0cea31a: OUTPUT: «1.32154434␤»09:23
mscha yup. :-)09:23
sena_kun joined09:23
tyil sarna: I'll update it right away, thanks for notifying09:23
sarna tyil: no prob :) just letting you know09:24
tyil: I've tried sending your tutorial to a friend and your website was offline yesterday :D09:24
I'm glad it's back online, it's my cheatscheet for new projects09:24
tyil hmm, I didn't do much yesterday, other than the rss/atom feed09:24
how's the more lightweight design? :.09:25
:p09:25
sarna yesterday evening, I was getting nginx errors09:25
I like it :)09:25
tyil if you have any ideas for tutorials, let me know09:26
or hope that TPF approves my grant, then you'll get a whole book09:26
sarna woo!09:26
please do http://norvig.com/lispy.html but better09:26
tyil heh09:27
that could be interesting09:27
I'll read through that and see if I can redo it in a timely manner in Perl 6 :>09:27
sarna I've tried :) it's pretty straightforward, but I ran out of steam09:28
I think it'd be fun to implement some additional features09:29
"look how easy it is in perl6!"09:29
tyil everything is easy to Perl 6 from my (limited) experience09:30
and if it's not easy, I complain here09:30
xtreak joined09:31
sarna "make the easy things easy and the hard things possible" :D09:32
mscha m: my $t = now; say +(^10_000).grep(&is-prime); say now - $t;09:33
camelia rakudo-moar dd0cea31a: OUTPUT: «1229␤1.5468864␤»09:33
mscha m: my $t = now; say +(^10_000).race.grep(&is-prime); say now - $t;09:33
camelia rakudo-moar dd0cea31a: OUTPUT: «1229␤0.6871809␤»09:33
moritz m: my $t = now; say +(^10_000).race(:batch(500)).grep(&is-prime); say now - $t09:37
camelia rakudo-moar dd0cea31a: OUTPUT: «1229␤0.64363365␤»09:37
moritz m: my $t = now; say +(^10_000).race(:batch(500), :jobs(8)).grep(&is-prime); say now - $t09:38
camelia rakudo-moar dd0cea31a: OUTPUT: «1229␤0.55715299␤»09:38
sarna does perl6 have a preference about bracing style?09:43
lizmat TIMTOWTDI :-)09:47
Different Perl 6 books use different styles09:47
so I'd so, no, perl6 does not have a preference09:47
except for syntactical correctness09:48
which means in general, you *must* have whitespace before the opening {09:48
sarna ha! great :D09:48
tbrowder_ hi, #perl609:51
zakharyas joined09:52
tyil hi09:53
sarna: even me and my gf have vastly different ways of writing our perl 6 programs09:53
just write it in a way that makes you work best with it09:54
when you're in a team, you might want to have some guidelines, to make it look consistent across the project, though09:54
sarna tyil: yeah, consistency is important09:54
tbrowder_ my doc PR #2177 needs a look (and votes welcome) before a possible merge. it implements the Phase 2 doc Language listing reorg discussed in the doc wiki. AlexDaniel is not excited about it but i am. please review if you can and ask questions if something doesn’t make sense.09:55
tyil: hi09:55
tyil hi :>09:56
tbrowder_ i am making progress on the proper handling of the =defn block09:56
tyil nice :>09:57
do you think it will be able to get into this month's rakudo star?09:57
tbrowder_ the grammar around it is somewhat ugly09:57
when is the star release cutoff?09:58
tyil AlexDaniel: would you know when the exact date is ^09:59
AlexDaniel most likely won't make it into the release10:00
thing is that jnthn++ did a lot of nice work for perf improvements10:00
but we saw some bugs appear because of that10:01
see this ticket: https://github.com/rakudo/rakudo/issues/204710:01
now, we haven't fully decided *yet*, but it looks like the upcoming release will not include these changes10:01
so that we can test them a bit more in the upcoming month10:02
and that means that the release will be cut from a commit few weeks ago10:02
tyil ah10:02
tbrowder_: in that case, no hurry :p10:02
AlexDaniel + some manually cherry-picked changes, if we find anything really important10:02
Geth ¦ doc: 320b82aeaf | (Elizabeth Mattijsen)++ | doc/Language/list.pod610:03
¦ doc: Rwerite the "Testing for Elements" section 10:03
¦ doc:10:03
¦ doc: It assumed that you have to convert something to a Set before being able10:03
¦ doc: to use a set operator on it. This is not true: set operators will take10:03
synopsebot Link: https://doc.perl6.org/language/list10:03
Geth ¦ doc: care of conversion when needed. In the shown example, it was actually10:03
¦ doc: detrimental to first convert to a Set, because the (elem) operator can10:03
¦ doc: short-circuit whenever it finds a match, so it won't have to examine all10:03
¦ doc: <…commit message has 6 more lines…> 10:03
¦ doc: review: https://github.com/perl6/doc/commit/320b82aeaf10:03
sarna I'd just like to say I'm thankful for all the work on Rakudo and stuff o/10:04
AlexDaniel samcv: btw we'll have to discuss this tomorrow-ish ↑10:05
samcv ok, now (maybe) works for me if it works for you10:07
Geth ¦ doc: ea2a05b8d8 | (Elizabeth Mattijsen)++ | doc/Language/list.pod610:08
¦ doc: Duh, it's using the infix === , not infix =:= 10:08
¦ doc: review: https://github.com/perl6/doc/commit/ea2a05b8d810:08
synopsebot Link: https://doc.perl6.org/language/list10:08
robertle joined10:13
AlexDaniel samcv: well, I think jnthn also wanted to look at current blockers and stuff10:13
samcv ah ok10:13
AlexDaniel previous discussion: http://colabti.org/irclogger/irclogger_log/moarvm?date=2018-07-16#l32810:14
mscha left10:14
wamba1 joined10:21
wamba left10:23
Ulti < lizmat> Different Perl 6 books use different styles <--- sure and at least one of those was universally disliked by anyone who was vociferous about something that pointless, Allman or K&R style pick one is not the worst advice...10:24
tyil sarna: are you going to the Perl Conference or Perl workshops?10:24
Ulti: which style was universally disliked? :o10:25
lizmat Ulti: I'm well aware of those feelings10:26
Ulti the easiest is to just look at what people are using in the ecosystem if you genuinely care about picking one10:26
sarna tyil: I'm currently in Denmark, haven't heard about any10:26
tyil ah10:26
there's a conference in Glasgow next month, if that's doable for you10:27
I don't know about other Perl 6 events that would be closer to you, sadly10:27
Ulti tyil: I believe it was a variant of Ratliff10:28
https://en.wikipedia.org/wiki/Indentation_style#Ratliff_style10:28
tyil oh10:28
sarna tyil: unfortunately no, I'm a poor uni student :D10:28
Ulti this sort of stuff is kind of weird it feels like psychology could probably measure which is actually "the best"10:28
tyil I've seen people use it, but I can admit I'm not too fond of that style either, Ulti :p10:28
sarna maybe I'll try to convince my colleagues to use perl6 and we'll organise something, who knows10:28
tyil sarna: I recently lost my job, so it's struggling for me as well to find the means to attend, but I do want to go there10:29
Ulti I think it only matters if you are used to a given style to the point you rapidly parse it visually10:29
in many ways Ratliff would make switching from P6 to Python simpler if you got used to it10:29
which is a definite bonus I can see and fits the concept of the braces exist to demark the end of a block, I can see the logic of it... I just cant quickly look at it is the only problem which is personal to me10:30
Geth ¦ doc: 5e73790ee6 | (Elizabeth Mattijsen)++ | doc/Language/operators.pod610:31
¦ doc: Elaborate a bit about === 10:31
¦ doc:10:31
¦ doc: - show that it disregards containers10:31
¦ doc: - put in link to ValueObjAt to create custom .WHICH methods10:31
synopsebot Link: https://doc.perl6.org/language/operators10:31
Geth ¦ doc: review: https://github.com/perl6/doc/commit/5e73790ee610:31
tyil Ulti: I'd guess using a K&R-like style would work best, since that's what seems to be the standard used by many other books10:32
but in the end, it all depends on what an individual likes best10:32
it's impossible to make a book (or other article) that caters to everyone10:32
Ulti tyil: sure but even then the real zealots start to get into if you cuddle an } else {10:33
this is the sort of stuff thats seriously down in the weeds of importance10:33
I think I probably have an inconsistent use of cuddling too, if its a single if and else I will cuddle, if its a chain of elsif I will keep them all uncuddled for clarity and easy cut and paste movement10:36
which if you think about it is a good argument for never having cuddles10:37
tyil I tend to not use an elsif when possible10:37
given/when looks cleaner imo when you have many cases10:37
lizmat tyil: but you can cuddle when's just as much10:38
tyil w-why10:38
Ulti whens you cuddle10:38
lizmat not saying that you should10:38
tyil I cuddle my } else {, if I have one10:38
but generally I try to avoid those altogether10:38
lizmat } when { :-)10:39
tyil no!10:39
lizmat :)10:40
Ulti the worst would be cuddling your phasers10:40
lizmat .oO( don't cross the streams! )10:41
Ulti this is really why I think programming at the developer level should be much more symbolic rather than about crafting text files10:41
there's no reason you couldn't render Perl 6 exactly like Python style white space and negotiate that with saving to file10:42
then all these really stupid arguments go away10:42
tyil wouldn't it be possible to use a slang to basically apply python style to a perl 6 program10:44
Ulti you would probably have to still allow braces for blocks otherwise you will lose a lot of expressivity10:44
psychoslave joined10:45
Ulti but yeah Tux has his own Slang to just allow a single white space difference >:D10:45
https://github.com/FROGGS/p6-Slang-Tuxic10:46
lizmat Tux is very specific: he actually proxies HTML pages to filter out fonts he doesn't like :-)10:46
Ulti you can probably reuse the code in the Rakudo grammar for indent of here docs too10:47
sarna is there a syntax for multiple traits? like 'is (required, rw)' instead of 'is required is rw'10:48
Ulti then implement all of the Python standard library.... and you have Python 4.010:48
cognominal joined10:48
jnthn sarna: No10:49
lizmat sarna: no there isn't, afaik10:49
sarna :(10:49
jnthn "is" is a very short word :)10:49
m: say 'is (required, rw)'.chars10:49
camelia rakudo-moar dd0cea31a: OUTPUT: «17␤»10:49
sarna "repetition is bad" got burned into my brain, sorry10:49
jnthn m: say 'is required is rw'.chars10:49
camelia rakudo-moar dd0cea31a: OUTPUT: «17␤»10:49
jnthn It's not even shorter! :P10:49
lizmat sarna: also, if they get long, I tend to make it a multi-line, with " is" at the start of each line10:50
tyil jnthn: but what if you could do is <required rw>10:50
that will save you a character10:50
jnthn But traits aren't strings10:50
tyil not yet10:50
sarna lizmat: yep, that's what I do as well10:50
tyil that could be changed10:50
jnthn lol10:50
no10:50
Eww :)10:50
Ulti ^ needs more o's10:50
jnthn In the early says of Perl 6 implementation, on Parrot, various things - including types - we represented as strings. That was "fun"10:51
*early days10:51
tyil if everything is a string10:52
you'll have no conversion issues10:52
jnthn hah :)10:52
Ulti "fun" <--- punned air quotes as a string?10:53
Geth ¦ modules.perl6.org: 71d4c79656 | (Zoffix Znet)++ (committed using GitHub Web editor) | lib/ModulesPerl6/DbBuilder/Dist/PostProcessor/p30METAChecker.pm10:59
¦ modules.perl6.org: Harden metachecker against undefs 10:59
¦ modules.perl6.org:10:59
¦ modules.perl6.org: Avoids immediate error causing10:59
¦ modules.perl6.org: https://github.com/perl6/modules.perl6.org/issues/10810:59
¦ modules.perl6.org: review: https://github.com/perl6/modules.perl6.org/commit/71d4c7965610:59
stmuk joined10:59
jameslenz joined11:02
dakkar joined11:04
jameslenz left11:06
sarna how to say an array has to have, for example, seven ints? arr[7] and arr[Int], but how to connect those11:09
timotimo i think you want "my Int @arr[7]"11:11
sarna got it! my Int @arr[7] or my @arr[7] of int11:11
yeah :D11:11
Ven` left11:11
timotimo shaped arrays are a little bit wonky in some respects, but really only if they have more than one dimension i think11:11
sarna `@arr[6;6] of Int` works just as well as his one-dimensional brother11:13
lizmat timotimo: I think I covered dimensions 1..3 pretty well, above that, it gets a bit wonky indeed :-)11:17
timotimo unless you hit "partially dimensioned views NYI"11:18
lizmat ah, yes11:18
Geth ¦ doc: 208213bdb1 | (Elizabeth Mattijsen)++ | 2 files11:20
¦ doc: Document ValueObjAt 11:20
¦ doc: review: https://github.com/perl6/doc/commit/208213bdb111:20
¦ doc: a5899670b4 | (Elizabeth Mattijsen)++ | doc/Type/List.pod611:27
¦ doc: Document my int @a; @a.sum(:wrap) 11:27
¦ doc: review: https://github.com/perl6/doc/commit/a5899670b411:27
synopsebot Link: https://doc.perl6.org/type/List11:27
Geth ¦ doc: e57e45852c | (Elizabeth Mattijsen)++ | doc/Type/ValueObjAt.pod611:30
¦ doc: Adhere to the way we document actual output 11:30
¦ doc: review: https://github.com/perl6/doc/commit/e57e45852c11:30
synopsebot Link: https://doc.perl6.org/type/ValueObjAt11:30
pmurias Ulti: re developement being more symbolic, making people switch editors is a gigantic barrier to programming language adoption11:52
sarna hey, how to access a private array from a class? self.arr doesn't work, even from inside the class11:55
oh well, it's just `@!arr`, weird11:56
lizmat sarna: yeah, attributes inside a class can always be accessed with sigil ~ ! ~ name11:57
the @ sigil just means it needs to get something Positional:11:58
m: my @a := "foo" but Positional; dd @a; dd @a.WHAT11:58
camelia rakudo-moar 20b1756a7: OUTPUT: «"foo"␤Str+{Positional}␤»11:58
lizmat m: my @a := "foo"11:59
camelia rakudo-moar 20b1756a7: OUTPUT: «Type check failed in binding; expected Positional but got Str ("foo")␤ in block <unit> at <tmp> line 1␤␤»11:59
Ven` joined12:00
kanbas hey, is there any way to see if coercion to an enum failed? Currently I have enum Stuff( foo => 25, bar => 30 ), and I want to return True for e.g. Stuff(25) and false for e.g. Stuff(40)12:06
Stuff(40) is still of type Stuff and Mu, so I can't check with ~~ Stuff or ~~ Mu, and .HOW is also EnumHOW12:07
lizmat kanbas: enums are compile time, and I assume "40" is just an example of a runtime value, right ?12:08
markoong joined12:08
kanbas lizmat: yeah - I need to take some values and check if they would be valid as enums, but wondered if there was a better way than keeping a map of the Enum collection and looking the value up in it12:09
lizmat so you want to map numeric values to True/False ?12:09
kanbas Nah, I need to map keywords to numeric values and detect if an incoming Int would be a valid keyword12:09
i'm trying to write a telnet state machine atm, and using enums for the control codes12:10
lizmat so in fact you're mapping Ints to strings ?12:13
(or enums as that may be)12:13
kanbas yeah, though the current implementation is mapping strings to ints12:14
ideally i just want to be able to either lookup the string via the int, or the int via the string12:15
eliasr joined12:15
kanbas (well, it could do with doing both rather than one or the other)12:15
lizmat perhaps just 2 Maps would be best:12:17
m: my %f is Map = foo => 25, bar => 42; my %g is Map = %f.invert; dd %f, %g12:17
camelia rakudo-moar 20b1756a7: OUTPUT: «Map.new((:bar(42),:foo(25)))␤Map.new(("25" => "foo","42" => "bar"))␤»12:17
lizmat first one is by name, second one by integer value ?12:18
kanbas TIL Map.invert. Yeah that looks like it'd be perfect tbf. Thanks12:18
sarna left12:20
Geth ¦ whateverable: 465332e8e8 | (Aleks-Daniel Jakimenko-Aleksejev)++ | bin/Releasable.p612:25
¦ whateverable: Link to rakudo wiki 12:25
¦ whateverable: review: https://github.com/perl6/whateverable/commit/465332e8e812:25
¦ whateverable: aeed5c233e | (Aleks-Daniel Jakimenko-Aleksejev)++ | config-default.json12:25
¦ whateverable: Spam every 20 hours by default 12:25
¦ whateverable:12:25
¦ whateverable: So that it shifts a bit every day to cover all timezones.12:25
¦ whateverable: review: https://github.com/perl6/whateverable/commit/aeed5c233e12:26
tobs m: enum Stuff(foo => 25, bar => 30); say so Stuff(25):exists; say so Stuff(50):exists12:26
camelia rakudo-moar 20b1756a7: OUTPUT: «True␤False␤»12:26
releasable6 joined12:27
ChanServ set mode: +v12:27
lizmat tobs: TIL that works :-)12:34
m: enum Stuff(foo => 25, bar => 30); say Stuff(25):exists; say Stuff(50):exists12:35
camelia rakudo-moar b6cc7168a: OUTPUT: «foo␤(Stuff)␤»12:35
lizmat hmmm... that feels wrong12:35
m: enum Stuff(foo => 25, bar => 30); say Stuff(25); say Stuff(50)12:35
camelia rakudo-moar b6cc7168a: OUTPUT: «foo␤(Stuff)␤»12:35
sena_kun left12:35
lizmat the :exists isn't necessary at all12:35
sena_kun joined12:35
timotimo m: enum Stuff(foo => 25); say Stuff(50):lolwhat12:35
camelia rakudo-moar b6cc7168a: OUTPUT: «(Stuff)␤»12:35
lizmat TIL that doesn't work, at least not for the reason you think12:35
timotimo it just ignores it12:36
lizmat yup12:36
however, you could use that with "with"12:36
timotimo yeah12:36
lizmat m: enum Stuff(foo => 25, bar => 30); with Stuff(25) { .say }; with Stuff(50 { die } # doesn't die12:37
camelia rakudo-moar b6cc7168a: OUTPUT: «=== SORRY!=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' (corresponding starter was at line 1)␤at <tmp>:1␤------> ; with Stuff(25) { .say }; with Stuff(50 { die } # doesn't die…» 12:37
kanbas tobs: oh neat, ty also12:37
lizmat m: enum Stuff(foo => 25, bar => 30); with Stuff(25) { .say }; with Stuff(50) { die } # doesn't die12:37
camelia rakudo-moar b6cc7168a: OUTPUT: «foo␤»12:37
lizmat m: enum Stuff(foo => 25, bar => 30); with Stuff(25) { .say }; without Stuff(50) { say "doesn't exist" }12:38
camelia rakudo-moar b6cc7168a: OUTPUT: «foo␤doesn't exist␤»12:38
tobs m: enum Stuff(foo => 25, bar => 30); say so Stuff(25); say so Stuff(50)12:39
camelia rakudo-moar b6cc7168a: OUTPUT: «True␤False␤»12:39
tobs I see, lizmat++12:39
AlexDaniel FWIW we're currently at 50 tickets with testneeded tag12:40
some of them are easy, others maybe not12:40
but if anyone is looking for a way to help, perhaps that's a good start :)12:40
https://github.com/rakudo/rakudo/issues?q=is%3Aissue+is%3Aopen+label%3Atestneeded12:41
and https://fail.rakudo.party/t/TESTNEEDED12:41
see also `easy to resolve` tickets: https://github.com/rakudo/rakudo/issues?q=is%3Aissue+is%3Aopen+label%3A%22easy+to+resolve%2212:41
xtreak left12:43
Geth ¦ doc: 4aaa191664 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/IO/Handle.pod612:43
¦ doc: Fix incorrect plurification 12:43
¦ doc: review: https://github.com/perl6/doc/commit/4aaa19166412:43
synopsebot Link: https://doc.perl6.org/type/IO::Handle12:43
Geth ¦ marketing: 59df463292 | (Zoffix Znet)++ | 14 files12:55
¦ marketing: Add "Simple Handle" 6.d Teaser Flyer / ID 1531801752 12:55
¦ marketing: review: https://github.com/perl6/marketing/commit/59df46329212:55
buggable joined12:56
ChanServ set mode: +v12:56
Geth ¦ doc: d6b162b2ff | (Elizabeth Mattijsen)++ | doc/Type/Attribute.pod612:59
¦ doc: Document that "is required($reason)" is also possible 12:59
¦ doc: review: https://github.com/perl6/doc/commit/d6b162b2ff12:59
synopsebot Link: https://doc.perl6.org/type/Attribute12:59
jameslenz joined13:02
Ven` left13:03
eythian joined13:04
eythian left13:04
eythian joined13:04
jameslenz left13:07
Ven` joined13:09
brrt joined13:16
skids joined13:25
molaf joined13:41
tbrowder_ joined13:46
HaraldJoerg1 joined13:47
uzl joined13:55
fake_space_whale joined14:05
uzl Hello to everybody!14:06
timotimo greetings uzl14:07
jkramer Is there something in P6 that allows me to assign some value to nothing, like this:14:10
m: my @foo = <foo bar baz>; my ($a, _, $c) = @foo14:10
camelia rakudo-moar 7a7e5e96f: OUTPUT: «=== SORRY!=== Error while compiling <tmp>␤Invalid typename '_' in parameter declaration.␤at <tmp>:1␤------> my @foo = <foo bar baz>; my ($a, _ , $c) = @foo ␤»14:10
AlexDaniel m: my @foo = <foo bar baz>; my ($a, $, $c) = @foo14:10
camelia rakudo-moar 7a7e5e96f: ( no output )14:10
jkramer Oh true. But that's an actual assignment, isn't that costly?14:11
AlexDaniel if it is costly, then file a ticket. Can be optimized away I'm pretty sure14:11
zakharyas left14:11
jkramer I mean $ is an actual variable, even though it's value is lost afterwards14:11
zakharyas joined14:11
uzl greetings timotimo!14:12
timotimo could be optimized out, jkramer. maybe it isn't yet, though14:12
uzl To anyone interested: I've translated Think Perl 6 to Spanish. As of now, I'm going over the translation and fixing typos (at least the one I can spot) and doing minor corrections.14:14
Nonetheless, I think it'd benefit from some proofreading.14:14
timotimo RT #12482214:14
synopsebot RT#124822 [new] : https://rt.perl.org/Ticket/Display.html?id=124822 [CONC] S17-supply/stable.t line:14 reason: doesn't work or can't test 14:14
AlexDaniel .tell jmerelo http://colabti.org/irclogger/irclogger_log/perl6?date=2018-07-17#l63114:14
yoleaux AlexDaniel: I'll pass your message to jmerelo.14:14
timotimo huh.14:14
AlexDaniel weekly: http://colabti.org/irclogger/irclogger_log/perl6?date=2018-07-17#l63114:15
notable6 AlexDaniel, Noted!14:15
uzl Gitlab repo: https://gitlab.com/uzluisf/piensaperl614:15
Book (simple) page: https://uzluisf.gitlab.io/piensaperl6/14:15
El_Che Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License14:15
zakharyas left14:15
El_Che nice14:15
AlexDaniel is it? Kinda non-free if you can't sell14:16
I mean in terms of available resources for perl6 that's indeed not bad :)14:16
El_Che it's not software, o'reilly will not get beter version when somene adapt it and sells it14:17
AlexDaniel timotimo, jkramer: I think it's not optimized currently14:17
uzl El_Che: It has the same license as Think Perl 6.14:18
El_Che uzl: yes, that's the license I was referring to14:18
uzl But I think any derived work from it must have the same license?14:19
El_Che: Oh, got it!14:19
El_Che uzl: https://creativecommons.org/licenses/by-nc-sa/3.0/14:19
ShareAlike — If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.14:19
brrt left14:19
uzl My intended purpose ;)14:22
El_Che uzl++14:22
uzl AlexDaniel: No commercial plan behind it!14:29
El_Che uzl: as long as oreilly does not public the book in Spanish, you have a captive market :)14:30
uzl El_Che: just a community effort for Perl 6 to reach far and beyond...14:33
MilkmanDan joined14:34
El_Che good, very useful14:34
uzl Now I'm wondering if using one of those printing services (lulu, etc) fall under commercial. I guess it's not since all the money goes into printing it.14:37
jkramer Hmpf, in some regards P6 is really painfully slow, to a point where it just can't be used for real-life applications. :(14:39
https://bpaste.net/raw/a14abeaf6bcc - this is running for 8 minutes already for a ~130M text file.14:39
timotimo jkramer: i believe .tail(*-2) is a whole lot faster than .[2..*]14:40
nemo joined14:40
jkramer And using 2G of RAM :D14:41
Thanks, I'll try14:41
nemo been a looong time since I've been here. how do I ask the bot a question again?14:41
I mean. a snippet14:41
camelia that is14:41
timotimo just m: the code14:41
jkramer Is .head also faster than .[0] maybe?14:41
nemo m: 729**⅓14:41
camelia rakudo-moar 7a7e5e96f: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "**" in expression "729**⅓" in sink context (line 1)␤»14:41
nemo O_o14:41
m: print 729**⅓14:42
camelia rakudo-moar 7a7e5e96f: OUTPUT: «8.999999999999998»14:42
timotimo oh, you have to explicitly "say" things14:42
or print, yes14:42
nemo hm14:42
timotimo jkramer: should be14:42
nemo ok. so. if I ask our haskell bot pow(729,1/3)14:42
it returns 9 😝14:42
so does calculator14:42
what is nqp/camelia/rakudo doing?14:42
gnome-calculator etc14:42
timotimo floating point calculations14:42
nemo well obv 😉14:43
timotimo rakudo just outputs it precisely14:43
Zoffix joined14:43
nemo hm14:43
timotimo can you check if the result == 9 or not?14:43
nemo timotimo: so you think the others are just rounding their fp eh14:43
Zoffix jkramer: what's some sample data you're feeding it with?14:43
lizmat m: my @a = ^10; @a[0] for ^10000; say now - INIT now14:43
camelia rakudo-moar 7a7e5e96f: OUTPUT: «0.00898764␤»14:43
Zoffix m: say 729 ** ⅓14:43
camelia rakudo-moar 7a7e5e96f: OUTPUT: «8.999999999999998␤»14:43
jkramer Hmm if I use .head and .tail it complains about the Seq already being used up. No I don't know what's faster/slowing, using .[0] instead of .head or .cache on the Seq :)14:44
nemo our haskell bot says that 729**⅓ ==914:44
timotimo that's good14:44
nemo well. pow(729,1/3)==914:44
lizmat m: my @a = ^10; @a.head for ^10000; say now - INIT now14:44
camelia rakudo-moar 7a7e5e96f: OUTPUT: «0.03005977␤»14:44
lizmat that is weird14:44
Zoffix nemo: what about (-125)**⅓ ?14:44
timotimo oh, it's muhc slower?14:44
jkramer Zoffix: Just plain text, about 1-10 words per line, plus a line number in the beginning and a separator (the element that's skipped)14:44
nemo Zoffix: -514:45
m: say -125**⅓14:45
camelia rakudo-moar 7a7e5e96f: OUTPUT: «-4.999999999999999␤»14:45
nemo m: say -125**⅓==-514:45
camelia rakudo-moar 7a7e5e96f: OUTPUT: «False␤»14:45
lizmat m: my @a = ^10; for ^1000000 { my $a = @a[0]; say now - INIT now14:45
camelia rakudo-moar 7a7e5e96f: OUTPUT: «=== SORRY!=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 000 { my $a = @a[0]; say now - INIT now <EOL> ␤ expecting any of:␤ postfix␤ statement end␤ statement modifier␤ sta…»14:45
lizmat m: my @a = ^10; for ^1000000 { my $a = @a[0] }; say now - INIT now14:45
camelia rakudo-moar 7a7e5e96f: OUTPUT: «0.3849081␤»14:45
lizmat m: my @a = ^10; for ^1000000 { my $a = @a.head }; say now - INIT now14:46
camelia rakudo-moar 7a7e5e96f: OUTPUT: «1.4415858␤»14:46
lizmat jkramer: when done on an array, [0] is definitely faster14:46
Zoffix nemo: -125**⅓ is no the same as (-125)**⅓14:46
m: say (-125)**⅓14:46
e: say (-125)**⅓14:46
lag :(14:46
camelia rakudo-moar 7a7e5e96f: OUTPUT: «NaN␤»14:46
timotimo but .words is a Seq14:46
evalable6 Zoffix, rakudo-moar 7a7e5e96f: OUTPUT: «NaN␤»14:46
Zoffix jkramer: well, what's the actual data?14:47
jkramer lizmat: But is it still worth it with the overhead of turning Seq into an Array? :)14:47
lizmat no, probably not :-)14:47
jkramer Zoffix: https://filebin.net/za13pgx296tpfpo314:47
timotimo cool14:47
lizmat m: my $a = "foo " x 1000; $a.words[0] for ^100000; say now - INIT now14:48
camelia rakudo-moar 7a7e5e96f: OUTPUT: «0.5005249␤»14:48
lizmat m: my $a = "foo " x 1000; $a.words.head for ^100000; say now - INIT now14:48
camelia rakudo-moar 7a7e5e96f: OUTPUT: «0.26912142␤»14:48
nemo Zoffix: heh. true. guess I need to wait to see what camelia's response is though14:48
Zoffix nemo: the response is a NaN14:49
You need to force explicit complex to do powers with negative numbers, even if the power is an odd power14:49
e: say (-125+0i)**⅓14:49
evalable6 Zoffix, rakudo-moar 7a7e5e96f: OUTPUT: «2.500000000000001+4.330127018922194i␤»14:49
Zoffix huh14:50
nemo why would it be NAN?14:50
Zoffix: -5*-5*-5 = -12514:50
oh14:50
weird14:50
required even for odd eh14:50
Zoffix e: say (<125+1i>)**⅓14:51
evalable6 Zoffix, rakudo-moar 7a7e5e96f: OUTPUT: «5.000035554712788+0.013333175313586194i␤»14:51
Zoffix weird14:51
timotimo jkramer: it doesn't seem like it can even get past the first line :)14:51
ah, the first thing it does is assign to spot number 208758414:52
Zoffix jkramer: are you sure your logic is correct? Starting with the first 6 lines of the file I already get an array with 2087584 elements in it14:52
jkramer: what's this program meant to do?14:53
timotimo it's supposed to put the words after the # in the nth spot, where n is the first field14:53
i forgot to put input.txt into stdin m)14:54
that's why i didn't get any progress, it was waiting for me to type something in14:54
i'm smart14:54
Zoffix That just describes what it's doing…14:55
HaraldJoerg1HaraldJoerg14:55
timotimo by outputting the +@line at the end, you could also just put all the numbers into a set14:56
jkramer Zoffix: It's a coding challenge. :) The number is the line number (the file is supposed to be a "shuffled" book), so I'm trying to assign the lines to the correct spot in the array instead of reading it all and then sorting by line number to save some time.14:56
timotimo but i don't think that's the goal, just a benchmark14:56
ruoso joined14:57
jkramer The code I posted above is just the beginning, there's some more stuff to do with the input, once I manage to read it :)14:57
timotimo we spend a whole lot of time GC-marking the huge array14:57
Zoffix jkramer: if it's a coding challenge, perhaps it's part of the challenge that you need to come up with a fast algo and has nothing to do with "P6 is really painfully slow, to a point where it just can't be used for real-life applications"14:58
nemo Zoffix: BTW your NaN thing applies to javascript at least14:58
Zoffix: no idea how to even include a negative component in javascript ☺14:59
er imaginary component14:59
Zoffix nemo: it's posible the NaN thing comes from IEEE standard14:59
jkramer Zoffix: Sorry if that came across as a complaint or bashing, but reading a big file is not a very difficult task and the way I'm doing it is already the fastest way (alternative would be to read all lines, then sort it).14:59
timotimo honestly, it'd be faster to store byte offsets into the file in a native integer array ;)15:00
fake_space_whale have you considered using a hash instead of an array? (I don't know if it would be faster or not)15:00
since that way you wouldn't need to claim as big chunks of memory15:00
at first at least15:01
jameslenz joined15:02
Zoffix jkramer: except the reading of the file takes just 11 seconds15:03
"can't be used for real-life applications" is a pretty bold claim15:03
7 seconds if you .lines a .slurp15:03
timotimo fake_space_whale: it would actually be faster since it won't have to parse the numbers into an integer15:04
but i'm not actually sure how much time it spends parsing, i just saw that it does15:04
jkramer Zoffix: But that's not what I said or meant. I can't use it for this specific task which I consider a "real-life" scenario.15:05
pmurias left15:06
scovit jkramer: this is much faster for me, https://gist.github.com/scovit/f162349b4ac93bab757c7b7bd693afac15:06
buggable New CPAN upload: Image-Libexif-0.0.2.tar.gz by FRITH http://modules.perl6.org/dist/Image::Libexif:cpan:FRITH15:06
pmurias joined15:06
jameslenz left15:07
jkramer scovit: Thanks, I'll try that15:07
scovit dunno if it helps.. I often resort to perl5 for these kind of works15:07
nemo Zoffix: I bet Haskell is doing exact cube root while perl6 and javascript are doing floating point approximations15:08
Zoffix nemo: what about (-1953125)**(1/9) does that give -5 in Haskel?15:09
jkramer scovit: I already implemented it in perl5, I justed wanted to do in Perl6 as well :)15:09
nemo Zoffix: it does yes15:10
Zoffix: and ofc 0.33333333333333333333333333333333333333333333333333!=(1/3) ☺15:10
scovit jkramer point is that perl6 is encoding all the strings in unicode15:10
nemo Zoffix: which is true in javascript15:10
scovit even if it is not, it still carries all the logic15:10
nemo m: say 0.333333333333333333333333333333333333333333333333333==⅓15:11
camelia rakudo-moar 7a7e5e96f: OUTPUT: «False␤»15:11
nemo interesting!15:11
well score one for camelia15:11
Zoffix m: say 0.33333333333333333333333333333333333333333333333333 ≠ ⅓15:11
camelia rakudo-moar 7a7e5e96f: OUTPUT: «True␤»15:11
Zoffix nemo: yeah, because in P6 that's a Rational number, but in JS it's a float, innit?15:11
double15:11
pmurias left15:11
Zoffix not-rational15:11
nemo Zoffix: oh. ok. well that would explain why Math.pow(-125,1/3) fails in javascript but not perl6 then15:12
Zoffix Well, it does "fail". It gives you NaN15:12
jkramer scovit: Yours took about 2.5min on my machine, much better :)15:12
nemo Zoffix: but... odd that it does = -5 in perl6... if it is doing rationals15:12
*doesn't*15:12
m: say (-125)**⅓15:12
camelia rakudo-moar 7a7e5e96f: OUTPUT: «NaN␤»15:12
Zoffix nemo: the power op is just C's pow call15:12
[Coke] Folks - perlfoundation.org updated their website; please feel free to hit me up with any issues you find before it gets publicized more. Already known: YAPC not TPC, confusing YAPC::NA and YAPC north america links, donate button. hit me up with anything else.15:12
nemo oh oups. I thought that worked15:12
doh15:12
Zoffix I think15:13
nemo m: say ⅓==1/315:13
camelia rakudo-moar 7a7e5e96f: OUTPUT: «True␤»15:13
nemo oh good15:13
Zoffix s: &infix:<**>, \(-125, ⅓)15:13
SourceBaby Zoffix, Sauce is at https://github.com/rakudo/rakudo/blob/7a7e5e96f/src/core/Real.pm6#L14715:13
scovit jkramer happy it helps!15:13
Zoffix hmm15:14
m: say (-125.0)**⅓15:14
camelia rakudo-moar 7a7e5e96f: OUTPUT: «NaN␤»15:14
Zoffix s: &infix:<**>, \(-125.0, ⅓)15:14
SourceBaby Zoffix, Sauce is at https://github.com/rakudo/rakudo/blob/7a7e5e96f/src/core/Real.pm6#L14715:14
Zoffix oh well15:15
uzl left15:16
buggable New CPAN upload: Desktop-Notify-0.3.4.tar.gz by FRITH http://modules.perl6.org/dist/Desktop::Notify:cpan:FRITH15:16
zakharyas joined15:17
Zoffix having trouble profiling jkramer's program15:18
Got down to 400 entries and yet the profile is so huge, it kills my browser :/15:18
benjikun2 joined15:19
Zoffix At 285 entries it's empty :|15:19
And at 145 entries, it's mostly red :/15:20
pmurias joined15:22
psychoslave left15:24
timotimo i wonder if the call graph gets bloated somehow15:24
Zoffix timotimo: looks like it. I managed to sit long enough to load a profile of doing a run over 365-line file. The call graph looks like a cardiogram lol: https://temp.perl6.party/out.html15:25
psychoslave joined15:26
Zoffix https://temp.perl6.party/z.png15:26
troys joined15:26
timotimo haha15:27
that is funny15:27
in my run it's got 2_704_613 nodes in the call graph15:27
Zoffix "There was no global deoptimization triggered by the profiled code. There was one global deoptimization triggered by the profiled code. There were 0 global deoptimization triggered by the profiled code."15:27
lol wat? 0 and 1 and "no"?15:28
timotimo it's the bug that happens in some circumstances due to inlining15:28
zakharyas1 joined15:28
timotimo turn inlining off and the profile file should become tiny15:28
zakharyas left15:28
Zoffix timotimo: is there something wrong with the code that it made the callgraph look like that or is that just a deficiency in the profiler itself?15:29
timotimo it's a deficiency in the profiler part that lives in moarvm15:29
Zoffix ok15:29
heh, it tells me <unit> took 2398076729582145.5ms to run :P15:29
I'm older than I thought to have waited so long15:29
timotimo that's ... also a bug that annoys me15:30
Geth ¦ doc: coke assigned to lizmat Issue attribute example dies https://github.com/perl6/doc/issues/218415:31
¦ doc: f8d9b441c8 | (Will "Coke" Coleda)++ | doc/Language/list.pod615:31
¦ doc: fix example compilation 15:31
¦ doc: review: https://github.com/perl6/doc/commit/f8d9b441c815:31
synopsebot Link: https://doc.perl6.org/language/list15:31
raschipi joined15:32
psychoslave left15:32
timotimo postcircumfix:<[ ]> spends like a third(?) of its time in POSITIONS in that code15:34
pmurias left15:34
timotimo i imagine that's the 2..* part15:34
Geth ¦ doc: coke self-assigned attribute example dies https://github.com/perl6/doc/issues/218415:35
pmurias joined15:35
tbrowder_ [Coke]: site needs p6 logo and PERL6.ORG near PERL.ORG link15:36
timotimo push-exactly from Iterator.pm6 is on the top spot with 5.3%, and it's only jitted in small part15:37
Zoffix m: say 0.1150374/0.080893815:37
camelia rakudo-moar 7a7e5e96f: OUTPUT: «1.4220793␤»15:37
Zoffix This version is about 42% faster than scovit's https://gist.github.com/zoffixznet/73f1cb0b0ae63e46de8fc14b8ae753f315:38
timotimo oh i didn't see scovit suggest a change, let me scroll15:39
pmurias left15:39
timotimo ah, hypered the .words, eh?15:39
Zoffix Yeah15:39
timotimo i imagine that's a bit slower than the .words inside the for loop's body15:40
Zoffix yeah, like15:40
oh, yeah, I think that's where my speedup comes from15:40
tbrowder_ [Coke]: would be nice to see EVENTS on the main top bar menu.15:40
timotimo i imagine it'd be most performant to only split the line in "before the separator" and "after the separator" and only lazily split the words off in the next step15:41
that way you have so many fewer long-lived objects on the heap15:41
Zoffix jkramer: how long does perl5's version take to run?15:42
scovit Zoffix I think that your version is faster because of Seq instead of List15:44
timotimo m: say 1000000 / 2615:44
camelia rakudo-moar 7a7e5e96f: OUTPUT: «38461.538462␤»15:44
timotimo 38.5k lines per second15:44
psychoslave joined15:44
scovit but it is surprising to me that the assignment in the for loop body leads to a .cache15:44
Zoffix scovit: @a = .words consumes the Seq and creates an Array15:45
no cache15:45
scovit right15:46
timotimo my assumption it'd be faster with a hash was wrooooong15:46
Zoffix :)15:46
timotimo GC for arrays that are mostly null slots is extremely expensive15:51
wamba1 left15:52
pmurias joined15:55
timotimo if we knew that up front, we could switch to an implementation that tries to skip multiple slots at a time15:55
psychoslave left15:56
Zoffix What is it GCing tho? There's just one mostly-null-slot array in there, isn't there?15:56
timotimo yeah15:56
but it has to go through all 2 million or what slots15:56
mienaikage What's happening in the following? Switching to a block or using '==' works as expected. Does LHS not become the topic here?:15:56
subset Tuesday of Date where *.day-of-week ~~ 2;15:56
brrt joined15:56
Zoffix timotimo: But why is it GCing it? It's one object that's living through the whole program?15:57
timotimo mienaikage: ~~ will make the RHS the topic of the LHS15:57
Zoffix mienaikage: the closure ends before the ~~15:57
timotimo Zoffix: check the difference between full and minor collections15:57
i have a profile here that looks like this: The profiled code did 5986 garbage collections. There were 9 full collections involving the entire heap.15:58
The average nursery collection time was 12.24ms. The average full collection time was 326.39ms.15:58
zakharyas1 left15:58
timotimo the trick is that the last gc run, number 5201, took 978ms15:58
mienaikage 👍15:58
timotimo number 3680 is 687.6ms15:59
Zoffix There's a doc issue for making info on whatevercodes clearer D#201716:00
synopsebot D#2017 [open] : https://github.com/perl6/doc/issues/2017 [docs] Docs on Whatever curry could be clearer / don't cover everything 16:00
timotimo but also the minor collections start at about 3ms, but end at about 19ms16:00
Zoffix You can also dump the QAST with --target=optimize and see the subset's matcher thunked your thing and it's basically a `{ *.day-of-week ~~ 2 }.ACCEPTS: $param's-value`: https://gist.github.com/zoffixznet/94af7dc1eb36cdda1317de5b556cde2116:01
.oO( maybe this should warn... )16:01
m: { *.so } # like we do here16:02
camelia rakudo-moar 7a7e5e96f: OUTPUT: «=== SORRY!=== Error while compiling <tmp>␤Malformed double closure; WhateverCode is already a closure without curlies, so either remove the curlies or use valid parameter syntax instead of *␤at <tmp>:1␤------> { *.so } # like we do here …» 16:02
brrt left16:03
Zoffix mienaikage: filed R#2086 for that16:04
synopsebot R#2086 [open] : https://github.com/rakudo/rakudo/issues/2086 [LTA][RFC] Maybe warn when thunking `*.foo ~~ $bar` constructs? 16:04
Khisanth joined16:05
robertle left16:06
jkramer Zoffix: In total ~12sec, but that includes solving the actual challenge as well, not just reading and sorting lines into the array16:08
Zoffix Interesting. A mostly-nqp version of the code is a bit SLOWER than my last version above16:09
for ~16K rows, the HLL version takes 0.5290986 and NQP one … oh, nm, they're the same… I think it was just noise, NQP is 0.5266144616:10
This one: https://gist.github.com/zoffixznet/1670ac204a8f13a8eb2a3bf252eb94de16:10
jkramer I also have an implementation in rust (~5.5sec) and C (~1.1sec) :)16:11
Zoffix Which is awesome news, no? Means it's one of the cases where we *are* converting HLL version to basic bits that's NQP version16:11
jkramer: is that 12 sec with full UTF8 encoding?16:11
lizmat smells a blog post16:13
jkramer Zoffix: No, just https://bpaste.net/show/0e705b0135cf16:13
Zoffix mhm16:13
jkramer Oh actually that's a bit unfair because it doesn't split _all_ words16:13
No wait. It does, later in the code :)16:13
Zoffix That's one of the things that makes p6 version slower. You pay automatically for encoding and graphemes and all taht stuff16:14
timotimo it also doesn't - 1 on the $n16:14
jkramer timotimo: Yes but later when iterating over the sorted array it does a defined check on all rows. Actually I think removing that and doing the -1 instead would be faster16:15
I'm gonna try that16:15
timotimo i'll be afk for a bit16:15
Zoffix left16:17
jkramer No, didn't really change anything16:17
guest__ joined16:21
isacl joined16:30
scimon left16:31
wamba joined16:34
tbrowder_ AlexDaniel: any objection to a doc merge if i use a different bar style row separator (thinner, but double-line)?16:39
dakkar left16:39
guest__ left16:39
AlexDaniel tbrowder_: uh… well… let's merge it and then modify to our liking…16:48
perlpilot joined16:48
tbrowder_ ok, will do16:56
Geth ¦ doc/master: 7 commits pushed by (Tom Browder)++16:57
¦ doc/master: 3952836ddb | remove executable bit 16:57
¦ doc/master: 04950bd363 | Auto-generate doc/Language/0-html-source pod6 target files 16:57
¦ doc/master: c0458fb2b7 | remove spurious hyphen 16:57
¦ doc/master: b2655723de | remove spurious hyphen 16:57
¦ doc/master: 92013442cb | Merge branch 'phase2' of github.com:tbrowder/doc into phase2 16:57
¦ doc/master: 289999efaa | add a new dir for travis 16:57
¦ doc/master: 7afe426b83 | Merge pull request #2177 from tbrowder/phase2 16:57
¦ doc/master: review: https://github.com/perl6/doc/compare/f8d9b441c82d...7afe426b839a16:57
donpdonp joined17:01
donpdonp whats the right way to give grep a block, this is my best non-funcitonal try: [1,2].grep {element == 2}17:01
timotimo you need either a : after grep, or parenthesis around the block17:02
donpdonp hmms17:02
timotimo because it's a method call17:02
sub calls take everything after themselves as arguments, method calls don't17:02
donpdonp what do I use for 'element'17:03
jameslenz joined17:03
timotimo oh17:03
$_ would be your candidate17:03
i mean, i'd probably have written it as a whatevercode, or with just the 2 instead of a block17:03
m: say "2" ~~ 217:04
camelia rakudo-moar 7a7e5e96f: OUTPUT: «True␤»17:04
timotimo mhm mhm17:04
donpdonp interesting thx.17:04
timotimo because grep uses smartmatch17:04
donpdonp whats the significance of grep: {expr} over grep(expr)17:04
timotimo foo.grep: ... will take everything after it as arguments as well17:04
raschipi donpdonp: It's the same thing.17:04
perlpilot raschipi, not quite17:05
timotimo and you can't use : with grep if you use it as a sub17:05
grep: {expr} will be a label followed by a bare block17:05
greppable6 timotimo, Found nothing!17:05
timotimo thank you greppable617:05
m: thissubdoesntevenexist: 117:05
camelia rakudo-moar 7a7e5e96f: OUTPUT: «WARNINGS for <tmp>:␤Useless use of constant integer 1 in sink context (line 1)␤»17:05
donpdonp timotimo: great. thx.17:05
raschipi right, only works for methods.17:05
domidumont joined17:05
raschipi It's possible to call methods like they are subs using 'method Object: arg1, arg2' too.17:06
jameslenz left17:07
timotimo yup, think of it like "new Foobar: 1, 2, 3"17:10
[Coke] timotimo: that's a label, no?17:11
jkramer Interestingly, reading the whole file first and then sorting the lines is faster than putting the lines into their slot directly :) my @input = lines.sort: { +.substr(0, .index(' ')) };17:13
raschipi It's indirect method call.17:13
timotimo [Coke]: no, only single identifiers in front of the : are labels17:13
jkramer This is about ~30s fast than scovit's approach from earlier today on my machine17:13
*er17:13
timotimo jkramer: that'll probably significantly cut down on GC time for all the empty slots that would otherwise be in the array early on17:14
[Coke] timotimo: thissubdoesntevenexist is a single identifier...17:17
donpdonp is there a way to say "use Cro::HTTP::Client as Client" so I can say "Client.get($url)" instead of "Cro::HTTP::Client.get($url)"17:18
timotimo const Client = Cro::HTTP::Client; should work17:18
El_Che make an object?17:18
timotimo [Coke]: oh, you meant that line. yes, that was an example of a label17:19
[Coke] perl6 --target==barf ... be nice if this told you what valid targets were.17:19
raschipi [Coke]: does it at least barfs though?17:19
Geth ¦ doc: 826c3b9e6f | (Aleks-Daniel Jakimenko-Aleksejev)++ | manage-page-order.p617:25
¦ doc: Just say `Category` instead of annoying unicode art 17:25
¦ doc: review: https://github.com/perl6/doc/commit/826c3b9e6f17:25
[Coke] yes, you get: Unknown compilation target '=barf'17:25
zakharyas joined17:25
AlexDaniel tbrowder_: so… let's talk about it a bit more…17:25
[Coke] but then a bunch of nqp stacktrace17:25
AlexDaniel tbrowder_: why can't we have a separate table for every category?17:25
raschipi So it's doing exactly what you asked for?17:25
donpdonp timotimo: where would be a good place to put that const in the .pm6? this is how not to do it: module { const Client = Cro::HTTP::client; sub go($url) { Client.get($url) };17:27
sarna joined17:27
timotimo you'll also need a "use", but other than that the position should be fine, as long as it's not an "our constant"17:27
constants are "my" scoped by default, right?17:27
Geth ¦ doc: 8cc0fde924 | (Aleks-Daniel Jakimenko-Aleksejev)++ | manage-page-order.p617:27
¦ doc: Empty subtitle for categories 17:27
¦ doc:17:27
¦ doc: After thinking about it a bit more, no subtitle will make it more17:27
¦ doc: appealing visually. That's a temporary solution anyway.17:27
¦ doc: review: https://github.com/perl6/doc/commit/8cc0fde92417:27
El_Che my $client = Cro::HTTP::client.new; $client.get($url)17:27
sarna hey, so I have an object with a list of objects in it. how do I populate this list? I put a loop in BUILD() that creates objects, but it doesn't seem to work17:28
donpdonp El_Che: many sub's in the module will need Client, so im trying to put it at the module-level if thats possible17:28
El_Che donpdonp: I see17:28
is it OO? it could be an attribute17:29
Geth ¦ doc: 0d7b7c93a9 | (Rafael Schipiura)++ (committed using GitHub Web editor) | doc/Language/contexts.pod617:29
¦ doc: Numeric context converts to numeric. 17:29
¦ doc: review: https://github.com/perl6/doc/commit/0d7b7c93a917:29
synopsebot Link: https://doc.perl6.org/language/contexts17:29
tbrowder_ AlexDaniel: good idea for the next step.17:29
donpdonp timotimo: use Cro::HTTP::Client; module Commands { const Client = Cro::HTTP::Client; => Preceding context expects a term, but found infix = instead.17:29
timotimo oh?17:30
perlpilot donpdonp, except you'll want to spell "const" as "constant" :)17:30
timotimo d'oh, yes, constant not const17:30
we can put a better error message for that in the parser!17:30
donpdonp ha thx perlpilot !17:30
too much typescript i think.17:30
raschipi AlexDaniel tbrowder_ : Also, remove the bit about "mostly alphabetical order" at the top while you're at it.17:34
Xliff joined17:36
Xliff left17:36
Xliff joined17:40
AlexDaniel raschipi++17:40
Geth ¦ doc: 46a7470c01 | (Aleks-Daniel Jakimenko-Aleksejev)++ | htmlify.p617:40
¦ doc: The list is no longer in alphabetical order 17:40
¦ doc: review: https://github.com/perl6/doc/commit/46a7470c0117:40
Xliff \o17:43
<- New supporter of comma.17:43
moritz Xliff++17:43
sena_kun Xliff++17:44
perlpilot I like commas too They go well between items ;)17:46
Geth ¦ doc: a2336a5fe2 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Any.pod617:47
¦ doc: Reword implementation-specific versioning of 6.d feature 17:47
¦ doc: review: https://github.com/perl6/doc/commit/a2336a5fe217:47
synopsebot Link: https://doc.perl6.org/type/Any17:47
raschipi But not periods.17:48
Zoffix joined17:49
Zoffix What's a really awesome example of .toggle's use? https://docs.perl6.org/routine/toggle17:49
Xliff Yeah. Does Comma come with any docs? I am trying to use it to debug p6 code.17:49
fbynite joined17:50
timotimo the debug support isn't quite fantastic yet17:50
https://commaide.com/docs - this is the odcs17:50
tbrowder_ AlexDaniel: putting doc/Language categories alone on the language page with links to a separate page is good. Or we could have collapsible lists under the categories.17:50
Zoffix *crickets*17:52
Xliff m: ( (^10).toggle: * %% 2).say17:52
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(0)␤»17:52
tbrowder_ At any rate, for now I’m going to go back to working on pod =defn. Anyone is weclome to continue to move the docs toward your vision if they wish.17:53
Xliff m: ( (^10).toggle: * %% 2, :off, * > 8).say17:53
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(0)␤»17:53
perlpilot Zoffix, maybe something with identifying a square wave out of some random data? (I clearly don't have any awesome examples)17:53
Xliff m: ( (^10).toggle: * %% 2, * > 8).say17:53
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(0 9)␤»17:53
Xliff m: ( (^10).toggle: * %% 2, :on, 7, * > 8).say17:53
camelia rakudo-moar 7a7e5e96f: OUTPUT: «No such method 'CALL-ME' for invocant of type 'Int'␤ in block <unit> at <tmp> line 1␤␤»17:53
Zoffix Xliff: so what does that do?17:53
Xliff m: ( (^10).toggle: * %% 2, :on, * == 7, * > 8).say17:53
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(0 7)␤»17:53
Xliff Zoffix: I'm moving to camelia. Trying to figure it out.17:54
Zoffix heh17:54
c'mon, it's a new feature in 6.d! It's meant to be awesome for something17:54
perlpilot Seems like an example that would be good for ff would also be good for .toggle (but with extra behavior because of the callables)17:55
imcsk8_ joined17:56
Zoffix m: say ^10 .toggle: :off, * > 3, * < 817:57
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(4 5 6 7)␤»17:57
Zoffix m: say ^10 .grep: 3 < * < 817:57
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(4 5 6 7)␤»17:57
sarna left17:58
Xliff Yeah. The syntax of toggle is weird.17:58
Would be better if there was a clear indication of what is on and what is off17:58
tyil I reposted one of the reddit threads mentioned in the p6weekly to other subreddits, for those interested in a discussion: https://old.reddit.com/r/programming/comments/8zk5cy/what_are_some_features_new_to_perl_6_that_should/ and https://old.reddit.com/r/ProgrammingLanguages/comments/8zk5al/what_are_some_features_new_to_perl_6_that_should/17:58
Geth ¦ atom-language-perl6: threadless-screw++ created pull request #86: Variable identifiers with embedded dashes/apostrophes highlight properly 17:59
¦ atom-language-perl6: review: https://github.com/perl6/atom-language-perl6/pull/8617:59
Zoffix heh17:59
visiting that URL killed my browser17:59
Xliff m: ( (^10).toggle: :on, * < 3, *.is-prime ).say17:59
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(0 1 2 5 6 7 8 9)␤»17:59
tyil :(17:59
Xliff ^^ Not clear here as to what is going to show.17:59
tyil it shouldn't do that18:00
Zoffix Didn't get a chance to read the answer that started with "find relevance in modern programming language"18:00
Xliff 0, 1, 2 are there by the first condition. 4 is skipped by the *is-prime18:00
So why the 6, 7, 8, and 9?18:00
Zoffix Xliff: did you read the documentation for the method?18:00
Xliff Yeees.18:00
perlpilot you're missing an arg18:01
Xliff m: ( (^10).toggle: :on, * < 3, *.is-prime, :off ).say18:01
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(0)␤»18:01
perlpilot I mean if you wanted is-prime to modulate the "on" values18:01
Xliff m: ( (^10).toggle: :on, * < 3, :on,*.is-prime, ).say18:01
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(0 1 2 5 6 7 8 9)␤»18:01
Xliff Again. Docs aren't clear and neither is the syntax.18:02
Zoffix Xliff: :on is the default. It keeps producing els while first callable is true, that happens for 0, 1, 2, then it toggles and switches to the next callable in the list, which is *.is-prime, 5 makes that true, so it toggles again, and there are no other callables, so it remains on until the rest of the sequence, giving you 6, 7, 8, and 918:02
Xliff I figured that out.18:03
Zoffix Xliff: there's no special syntax involved, so you using `:on` and `:off` named args in certain places has no effect on anything. They're unordered18:03
Xliff m: ( (^10).toggle: :on, * < 3, *.is-prime, *.is-prime ).say18:03
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(0 1 2 5)␤»18:03
Xliff So why no 7?18:03
Zoffix Xliff: it toggles off on 6, and there are no more callables, in the list so it never switches back on18:04
m: say ^10 .toggle: *.is-prime xx *18:04
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(2 3 5 7)␤»18:04
Zoffix m: say ^100 .toggle: *.is-prime xx *18:04
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97)␤»18:04
Zoffix m: say ^100 .grep: *.is-prime18:04
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97)␤»18:04
Xliff m: ( (^10).toggle: :on, * < 3, *.is-prime xx 4 ).say18:04
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(0 1 2 5 7)␤»18:04
Xliff m: ( (^100).toggle: :on, * < 3, *.is-prime xx 4 ).say18:04
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(0 1 2 5 7)␤»18:04
Zoffix .ask lizmat do you remember what was the usecase for .toggle? I need something nice and awesome for a 6.d teaser poster18:05
yoleaux Zoffix: I'll pass your message to lizmat.18:05
Xliff ^^ That says to me that I should get the next 4 prime numbers.18:05
domidumont left18:05
Xliff m: ( (^100).toggle: :on, * < 3, *.is-prime xx 6 ).say18:05
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(0 1 2 5 7 11)␤»18:05
Xliff ^^ You'd have to know where the next prime number is to get to 1118:06
domidumont joined18:06
Zoffix You'd just use .grep for that18:06
Xliff Well.... you asked for a cool use. I'm trying, here !18:06
Numbers less than 3, the next 4 prime numbers and numbers within a range.18:07
That would be a cool use of toggle.18:07
m: ( (^100).toggle: * ~~ 10..30).say18:07
camelia rakudo-moar 7a7e5e96f: OUTPUT: «()␤»18:07
Xliff m: ( (^100).toggle: * < 10, * ~~ 10..30).say18:08
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(0 1 2 3 4 5 6 7 8 9 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87…»18:08
Xliff m: ( (^100).toggle: * < 9, * ~~ 10..30).say18:08
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(0 1 2 3 4 5 6 7 8 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 8…»18:08
tyil also, for what it's worth, the Den Bosch Linux User Group is now making use of Perl 6 on their mail server :>18:09
Xliff m: ( (^100).toggle: * < 9, * ~~ 10..30, &is-prime).say18:09
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(0 1 2 3 4 5 6 7 8 10 11)␤»18:09
Zoffix Xliff: yeah, but that describes a grep condition.18:09
Xliff throws hands up in the air.18:09
Xliff I guess I just don't grok the coolness, yet.18:09
raschipi You don't toggle the coolnesss. Yet.18:10
domidumont left18:10
donpdonp left18:11
Xliff A grep filter will do me just fine until I do.18:11
perlpilot Maybe in data processing where your conditions are something like "header lines match this pattern" and "data lines match this pattern" where you're given a sequence of lines where there's junk lines before/after the header/data lines18:13
I dunno. I can't imagine any neat examples for .toggle18:14
Xliff That sounds on the right track though, perlpilot18:14
AlexDaniel yeah maybe something similar to stuff you'd use ff operator for: https://docs.perl6.org/routine/ff18:14
Xliff .toggle: *.is-header, ( (*.is-junk, *.is-data) xx 5 ).flat # Cover a header and 5 groupings of junk and data.18:16
Zoffix But again, that's a grep, not a toggle18:17
m: say <a 42 b c d e 100 d> .toggle: :off, +*18:17
perlpilot yeah18:17
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(42 b c d e 100 d)␤»18:17
Zoffix m: say gather for <a 42 b c d e 100 d> .lines { .take if 42 ff 100 }18:18
camelia rakudo-moar 7a7e5e96f: OUTPUT: «()␤»18:18
Zoffix .oO( does that docs example even work )18:19
nope18:19
yup (forgot to CTRL+S, I think)18:20
pmurias left18:20
Zoffix m: say gather for <a 42 b c d e 100 d> { .take if 42 ff 100 }18:21
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(42 b c d e 100)␤»18:21
Zoffix m: say gather for <a 42 b c d e 100 d 100> { .take if 42 ff 100 }18:21
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(42 b c d e 100)␤»18:21
zakharyas left18:22
Zoffix m: say <a 42 b c d e 100 d> .toggle: :off, * == 42, * == 10018:22
camelia rakudo-moar 7a7e5e96f: OUTPUT: «Cannot convert string to number: base-10 number must begin with valid digits or '.' in 'a ' (indicated by ⏏)␤ in block <unit> at <tmp> line 1␤␤»18:22
Zoffix m: say <a 42 b c d e 100 d> .toggle: :off, {+$_ andthen $_ == 42}, {+$_ andthen $_ == 100}18:22
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(42)␤»18:22
Zoffix m: say <a 42 b c d e 100 d> .toggle: {+$_ andthen $_ == 42}, {+$_ andthen $_ == 100}18:22
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(100 d)␤»18:22
perlpilot .toggle still makes me think of square waves and leading/trailing edges.18:23
Zoffix This kind of problems don't occur when devs document the stuff they implement, because they know why they're implementing18:23
Instead of having some one else describe the behaviour of the implementation in the docs, rather than the purpose of the routine18:24
SmokeMachine Zoffix: is it cool? `ifconfig | perl6 -e 'say join "\n", lines.toggle: :off, * ~~ /^lo/, * ~~ /^\s+/'`18:25
perlpilot Zoffix, just look at the IRC logs from Nov 2017 and see what lizmat was thinking! ;->18:26
Zoffix perlpilot: way ahead of you :)18:26
The original names were skip-until and skip-while18:26
TimToady m: my %orig = :1a, :2b; my %new = :5b, :6c; %orig «=« %new; dd %orig18:28
camelia rakudo-moar 7a7e5e96f: OUTPUT: «Hash %orig = {:a(1), :b(5), :c(6)}␤»18:28
TimToady kjk: ^^^18:28
Zoffix SmokeMachine: I guess18:28
I was expecting {/^eth1/}, {/^\s+/} to also work,18:28
m: my $c := {/^eth1/}; if $c("eth") {say 42 }18:29
camelia rakudo-moar 7a7e5e96f: ( no output )18:29
Zoffix Oh, I ran it with `perl`18:30
$ perl -e 'my $c := {/^eth1/}; if $c("eth") {say 42 }'18:30
Use of := for an empty attribute list is not allowed at -e line 1.18:30
was gonna yell at it :}18:30
Xliff left18:31
Zoffix m: my $c := {?/^eth1/}; dd $c("eth")18:31
camelia rakudo-moar 7a7e5e96f: OUTPUT: «Bool::False␤»18:31
Zoffix m: my $c := {?/^eth1/}; dd $c("eth1")18:31
camelia rakudo-moar 7a7e5e96f: OUTPUT: «Bool::True␤»18:31
Zoffix oh18:31
OK, now I get why {/^eth1/} doesn't work18:31
SmokeMachine: the uncool part is * ~~ /^lo/ looks really gross :)18:31
SmokeMachine Zoffix: `*.starts-with("lo")` ?18:32
Zoffix I was thinking more of smartmatching18:33
Like taking a bunch of matchers instead of just a bunch of callables18:33
TimToady kjk: Unless something has changed since I last looked at it, I suspect «=« is implemented key-by-key, but ,= is gonna do the stupid thing; one should try timing it both ways, of course18:33
Zoffix You could write it as .toggle: :off, /^lo/, /^\s/18:33
SmokeMachine Zoffix: why only `/^lo/` doesnt work? that have to be a Callable... why?18:34
Geth ¦ doc: d2a28d2c03 | (Clifton Wood)++ | doc/Language/nativecall.pod618:34
¦ doc: - Fixes bad link in route page for nativecast. 18:34
¦ doc: review: https://github.com/perl6/doc/commit/d2a28d2c0318:34
¦ doc: 43cbe0e463 | Altai-man++ (committed using GitHub Web editor) | doc/Language/nativecall.pod618:34
¦ doc: Merge pull request #2180 from Xliff/master 18:34
¦ doc:18:34
¦ doc: - Fixes bad link in route page for nativecast.18:34
synopsebot Link: https://doc.perl6.org/language/nativecall18:34
Geth ¦ doc: review: https://github.com/perl6/doc/commit/43cbe0e46318:34
SmokeMachine Zoffix: that was my first try...18:34
Zoffix SmokeMachine: ifconfig | perl6 -e '/^eth1/ fff^ !/^\s+/ and .say for lines'18:34
:)18:34
SmokeMachine: why it has to be a Callable? Dunno, it was designed that way, I guess18:35
But it's not too late to change it18:35
SmokeMachine https://www.irccloud.com/pastebin/lI8nQoWQ/18:35
Zoffix SmokeMachine: yeah, that's cause Regex is a Callable18:36
but you can't just call it with a string18:36
AlexDaniel gah did I break the doc build18:36
SmokeMachine Zoffix: couldnt it be just like grep?18:37
m: say grep ^100: /^2/18:37
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(2 20 21 22 23 24 25 26 27 28 29)␤»18:37
SmokeMachine Zoffix: talking about grep... why this doesnt work?18:39
m: say map ^100: :is-prime18:39
camelia rakudo-moar 7a7e5e96f: OUTPUT: «Cannot resolve caller map(Range: :is-prime); none of these signatures match:␤ ($: Hash \h, *%_)␤ (\SELF: &block;; :$label, :$item, *%_)␤ in block <unit> at <tmp> line 1␤␤»18:39
SmokeMachine m: say map ^100: * ~~ :is-prime # if it works...18:40
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(False False True True False True False True False False False True False True False False False True False True False False False True False False False False False True False True False False False False False True False False False True False True …»18:40
SmokeMachine i mean with grep...18:40
m: say grep ^100: :is-prime18:40
camelia rakudo-moar 7a7e5e96f: OUTPUT: «Cannot resolve caller grep(Range: :is-prime); none of these signatures match:␤ ($: Bool:D $t, *%_)␤ ($: Mu $t, *%_)␤ in block <unit> at <tmp> line 1␤␤»18:40
SmokeMachine m: say grep ^100: * ~~ :is-prime18:40
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97)␤»18:40
Zoffix m: say map ^100: (:is-prime)18:41
camelia rakudo-moar 7a7e5e96f: OUTPUT: «Cannot resolve caller map(Range: Pair); none of these signatures match:␤ ($: Hash \h, *%_)␤ (\SELF: &block;; :$label, :$item, *%_)␤ in block <unit> at <tmp> line 1␤␤»18:41
Geth ¦ doc: 78fd2efec4 | (Aleks-Daniel Jakimenko-Aleksejev)++ | manage-page-order.p618:41
¦ doc: No subtitle instead of empty subtitle 18:41
¦ doc:18:41
¦ doc: Otherwise Pod::To::BigPage seems to be unhappy.18:41
¦ doc: review: https://github.com/perl6/doc/commit/78fd2efec418:41
Zoffix m: say ^100 .grep: (:is-prime)18:41
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97)␤»18:41
Zoffix SmokeMachine: 'cause .map takes a mapper, not a matcher18:42
SmokeMachine isnt it mapping to Bool?18:42
TimToady it's smartmapping to Bool :P18:43
Zoffix SmokeMachine: it's not doing anything. There isn't any candidate that accepts Pair as a mapper18:43
SmokeMachine Zoffix: sure! its not using `~~`, sorry I was thinking of grep...18:44
but shouldnt `.toggle` behave as grep?18:44
TimToady: :P18:45
Zoffix R#208818:45
synopsebot R#2088 [open] : https://github.com/rakudo/rakudo/issues/2088 [RFC] Make .toggle take matchers, not just Callables 18:45
SmokeMachine :)18:45
you are faster than I thought18:45
TimToady suspects Zoffix downloaded his brain into a supercomputer a year or two ago18:47
Ven` left18:47
Zoffix suspects there is more than one Zoffix and they all pretend to be the same person to appear to do stuff super fast18:48
TimToady you can say that again18:48
Geth ¦ doc: 6639ef1811 | (Will "Coke" Coleda)++ | xt/examples-compilation.t18:49
¦ doc: add note 18:49
¦ doc: review: https://github.com/perl6/doc/commit/6639ef181118:49
¦ doc: 896c9bd363 | (Will "Coke" Coleda)++ | doc/Type/List.pod618:49
¦ doc: fix example compilation 18:49
synopsebot Link: https://doc.perl6.org/type/List18:49
Geth ¦ doc: review: https://github.com/perl6/doc/commit/896c9bd36318:49
[Coke] wonders why we have new top level .p6 files in doc18:50
SmokeMachine Do all Zoffix have a lock? how does they syncronize the job? whitch one do the boring tasks? :P18:50
[Coke] wasn't tbrowder_ one of the people that was just concerned about that?18:50
Zoffix SmokeMachine: here's another cool one. Get all the changes for last Rakudo release: ./perl6 -e 'for lines.toggle: :off, {?/^\S/}, {?/\s+/} { .say }' docs/ChangeLog18:51
:)18:52
SmokeMachine :)18:52
perlpilot If .toggle had some way to distinguish between toggling from on to off and off to on and/or when to actually switch the callable, then it would have a way to do something with leading/trailing edges of square waves. And it could also have the same distinction as ff and fff. (I dunno how useful that is though given I don't entirely grok .toggle :-)18:52
I mean, I understand what we've got, I just don't quite understand why we've got it18:53
Zoffix ./perl6 -e 'for lines.toggle: :off, ({?/^\S/}, {?/\s+/}) xx 3 { .say }' docs/ChangeLog18:53
Change log for last 3 releases18:53
wooo, I think I finalle grok it :P18:54
perlpilot I think anyone who uses .toggle is going to have to do mental exercises each time to understand the results. That's somewhat counter productive. (Or maybe there just hasn't been an awesome enough example yet that makes it clear to everyone :-)18:57
Zoffix Or maybe the docs suckl18:58
perlpilot m: say ^20 .toggle: * < 4, * < 7, * < 1218:59
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(0 1 2 3 5 6 7 8 9 10 11)␤»18:59
perlpilot I still have to *really* think about it to understand what's happening there.19:00
Zoffix The originally suggested .while/.until is kinda a better name **to understand the workings**: `.toggle: :off, {?/^\S/}, {?/\s/}` => (starting with off position) .until {?/^\S/} is true, don't take stuff; then, .while {?/\s+/} is true take stuff; then, ooops.. ran out of toggles and we're toggled off, so we won't take any more stuff19:00
perlpilot I don't know that I'd go "oh! of course!" if I ran across it in the wild19:00
AlexDaniel perlpilot: sure, but what's the alternative?19:01
I mean, toggle was introduced because there was no better way, sort of19:01
Zoffix perlpilot: what you wrote is not the common case, I think. A common case is to toggle once (based on discussions in 2017 logs). So understanding `.toggle: * < 4, * < 7, * < 12` is equivalent to understanding a multi-line grep or something19:01
perlpilot Zoffix, "common case"? Have you seen what sort of crazy stuff people write? ;)19:01
Zoffix perlpilot: the common case designed for19:02
@pressure-readings.toggle: * > .005 { FIRST say "our spacecraft entered the atmosphere!"; say "Current atmospheric presure: $_" }19:03
perlpilot AlexDaniel, the alternative is more code that is perhaps clearer in intent.19:03
jameslenz joined19:03
Zoffix That's a good example actually19:03
AlexDaniel perlpilot: well, that code should work nicely with Seqs :)19:03
fbynite left19:04
Zoffix Well, missing `:off`, but whatever19:05
perlpilot Show me an example that uses 3 or more conditions. That would be the best for the docs IMHO.19:06
Zoffix In .toggle?19:06
perlpilot aye19:06
Zoffix "<Zoffix> perlpilot: what you wrote is not the common case,"19:06
SmokeMachine I would like `list.while(/^lo/).until(/^$/)`19:06
Zoffix That's like saying, show me a grep with a dozen conditions. That would be the best for the docs19:07
jameslenz left19:07
perlpilot eh, I don't think so. Toggling once or twice is easy-ish *without* .toggle19:08
Zoffix perlpilot: ok, let's see it19:08
in code19:08
perlpilot heh, I knew you were going to say that :)19:08
Zoffix :)19:08
raschipi 'say ^20 .toggle: * < 4, * < 7, * < 12' from the explanation above, I would expect this to be (0, 1, 2, 3, 7, 8, 9, 10, 11)19:08
Zoffix m: say ^20 .toggle: * < 4, * < 7, * < 1219:09
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(0 1 2 3 5 6 7 8 9 10 11)␤»19:09
perlpilot raschipi, the * < 7 condition is used once and throw away (because of the toggling)19:10
s/throw/thrown/19:10
Zoffix, I don't have any code in my head right now, so I'll retract my statement until I can come up with some actual code for it. But it still *feels* easyish given that I've written such code many times before (though not in P6 nor with a Seq)19:11
Zoffix 'say ^20 .toggle: * < 4, * < 7, * < 12' => we're starting in on position, so the first is `.while` => .while * < 4 is true, take stuff (we take 0, 1, 2, 3); we switch to .until => until * < 7 we don't take stuff, it's immediatelly true, so we toggle to .while => .while * < 12 is true, take stuff, so we take 5, 6, 7, 8, 9, 10, 11, now we toggle, there's no more callables, so we remain off19:12
raschipi I see, so it's not a toggle?19:13
Zoffix raschipi: what do you mean? It does toggle from on and off19:13
SmokeMachine: yeah, the .while + .until pair is better than a single .toggle19:13
raschipi m: say ^20 .toggle: * > 4, * > 7, * > 1219:13
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(8)␤»19:13
jmaslak joined19:14
Zoffix `m: say ^20 .toggle: * > 4, * > 7, * > 12` => `m: say ^20 .toggle: [take all that stuff that's * > 4], [ignore all the stuff that's * > 7], [take all the stuff that's * > 12]`19:19
`m: say ^20 .toggle: * > 4, * > 7, * > 12` => `m: say ^20 .toggle: [take until * > 4], [ignore until * > 7], [take until * > 12]`19:20
yeaaaah19:20
m: say join ' ', ('^50 .toggle: * > 3, * > 7, * > 10, * < 15, * > 20'.split(/':'|','/) Z, ^10 .map: {<take ignore>[$++ %% 2] ~ " until"})19:22
camelia rakudo-moar 7a7e5e96f: OUTPUT: «^50 .toggle ignore until * > 3 take until * > 7 ignore until * > 10 take until * < 15 ignore until * > 20 take until␤»19:22
pmurias joined19:22
Zoffix m: say join ' ', ('^50 .toggle: * > 3, * > 7, * > 10, * < 15, * > 20'.split(/':'|','/) Z, ^10 .map: {<ignore ignore>[$++ %% 2] ~ " until"})19:22
camelia rakudo-moar 7a7e5e96f: OUTPUT: «^50 .toggle ignore until * > 3 ignore until * > 7 ignore until * > 10 ignore until * < 15 ignore until * > 20 ignore until␤»19:22
Zoffix bah19:22
.oO( why are they all ignores... )19:23
a bug?19:24
m: say join ', ', ('^50 .toggle: * > 3, * > 7, * > 10, * < 15, * > 20'.split(/':'|','/) Z, ^10 .map: {my $v = $++; dd $v; <ignore take>[$v %% 2] ~ " until"})19:24
camelia rakudo-moar 7a7e5e96f: OUTPUT: «Int $v = 0␤^50 .toggle, take until, * > 3, ignore until, * > 7, take until, * > 10, ignore until, * < 15, take until, * > 20, ignore until␤Int $v = 1␤Int $v = 2␤Int $v = 3␤Int $v = 4␤Int $v = 5␤Int $v = 6␤»19:24
perlpilot because you used <ignore ignore>19:24
Zoffix oh19:24
haha19:24
so that gives us: 0, 1, 2, 3, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2019:25
m: ^50 .toggle: * > 3, * > 7, * > 10, * < 15, * > 2019:25
camelia rakudo-moar 7a7e5e96f: ( no output )19:25
Zoffix m: say ^50 .toggle: * > 3, * > 7, * > 10, * < 15, * > 2019:25
camelia rakudo-moar 7a7e5e96f: OUTPUT: «(8 10)␤»19:25
Zoffix -_-19:25
perlpilot initial condition is "on" and is toggled by the first condition19:26
See? that's kind of my only objection here: .toggle is too inscrutable.19:28
japhb__ joined19:30
hythm_ joined19:30
japhb__ left19:30
[Coke] it's slightly more scrutable than "ff"19:31
SmokeMachine sorry, what means "inscrutable"?19:32
Zoffix inescrutável19:32
inescrutable19:32
hard to understand19:32
Filed R#208919:33
synopsebot R#2089 [open] : https://github.com/rakudo/rakudo/issues/2089 [6.d review][LTA][RFC] .toggle is hard to understand 19:33
perlpilot [Coke]: I don't think so. With 'ff' you only have to worry about a single "toggle"; a single bit of hidden information changing state19:33
(changing state one time)19:33
hythm_ Hi, is there a way to evaluate WhateverCode { ... } to actual code text?19:34
p6: my $c = * > *; say $c.perl;19:34
camelia rakudo-moar 7a7e5e96f: OUTPUT: «{ ... }␤»19:34
Zoffix hythm_: noi19:34
*no19:35
hythm_: or at least not at the moment19:35
hythm_ Ok, thank you19:35
perlpilot hythm_: in your mind perhaps :-) * > * is the same as { $^a < $^b } in any case19:35
er, * > * is the same as { $^a > $^b } even19:37
hythm_ Hmm, i needed to serialize WhatEver code, which can be , * > * or19:37
perlpilot (why do those keys have to be so close to each other? ;)19:37
Zoffix [Coke]: not really, you can understand `ff` without knowing what the data is. `2 ff 5` will give you the all the items between the first 2 and the first 5. With .toggle you can't say that. You must know the positions of 2 and 5 in the list. you might get all the data after the first 5, you might get the 2, and then all the data after the first 5, or you might *just* get the data after the first 519:38
[Coke] perlpilot: I thought you were referring just to the routine name.19:39
pmurias left19:39
perlpilot no, the name is fine and makes good sense to me. It's the implementation that seems surprising at times.19:40
(even though it works as advertised)19:41
benji__ joined19:41
perlpilot btw, ff and fff both start in the "off" position. I wonder if .toggle should too?19:41
Zoffix s/With/With .toggle: * == 2, * == 5/19:41
perlpilot: I think it should be split off into two separate routines19:42
perlpilot: but you should leave your comments on the ticket: https://github.com/rakudo/rakudo/issues/208919:42
Zoffix &19:42
Zoffix left19:42
benjikun2 left19:44
pmurias joined19:51
hythm_ my $var can be assigned one of these values: ">" or "<", how can i create WhateverCode like: * $var *19:51
raschipi EVAL19:52
timotimo hythm_: if it's okay you can just store &infix:«>» and &infix:«<» instead of building a whatevercode19:52
hythm_ EVAL did not work19:53
SmokeMachine Zoffix: yes, I dont know whats 'inescrutável' in portuguese either... :(19:53
hythm_ timotimo: will try that19:54
raschipi It means incomprehensible19:54
But in an inescrutável way19:55
SmokeMachine raschipi: thanks!19:56
geekosaur 'inscrutable'20:00
(== 'can't be scrutinized' / studied)20:00
ChoHag joined20:01
hythm_ left20:07
hobbs scruting the inscrutable since 196320:13
perlpilot left20:15
zakharyas joined20:17
zakharyas1 joined20:20
sena_kun see the invisible, hear the unhearable, do the impossible...20:20
geekosaur I think "unscrewing the inscrutable" is the best take I've seen on that one20:20
zakharyas left20:21
sno joined20:21
pmurias in the browser should printing to stdout/stderr be mapped to console.log/console.error?20:23
raschipi left20:24
sena_kun I'd say, that's natural enough approach.20:24
zakharyas1 left20:29
masak .oO( redirect it to the printer! )20:50
skids left20:56
jameslenz joined21:03
SmokeMachine what about `.take-while`, `.ignore-while`, `.take-until` and `ignore-until`?21:05
jmaslak I've got a user question here. I'm looking for something like IO::Socket::Async where I can basically ask for a socket that listens on a system-assigned, available epithermal port (I.E. a high numbered port), and get the port number chosen back once it's listening. Basically "I don't care what port you listen on, just let the system pick a port and then tell me what it picked."21:08
jameslenz left21:08
jmaslak Does anyone have any ideas on that?21:08
HaraldJoerg left21:09
moritz jmaslak: I'd approach this by using a random list of high ports and checking each one if it can be bound to21:09
jmaslak: something like (1024..32255).roll(*).map(&try-connect).first21:10
p6fan joined21:10
moritz where sub try-connect($port) { ... } tries to bind to the port, and returns an undefined value if it fails21:10
.first(&so) instead of .first21:11
AlexDaniel jmaslak: I had the same question some time ago21:11
moritz (I'm not aware of any system call that automatically allocates a free port in an atomic manner)21:11
AlexDaniel just using port 0 should work on linux21:12
jmaslak That's kind of where I was landing, but it seems not-terribly-elegant to code for something. Plus it ignores the system configuration of epithermal ports, so it's possible I could randomly grab something something else doesn't expect me to grab.21:12
AlexDaniel but there was a problem of doing that from perl 6, IIRC21:12
timotimo we do get the ports for you, iirc21:12
geekosaur epithermal? too hot to touch?21:13
p6fan Popular youtuber Derek Banas has listed perl6.org as a supporter in his recent videos and has said that he is working on creating a Perl6 tutorial video! https://www.youtube.com/watch?v=I96uPDifZ1w21:14
timotimo that's bananas!21:14
AlexDaniel p6fan: what second in the video?21:15
[Coke] epithermal? ephemeral?21:15
AlexDaniel oh, I see something in the description of the video. Interesting21:16
timotimo oh, damn it21:16
p6fan The video link just shows perl6.org in the description. I messaged him about a perl6 tutorial and he said that it is one of the videos he is currently working on.21:16
timotimo we get the host and port (both remote and local) only when a connection comes in21:16
AlexDaniel p6fan: plz don't forget to let us know when it's out :) sounds very cool21:17
b2gills m: say (^100).toggle: :off, *==5, * <=10, *==23, * <= 30, *==50, * <=52; # (^100).toggle: :off, 5, 10, 23, 30, 50, 5221:17
camelia rakudo-moar 6ad096c8a: OUTPUT: «(5 6 7 8 9 10 23 24 25 26 27 28 29 30 50 51 52)␤»21:17
AlexDaniel jmaslak: can you file a ticket for that?21:17
huggable: rakudobug21:17
huggable AlexDaniel, Report bugs on https://github.com/rakudo/rakudo/issues/new If you don't have access to GitHub, you can email your report to [email@hidden.address] . See also: https://github.com/rakudo/rakudo/wiki/rt-introduction21:17
p6fan I followed the channel and will let you all know when it is out. I am really looking forward to it. I have actually watched a lot of his other tutorials.21:18
AlexDaniel timotimo: so I guess you can listen on port 0 but you wouldn't know what port that is?21:18
timotimo that's right. only once a connection has come in will you get the port21:18
lizmat doesn't 'cro stub' have some code to generate a port to listen on ?21:18
timotimo lizmat: i believe 'cro run' is the one you mean21:19
lizmat ah, could be :-)21:19
timotimo since what port to use is more or less dynamic, based on what's in use21:19
raschipi joined21:23
jmaslak Yes, I can definitely put in a ticket. It would help a lot of types of network code to have something along those lines.21:24
p6fan left21:25
timotimo does it make any sense to also feed back the host used from the VM to the perl6 code?21:25
i know it makes sense for the port if it's 0, but will the "actually used" host ever differ from what you passed in?21:25
[Coke] I like the idea of splitting toggle up into separate chunks of *until and *while21:27
(and then you can more easily put a .race in front of it)21:27
timotimo On Windows if the addr is initialized to point to an unspecified address (0.0.0.0 or ::) it will be changed to point to localhost. This is done to match the behavior of Linux systems.21:30
sayeth the uv docs21:30
Geth ¦ doc/coke/build: 27 commits pushed by (Will "Coke" Coleda)++, Coke++21:33
¦ doc/coke/build: review: https://github.com/perl6/doc/compare/93709455703c...fcd0c9f66fd521:33
jmaslak Hmmpf, looks like github is having problems, I got a 500 error from them when I submitted the ticket. I'll try again in a bit.21:35
AlexDaniel jmaslak++ # persistence21:37
MasterDuke joined21:38
xi- does the <<terminator in string initialization work differently in perl6? it can't seem to find it https://p.nuxi.ca/pnmjoyqbx/sbv60s21:40
[Coke] https://docs.perl6.org/syntax/heredocs%20:to21:40
(yes)21:40
xi- right, thank you21:40
timotimo jmaslak: i've got the right functions together, and the places it has to go. just need to decide on an API to use between moarvm/jvm and rakudo ...21:44
jmaslak https://github.com/rakudo/rakudo/issues/2091 - I apologize if anything is unclear in the ticket.21:46
sena_kun left22:00
wamba left22:10
Xliff joined22:10
Xliff m: grammar Test { token TOP { <A> || <B> }; token A { 'A' }; token B { 'B' }; }; Test.^methods.name.say;22:12
camelia rakudo-moar b30800c8e: OUTPUT: «No such method 'name' for invocant of type 'List'. Did you mean any of these?␤ none␤ note␤ race␤ take␤␤ in block <unit> at <tmp> line 1␤␤»22:12
Xliff m: grammar Test { token TOP { <A> || <B> }; token A { 'A' }; token B { 'B' }; }; Test.^methods.gist.say;22:12
camelia rakudo-moar b30800c8e: OUTPUT: «(token TOP { <A> || <B> } token A { 'A' } token B { 'B' } parse parsefile subparse chunks orig CURSOR set_how space punct !cursor_start_subcapture same INDRULE !LITERAL perl pos prematch !cursor_push_cstack ident switch_to_slang !DYNQUANT_LIMITS blank…»22:12
Xliff Is there a way to get the name assigned to a regex object?22:15
m: my regex A { 'A' }; A.^name.say22:15
camelia rakudo-moar b30800c8e: OUTPUT: «Too few positionals passed; expected 1 argument but got 0␤ in regex A at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»22:15
Xliff m: my token A { 'A' }; A.^name.say22:16
camelia rakudo-moar b30800c8e: OUTPUT: «Too few positionals passed; expected 1 argument but got 0␤ in regex A at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»22:16
Xliff m: my token A { 'A' }; my $a = /<A>/; $a.^name.say22:16
camelia rakudo-moar b30800c8e: OUTPUT: «Regex␤»22:16
Xliff m: my token A { 'A' }; my $a = /<A>/; $a.VAR.name22:19
camelia rakudo-moar b30800c8e: ( no output )22:19
Xliff m: my token A { 'A' }; my $a = /<A>/; $a.VAR.name.say22:19
camelia rakudo-moar b30800c8e: OUTPUT: «$a␤»22:19
Xliff Maahahahaaha!22:19
xinming is 'has $a' the same as 'has $!a' ?22:19
Xliff m: my token A { 'A' }; A.VAR.name.say22:20
camelia rakudo-moar b30800c8e: OUTPUT: «Too few positionals passed; expected 1 argument but got 0␤ in regex A at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»22:20
jnthn m: my token A { }; say A.name22:21
camelia rakudo-moar b30800c8e: OUTPUT: «=== SORRY!=== Error while compiling <tmp>␤Null regex not allowed␤at <tmp>:1␤------> my token A { }; say A.name ␤»22:21
jnthn m: my token A { xxx }; say A.name22:21
camelia rakudo-moar b30800c8e: OUTPUT: «Too few positionals passed; expected 1 argument but got 0␤ in regex A at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»22:21
Xliff m: grammar Agrammar{ token A { 'A' }; }; for A.^methods { when Regex { $_.VAR.name.say }; };22:21
camelia rakudo-moar b30800c8e: OUTPUT: «=== SORRY!=== Error while compiling <tmp>␤Undeclared name:␤ A used at line 1␤␤»22:21
jnthn m: my token A { xxx }; say &A.name22:21
camelia rakudo-moar b30800c8e: OUTPUT: «A␤»22:21
jnthn duh :)22:21
Xliff Yeah. I figured it out. Thanks, jnthn++22:21
jnthn You just need .name.say there, not .VAR.name.say :)22:21
xinming is 'has $a' the same as 'has $!a' ? <--- ANyone here? :-)22:21
Xliff xinming: Yes.22:21
Not the answer to your question. One sec.22:21
No. "has $a" is not the correct syntax.22:22
jnthn xinming: Yes, in that it declares $!a. It also adds a compile-time alias so you can write $a and it is rewritten to $!a22:22
Xliff Oops! Listen to jnthn.22:22
I didn't know that. :p22:22
xinming jnthn: Thanks. That answer makes more sense. :-)22:22
I actually wish to understand the internal idea of the differences.22:23
jnthn It was a sop to people who don't like twigils, but the only folks I've ever seen objecting to them would just have found something else about Perl 6 to object to anyway. :P22:23
xinming: Every attribute is actually stored with with the ! twigil. Always.22:23
xinming jnthn: Yea, understand that, the $. only addess accessor method22:24
jnthn Yeah, it's similar for has $a :)22:24
xinming is rw makes the accessor writble.22:24
writable*22:24
jmaslak left22:24
jnthn Except that by runtime there's actually no "evidence" left behind of the fact it was declared has $a22:24
The compiler just rewrites them as it sees it22:25
xinming Ok, Thanks.22:25
jnthn m: class C { has $a = 42; method m() { say $a } }; C.new.m22:25
camelia rakudo-moar b30800c8e: OUTPUT: «42␤»22:25
jnthn m: class C { has $a = 42; method m() { EVAL 'say $a' } }; C.new.m22:25
camelia rakudo-moar b30800c8e: OUTPUT: «=== SORRY!=== Error while compiling /home/camelia/EVAL_0␤Variable '$a' is not declared. Did you mean '$!a'?␤at /home/camelia/EVAL_0:1␤------> say $a ␤»22:25
jnthn Rumbled :)22:25
xinming I have several small projects, and they'll be in perl6. :-)22:25
jnthn :)22:26
xinming I've been here over 12 years, and sees the huge changes in perl6 for each development stage. :-)22:27
jnthn Wow, I think that's longer than me :D22:29
[Coke] if I have a #| pod section before a sub invocation, how can I refer to it from inside the sub? #| some stuff \n add-it(3,4); sub add-it($a, $b) { ... what is the .WHY ? }22:32
jnthn &?ROUTINE.WHY?22:32
oh, the invocation22:33
duh22:33
Umm...I'm not sure that that pod declarator comment attaches to anything22:33
Though there's others who know the Pod6 stuff better than I22:33
Xliff jnthn: It looks like for grammars, you need the .VAR22:35
m: grammar Test { token TOP { <A> || <B> }; token A { 'A' }; token B { 'B' }; }; for Test.^methods { .VAR.name.say };22:35
camelia rakudo-moar b30800c8e: OUTPUT: «TOP␤A␤B␤parse␤subparse␤parsefile␤prematch␤xdigit␤same␤!DELEGATE_ACCEPTS␤at␤switch_to_slang␤FAILGOAL␤postmatch␤Str␤!reduce␤clone_braid_from␤to␤!cursor_start_subcapture␤snapshot_braid␤print␤!cursor_init␤INDRUL…»22:35
Xliff The only problem comes when I want to filter by Regex22:36
m: grammar Test { token TOP { <A> || <B> }; token A { 'A' }; token B { 'B' }; }; for Test.^methods { when Regex { .VAR.name.say }; };22:36
camelia rakudo-moar b30800c8e: OUTPUT: «TOP␤Died with X::Multi::NoMatch␤ in block <unit> at <tmp> line 1␤␤A␤B␤»22:36
Xliff m: grammar Test { token TOP { <A> || <B> }; token A { 'A' }; token B { 'B' }; }; for Test.^methods { when Regex { .VAR.name.say }; default { .name.say }; };22:37
camelia rakudo-moar b30800c8e: OUTPUT: «TOP␤Died with X::Multi::NoMatch␤ in block <unit> at <tmp> line 1␤␤A␤B␤parse␤parsefile␤subparse␤»22:37
jnthn Ah, it's probably tripping over the various internal methods22:38
.^methods(:local) might help22:38
Xliff \o/22:38
Yep. That works. Thanks much!22:38
[Coke] jnthn: I feel like I might be able to abuse it with CALLER somehow. :P22:43
Altreus does 'is copy' apply deeply to a data structure?22:43
separately: is there a shortcut to the current class, so I can say a constructor will return one?22:45
benji__benjikun22:46
jnthn Altreus: No, shallow22:48
And ::?CLASS for the second22:48
Altreus nice22:49
thanks :)22:49
turns out I actually want the input parameter to be ro22:49
so that one was ok22:49
jameslenz joined23:03
jameslenz left23:08
DarthGandalf joined23:09
testABC joined23:15
pmurias left23:16
xinming Is there a good web framework for perl6?23:17
timotimo xinming: Cro is a thing. it's more focused on "microservices", but it can do web apps, too23:18
xinming timotimo: THanks.23:19
timotimo xinming: cro.services is the web address23:19
testABC left23:21
xinming Thanks23:25
kerframil joined23:30
raschipi left23:33
Xliff left23:34
SmokeMachine is there any way to "mix" a class into IterationEnd to "return some data" to the class is iterating the iterator? but make it continue to finish the loops23:34
jnthn No23:37
SmokeMachine :(23:37
jnthn IterationEnd is a constant, if you did find a way to mix in to it you'd affect it globally23:38
SmokeMachine jnthn: I meant something using `but` but:23:39
timotimo all code that i've seen compares against the constant "behind" IterationEnd23:39
m: say IterationEnd.^name23:40
camelia rakudo-moar b30800c8e: OUTPUT: «Mu␤»23:40
SmokeMachine m: say IterationEnd =:= IterationEnd but role :: {}23:40
camelia rakudo-moar b30800c8e: OUTPUT: «False␤»23:40
jnthn You can do that, but then it won't be the end of the iteration23:41
Just some object23:41
SmokeMachine jnthn: Yes... I tried that... :(23:42
jnthn I susggest finding some other way to do whatever you're trying to do23:42
timotimo throw a control exception :P23:43
like, a warn23:43
b2gills Maybe an empty Slip just before IterationEnd?23:43
Actually, I don't think that would work23:44
SmokeMachine I was trying to implement `.take-while` and `.ignore-until`...23:44
I was trying something like this: https://www.irccloud.com/pastebin/XbfFizxy/23:45
b2gills I tried that once https://gist.github.com/b2gills/b877658f38dae51e3c88fbdc0990f581 except I went for .accept-while23:46
MasterDuke benchable6: HEAD compare my %orig = :1a, :2b; my %new = :5b, :6c; %orig «=« %new for ^10_000; dd %orig ||| my %orig = :1a, :2b; my %new = :5b, :6c; %orig ,= %new for ^10_000; dd %orig23:48
benchable6 MasterDuke, starting to benchmark the 1 given commit23:48
MasterDuke, No new data found23:48
MasterDuke benchable6: compare HEAD my %orig = :1a, :2b; my %new = :5b, :6c; %orig «=« %new for ^10_000; dd %orig ||| my %orig = :1a, :2b; my %new = :5b, :6c; %orig ,= %new for ^10_000; dd %orig23:48
benchable6 MasterDuke, starting to benchmark the 1 given commit23:48
MasterDuke, ¦HEAD: «Benchmark: ␤Hash %orig = {:a(1), :b(5), :c(6)}␤«timed out after 10 seconds»»23:48
MasterDuke benchable6: compare HEAD my %orig = :1a, :2b; my %new = :5b, :6c; %orig «=« %new for ^5_000; dd %orig ||| my %orig = :1a, :2b; my %new = :5b, :6c; %orig ,= %new for ^5_000; dd %orig23:49
benchable6 MasterDuke, starting to benchmark the 1 given commit23:49
MasterDuke, https://gist.github.com/c74a3252c670db25a315ae70022e64ca23:49
jnthn m: sub take-while($matcher, Iterable \things) { gather { for things { if $matcher.ACCEPTS($_) { .take } else { last } } } }; say take-while(* < 3, 1..10)23:49
camelia rakudo-moar b30800c8e: OUTPUT: «(1 2)␤»23:49
MasterDuke TimToady, kjk: ^^^ (the benchable results)23:49
SmokeMachine jnthn: I was trying to make possible something like: `^10 .take-while(* < 3).ignore-until(5).take-while(* < 9)` and that would return `(0, 2, 5, 6, 7, 8)`23:52
sorry: `(0, 1, 2, 5, 6, 7, 8)`23:54
TimToady MasterDuke: you mean the one that says "too few iterations" :)23:54
jnthn Ah, that'd be done by having an implementation of Iterable like TakeIgnoreIterable or some such23:55
And then add .ignore-until and .take-until methods on to that and stack them up23:55
And then apply them all at the point we really iterate23:56
SmokeMachine jnthn: yes, that makes sense...23:56
jnthn: both, take-while and ignore-until, would make some changes on self and return self, right? (being self a Seq)23:58
jnthn No23:59
Always do immutable things23:59
SmokeMachine or a new instance of Seq?23:59
ok23:59
jnthn But you might actually want a TakeIgnoreSeq or something (name to be bikeshed later :))23:59

Logs Search ←Prev date Next date→ Channels Documentation