»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by masak on 12 May 2015.
00:00 spider-mario left
timotimo gist.github.com/timo/a26ef6942bfed92e4d8e - JSON, ladies and gentlemen!! 00:01
00:01 bjz left
RabidGravy boom 00:02
timotimo i.imgur.com/kEyoHtz.png 00:04
i've spent about 2 hours on making the text in the entries column monospaced and right-aligned :) 00:05
i'm not a smart man
00:05 FROGGS joined 00:06 RabidGravy left 00:14 telex left 00:16 telex joined 00:19 yqt left 00:24 FROGGS left 00:28 FROGGS joined 00:31 tokuhirom joined
timotimo does javascript have something like an infix "defor" operator? 00:35
00:36 tokuhirom left
timotimo seems like i can use || for this 00:36
00:38 kjs_ joined 00:55 kjs_ left
ugexe "replace this Array is copy logic" - the missing uppercase r is more distracting than the strange error message itself 01:00
01:02 FROGGS left
dalek kudo/nom: d192f1c | lizmat++ | src/core/List.pm:
Make xx quite a bit faster

  - 42 xx 100 # no change, was already optimized
  - rand xx 100 # about 3.5x as fast
  - 42 xx * # about 5x as fast
  - rand xx * # about 1.5x as fast
The fixed lenghts xx completely build the list in memory. For large values, that may not be such a good idea. On the other hand, you would probably use a * in those cases anyway. Should this turn out to be a problem, then maybe we can switch to an iterator type approach if N > X. Of course, in the "push-all" case, there would be only a performance degredation, so I'm not so sure about such an aproach anyway. The
  * cases are implemented now as proper Iterators.
01:11
lizmat japhb timotimo : spectest clean and implemented in "your" pov :-) 01:12
and on that thought, I wish #perl6! good night
01:16 FROGGS joined
dalek c: 37b1f83 | (Carl Hayter)++ | doc/Type/Junction.pod:
missing > on a C<> breaks formatting
01:19
timotimo lizmat: thank you for your consideration! though i'm not 100% comfortable with the necessary compromise in semantics we had to make :( 01:22
01:24 zakharyas joined 01:27 aborazmeh joined, aborazmeh left, aborazmeh joined 01:35 bpmedley left 01:36 lolisa left 01:42 edehont left 01:45 leont joined
dalek p: 2480f74 | timotimo++ | src/vm/moar/ (2 files):
handle the possibility of elided fields in profile data
01:47
p: 875ce69 | timotimo++ | src/vm/moar/profiler/template.html:
we don't need no trailing spaces
01:48 TimToady left
timotimo ^- updating NQP is fine even without updating moarvm. updating only moarvm will result in non-functioning profiler html apps 01:48
01:49 FROGGS left 01:54 xinming left 01:55 xinming joined 01:57 TimToady joined, colomon joined
psch fwiw, i'm +1 for AlexDaniel++'s qx changes. i'd like &out as replacement for &runout and :shout as replacement for :x on q// 02:01
AlexDaniel yaay!
psch: but still, why there must be a quoting adverb for that? 02:02
psch bartolin: there's at least one spectest that exhibits the Mu.new spam you described. it's probably the same that made you bring this up, though... 02:03
AlexDaniel: definitely hysterical raisins. it's quite embedded in the Perfectly Eclectic Rubish Lister that makes our preferred language 02:04
AlexDaniel psch: uhh…
psch AlexDaniel: i'll readily admit that there's at least a lot of not-wanting-to-alienate-people-that-know-it behind my reasoning, and finding a different reason would take me some time 02:05
AlexDaniel: basically, "it's in perl5 and i'd dislike ripping it out just because, if anything just offer a long and cumbersome alternative that seems to do the same" 02:06
s/anything/nothing else/
AlexDaniel psch: I think that it is good. It gives a chance to think about other alternatives, like &run
psch AlexDaniel: right, that's the exact opposite of an answer to the same question, motivated by a very different point of origin
AlexDaniel: mind, i'm not saying you're wrong, i'm just saying that we might benefit from keeping something-like-qx around. although i do admit this is probably a negligable (sp?) benefit 02:07
AlexDaniel psch: thanks for your feedback 02:08
psch bartolin: on the upside, the r-j build is broken until someone figures out how to split CORE across multiple files and still load it properly, so i think it's fair to let it sit
AlexDaniel: no problem, as i said, i agree with everything except "remove the option to hang your rope with an appropiately dehuffmanized QX alternative" 02:10
i really like qshout because it looks somewhat scary :P
as in, shouting in general is somewhat unsafe, because it alerts lots of people you might not want alerted etc. it seems fitting 02:11
and, well, removing it seems contra TIMTOWTDI
AlexDaniel psch: actually, this whole story started from me asking about an equivalent to ShellQuote in perl6. Most likely other people moving from perl5 world will attempt to do the same, which is not what we want… 02:12
the deprecation message says "use 'runout' or 'shellout' instead", which is perfect 02:13
if runout is changed to “out”, then it is even better
psch: so if someone is used to hang his rope here, I don't think that it is a bad idea to say “hey, there is a different place to do that. By the way, here is a safe alternative” 02:14
psch hm, yeah, i suppose i'm too attached to the idea of having an extension to quoting syntax that does something forky 02:15
AlexDaniel psch: and you are not the only one :)
psch i mean, linguistically it sorta makes sense. we're changing language from the one we're in to the one we come from
(that's of course operating from "i like terminals" perspective) 02:16
and Q is about changing languages
so there it fits
AlexDaniel but the output does not equal to the input, does it make sense? 02:17
psch that *might* depend on whether the chinese room is sapient or not...
masak did someone say Q? 02:18
AlexDaniel I mean, you don't get a shell-adapted version of your string, what you get is completely different
so to me it sounds like a function, not a quoting construct…
psch masak: only if you have a remote-controlled car to spare :)
AlexDaniel but perhaps there are different ways to look at it
psch AlexDaniel: &map doesn't care if the mapper you write exhibits what you mean either 02:19
02:19 mike` joined
psch (although Cool breaks the obvious example i had in mind...) 02:19
maybe that's reason enough to demand a sh-ish grammar for qx//, though 02:20
Ben_Goldberg wonders whether a module which monkey patches Str and adds a .shellout or .qx, etc, would be sensible. 02:21
psch as in, the mapper supplied to &map still works according to the current language, but arguments to qx don't work according to what they are understood by
i think that convinces me, actually
if we want a shell-execution adverb to Q it should interpret the thus quoted string as the shell would 02:22
AlexDaniel I agree
psch what exactly that means is probably up for debate, though
Ben_Goldberg And the other thing up for debate is, "which shell", because not all of us are on *nix 02:23
AlexDaniel Ben_Goldberg: I'd say “perl6” shell! I mean, it would be great if it could autoquote variables… 02:24
psch masak: for your last blog post, i was thinking "grok time" for the "check but not CHECK time" you were writing about
masak: that's pretty much a gut reaction though, and might have occured to you already...
AlexDaniel Ben_Goldberg: it sounds weird, but it would be super cool if the shell quoting was inverted somehow 02:25
that is, everything is quoted, but you have to “unquote” it explicitly if you want it to break
but that's not what shells do, so I don't know…
timotimo i missed the 0hr game jam :|
Ben_Goldberg Sounds like lisp's "`" operator, with "," to unquote things. 02:26
02:27 uberbaud joined
masak psch: thanks for the suggestion. :) 02:30
psch: "grok" is not half-bad. I won't commit on it just yet, though. need to use these abstractions a bit more first.
02:33 tokuhirom joined
Ben_Goldberg Here's another interesting way of abstracting processes: metacpan.org/pod/IO::Pipeline 02:33
02:35 tokuhiro_ joined 02:37 tokuhirom left 02:38 lizmat_ joined 02:39 tokuhiro_ left 02:40 zakharyas left
psch masak: yeah, it's hanging a bit between the "understand how to use fittingly" and "internalize to the point of automation" meanings 'grok' has, but as i said, it's mostly a gut reaction - the other one was "get", but that's too overloaded, albeit a bit more common 02:41
AlexDaniel Ben_Goldberg: interesting. I'm not sure if there is any need for that though
02:42 lizmat left
AlexDaniel Ben_Goldberg: For example, run(…, :out).out is very useful in that sense 02:42
psch and it probably should be "'getting it' time" then anyway, which is probably worse...
masak psch: I keep reaching for a meaning a bit like "contextize", i.e. "endow with a surrounding context". because that captures it quite well. 02:43
02:46 ilbot3 left
psch masak: a bit of thesaurus clicking brought me "merge time", which seems quite good 02:47
02:48 ilbot3 joined
psch masak: although there might be a bit of lack of clarity on my end, i'm not sure whether it's the time where we know how to handle the quasi or where we know how to insert it 02:48
02:48 O47m341 joined
psch ...at least i think there's a difference there 02:48
psch might need to re-read the blog post in the morrow 02:49
02:49 SuzieQueue left, BenGoldberg joined
psch i'll think about that, i suppose 02:50
and about the jvm stuff too, probably
i have a hunch that 007 could help me explore concepts with that, but that might be horribly misguided :P
anyway, g'night o/
02:51 Ben_Goldberg left
AlexDaniel BenGoldberg: like this: run('some', 'command', :out).out.lines ==> grep { … } ==> map { … } ==> grep { … }; 02:52
BenGoldberg: as far as I know it wont build an efficient pipeline right now, but perhaps it would in the future? 02:53
.lines is also not lazy
BenGoldberg: but syntactically it is the same thing, isn't it? 02:54
BenGoldberg Pretty close. 03:04
Anyway, goodnight. Sleep is calling me. 03:06
03:06 BenGoldberg left 03:09 AlexDaniel left
dalek ecs/newio: f5e1f86 | labster++ | S32-setting-library/Temporal.pod:
Mention RFC 3339 in DateTime (which is what we currently accept), proleptic Gregorian Calendar
03:20
labster wait, I was on newio? *sigh*
dalek ecs: 34443f6 | labster++ | S32-setting-library/Temporal.pod:
Mention RFC 3339 in DateTime (which is what we currently accept), proleptic Gregorian Calendar
03:21
03:21 aristotle joined
aristotle apple.stackexchange.com/questions/...n-terminal 03:21
labster I really need to change my prompt to mention to the box name
aristotle might be of interest to anyone here using a Mac 03:22
03:22 aristotle left
labster the aristotelian method: infodump and sign off channel :) 03:24
03:38 leont left
dalek kudo-star-daily: 581381d | coke++ | log/ (8 files):
today (automated commit)
03:50
rl6-roast-data: d1cc57b | coke++ | / (9 files):
today (automated commit)
03:57 FROGGS joined
masak psch: we know how to handle the quasi by the time we evaluate it. identical in spirit to when you have a string "OH HAI, $person" -- you know what the string will be exactly when you reach that expression and $person is in scope and has a certain value. 04:00
psch: this happens before the quasi gets spliced into mainline code somewhere. the weird-and-wonderful bit is that the mainline code is a *different* context than where the quasi was evaluated, but the code from the quasi "remembers" where it was evaluated, kind of in analogy to closure semantics 04:02
concretely, if there's a $foo variable in the Qtree from the quasi, then variable lookup will go looking in the quasi's context, not in the mainline's. 04:03
I'm digging into exactly these details right now in 007. it's tricky to get right -- or, rather, I suspect it's one of those "easy once you know how" skills. 04:06
04:14 khw left, raiph left 04:29 bjz_ left 04:34 tokuhirom joined 04:39 tokuhirom left 04:41 kid51 left 04:44 baest left, baest joined 04:45 z8 left 04:51 tokuhiro_ joined 04:56 tokuhiro_ left, labster left 04:58 labster joined 04:59 skids joined 05:00 mike` left 05:05 z8 joined 05:06 acrussell joined 05:09 z448 joined 05:11 z8 left 05:20 kmel joined 05:29 bjz joined 05:34 kmel left 05:40 kaare_ joined 05:43 dayangkun joined, bjz left 05:51 dayangkun left, ggoebel left, Thigh joined 05:53 bjz joined 05:56 Thigh left 05:59 bjz left 06:01 bjz joined 06:11 Zoffix joined 06:21 z448 left 06:24 rurban joined 06:31 uberbaud left 06:34 skids left 06:36 tokuhirom joined, _dolmen_ joined 06:40 tokuhirom left 07:02 aborazmeh left 07:05 abaugher left 07:06 abaugher joined 07:22 ribasushi left 07:30 rindolf joined 07:31 ribasushi joined 07:36 azawawi joined
azawawi m-star: require MIME::Base64; say MIME::Base64.encode('foo'); 07:37
07:37 tokuhirom joined
azawawi star-m: require MIME::Base64; say MIME::Base64.encode('foo'); 07:37
camelia star-m 2015.09: OUTPUT«Could not find symbol '&Base64'␤ in block <unit> at /tmp/1hgCtm7lUH:1␤␤Actually thrown at:␤ in block <unit> at /tmp/1hgCtm7lUH:1␤␤»
azawawi m: require MIME::Base64; say MIME::Base64.encode('foo');
camelia rakudo-moar cd7766: OUTPUT«Could not find MIME::Base64 in any of:␤ file#/home/camelia/.perl6/2015.10-14-gcd77669/lib␤ inst#/home/camelia/.perl6/2015.10-14-gcd77669␤ file#/home/camelia/rakudo-inst-1/share/perl6/lib␤ file#/home/camelia/rakudo-inst-1/share/perl6/vendor/lib…»
azawawi hi #perl6 07:38
rindolf azawawi: hi! What's new? 07:41
azawawi: how's the weather there?
07:41 sunnavy left 07:42 tokuhirom left
azawawi rindolf: dusty lol 07:42
07:42 sunnavy joined
rindolf azawawi: ah. :-(. 07:42
azawawi: here it's raining.
azawawi rindolf: cool
rindolf: hopefully it will rain here also :)
rindolf azawawi: yes. 07:43
azawawi rindolf: what are you working on these days?
rindolf azawawi: I'm working on Mageia Linux, Project Euler, various CPAN distributions, Freecell Solver - stuff like that. 07:44
azawawi rindolf: im actually reading more code for implementing more selenium drivers in Perl 6. 07:45
rindolf azawawi: ah.
azawawi rindolf: so far the python version seemed to be the most well written along with the Perl 5 version :)
rindolf: the ruby bindings to selenium code is like OOP for the sake of OOP 07:46
rindolf: github.com/azawawi/perl6-selenium-webdriver/
rindolf: im now working on the firefox driver after finishing the json wire webdriver protocol with phantomjs/ghostdriver 07:47
rindolf azawawi: Rakudo is still very slow from my experience with it.
It's frustrating.
azawawi rindolf: i know :)
rindolf: i was working on some code that day and then wrote back a Perl script to do the same... and i was like... Perl 6 is so slow :)
rindolf: startup time is cutting back on my developer productivitiy as far as i noticed. but it is normal at this stage. 07:48
rindolf azawawi: bye! I'm going to rest.
masak lizmat_: haha -- I know I'm brain damaged by CT when I read your irclog.perlgeek.de/perl6/2015-10-24#i_11429273 and my mind goes "category of weird errors! what the heck would you take the morphisms to be!?" :P
azawawi rindolf: enjoy :)
rindolf: bye 07:49
masak .oO( from the category of things I don't expect many others to find amusing )
azawawi masak: hi there
masak aloahoy
azawawi masak: so what's recommended self.xyz or $.xyz? 07:51
07:51 zacts left
masak azawawi: I think consensus is "don't do $.xyz unless there's a good reason". but people might draw the line for that differently. 07:52
some say "don't do it unless $!xyz actually is an attribute"
others say "it's OK as long as $.xyz acts like an accessor in practice" 07:53
azawawi masak: from my experience (so far) $.xyz has troubles when using in BUILD(...)
ShimmerFairy I've taken a liking to $.xyz as a way of saying "I expect subclasses to give me this attribute-ish as something different than I would have", particularly in string interpolation stuff :)
masak azawawi: well, in BUILD I wouldn't use anything with a '.', because the object is not fully constructed.
azawawi: calling (non-sub)methods on a not-fully-constructed object is suspect, design-wise. 07:54
ShimmerFairy: yes, string interpolation is a temptation to mis-/over-use the $.xyz syntax :)
07:55 petercommand left
azawawi masak: i think we need to draw a diagram for newbies to explain the whole object construction thing in Perl 6 07:55
masak: the sequence, what's allowed, what's not... that is
masak agreed.
ShimmerFairy masak: well, it came in handy in places like class MyErrorBase { method gist() { "Error: $.message " } method message() { "boring default" } } :)
masak though moritz++ already has at least one nice post about that 07:56
azawawi coming from a Java background, i was like why did we complicate that :)
masak azawawi: the complications are in Java as well, believe me.
azawawi masak: well I use everyday :)
masak azawawi: I had a bug in a piece of code with exactly what we're talking about, not one month ago.
azawawi masak: s/use/use it/
ShimmerFairy masak: as a way of saying "There a thing called 'message' that's more-or-less an attribute, and I want whatever the class wants me to get as a 'message'"
masak azawawi: Java's .new is like a combined Perl 6's .new/.BUILD 07:57
07:57 sunnavy left
masak ShimmerFairy: aye. in that case, I would say that .message is "sufficiently accessor-like" 07:57
ShimmerFairy: what I mean is that some people might object to, say, calling $.activate on a method .activate that had side effects 07:58
ShimmerFairy masak: yeah, that seems a bit weird to me :) . As far as I'm concerned, if you think of the method call as really an attribute-like thing that you want subclasses to override, that's what you use. 07:59
07:59 sunnavy joined 08:00 z8 joined
azawawi :) 08:04
08:06 _dolmen_ left 08:08 firstdayonthejob joined 08:09 rurban left
masak ShimmerFairy: I guess I think of it from the (Eiffel) perspective of queries vs commands. 08:17
08:19 domidumont joined 08:24 ecocode joined 08:31 petercommand joined 08:37 z448 joined 08:38 tokuhirom joined 08:39 vendethiel joined 08:40 z8 left 08:41 [particle] joined 08:42 tokuhirom left, [particle]1 left, darutoko joined
dalek kudo/curli: 5e45f99 | (Stefan Seifert)++ | src/core/CompUnitRepo/Locally.pm:
Make CompUnit::Repository::need actually load the found module
08:44
09:00 z448 left
vendethiel m: class A { has $!a; method BUILD(:$!a!) {}}; A.new 09:27
camelia rakudo-moar cd7766: OUTPUT«Required named parameter 'a' not passed␤ in method BUILD at /tmp/IFt3iKzHsz:1␤ in block <unit> at /tmp/IFt3iKzHsz:1␤␤»
09:27 bjz left
vendethiel "bang-fence" 09:27
09:30 edehont joined 09:34 bjz joined, vendethiel left
[Tux] test 50000 37.623 37.508 09:37
test-t 50000 38.952 38.837
09:41 kjs_ joined 09:45 kjs_ left 09:46 RabidGravy joined 09:58 tokuhiro_ joined 10:07 pmurias joined
RabidGravy whassup? 10:15
10:19 ifim left 10:20 azawawi left
dalek kudo/curli: d751433 | (Stefan Seifert)++ | src/core/CompUnit (3 files):
Replace use of @*INC by $*REPO for loading modules.

CompUnitRepo.load_module now creates a CompUnit::DependencySpecification and
  $*REPO.need for loading modules.
10:23
10:26 virtualsue joined 10:27 tokuhirom joined 10:36 tokuhirom left 10:39 tokuhiro_ left
skaji { temp %*ENV<FOO> = "1" }; { temp %*ENV<BAR> = "1"; run "ls" } 10:44
the above code exits with "Cannot unbox a type object"
10:44 void1 joined
skaji is this expected? 10:45
moritz no; looks like a bug
skaji OK, I will raise a RT ticket. Thanks. 10:46
(note: { temp %*ENV; %*ENV<FOO> = "1" }; { temp %*ENV; %*ENV<BAR> = "1"; run "ls" } is works) 10:47
10:49 tokuhiro_ joined, tokuhiro_ left 10:50 tokuhiro_ joined 10:57 azawawi joined
azawawi hi 10:57
is there any p6 module to deal with unzipping an archive?
10:57 TEttinger left
moritz azawawi: I'm not aware of one 10:58
azawawi moritz: thx
moritz though with 400+ modules in the running, it's easy to lose overview :-) 10:59
10:59 Actualeyes joined 11:01 cognominal left
itz_stmuk its the most wanted 11:04
^ in the most wanted
11:04 spider-mario joined, Actualeyes left
RabidGravy nice little hack for someone on a Sunday afternoon 11:05
azawawi, it is possible that Compress::Zlib might be persuaded to do it depending on the version of zip used 11:08
11:10 virtualsue left
azawawi checks 11:10
11:13 Alina-malina left
azawawi RabidGravy: Compress::Zlib is too low level (i.e. stream) 11:14
RabidGravy then it seems you found something to do this afternoon ;-) 11:15
azawawi finally it is raining :)
rindolf: yes!
rindolf azawawi: awesome! 11:16
azawawi RabidGravy: yup but i need to focus on firefox/webdriver thing first :)
RabidGravy: thx for the info though. I was not aware of the Compress:: namespace in modules.perl6.org 11:18
11:27 bpmedley joined 11:29 Actualeyes joined
lizmat_ .botsnack 11:30
yoleaux :D
synbot6 om nom nom
tadzik :D
lizmat_ need to appease the bots! 11:31
11:31 lizmat_ is now known as lizmat
lizmat .botsnack 11:31
yoleaux :D
synbot6 om nom nom
11:32 cognominal joined 11:33 tokuhirom joined 11:36 AlexDaniel joined 11:37 Begi1114 joined, tokuhirom left
azawawi m: %*ENV<FOOBAR> = 1; my $p = Proc::Async.new("foobar"); $p.start; 11:41
camelia rakudo-moar cd7766: OUTPUT«Proc::Async is disallowed in restricted setting␤ in sub restricted at src/RESTRICTED.setting:1␤ in method new at src/RESTRICTED.setting:32␤ in block <unit> at /tmp/V2PGgqJTb9:1␤␤»
azawawi i found a possible mini bug in Proc::Async 11:42
"This type cannot unbox to a native string" when you use %*ENV<FOOBAR> = 1
it took me a while to figure out what happened lol 11:43
skaji %*ENV<FOOBAR> = 1.Str; 11:44
AlexDaniel actually, the problem is not with Proc::Async 11:46
it seems like everything is affected
%*ENV<FOOBAR> = 1; run("echo");
%*ENV<FOOBAR> = 1; qx/echo/;
same error everywhere
azawawi i see 11:47
AlexDaniel azawawi: will you report that or should I do it?
azawawi please report it. im busy writing code for automating firefox :) 11:48
AlexDaniel: thx
AlexDaniel ok
RabidGravy azawawi, AlexDaniel I think skaji just reported this about an hour ago 11:49
they may or may not have RT'd 11:50
11:50 pecastro joined
AlexDaniel RabidGravy: indeed! 11:50
RabidGravy yeah rt.perl.org/Ticket/Display.html?id=126447
11:52 pecastro_ left
lizmat FWIW, looking at that now 11:53
note that if you say = "1", it works ok 11:54
RabidGravy lizmat++
AlexDaniel lizmat: but the bug report does not make any sense to me, actually 11:55
lizmat: there it is written as "1"
11:55 virtualsue joined
azawawi so after looking at selenium language bindings (python,rb,...) i found really something 11:55
bartolin lizmat: looks like there is also RT #125953 about the same problem 11:56
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=125953
azawawi bad logic/code does propagate to language ports in the end :)
lizmat well, I took azawawi's line, and that failed for me, and didn't with "1"
11:56 lucasb_ joined
lizmat so #126447 may be a different issue altogether 11:56
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=126447
lizmat yeah, it's really #125953 I'm looking at 11:57
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=125953
bartolin lizmat++
pmurias azawawi: you mean bugs get ported over to language ports? 11:58
11:58 ggoebel joined
azawawi pmurias: yup bad logic that is 11:59
pmurias: and over-designed feature sets
11:59 rupert160 joined 12:00 rupert160 left
RabidGravy azawawi, there are shit developers out there? who knew? ;-) 12:01
azawawi pmurias: to explain, to automate firefox you need to create a temporary profile folder for it, unzip the extension which acts as web driver (http/json) and then communicate with it directly. 12:02
pmurias: in selenium code it is like 3 different classes which you jump back and forth to understand code lol 12:03
12:04 AlexDani` joined, Actualeyes left 12:05 AlexDaniel left
RabidGravy on a complete un-related is iit a design decision to not allow type constraints on "our" variables or basically a NYI or something else? 12:06
12:11 virtualsue left 12:14 bjz_ joined 12:15 bjz left, kid51 joined 12:16 Actualeyes joined
lizmat RabidGravy: I think it was an implementation decision 12:19
AlexDani` weird. I've never thought about it 12:20
12:22 diana_olhovik_ joined
dalek ast: a5831ca | usev6++ | S32-exceptions/misc.t:
Add test for RT #125780
12:24
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=125780
12:31 AlexDani` is now known as AlexDaniel 12:32 pmurias left
AlexDaniel m: our Str $foo 12:35
camelia rakudo-moar cd7766: OUTPUT«5===SORRY!5=== Error while compiling /tmp/s9dl8D4LAm␤Cannot put a type constraint on an 'our'-scoped variable␤at /tmp/s9dl8D4LAm:1␤------> 3our Str $foo7⏏5<EOL>␤ expecting any of:␤ constraint␤»
AlexDaniel expecting any of: constraint? 12:36
12:36 Axord joined
lizmat yeah, LTA error message 12:39
12:43 leont joined
lucasb_ m: say so False S& False 12:45
camelia rakudo-moar cd7766: OUTPUT«True␤»
lucasb_ ^^ This little one still here. Maybe few people use the 'S' metaop
AlexDaniel m: 'x' <= 25 12:46
camelia rakudo-moar cd7766: OUTPUT«WARNINGS:␤Useless use of "<=" in expression "'x' <= 25" in sink context (line 1)␤Earlier failures:␤ Cannot convert string to number: base-10 number must begin with valid digits or '.' in '7⏏5x' (indicated by 7⏏)␤ in block <unit> at /tmp/W…»
lizmat RabidGravy AlexDaniel skaji spectesting fix 12:48
AlexDaniel hm, it cuts it, but the “Final error:” is “Cannot call Real(Failure: ); none of these signatures match: (Mu:U \v: *%_)”
12:49 ^elyse^ joined
leont Does anyone have an idea of how expensive the gradual type is? 12:52
12:53 ^elyse^ left
lizmat leont: if you don't specify a type, all type checking is done against Any 12:53
so: type checking is done *always* 12:54
already
leont Ah, ok
lizmat it's just checking against Any if you don't specify anything more strict
AlexDaniel well, this sounded like there's no difference if you specify a type or not 12:55
lizmat indeed, there is no execution speed difference
12:55 Alina-malina joined
AlexDaniel but in reality it should be faster if you do, since then there's no need to mess with type checks and stuff 12:56
12:56 El_Che_ is now known as El_Che
lizmat well, if you're using simple types... I mean, if you specify a type that has a where in it, it *will* be slower because it needs to execute that code 12:56
typechecks are done on C-code, *very* low level
*in
AlexDaniel in fact, even if you don't specify the type, it seems like it will do that automatically… at least that's what I understood from jnthn talks 12:57
with a drawback that it might have to deoptimize it in the future
lizmat yes, it will be of type Any
AlexDaniel lizmat: well, on what level? 12:58
lizmat AlexDaniel: deopt why ?
leont Then I'll keep my types, and may add a few more
(and try to not add too many subsets 12:59
AlexDaniel lizmat: well, if your code always gets a Str in runtime, then it makes sense to optimize it for Str. Just to get the instruction count lower
lizmat: if then all of sudden it gets something else, then you have to rewind that… 13:00
I could be wrong, but that's how I understood it
lizmat ah, yes
leont Do return types on subs/methods help in avoiding those checks? 13:02
AlexDaniel leont: I'd say yes, but it's hard to measure how much you actually win in terms of wallclock time 13:03
leont: so if I were you I would not care about this. What I would care about is the self-documenting code
leont: if the types are specified everywhere, arguably it is easier to read 13:04
though I don't say that you always should do that
lucasb_ r: say ('abc' x 2 ~ '1234').substr(4) 13:06
camelia ( no output )
..rakudo-moar cd7766: OUTPUT«bcabc1␤»
lucasb_ j: say ('abc' x 2 ~ '1234').substr(4)
camelia rakudo-jvm cd7766: OUTPUT«bc1234␤»
leont Given how much C++ I've been doing lately, adding the types feels fairly natural to me ;-)
lucasb_ don't know why rakudo-jvm had no output in the first eval 13:07
AlexDaniel well, what if we try it again?
r: say ('abc' x 2 ~ '1234').substr(4)
camelia rakudo-moar cd7766: OUTPUT«bcabc1␤»
..rakudo-jvm cd7766: OUTPUT«bc1234␤»
AlexDaniel r: say ('abc' x 2 ~ '1234').substr(4)
camelia rakudo-moar cd7766: OUTPUT«bcabc1␤»
..rakudo-jvm cd7766: OUTPUT«bc1234␤»
AlexDaniel r: say ('abc' x 2 ~ '1234').substr(4) 13:08
camelia rakudo-jvm cd7766: OUTPUT«bc1234␤»
..rakudo-moar cd7766: OUTPUT«bcabc1␤»
AlexDaniel go figure
lizmat oh, wow
looks to me jvmis correct 13:09
lucasb_ indeed. this is an old one
leont How heavy is compiling rakudo-jvm compared to rakudo-moar? 13:10
AlexDaniel leont: by heavy you mean?
lizmat takes about 4x as long on my machine
leont Memory-wise mainly
ShimmerFairy lizmat: how so? I have a hard time seeing why moar isn't the correct one
leont But CPU is also useful to know
moritz last I tried, I needed about 3GB RAM 13:11
lucasb_ ShimmerFairy: It looks like a off-by-one error, but I think moar is wrong, don't you?
ShimmerFairy lucasb_: no?
AlexDaniel ShimmerFairy: please explain…
ShimmerFairy r: say 'abcabc1234'.substr(4)
camelia rakudo-{moar,jvm} cd7766: OUTPUT«bc1234␤»
ShimmerFairy must've miscounted in my head the first time :) 13:12
AlexDaniel ShimmerFairy: by the way, thanks for your comment
lizmat r: say (('abc' x 2) ~ '1234').substr(4) 13:13
camelia rakudo-moar cd7766: OUTPUT«bcabc1␤»
..rakudo-jvm cd7766: OUTPUT«bc1234␤»
13:13 parsonsNose joined
awwaiid AlexDaniel: well... specifying types everywhere, IMO, is a double edged sword. Working with haskell code I see few things I don't care for. One is that by not allowing type inference you end up having to edit lots of code if you change a type. Another is that instead of having like $name they have Name $n, and then in the body use one-letter variable names with the excuse that you can look up to see the type of the variable. 13:14
parsonsNose why is `perl6 -e 'my ($x,$y,$i) = (0,1,1); while ($i < 1000000) {$y += $x ; $x = $y - $x ; $i += 1 } ; say $y;'` using up 6GB of RAM before plateauing?
ShimmerFairy AlexDaniel: you're welcome. I hope I was better able to describe how I view :x in a long comment as opposed to short IRC statements :) 13:15
moritz parsonsNose: looks like a bug to me
parsonsNose: some weird conditions not triggering a GC run
parsonsNose *sad face* this is on rakudobrew moar
AlexDaniel ShimmerFairy: well, I still completely disagree, but it's good to have different opinions :) 13:16
moritz parsonsNose: care to submit that via email to [email@hidden.address]
parsonsNose Sure thing
AlexDaniel wow, it is so hungry for ram 13:17
13:21 loren joined
AlexDaniel my: my $x = 0; my $y = 1; for 1..1000000 { $y += $x; $x = $y - $x; }; say $y; 13:22
whoops, I meant m:
but it does not matter, what I wanted to say is that it eats the whole memory too
13:23 domidumont left 13:24 ggoebel left
AlexDaniel parsonsNose: how many digits are there in the final result? 13:25
parsonsNose something like 20k... I'll check
loren m: my $x = 1; if ($x = 0) { say "invoke me"; }; $x = 2; if ($x = 0) & ($x = 1) { say $x; } 13:27
camelia rakudo-moar cd7766: OUTPUT«1␤»
loren why the second if condtion '($x = 1)' be calculated 13:28
azawawi github.com/azawawi/perl6-selenium-...firefox.p6 # POC: Automating firefox process through Perl 6 selenium webdriver :) 13:29
parsonsNose 208k
moritz loren: are you realizing you're not using comparison (==) but assignment (=) ?
parsonsNose (took a while)
loren that's not point
lucasb_ well, 1 is true
AlexDaniel I thought that this would help: $y += $x; $x -= $y; $x *= -1; but no
lucasb_ 0 is not
moritz loren: the problem is that you're reading and writing from a variable in the same statement with no sequence point 13:30
loren: both assignments return $x (the, variable, not its value)
loren m: my $x = 1; if ($x = 0) { say "invoke me"; }; $x = 2; if ( 0 ) & ($x = 1) { say $x; }
camelia ( no output )
13:30 ggoebel joined, raiph joined
moritz loren: so both expressions return $x (which evaluates to 1), and & is not short-circuiting 13:30
ShimmerFairy loren: did you mean && perchance? 13:31
(a single & makes a Junction)
moritz loren: your statement is equivalent to do { $x = 1; $x & $x }
parsonsNose Bug report sent, anyway. Feel like the original code should've worked. For comparison, scala uses about 300MB with equivalent code
loren OK, moritz i know it .
I will take some look '&&' 13:32
awwaiid azawawi: that's pretty awesome! 13:34
loren I just sae '&' operator , ignored '&&'
13:35 tokuhirom joined 13:36 mayuresh joined 13:39 mayuresh left, tokuhirom left 13:43 ngie joined 13:48 FROGGS_ joined 13:52 FROGGS left
masak loren: heh. most of the time you'll want '&&', I think. 13:54
13:55 ^elyse^ joined, void1 left
loren Em, yes, '&&' is my wanted. thks, masak 13:56
The '&' will hang up my program.. 13:57
13:57 BenGoldberg joined
masak almost never the desired behavior :P 13:57
13:58 diana_olhovik_ left
moritz did I ever tell you folks that three weeks ago, I was very happy about a segfault? 13:58
story time :-) 13:59
so, at $work, we have a huge OTRS (ticket system) installation
masak listens
llfourn puts headphones on
moritz and to be able to reproduce some bug in our testing environment, we copied the prod database to the test env 14:00
and since permissions aren't as restrictive in test (more people have root), we have a job that deletes sensitive data (HR, security stuff, invoices, ...)
and $cow-orker accidentally enabled that job in prod instead of test 14:01
llfourn hopes the story doesn't end with "and then we realised we have no backup..."
moritz and luckily, that job segfaulted
... after deleting about 10k tickets, instead of deleting 30k tickets
14:01 Actualeyes left
lizmat *phew* 14:01
masak urgh 14:02
moritz so, hence I was glad about a segfault :-)
masak kind of two wrongs making a right, though
moritz but we noticed that only after ~5 hours
so, restoring the last backup wasn't really an option
azawawi awwaiid: thx
bartolin . o O ( so the story ends with "and now our backups run faster" ) 14:03
moritz we ended up using the last backup in a separate database
azawawi home &
parsonsNose still, you had those 10k records in test, right, since you didn't run the job there?
:D
moritz and removed the DEETE statements from the mysql replication logs
14:03 ollej joined
moritz then ran the replication logs in that database copy 14:03
and then wrote a script that copies the deleted rows from the backup database to prod 14:04
lizmat sounds familiar in a way :-)
llfourn what caused the deleting job to segfault? was it a script or some db native thingo....
moritz parsonsNose: we had, but we also had 5 hours of people going wild in the test database. Because all is fair in test, right? :-)
14:05 azawawi left
moritz llfourn: I haven't yet debugged why it segfaulted :-) 14:05
14:05 ollej left
llfourn was it perl? 14:05
moritz llfourn: yes 14:06
14:06 Begi1114 left
moritz llfourn: but with lots of XS under the hood (DBI, EV, mod_perl, ...) 14:07
llfourn ahhh well that's what saved you
moritz still it was 2.5 work days to get it all back 14:08
lizmat moritz: with a PP version, it wouldn't have sagfaulted, but it would have been slower
masak moritz: what do you feel you learned from the episode? :)
moritz lizmat: pure perl mod_perl? 14:09
lizmat np, PP DBI :)
*no 14:10
moritz masak: that backups and replication logs can save your behind. That it sucks to be the one to have pressed the wrong button (luckily, wasn't me). That it shouldn't be so easy to press the wrong button, but sometimes it's hard to make it harder.
masak aye 14:11
14:11 Begi1114 joined
moritz masak: but maybe most importantly that it helped imensly to not do the recovery alone 14:12
14:14 lichtkind joined, Actualeyes joined 14:16 ngie left 14:17 BenGoldberg left 14:18 BenGoldberg joined, BenGoldberg left 14:19 BenGoldberg joined 14:20 BenGoldberg left, BenGoldberg joined
dalek kudo/nom: 0c775c9 | lizmat++ | / (4 files):
Wean slicing away from CLONE-HASH-DECONTAINERIZED

This might have a beneficial effect on slicing with adverbs, but alas this appears to be within noise levels :-(
14:21
14:21 BenGoldberg left, BenGoldberg joined
masak moritz: yeah, I can imagine. 14:23
14:23 dayangkun joined 14:24 khw joined
dalek kudo/nom: b0b2489 | lizmat++ | src/core/control.pm:
Fix #126447 and #125953 (and possibly more)
14:30
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=126447
14:31 zakharyas joined 14:34 dayangkun left, cosine joined 14:39 rurban joined, andreoss joined 14:44 zakharyas left
gfldex is the last statement in the following still valid? rosettacode.org/wiki/Unicode_strings#Perl_6 14:44
lizmat I think the "specced not entirely implemented" can be removed 14:46
14:46 intrigue is now known as heisenberg
lizmat the rest seems still applicable to me 14:47
cosine Hello everyone... 14:49
Is there some way to automatically convert built-in types to custom classes?
Like this: pastebin.com/Jk168sHC
gfldex cosine: you would use a multi for do-a-b-c 14:50
cosine So I have to define a multi for each type then? 14:51
Int, Str, etc.
gfldex or you replace method do-? with a multi 14:53
14:53 ollej joined
cosine Hmm, how do you mean? 14:53
Should I write it like this? pastebin.com/RhPQhh7F 14:54
lizmat cycling&
14:54 rurban left
gfldex Perl 6 does not provide automatic type casts like C++ does, so you have to do it by hand and redefine your problem. 14:55
I tend to find myself doing the latter quite often.
cosine Okay... I mainly just want to do it for convenience in a few places anyway, so it's not really a problem to just call .new manually. 14:56
Thanks for the help 14:57
14:57 rurban joined 15:06 tokuhiro_ left
masak greetings, cosine. welcome :) 15:06
'night, #perl6
pink_mist sleep well masak 15:07
15:07 AlexDaniel left
skaji lizmat: I reported #126447. Thank you for your quick fix. It now works, but a warning is emitted. 15:09
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=126447
skaji $ perl6 -e '{ temp %*ENV<FOO> = "1" }; { temp %*ENV<BAR> = "1"; run "ls" }'
Use of uninitialized value %ENV of type Any in string context
Any of .^name, .perl, .gist, or .say can stringify undefined things,
if needed. in block at -e:1
Applications System bin etc net sbin var
15:12 rurban left 15:13 edehont left 15:16 xfix joined 15:17 cosine left 15:18 weihan joined 15:23 telex left 15:24 telex joined
ugexe looks like <foo> isn't getting removed when it leaves the scope 15:29
15:29 edehont joined
ugexe m: { temp %*ENV<FOO> = 1; }; say %*ENV.perl 15:32
camelia rakudo-moar cd7766: OUTPUT«{:FOO(Any), :HOME("/home/camelia"), :LANG("POSIX"), :LC_CTYPE("en_US.UTF-8"), :LOGNAME("camelia"), :MANPATH("/home/camelia/perl5/perlbrew/perls/perl-5.20.1/man:"), :PATH("/home/camelia/perl5/perlbrew/bin:/home/camelia/perl5/perlbrew/perls/perl-5.20.1/bin:/…»
15:34 anaeem1_ joined 15:35 anaeem1_ left 15:36 tokuhirom joined
moritz m: { temp %*ENV<FOO> = 1; }; say %*ENV.keys.sort.perl 15:37
camelia rakudo-moar cd7766: OUTPUT«("FOO", "HOME", "LANG", "LC_CTYPE", "LOGNAME", "MANPATH", "PATH", "PERL5LIB", "PERLBREW_BASHRC_VERSION", "PERLBREW_HOME", "PERLBREW_MANPATH", "PERLBREW_PATH", "PERLBREW_PERL", "PERLBREW_ROOT", "PERLBREW_VERSION", "PWD", "RAKUDO_NO_DEPRECATIONS", "SHELL", "…»
15:41 tokuhirom left 15:42 liztormato joined, liztormato left 15:43 liztormato joined, liztormato left 15:47 xenowoolfy joined, xenowoolfy left, xenowoolfy joined 15:48 nightfrog joined 15:49 xenowoolfy left 15:51 parsonsNose left, lizmat_ joined
lizmat_ skaji: will look at the warnings when I'm back home 15:53
15:56 lizmat_ left, liztormato joined 16:03 edehont left 16:06 tokuhiro_ joined 16:07 domidumont joined 16:10 ^elyse^ left 16:11 tokuhiro_ left
xinming Hi, Just curious about the question yesterday. 16:13
my $str = "xx"; %h<<$str>>; and %h<<xx>> behaves differently.
Is this intentional?
liztormato Different how? 16:14
xinming m: my %h = 1, 'a', 2, 'b'; %h<<1>>.WHAT.say; my $var = 1; %h<<$var>>.WHAT.say; 16:15
camelia rakudo-moar cd7766: OUTPUT«(Str)␤(List)␤»
16:16 leont left
xinming liztormato: Did you see? One returns the value of the key, the other returns a List 16:16
liztormato $var could expand to multiple values, that's why it returns a List 16:19
A bare str can not
RabidGravy aye, it's use {} unless you actually *want* that behaviour 16:21
16:26 weihan left
RabidGravy after all you know when you are typing the program whether it is a string literal or a variable 16:26
16:32 xfix left 16:35 ^elyse^ joined
[Coke] messages? 16:37
16:38 edehont joined 16:39 slobo left
liztormato o/ edehont 16:39
edehont \o/
Lurking and learning... 16:40
liztormato ;-). Welcome! 16:41
16:46 liztorma_ joined 16:48 liztormato left 16:49 diana_olhovik_ joined 16:50 liztorma_ left, llfourn left 16:52 patrickz joined
patrickz Hey! How would I go about accessing a perl5 package variable using Inline::Perl5? 16:54
yoleaux 9 Oct 2015 11:18Z <jdv79> patrickz: yes. i'd like to try to get cpants support though since that's more mature
9 Oct 2015 11:19Z <jdv79> patrickz: less work for all:)
9 Oct 2015 11:20Z <jdv79> patrickz: oh, seems cpants and cpantesters aren't the same thing. I mean the latter.
16:55 ^elyse^ left 16:56 Mark- joined, Mark- left, virtualsue joined
RabidGravy patrickz, it's something like: use Foo :from<perl5> 17:00
(I've never used it so that could be wrong)
infact the synopsis here has it github.com/niner/Inline-Perl5/ 17:01
sorry I may have mis-read what you asked
"package variable" 17:02
dalek ast: e58cb30 | usev6++ | S02-magicals/env.t:
Add test for RT #125953
synbot6 Link: rt.perl.org/rt3/Public/Bug/Display...?id=125953
Zoffix patrickz, have you tried just the normal way? use DBI:from<Perl5>; say $DBI::Foo::Bar::Baz::Var; 17:05
yoleaux 24 Oct 2015 14:46Z <Ven> Zoffix: tell me when I can start treating github.com/adambard/learnxinyminut...ssues/1390
patrickz Haven't tried yet. Thought I'd ask first. But will try and report. :-) 17:06
Zoffix .tell Ven RE learnxiny: any time :) I finished with the docs and submitted my PR (#1434), which got merged. The ones that aren't crossed out are still open. And I don't know a suitable answer :) 17:07
yoleaux Zoffix: I'll pass your message to Ven.
Zoffix .botsnack
yoleaux :D
synbot6 om nom nom
17:14 blackcat_ joined 17:16 diana_olhovik_ left, loren left 17:18 kmel joined 17:23 BenGoldberg left, BenGoldberg joined 17:26 colomon left, colomon joined 17:33 pmurias joined 17:35 BenGoldberg left, BenGoldberg joined 17:36 BenGoldberg left, BenGoldberg joined
timotimo hello everybody 17:36
i know why the problem happens with the eating all the memory thing parsonsNose encountered 17:37
RabidGravy hello
timotimo allocating big bignums doesn't put pressure on the GC at all, because only the header of the bignum object lives in GC'd memory
and those are small; the actual number itself gets malloc'd directly
RabidGravy ew
pmurias people seem to be complaining about q:x being a foot gun, should q:w:x {...} be the safer version?
timotimo so the GC will happily fill up its nursery of 4 megabytes with these tiny objects that all have a few megabytes of non-gc-managed memory backing them 17:38
in the past i've already added a pressure thingie for strings to the GC; that could be generalized to also handle bigints
perhaps there's also a reason to do the same for Blob-like objects, i.e. everything repr'd VMArray 17:39
but the way bigint ops work is much more prone to memory ballooning than Blobs etc
because basically every operation on a bigint will do a copy, whereas you'd be accessing positionals inside a Blob or slices much more often 17:40
17:44 heisenberg is now known as intrigue
lizmat m: { temp %*ENV<FOO> }; ~%*ENV<FOO> # golfed problem skaji reported 17:44
camelia rakudo-moar cd7766: OUTPUT«WARNINGS:␤Useless use of "~" in expression "~%*ENV<FOO>" in sink context (line 1)␤Use of uninitialized value %ENV of type Any in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in block <unit> at /tmp/Y…»
lizmat the problem is really that temp %h<FOO> removes the value, but not the key 17:45
timotimo i didn't even know temp could do such a thing yet ...
17:46 Actualeyes left
lizmat m: { let %*ENV<FOO> }; ~%*ENV<FOO> # same for let 17:46
camelia rakudo-moar cd7766: OUTPUT«WARNINGS:␤Useless use of "~" in expression "~%*ENV<FOO>" in sink context (line 1)␤Use of uninitialized value %ENV of type Any in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed. in block <unit> at /tmp/s…»
17:47 edehont left 17:48 yqt joined
lizmat timotimo: I guess World.setup_let_or_temp needs some extra magic to handle hashes 17:48
which is really outside of my comfort zone
timotimo as it is outside mine 17:49
i'm up to the first spectest run for the new "for ^foo -> loop" optimization to take advantage of nine's recent refactoring 17:50
17:50 rurban joined
timotimo but it's on my laptop, and that is curently in my bag, and i have to do other stuff before i can head out 17:50
17:53 diana_olhovik joined, Begi1114 left
nine patrickz: there's no way to access Perl 5 package variables from Perl 6 directly. It's on my TODO list. In the mean time, you can help yourself with small getter/setter functions in Perl 5. Those can be called from Perl 6. 17:54
patrickz nine: ok. Thus no $DBI::errstr for now. 17:56
Zoffix There is Perl 6's DBIish :) 17:58
patrickz nine: Inline::Perl5 is totally awesome btw.
17:58 inokenty left
nine patrickz: thanks :) 17:59
patrickz Zoffix: True. I'm refactoring a Perl5 code base and thought I'd go the way of least resistance. Thus Inline::Perl5 for all stuff that's not yet polished in perl6. Thus DBI instead of DBIish
Zoffix :) 18:00
lucasb_ m: my %h = a=>1; { temp %h<b> = 1 }; say %h 18:03
camelia rakudo-moar cd7766: OUTPUT«a => 1, b => (Any)␤»
lucasb_ m: my @a = 1,2,3; { temp @a[5] = 42 }; say @a
camelia rakudo-moar cd7766: OUTPUT«[1 2 3 (Any) (Any) (Any)]␤»
lucasb_ ^^ the same thing for arrays, too, right?
18:05 inokenty joined
lucasb_ another thing is that 'temp' doesn't work with slices %h<a b c> = ... or @a[0,1,2] = ...; should it work? 18:06
18:07 BenGoldberg left, BenGoldberg joined 18:08 ^elyse^ joined, BenGoldberg left 18:09 BenGoldberg joined, ^elyse^ left
lizmat lucasb_: temp at this moment only works for scalar values 18:11
18:12 BenGoldberg left 18:13 BenGoldberg joined
xinming m: my %h = 1, 'a', 2, 'b'; %h<<"1 2">>.WHAT.say; my $var = "1 2"; %h<<$var>>.WHAT.say; 18:14
camelia rakudo-moar cd7766: OUTPUT«(Any)␤(List)␤»
xinming m: my %h = 1, 'a', 2, 'b'; %h<<"1 2">>.WHAT.say; my $var = "1 2"; %h<<$var>>.WHAT.say; %h<<$var>>.perl.say;
camelia rakudo-moar cd7766: OUTPUT«(Any)␤(List)␤("a", "b")␤»
psch m: my %h = 1, 'a', 2, 'b'; %h<<1 2>>.WHAT.say; my $var = "1 2"; %h<<$var>>.WHAT.say;
camelia rakudo-moar cd7766: OUTPUT«(List)␤(List)␤»
xinming Yes, But I'm still a bit confused 18:15
psch m: say <<"1 2>>.perl; say <<1 2>>.perl
camelia rakudo-moar cd7766: OUTPUT«5===SORRY!5=== Error while compiling /tmp/_qk5RAvrrE␤Unable to parse expression in double quotes; couldn't find final '"' ␤at /tmp/_qk5RAvrrE:1␤------> 3say <<"1 2>>.perl; say <<1 2>>.perl7⏏5<EOL>␤ expecting any of:␤ argument …»
xinming I mean on the $list thing
psch m: say <<"1 2">>.perl; say <<1 2>>.perl
camelia rakudo-moar cd7766: OUTPUT«"1 2"␤(IntStr.new(1, "1"), IntStr.new(2, "2"))␤»
xinming <<"1 2">>.perl.say;
lizmat my %h = 1, 'a', 2, 'b'; %h<<1 2>>.WHAT.say; my $var = "1 2"; %h<<"$var">>.WHAT.say;
xinming m: <<"1 2">>.perl.say;
camelia rakudo-moar cd7766: OUTPUT«"1 2"␤»
lizmat m: my %h = 1, 'a', 2, 'b'; %h<<1 2>>.WHAT.say; my $var = "1 2"; %h<<"$var">>.WHAT.say;
camelia rakudo-moar cd7766: OUTPUT«(List)␤(Any)␤»
xinming It's still confusing to me. 18:16
I'll give up anyway, Go on with other parts of perl6, Thanks
timotimo has never used the << >> slices before 18:17
lucasb_ I think <<...>> should have been called shellwords. :)
18:17 BenGoldberg left
moritz %hshellwords(...) # doesn't read so well :-) 18:17
18:17 BenGoldberg joined 18:18 BenGoldberg left 18:19 BenGoldberg joined 18:20 yqt left 18:30 xfix joined 18:34 kmel left, AlexDaniel joined
lucasb_ so... there is this secondary prompt "*" in the REPL now? 18:36
first one is ">". if you type a blank line, then it is "*"
if you type any arbitrary expression in the "*" prompt, it doesn't give any error! 18:37
AlexDaniel pmurias: no, q:w:x is not safer 18:41
not even close… 18:42
18:43 BenGoldberg left, BenGoldberg joined
AlexDaniel pmurias: actually, it seems like :w will split the output returned by the shell 18:44
pmurias: but even if it didn't, there is no easy way to pass arguments to shell
18:44 Ben_Goldberg joined 18:45 BenGoldberg left
AlexDaniel pmurias: that is, you pass a string, not something else. What you probably want is “run”, which actually accepts arguments 18:45
18:45 Ben_Goldberg left 18:46 Ben_Goldberg joined, kanishka joined
RabidGravy I actually think there needs to be a "Working with external programs" page in the docs 18:46
18:46 diana_olhovik left, Ben_Goldberg left 18:47 kanishka left
RabidGravy that way we can inculcate good practice in people from the start rather them gleaning possibly insecure practice from other sources 18:47
18:47 Ben_Goldberg joined
AlexDaniel RabidGravy: I haven't submitted a pull request to the docs yet, but actually I'm hoping that :x will just go… 18:47
so that I don't have to explain how nothing will make :x safer 18:48
RabidGravy I'm talking irrespective of any other change
dalek kudo/nom: cfb7d87 | lizmat++ | / (2 files):
Make single key slices with 1 adverb 15% faster
18:49
AlexDaniel RabidGravy: well, sure, but it has to be reworked after the change, so…
RabidGravy er, only very slightly 18:50
18:50 Ben_Goldberg left 18:51 Ben_Goldberg joined
RabidGravy the point being if one was to document the best practice as it currently stands it may not even mention the ':x' 18:51
AlexDaniel RabidGravy: indeed 18:53
lizmat commute to Amsterdam for EuroOSCON Mon/Tue/Wed & 18:56
18:56 lizmat left
timotimo oh, cool 18:57
19:00 Ben_Goldberg left 19:02 yqt joined
RabidGravy I may commute to the other side of the sofa for fun 19:05
19:11 zengargoyle joined 19:12 blackcat_ left
zengargoyle i have a weird problem, using Channel and earliest, seems like 'more' creates a closure that never goes away. 19:14
gist.github.com/zengargoyle/5324c9...d6f5a376a3
^ minimal test
or i might be doing something completely wrong...
19:14 softmoth joined 19:15 rurban left 19:18 andreoss left
pmurias AlexDaniel: banning interpolation would make :x safe 19:22
19:22 tokuhiro_ joined
pmurias AlexDaniel: or are there other serious problems with :x besides shell injection? 19:22
AlexDaniel pmurias: I agree, but why keep :x at all then? 19:23
pmurias it can be usefull in short quick and dirty scripts 19:24
AlexDaniel pmurias: what's wrong with “shell()”? 19:25
pmurias it doesn't return the result of the command
AlexDaniel pmurias: what's wrong with “shellout()”?
19:26 tokuhiro_ left
pmurias shouldn't it be shell-out? 19:26
AlexDaniel pmurias: good question, actually. However, if it is shellout or shell-out, is it less convenient than qx// in “quick and dirty” scripts? 19:28
pmurias isn't it qq:x and q:x instead of qx? 19:29
ah, the colon is optional 19:30
AlexDaniel you can use qx and qqx without colons, just like with everything else
pmurias AlexDaniel: actually qx is safe as it doesn't interpolate
19:30 domidumont left
AlexDaniel internally the function is called QX :) 19:30
pmurias: still not safer than run though. For example, if someone attempts to use an ENV variable inside of it, then he can forget to quote it. One might argue that it's outside of the Perl6 scope, but I think that it's not enough to declare it safe. 19:32
19:33 TEttinger joined
AlexDaniel pmurias: also, there's a good article: julialang.org/blog/2012/03/shelling-out-sucks/ 19:33
it kinda mentions all of the other problems with shells
in other words, you should still prefer “run” even for dirty cases… 19:34
but if you don't want to, OK, TIMTOWTDI, “shell” and “shellout”! 19:35
pmurias it seems to be a tradeoff between convenience and avoid shell injection
I don't think I'm qualified to make a choice
AlexDaniel pmurias: you did not answer my question though
pmurias: I don't understand how qx// is less convenient than shellout() 19:36
pmurias you mean more convenient?
AlexDaniel whoops, yes, of course
pmurias it's shorter
AlexDaniel and that's it? 19:37
pmurias I think that's all
it's qx/.../ vs shell-out(q/.../)
19:38 rurban joined
RabidGravy frankly if it were me I would remove any thing that used the shell completely unless you presented a certificate signed by two responsible adults 19:38
AlexDaniel Ok, well, that's the whole point. “run” should be shorter than anything that uses the shell. Other than that, you are free to use shell if you dare to type it…
RabidGravy: I kinda agree, but at the same time I know that people want to play around when adults are far away :) 19:40
pmurias imagine qq:sql {select * from table where column = $value;} # jk 19:42
RabidGravy part of the problem viz Perl 6 vs Perl 5 in this regard is the absense of "source tracking" aka tainting
AlexDaniel pmurias: I thought we already have sql grammar thingy 19:44
19:45 vendethiel joined
AlexDaniel Also, I see no point to have a quoting adverb that cannot be combined with other adverbs in real life 19:45
pmurias having a shell-like grammar for quick scripts would be a fun and safer way of doing things 19:47
AlexDaniel pmurias: if you don't forget to quote your variables, the yes, perhaps 19:52
pmurias: also I had an idea that perl6 shell grammar should autoquote stuff by default
RabidGravy pubs.opengroup.org/onlinepubs/96999...#tag_18_10 there you go ;-) 19:53
AlexDaniel I don't know if that's a good idea, but perhaps better than nothing
pmurias AlexDaniel: the shell-like grammar should avoid calling the shell entirely 19:56
AlexDaniel pmurias: yes but if I type “rm $foo”, what is going to happen? 19:57
19:57 geraud joined
pmurias the file name contained in $foo should be removed 19:57
AlexDaniel what if $foo = 'world hello'
in normal shells two files will be deleted 19:58
b2gills «rm "$foo"» 19:59
moritz ... as long as $foo doesn't contain " 20:00
AlexDaniel b2gills: yes, I've mentioned that in my pull request. However, it means that you should never forget to quote your variables (people always forget to do that in bash, so why would they do it better in perl6?), it also means that you should only use run()
moritz: run(«rm "$foo"»); # are you sure?
b2gills I think that since you don't have to have 「use IPC::Run」 to get 「run」 that the :x can go into a deep hole 20:01
20:01 cognominal left
b2gills m: my $foo = 'world hello'; dd «rm "$foo"» 20:01
camelia rakudo-moar cd7766: OUTPUT«List $var = $("rm", "world hello")␤»
AlexDaniel m: my $foo = 'world "hello'; dd «rm "$foo"» 20:02
camelia rakudo-moar cd7766: OUTPUT«List $var = $("rm", "world \"hello")␤»
AlexDaniel safe!
uhm, safe!*
* – unless you pass that into shell(), but it's going to complain about too many args I think 20:03
“This type cannot unbox to a native string” 20:04
what!
RabidGravy ship it! 20:08
;-)
b2gills m: say Int.^roles; say Int.^roles(:transitive) 20:12
camelia rakudo-moar cd7766: OUTPUT«((Real))␤Cannot find method 'roles'␤ in any roles at gen/moar/m-Metamodel.nqp:2894␤ in block <unit> at /tmp/O0DtY7MkpV:1␤␤»
RabidGravy OooOOOoooh 20:13
20:15 espadrine_ joined, darutoko left
timotimo is about to run a before-spectest to verify his for-optimization-patch is sane 20:22
20:23 raiph left
timotimo ooooh, dinner is served! 20:24
Zoffix :(
Zoffix is hungry now
vendethiel o/ 20:25
Zoffix: thanks for your answers
(i've seen the PR go through, obviously)
Zoffix np 20:26
AlexDaniel .tell lizmat shell(«echo "world hello"»); # I wonder if this problem is associated with other “cannot unbox to a native string” problems. 20:27
yoleaux AlexDaniel: I'll pass your message to lizmat.
20:27 CurtisOvidPoe joined
AlexDaniel .tell lizmat not that it should work, but the error message is awful 20:27
yoleaux AlexDaniel: I'll pass your message to lizmat.
CurtisOvidPoe When I call await on a list of promises, I always seem to get the output in the same order. gist.github.com/Ovid/92ba0af93988f2c6e560 20:30
(It’s also not much faster than procedural)
b2gills of course you would get them in order, you are asking for them in order 20:31
20:34 ChoHag joined, tokuhirom joined
CurtisOvidPoe I guess that makes sense. I should look at it as more async if I’m less worried about the order. Still getting used to the Perl 6 way of handling this :) 20:34
labster Are we still trying to stop consenting adults from using shells? 20:35
20:35 virtualsue left
vendethiel CurtisOvidPoe: there are certain constructions that will explicitly discard order of operation/order of resulting set (hyper, race) if you want that, btw 20:36
i don't think they're any faster right now, though :)
20:36 kaare_ left
moritz vendethiel: hyper still preserves result order; only race doesn't 20:38
vendethiel moritz: hence my "order of operation/order of resulting set" :)
i should've used / between "hyper" and "race" though, you're right
moritz vendethiel: ah, didn't grok that
20:38 tokuhirom left
b2gills 「eager @promises.race.map: *.result.say」 20:39
CurtisOvidPoe Is there some way I can inject Promise.anyof into that last line to get the results as soon as they occur or do I need to rewrite it? 20:40
(I tried using b2gills’ last line and they’re still in order) 20:41
b2gills I think you want .then
CurtisOvidPoe So clearly I’m missing something here :)
mrf Does anyone knwo what had caused Grammar::Debugger to throw: pastebin.com/Dc1iv2Tf
CurtisOvidPoe b2gills: I want .then where?
b2gills They are still in the same order because the batch size is bigger than 4
@promise>>.then>>.say 20:42
@promise>>.then(*.say)
moritz @promise>>.then(&say)
mrf m-star: use Grammar::Debugger; grammar G { rule TOP { .* } }; G.parse('foo');
zengargoyle while @promises { my $got = await Promise::anyof(@promises); @promises.=map(?!*); }
moritz don't we have 'earliest' for that? 20:43
or something like that
or winner? no, I think winner is gone again
zengargoyle yes i think, but i'm having a problem with that
gist.github.com/zengargoyle/5324c9...ore-p6-L22
b2gills @promise».then(*.result.say)
CurtisOvidPoe OK, we’re getting into weird “Perl has scary punctuation” territory for some of those. Still trying to avoid that.
b2gills: that last line prints 13 and exists. It’s fast, though :) 20:44
moritz CurtisOvidPoe: you can do the .then(...) where you construct the promises 20:45
CurtisOvidPoe: which probably causes less weird punctuation
20:45 espadrine_ left
CurtisOvidPoe OK. I’m tired and it doesn’t seem quite as easy as I thought. I think I’ll skip that for tomorrow’s talk. 20:45
My apologies.
b2gills add a 「sleep 10」 or so
zengargoyle oops, think that map was meant to be grep 20:46
20:46 uruwi joined
zengargoyle it's removing the kept/broken promise from @promises 20:46
RabidGravy moritz, earliest appears to only work for Channels 20:47
20:48 vendethiel left
RabidGravy (though I thought it work with Promises too) 20:48
20:51 vendethiel joined
zengargoyle @promises = @promises.grep(*.status ~~ Promise::Planned) 20:55
vendethiel zengargoyle: can't you do that with .grep(!*)? 20:56
zengargoyle un-special remove kept/broken promises. CurtisOvidPoe didn't like the special-ness. :)
i thought maybe there were .kept .broken .planned methods but docs don't mention them. 20:57
vendethiel I think jnthn's talk used .grep(!*), also
zengargoyle yeah, that's my half-remembered source
vendethiel > @working .= grep({ !$_ }); 20:58
m: (!*)(True).say
camelia rakudo-moar cd7766: OUTPUT«False␤»
moritz *.not
CurtisOvidPoe zengargoyle: the docs mention them on Promises: design.perl6.org/S17.html#Promises (Or did I misunderstand what you were referring to?)
zengargoyle the Promise::anyof returns the matched promise's .result and not the promise itself.
vendethiel yeah, or {!$_} -- just fine
zengargoyle i was going by doc.perl6.org/type/Promise 20:59
the doc pages usually avoid the things that are in synopses that got dropped/changed or not implementd yet. but may also leave things out i guess. 21:00
vendethiel .tell jnthn on your blog, jnthn.net/papers/2008-fpw-rakudo-slides.pdf is broken
yoleaux vendethiel: I'll pass your message to jnthn.
CurtisOvidPoe Heading to bed. Night all! 21:01
21:01 CurtisOvidPoe left
vendethiel also, the >>.then seems to be pretty useless for me, if then is asynchronous, .map(*.then) should do the same. The order of the calls to same most probably doesn't matter.. 21:03
s/for me/to me/ # englishing? 21:04
21:09 Peter_R left
zengargoyle m: <a aa aaa>>>.comb>>.elems 21:09
camelia ( no output )
zengargoyle m: say <a aa aaa>>>.comb>>.elems
camelia rakudo-moar cd7766: OUTPUT«(1 2 3)␤»
zengargoyle m: say <a aa aaa>.map(*.comb.map(*.elems)) 21:10
camelia rakudo-moar cd7766: OUTPUT«((1) (1 1) (1 1 1))␤»
zengargoyle m: say <a aa aaa>.map(*.comb.elems)
camelia rakudo-moar cd7766: OUTPUT«(1 2 3)␤»
vendethiel zengargoyle: >> is one level only, afaik 21:11
m: say (1, 2, 3)>>.succ.perl;
camelia rakudo-moar cd7766: OUTPUT«(2, 3, 4)␤»
21:11 Peter_R joined
zengargoyle i tend to favor >> over map sometimes when doing fancy things down deep in a structure over nested map. failing to come up with a good simple example though. 21:12
21:15 labster left
dalek kudo/curli: 4fad898 | (Stefan Seifert)++ | lib/lib.pm6:
Have use lib change $*REPO instead of @*INC
21:16
mrf Does anyone have any ideas regarding the cause of github.com/jnthn/grammar-debugger/issues/22 ?
Grammar::Debugger seems unable to install on the version of Rakudo I have 'gcfb7d87' but camelias version of Star seems fine. 21:17
21:21 lucasb_ left
RabidGravy mrf, can confirm it works on a rakudo of about a wek ago 21:23
week
ugexe i think it had something to do with a somewhat recent commit about LHS smart matching 21:24
github.com/rakudo/rakudo/commit/5d...ba04ee7ce8 ? 21:25
RabidGravy I'll look on the morning if I can understand the code 21:26
mrf RabidGravy++ ugexe++ thanks. That certainly looks like a viable source of the issue. 21:27
21:27 bjz_ left
RabidGravy I vaguely recall someone mentioning this the other day 21:29
vendethiel yeah, seems like that disabled
m: say Mu.new ~~ /foo/; # ?
camelia rakudo-moar cd7766: OUTPUT«X::Multi::NoMatch exception produced no message␤ in block <unit> at /tmp/bjqKRdkZzN:1␤␤»
ugexe needs a Mu:D smiley sig FROGGS_ ?
mrf adds learning method sig syntax to TODO list 21:31
21:33 jstimpfle joined 21:34 zakharyas joined 21:40 lichtkind_ joined
itz_stmuk mrf: there is a pull request to fix Grammar::Debugger 21:43
FROGGS fixed it in github.com/jnthn/grammar-debugger/pull/21
mrf itz_stmuk: awesome thanks. I will see if I can install the version in that branch directly 21:46
21:47 xfix left
RabidGravy erk, wish I hadn't looked at that code 21:47
mrf I don't even pretend to understand what is going on there. 21:49
heh that was easier than I expected. 21:51
RabidGravy it's the multiple returns thhat are freaking me out
mrf I have a more fundimental problem in actually understanding the signatures 21:52
AlexDaniel RabidGravy: well, it is pretty much idiomatic perl5 21:53
21:53 tokuhiro_ joined
AlexDaniel RabidGravy: so I'm used to it 21:53
mrf RabidGravy: Ah you meant the Patch?
RabidGravy AlexDaniel, not idiomatic in my milieu 21:54
AlexDaniel RabidGravy: www.perlmonks.org/?node_id=864019 21:55
21:56 Begi1114 joined 21:57 zakharyas left, tokuhiro_ left
RabidGravy I'm not quite sure that perlmonks proves anything 21:57
AlexDaniel RabidGravy: no-no there's nothing to prove 21:58
RabidGravy certainly against how *I* think about software design
mrf I this issue multiple return values. rather than multiple return statements 21:59
RabidGravy I spent a lot of the nineties working with very grumpy cobol programmers 22:00
mrf RabidGravy: Having done some cobol I am sure that Grumpy is the normal state of being. 22:02
22:03 ecocode left
mrf hmm do I stay up and watch the Panthers game and work on these grammar tests some more or go to bed and do it tomorrow? 22:03
ugexe: wheen you were doing the grammar for URIs did you have the same sense of "This is nuts" that I do now. 22:04
RabidGravy watch the game, drink beer and fiddle with code
mrf RabidGravy: you make a convincing argument.
22:05 ecocode joined
mrf ugexe: also did you catch my comment a few days ago regarding using fully qualified namespaces in the HTTP gramars to avoid differning rule clashes? 22:06
22:06 Zoffix left 22:08 edehont joined 22:14 TEttinger left 22:16 Begi1114 left 22:24 ghur joined 22:26 lizmat joined
dalek kudo/nom: 360edeb | lizmat++ | / (4 files):
Make single key slices with 1 adverb 5% faster still

This basically reverts cfb7d876c0fe69c9a and does that logic inside of each of the postcircumfix [] and {} candidates themselves. This saves on setting up parameters to SLICE_ONE_LIST/HASH
22:26
22:29 raiph joined
lizmat messages 22:30
yoleaux 20:27Z <AlexDaniel> lizmat: shell(«echo "world hello"»); # I wonder if this problem is associated with other “cannot unbox to a native string” problems.
20:27Z <AlexDaniel> lizmat: not that it should work, but the error message is awful
22:30 mayuresh joined
mayuresh hello. :) 22:30
lizmat mayuresh o/
mayuresh :)
lizmat o/
lizmat CurtisOvidPoe: re irclog.perlgeek.de/perl6/2015-10-25#i_11431620 , I was thinking
would this syntax make sense: while await @promises -> $promise { # execute code when promise was kept } 22:31
mayuresh there's something i need to share with you all publicly; "i am getting drawn towards another open source project and hence probably, i won't be able to work on that perl6 execution environment i have been so harking about for a while now". 22:32
out there to it's going to be a tough run, perhaps even tougher because i'll be working on compiler tech instead of interpreters.
but, there's a very high chance that i might effect a major change for the good of that open source project. 22:33
b2gills mayuresh: you are free to come and go as you like, good look on whatever endeavor you choose
s/look/luck/
mayuresh :)
thanks b2gills. :) 22:34
lizmat mayuresh: more power to you doing good things for open source!
mayuresh thanks lizmat. :)
i am sorry mr. wall, and i thank you for the detailed responses to my queries. 22:35
22:35 tokuhirom joined, firstdayonthejob left
lizmat on behalf of TimToady , you're very welcome! 22:35
mayuresh hope perl6 (rakudo + moarvm) turns out to be greater than perl5.
gotta go now, need to catch up on some sleep, it's already 0400 hours out here, day begins shortly. 22:36
22:36 mayuresh left 22:37 firstdayonthejob joined
mrf Is anyone able to explain the rational behind why rules have :sigspace but tokens don't 22:37
mst RabidGravy: hm, multiple returns are totally normal to me 22:38
22:38 rindolf left
mst RabidGravy: ok, I mean, in a lot of my code it'd be one return and a bunch of die()s, but still 22:38
22:40 tokuhirom left
RabidGravy for me it's a sign a routine is too big but hey 22:40
b2gills I use multiple exit points in shorter routines rather than longer routines, but I see your point. 22:42
22:44 lsm-desktop left 22:47 _dolmen_ joined 22:48 patrickz left 22:53 lichtkind_ left 22:54 lichtkind left 22:55 vendethiel left
mst RabidGravy: er, multiple guard clauses in verification code are pretty common 22:57
22:58 _dolmen_ left 23:07 leont joined 23:09 tokuhiro_ joined
dalek kudo/nom: c938b10 | lizmat++ | src/core/asyncops.pm:
Introducing the awaiterator

This now lets you process the result of a number of promises as they become available. For example:
   .print for awaiterator(^10 .map: { start { sleep rand; $_ } })
   6513729840
Inspired by CurtisOvidPoe's question earlier today. Still subject to bikeshedding / removal / other reasons why this is not a good idea
23:11
23:13 tokuhiro_ left, BenGoldberg joined
lizmat .tell CurtisOvidPoe maybe the awaiterator is something for you ? 23:17
yoleaux lizmat: I'll pass your message to CurtisOvidPoe.
Juerd Love the awaiterator :) 23:18
edehont Love the term bikeshedding as well :-) 23:27
mst the destructive modification of @!todo in the elsif block really squicks me out 23:28
23:28 ecocode left
lizmat mst: why ? 23:29
otherwise you would need 2 iterations
23:29 rurban left
lizmat one to grep all the ones that are done, then all the ones that need doing 23:29
and in between things may change
mst no you wouldn't 23:30
lizmat please enlighten me :-)
mst re-assigning @!todo seems ok, it's the '@!todo.shift' that makes me gibber 23:31
seems like it'd work just the same as a foreach and be clearer too?
lizmat yeah, but then I don't clean up @!todo: remove the ones that are ready 23:32
mst yes you do
you're assigning @!todo = @next anyway
line 38
@!todo is getting replaced entirely at the end of the loop 23:33
lizmat yes, that's the next batch of todo's
mst so mutating it during the loop isn't, so far as I can tell, relevant to the end result
lizmat ah, ok, *now* I see your point
ok, agree
but a for would be another iterator... hmmm... lemme do some benchmarks 23:34
zengargoyle how about using classify on the promise list? 23:35
mst if it turns out to be a useful micro-optimisation, I'd be totally ok with a comment saying that and leaving the code as is
zengargoyle which i just suggested on CurtisOvidPoe's gist
lizmat no, the for is faster 23:36
mst awesome
always nice when the prettier code is the fast version too :D
lizmat mst++ # indeed! 23:37
lizmat looks up CurtisOvidPoe's gist 23:38
dalek kudo/nom: c017f78 | lizmat++ | src/core/asyncops.pm:
Make it simpler and faster, mst++
23:40
zengargoyle lizmat: can you maybe take a quick look and tell me why this little bit of test code doesn't work? gist.github.com/zengargoyle/5324c9...d6f5a376a3 23:44
23:44 firstdayonthejob left 23:47 spider-mario left
lizmat zengargoyle: looks to me the channel is almost immediately closed 23:47
zengargoyle i don't think that matters, the longer code it comes from the channel isn't closed. 23:48
lizmat so you're opening a Channel, sending 1 value on it, closing it and then looping until you get the value, right ?
zengargoyle the second time the more * is hit, it's holding onto to old variables like the { code here ... } part didn't change. 23:49
yes, but the second time through the for loop, the more still has the last $num/$value from the first time through the loop. 23:51
23:51 dayangkun joined
zengargoyle more still thinks $num and $value are 1 when they should both be 2 23:52
lizmat indeed 23:53
23:55 mordo joined
mst lizmat: the only thing that's bugging me now is that you're iterating the entire set of todos every time and I wonder if short-circuiting might be better, but, er, dunno 23:55
lizmat fwiw, the values are also wrong in the done block
23:56 pmurias left
lizmat the list of todo's is getting shorter every time pull-one is called (and there were no promises done yet) 23:56
zengargoyle: feels like a scoping issue that should be rakudobugged 23:58
RabidGravy right, bed time for rabid ;-) Play nicely
lizmat gnight RabidGravy
mrf RabidGravy: Night. And thanks for the help earlier 23:59
zengargoyle that's my take on it, but i'm new to the concurrent stuff and wanted second opinions :)
i might just be doing it totally wrong.