Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-04-25

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:07 _28_ria joined #perl6
00:17 tomboy64 joined #perl6
00:32 tomboy64 joined #perl6
00:33 jjido joined #perl6
00:34 Actualeyes joined #perl6
00:35 lizmat joined #perl6
00:35 pierre_ joined #perl6
00:45 BenGoldberg joined #perl6
01:00 lizmat joined #perl6
01:18 kaare_ joined #perl6
01:23 molaf joined #perl6
01:38 astj joined #perl6
02:03 jjido joined #perl6
02:23 avenj joined #perl6
02:29 noganex joined #perl6
02:38 Herby_ joined #perl6
02:39 jack_rabbit joined #perl6
02:43 _28_ria joined #perl6
02:58 Herby_ newbie question here... If I'm retrieving a JSON webpage, what's the best way to save the JSON data for later retrieval?  use a json module to decode the json, then spurt it to a .json file?
02:58 Herby_ or just save the entire webpage, and then later slurp the page and decode it
02:58 Herby_ or is one pretty much the same as the other
03:05 MadcapJake Best section header: "So you're on Windows" lol
03:07 MadcapJake Herby_: if it's JSON you're retrieving, there's nothing that decoding it will do but make it usable within your program.
03:07 Herby_ just learned that the hardway :)
03:07 Herby_ think i got it now
03:10 MadcapJake decoding larger json files is still a bit expensive, if you do need just bits of the data, you could pull it out and spurt into an easier delimited format (commas, \0 or \t)
03:28 MadcapJake wrt generator discussion the other day: http://www.perl6.org/archive/rfc/31
03:33 jjido joined #perl6
03:34 pierre_ joined #perl6
03:38 grondilu how do I get the name of a class?
03:40 grondilu m: my $class = class {}; sub () returns $class { $class.new }()
03:40 camelia rakudo-moar f05c77: OUTPUT«5===SORRY!5=== Error while compiling /tmp/l9d8TrD9dd␤Malformed trait␤at /tmp/l9d8TrD9dd:1␤------> 3my $class = class {}; sub () returns7⏏5 $class { $class.new }()␤»
03:41 grondilu m: say class A {}.Str
03:41 camelia rakudo-moar f05c77: OUTPUT«Use of uninitialized value of type A in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed.  in block <unit> at /tmp/U61mbTMQWJ line 1␤␤»
03:41 grondilu m: say class A {}.WHAT
03:41 camelia rakudo-moar f05c77: OUTPUT«(A)␤»
03:41 grondilu m: say class A {}.WHAT.Str
03:41 camelia rakudo-moar f05c77: OUTPUT«Use of uninitialized value of type A in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed.  in block <unit> at /tmp/xamaLRrTvT line 1␤␤»
03:53 BenGoldberg joined #perl6
03:59 dolmen joined #perl6
04:10 BenGoldberg joined #perl6
04:20 BenGoldberg joined #perl6
04:22 infina_ joined #perl6
04:22 infina_ joined #perl6
04:25 Actualeyes joined #perl6
04:32 Cabanossi joined #perl6
05:04 jjido joined #perl6
05:07 cognominal joined #perl6
05:09 CIAvash joined #perl6
05:18 neuron joined #perl6
05:18 neuron Hi
05:18 neuron Is there a way for class instance to detect which roles have been applied to it?
05:23 CIAvash grondilu: .^name gives you the name
05:23 pierre_ joined #perl6
05:27 neuron CIAvash: Oh, I'm not sure you replied to me, but certainly .^name seems to help me. Thanks! :)
05:30 CIAvash No, it wasn't a reply to you :)
05:30 CIAvash m: role R {}; class C does R {}; say so C.new.does(R);
05:30 camelia rakudo-moar f05c77: OUTPUT«True␤»
05:31 CIAvash neuron: ↑
05:32 neuron Oh, that seems even better!
05:33 neuron Hmm, how about parametrized roles, can I test them too?
05:34 CIAvash the `so` part is not needed, it returns a Bool.
05:36 CIAvash neuron: yeah, I think you can
05:36 neuron Oh, yes, I made a typpo, parametrized works the same - just fine
05:36 neuron Many thanks!
05:45 mr-foobar joined #perl6
05:50 kurahaupo joined #perl6
05:55 kurahaupo_ joined #perl6
05:58 sno joined #perl6
05:58 kurahaupo joined #perl6
06:02 kurahaupo_ joined #perl6
06:05 wamba joined #perl6
06:09 domidumont joined #perl6
06:12 _mg_ joined #perl6
06:15 domidumont joined #perl6
06:28 _mg_ joined #perl6
06:29 Xliff Is there a way to get a list of all roles that have been applied to an instance?
06:29 Xliff <CIAvash> m: role R {}; class C does R {}; say so C.new.does(R);
06:32 Xliff joined #perl6
06:34 jjido joined #perl6
06:34 abraxxa joined #perl6
06:36 Xliff ↑ I get what CIAvash said here, but what if you don't know the specific role you wish to test against, and just want a list from an instance variable?
06:39 pierre_ joined #perl6
06:39 abraxxa joined #perl6
06:43 MadcapJake Xliff: ClassName.^roles_to_compose is supposed to work but it just returns an empty list for me :\
06:46 MadcapJake m: role R {}; class C does R {}; say C.^roles_to_compose
06:46 camelia rakudo-moar f05c77: OUTPUT«()␤»
06:48 RabidGravy joined #perl6
06:49 jjido_ joined #perl6
06:52 pierre_ joined #perl6
06:52 MadcapJake if you use .^add_role it works:
06:52 MadcapJake m: role R {}; my class C {}; C.^add_role(R); say C.^roles_to_compose
06:52 camelia rakudo-moar f05c77: OUTPUT«((R))␤»
06:53 MadcapJake Xliff: ↑
07:01 brrt joined #perl6
07:14 Xliff Thanks, MadcapJake
07:15 Xliff That helps, but is slightly bothersome.
07:15 Xliff m: role A{}; role B{}; my class C does A {}; C.^roles_to_compose();
07:15 camelia rakudo-moar f05c77: ( no output )
07:15 Xliff m: role A{}; role B{}; my class C does A {}; say C.^roles_to_compose();
07:15 camelia rakudo-moar f05c77: OUTPUT«()␤»
07:16 Xliff m: role A{}; role B{}; my class C does A {}; C.^add_role(B); say C.^roles_to_compose();
07:16 camelia rakudo-moar f05c77: OUTPUT«((B))␤»
07:16 Xliff ↑ So that result is incomplete.
07:17 Xliff But accurate, according to the docs: http://doc.perl6.org/routine/roles_to_compose
07:17 CIAvash ^.roles_to_compose returns the list of roles that are not yet composed
07:17 CIAvash m: role R {}; my class C {}; C.^add_role(R); say C.^roles_to_compose; say C.does(R); C.^compose; say C.^roles_to_compose; say C.does(R)
07:17 camelia rakudo-moar f05c77: OUTPUT«((R))␤False␤()␤True␤»
07:17 Xliff CIAvash, Ah... OK.
07:18 Xliff m: role A{}; role B{}; my class C does A {}; C.^add_role(B); say C.^roles_to_compose(); C.^compose; say C.^roles_to_compose
07:18 camelia rakudo-moar f05c77: OUTPUT«((B))␤()␤»
07:18 Xliff Makes sense now.
07:18 zakharyas joined #perl6
07:18 Xliff CIAvash: But is there a way to retrieve a list of roles from an instance variable?
07:19 CIAvash I don't know
07:19 Xliff Fair enough. Thanks for the explanation.
07:21 CIAvash m: Role R {}; class C does R {}; say C.new.^roles;
07:21 camelia rakudo-moar f05c77: OUTPUT«5===SORRY!5=== Error while compiling /tmp/bhuhLLsuRF␤Invalid typename 'R'␤at /tmp/bhuhLLsuRF:1␤------> 3Role R {}; class C does R7⏏5 {}; say C.new.^roles;␤»
07:21 CIAvash m: role R {}; class C does R {}; say C.new.^roles;
07:21 camelia rakudo-moar f05c77: OUTPUT«((R))␤»
07:22 Xliff Oh, excellent.
07:22 Xliff m: role A{}; role B{}; my class C does A {}; C.^add_role(B); say C.^roles_to_compose(); C.^compose; say C.^roles
07:22 camelia rakudo-moar f05c77: OUTPUT«((B))␤((A) (B))␤»
07:22 Xliff Of course, I am poking through the docs in all the wrong places and it was something simple. *sigh*
07:23 ufobat good morning :)
07:23 Xliff \o ufobat
07:23 MadcapJake wow nice! yeah that needs to be documented
07:24 Xliff I would expect that to be a part of the Mu object, but I could be wrong.
07:24 MadcapJake Xliff: Metamodel::ClassHOW
07:24 MadcapJake https://github.com/rakudo/rakudo/blob/no​m/src/Perl6/Metamodel/ClassHOW.nqp#L168
07:25 Xliff http://doc.perl6.org/type/Metamodel::ClassHOW
07:25 Xliff ↑ Not here
07:25 MadcapJake yep, that's why I said "needs to be" :)
07:25 Xliff Oh. No fair going to the source. :P
07:26 MadcapJake B-) ohhh yeaaaahh
07:26 Xliff Heh!
07:26 Xliff (•_•)
07:26 * MadcapJake really needs to go to sleep
07:26 Xliff ( •_•)>⌐■-■
07:26 Xliff (⌐■_■)
07:26 MadcapJake hahaha
07:27 MadcapJake that's awesome, it's like a text-based gif :D
07:27 Xliff Yeah. Stole it from someone in hear when I first joined.
07:28 CIAvash :)
07:28 masak good (⌐■_■) morning, #perl6
07:28 Xliff HAH!
07:28 Xliff Speak of the devil. How goes, masak?
07:28 masak oh, you know. just my diabolic usual.
07:29 * masak .oO( within one standard deviation of my own peculiar little average )
07:29 Xliff Oh wow! I've been here over a month, now.
07:29 Xliff MadcapJake, http://irclog.perlgeek.de/p​erl6/2016-03-24#i_12233003
07:29 Xliff Time flies
07:30 MadcapJake lol, masak
07:31 MadcapJake irclog renders those glasses really well :P
07:32 MadcapJake gotta go to bed now! See ya Sixians!
07:33 brrt good morning masak
07:35 abraxxa joined #perl6
07:42 Xliff https://gist.github.com/Xliff/5​4c7b2f1661b8f56beb8b1b1b6c1bc87
07:43 Xliff Any thoughts? It's the last bit I need to complete read testing using libvorbis.
07:44 abraxxa joined #perl6
07:45 Xliff Gist updated with results.
07:46 Xliff *sigh* "Str" in that context is not getting interpreted as NULL. Does that only work with pure NativeCall types?
07:51 lizmat joined #perl6
08:00 psch m: use NativeCall; my @a := CArray[Str].new(["foo", "bar"]); say @a[2].defined
08:00 camelia rakudo-moar f05c77: OUTPUT«False␤»
08:07 matt_ joined #perl6
08:10 pmurias joined #perl6
08:10 _mg__ joined #perl6
08:11 darutoko joined #perl6
08:14 Xliff HAH!
08:14 Xliff The code in the updated gist did the trick.
08:15 jeek ^5
08:15 masak jeek: 0 1 2 3 4
08:15 Xliff psch: That was exactly the strategy I went with. Thanks.
08:17 Xliff Gist updated.
08:17 Xliff i think I will just start keeping gists and will then clean 'em all up and try to port them to the proper place in the P6 docs.
08:18 psch ++Xliff
08:27 rindolf joined #perl6
08:29 dakkar joined #perl6
08:29 luiz_lha joined #perl6
08:31 sunnavy joined #perl6
08:32 au joined #perl6
08:32 Xliff Now the write ogg-vorbis test. *sigh*
08:34 mtj_ joined #perl6
08:37 petercommand joined #perl6
08:44 agentzh joined #perl6
08:44 agentzh joined #perl6
08:58 mtj_ joined #perl6
09:00 wamba joined #perl6
09:00 au joined #perl6
09:01 agentzh joined #perl6
09:01 agentzh joined #perl6
09:01 petercommand joined #perl6
09:01 sunnavy_ joined #perl6
09:02 matt_ joined #perl6
09:14 abraxxa joined #perl6
09:20 ufobat joined #perl6
09:20 kerframil joined #perl6
09:21 pmurias If QAST::CompUnit has only a .load and not a .main does the load get run when it's used as the main program?
09:23 abraxxa joined #perl6
09:23 jnthn pmurias: load is only if it's loaded as a module, rather than top-level
09:24 jnthn If there's no main we default to running the top-level block
09:32 Xliff m: my $f = False; say $f; $f = True; if $f { say "F!" }
09:32 camelia rakudo-moar f05c77: OUTPUT«False␤F!␤»
09:33 psch m: my $f = True but False; if ~$f { say $f }
09:33 camelia rakudo-moar f05c77: OUTPUT«False␤»
09:34 psch what i actually was wondering is what exactly "but $value" overrides
09:35 pmurias jnthn: even if the top level block is *NOT* an immediate?
09:35 psch m: my $f = 1 but False; say ~$f; my $g = True but False; say ~$g
09:35 camelia rakudo-moar f05c77: OUTPUT«1␤False␤»
09:35 g4 joined #perl6
09:35 psch it seems to depend on the lhs on some level...
09:38 psch m: enum foo <A B>; my $f = A but B; say ~$f
09:38 camelia rakudo-moar f05c77: OUTPUT«A␤»
09:48 M-Illandan joined #perl6
09:48 vendethiel- joined #perl6
09:48 Relsak joined #perl6
09:49 jnthn pmurias: Sure. immediate vs. declaration is really a description of what code-gen should happen in the enclosing block anyway
09:50 jnthn pmurias: So blocktype isn't really relevant for the outermost block
09:51 M-tadzik joined #perl6
09:52 M-matthew joined #perl6
09:56 donaldh joined #perl6
10:05 pmurias joined #perl6
10:19 novavis joined #perl6
10:23 Xliff m: my $s = "two WORDS"; say $s.tc
10:23 camelia rakudo-moar f05c77: OUTPUT«Two WORDS␤»
10:23 lizmat m: my $s = "two WORDS"; say $s.tclc
10:23 camelia rakudo-moar f05c77: OUTPUT«Two words␤»
10:23 yoleaux 24 Apr 2016 19:10Z <moritz> lizmat: running a single spectest file through make fails: http://perlpunks.de/paste/show/571d1a03.5018.199
10:24 lizmat moritz: afaik, I fixed that late last night using leont++ advisement
10:24 Xliff m: my $s = "two WORDS"; say $s.wordcase
10:24 camelia rakudo-moar f05c77: OUTPUT«Two Words␤»
10:24 Xliff There we go.
10:28 Actualeyes joined #perl6
10:30 lizmat m: my $s = "two WORDS"; say $s.split(/\s+/,:v)>>.tclc.join   # alternate
10:30 camelia rakudo-moar f05c77: OUTPUT«Two Words␤»
10:35 abraxxa joined #perl6
10:43 pierre_ joined #perl6
10:45 pierre_ joined #perl6
10:49 Xliff lizmat++ -- nice alternate, but more wordy =)
10:49 lizmat more general  :-)
10:50 Xliff Really? Is there a case where yours would work and .wordcase wouldn't?
10:50 lizmat my point is that you can use split to split on anything, *and* still get the values you've split on with :v
10:51 Xliff Oooh.
10:51 lizmat so you can .join afterwards and get the original back
10:51 lizmat m: my $s = "two                WORDS"; say $s.split(/\s+/,:v)>>.tclc.join   # alternate
10:51 camelia rakudo-moar f05c77: OUTPUT«Two                Words␤»
10:51 lizmat m: my $s = "two WORDS"; say $s.split(/w/,:v)>>.tclc.join   # alternate
10:51 camelia rakudo-moar f05c77: OUTPUT«TWO words␤»
10:51 Xliff OK. Gotcha. Thanks for the explanation.
10:52 * Xliff is still used to ">>" meaning something entirely different.
10:53 lizmat what do you think it means?
10:54 moritz bit shift?
10:54 moritz \o
10:55 masak clearly ">>" means "send to cout" :P
10:55 * masak probably got that one wrong
10:56 Xliff LOL!
10:57 Xliff masak sees my point, exactly. Except ">>" also means "append" in a similar context :P
10:57 Xliff >> and » are the same in Perl6, right?
10:58 Xliff At least in lizmat's example.
10:59 lizmat yes
11:00 Xliff kk
11:01 Actualeyes1 joined #perl6
11:02 jast masak: yeah, it's for input streams, e.g. using cin
11:03 tomboy65 joined #perl6
11:04 timotimo aye, the out or in goes on the left side of the stream
11:04 timotimo that's why it's cout << "foo", or cin >> bar
11:04 masak right.
11:06 masak taking a discussion from p6l (back in January, gasp!) to here: I avoid `try` in production-level code nowadays
11:06 masak it catches too much, including exceptions you don't know you're getting
11:07 masak it's as if you're telling your body "keep on walking, even if it hurts" -- and you *think* this is just about your feet hurting a little, but in actual fact one leg and two ribs are broken and you really, really should stop walking
11:07 masak `try` keeps on walking in that case
11:08 masak I had a couple of these in 007, and it did indeed bite eventually. here's the commit that eliminates them: https://github.com/masak/007/commit/c0​62bc4e00129ca2c33b999ccbc449027a4ce2ad
11:09 tomboy64 joined #perl6
11:09 timotimo we might want a try variant that explicitly mentions the exception type it would like to defuse
11:10 masak I'm slightly dismayed to see that there are ~800 instances of `try` in the ecosystem.
11:10 leont_ joined #perl6
11:10 masak a significant fraction of those are likely to be susceptible in the way I outline above.
11:10 timotimo mhm
11:10 masak this smells like a blog post in the making
11:10 timotimo sadly, a catch block that no-ops a given type of exception is very wordy
11:11 timotimo and if you want to limit it to just one expression, it's even worse, because then you've got a do-block on your hands, and extra curlies
11:11 moritz masak: well, look for error handling after the try
11:11 masak moritz: well, yes and no.
11:12 masak moritz: it's possible to do that right, and re-throw any unknown exception types.
11:12 masak moritz: but my guess is it's rare, because the default is suppress-everything.
11:12 masak and people focus on the happy case, or more to the point, only the expected exceptions :)
11:14 jnthn It's horses for courses. Sometimes "it failed in some way" is eough information.
11:14 jnthn *enough
11:14 timotimo greetings jnthn
11:15 jnthn o/ timotimo
11:15 brrt \o jnthn
11:15 timotimo o/ brrt
11:15 jnthn hi brrt :)
11:15 moritz looking for very specific exceptions also has its dangers
11:15 brrt hi timotimo :-)
11:15 masak jnthn: yes, horses for courses, agreed.
11:15 masak jnthn: I guess the next step is to check those ~800 uses and categorize them :)
11:16 brrt har har.... har
11:16 masak moritz++ # that "search the ecosystem" thing
11:16 moritz in python, folks tend to write things like  foo = bar['baz'].quox() and catch AttributeError
11:16 masak brrt: you think I'm not serious? :)
11:16 moritz what about AttributeError thrown from quox()?
11:16 lizmat PSA: I'll be travelling for most of the rest of the day, and probably won't be in a state to finish the P6W tonight
11:16 brrt all the same to a python programmer moritz
11:16 masak moritz: even there, the problem is lack of specificity, not over-specificity
11:17 lizmat so most likely the P6W will appear tomorrw
11:17 brrt masak: it just reminds me of my own problems with OSM data
11:17 brrt 'i just categorise the 800 different ways that this data can fail, and patch them up'
11:17 moritz masak: right; but no language I know of offers this kind of specifity
11:17 timotimo moritz: that's not actually syntax, right? "and catch AttributeError"?
11:17 brrt now i have to implement a minimum-cost-spanning-tree classifier in plpgsql, figure that
11:18 moritz masak: so it's better siimply check for 'baz' in bar foirst
11:18 moritz timotimo: no, it's except AttributeError: pass
11:18 timotimo right
11:18 brrt actually, now that i'm here, do any of you know of a better classification algorithm;
11:18 lizmat commute home&
11:19 RabidGravy I have 24 try in 51 modules
11:19 brrt i have a M tuples and N classes, I need to find N tuples that represent the consensus of values
11:19 kid51 joined #perl6
11:19 brrt i intend to classify them based on tuple-to-tuple proximity using, well, minimum-cost-spanning-tree
11:20 brrt i want this to be repeatable, so k-means is out
11:20 brrt then after classification, figuring out the consensus value is easy
11:20 RabidGravy 8 of those are in one module
11:20 kaare_ joined #perl6
11:21 jnthn masak: Another thing to keep in mind when you're doing analysis of try: it's entirely possible to use CATCH without a try
11:21 jnthn masak: So just looking at how people use try won't be representitive of how robustly people handle exceptions.
11:22 RabidGravy two are in modules whose explicit purpose is to determine whether doing something would infact throw an exception
11:22 timotimo we could write a "fuzzer" of sorts that replaces exceptions with different types and analyzes paths taken in response
11:22 masak jnthn: well, what I want to check is how people mis-use `try`
11:22 timotimo RabidGravy: the way you write it "would" makes it sound like you've solved the halting problem :D
11:24 RabidGravy I didn't know there was any other way of spelling would
11:25 brrt otoh, sometimes you do want 'catch all the things'
11:25 RabidGravy I'm actually surprised I only have one "try require ::($module)"
11:25 timotimo i meant to refer to the whole sentence structure :)
11:25 jnthn masak: Ah, so the CATCH cases aren't even that interesting for you. OK :)
11:25 masak brrt: I think that's rather rare.
11:26 masak brrt: my thesis is that people *think* they want that way more often than it's actually good to do that.
11:26 moritz masak: interesting exercise: submit 5 PRs to make some of these trys more specific
11:26 brrt antithesis: people think they want that more often than *you* think they should want that
11:26 masak moritz: ooh
11:27 moritz masak: and count how many you visited until you got to the five
11:27 masak brrt: that doesn't feel very anti- :)
11:28 brrt well, its subtly anti
11:28 masak brrt: I think they do it too often because there's a real reason not to
11:28 timotimo so maybe it's the dualthesis?
11:28 masak it's not opinion, it's grounded in reality and actual bugs
11:28 timotimo sidethesis?
11:28 * brrt tries to get out of the grunt-industrial-programmer mental mode
11:28 jjido joined #perl6
11:29 masak brrt: I'd give you more credit for that point if it weren't for the fact that I *was* bitten by exactly this
11:29 masak so my blog post would count as a warning to others, based on hard-school-of-life experience
11:29 masak anyways
11:29 brrt masak: you are absolutely right, in a way that is going to be completely unconvincing to the mentality of a grunt programmer
11:29 * masak goes back to writing more code that can blow up in various ways
11:29 timotimo hard-school-of-life sounds much less fun than, say, Video Game High School
11:30 pmurias masak: isn't catching too match a general problem rather then something Perl 6 specific?
11:30 RabidGravy actually that's 13 in 48 modules if I exclude one which I haven't released
11:30 masak brrt: you're saying there are people out there who refuse to listen/adapt when someone says a practice is dangerous? ok -- as long as they're not on my team.
11:30 araujo joined #perl6
11:30 masak pmurias: yes.
11:30 brrt :-D
11:31 brrt i'm saying i'm working too much with people who will do exactly that
11:31 brrt (refuse to adapt)
11:31 masak not to put too fine point on it -- change jobs. :)
11:32 brrt point taken
11:32 masak I have absolutely no basis for saying that
11:32 masak except "my colleagues won't learn", which would make *me* do a 180 and run
11:33 brrt hmm, now that i think of it, it is kind of bad
11:33 vytas joined #perl6
11:34 timotimo well, if your daily experiences would make for a good post on thedailywtf, you know something's up :) :)
11:34 * masak .oO( dear diary: today I made someone on IRC quit his job )
11:34 brrt masak: that wouldn't have been just on you anyway
11:34 masak :)
11:36 moritz brrt: do you need a good job? Where are you located? :-)
11:36 moritz .oO( "asking for a friend" )
11:38 brrt moritz: yes, well, it's complicated; i'm in the finishing months of my study, i don't really have that much time on offer right now; i might be starting a PhD afterwards
11:38 masak brrt: ...we're hiring too! :D
11:38 brrt well, make it more difficult will you
11:38 masak that's what we're here for
11:38 masak brrt: many fine p6 people already work with us, so why not you as well? :)
11:39 jast reminds me, I've got to spend more time looking for jobs... not while I'm at work, though :}
11:39 brrt masak, moritz: it will be considered
11:39 brrt :-)
11:41 RabidGravy I have one module that has four try of which two could be removed completely because I actually catch the one exception I care about, one is associated with an open RT and one is "try and coerce something and *shrug* if it doesn't work"
11:42 masak RabidGravy: the last one, does it call a function or a method?
11:42 RabidGravy function
11:43 masak and that function will never, ever throw an exception for any reason whatsoever?
11:43 masak (or call something that does)
11:44 RabidGravy but the outcome is the same, "that didn't work"
11:45 masak ok
11:47 RabidGravy In a whole category of cases I have an attempt at coercion and leave the value as it was if it fails, thereby delegating the failure to a type constraint
11:48 RabidGravy which is actually what, for the most part, I want to happen as it makes more sense
11:53 pmurias node rakudo.js --setting=NULL -e 'nqp::say "Hello World"' just worked (locally with a bunch of hacks, including support for running code with --setting NULL), will now work on having it work in a commitable way
11:54 RabidGravy pmurias++ # nice one
11:55 smls joined #perl6
11:56 smls I found another interesting Rakudo concurrency failure mode:
11:56 smls «No such symbol 'primers' at /path/to/my/script/EVAL_19:4   ------>   $self(primers⏏.list[0], |{ %ahash, %chash }); # |{} wo»
11:56 smls Note that the code is not from my script (nor does my script use EVAL).
11:56 smls So that's some sort of Rakudo internals leaking out... :P
11:57 pierre_ joined #perl6
11:57 timotimo what is |{ %ahash, %chash } all about? o_O
11:58 brrt jnthn: is there some reason why writing a return value in the last bits of ->work would be invalid?
11:59 brrt in the reframe branch, i mean
12:00 masak pmurias++ # woot!
12:01 masak RabidGravy: even in the cases where you reliably fail no matter what the cause, the `try` has thrown away all the details about the cause.
12:02 masak (or, it hasn't -- the details are in $! -- but if you're not checking $! then that makes no difference)
12:04 RabidGravy I'm really not seeing the problem
12:05 RabidGravy m: my Int $a; my $b = "foo"; try $b = Int($b); $a = $b
12:05 camelia rakudo-moar f05c77: OUTPUT«Type check failed in assignment to $a; expected Int but got Str ("foo")␤  in block <unit> at /tmp/DGzCo_urxY line 1␤␤»
12:06 RabidGravy or
12:06 RabidGravy m: my Int $a; my $b = "foo"; $b = Int($b); $a = $b
12:06 camelia rakudo-moar f05c77: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5foo' (indicated by ⏏)␤  in block <unit> at /tmp/gufsuetL8L line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/gufsuetL8L line 1␤␤»
12:06 RabidGravy *shrug*
12:08 pierre_ joined #perl6
12:09 masak it all depends on how much machinery you're hiding away in the `try`
12:09 masak if it's just a coercion, then fine
12:09 masak (probably)
12:09 smls timotimo: Looks like it's from  Block.assuming  (Which my script does call.)
12:09 timotimo ah
12:09 smls src/core/Block.pm
12:10 timotimo holy hell, that's a long piece of code
12:10 RabidGravy no, it *is* fine
12:11 timotimo looks like there's a , missing in there?
12:12 timotimo "primers |{..., ...}" isn't correct
12:12 smls timotimo: I think what's going on is that I have different *clones* of the same closure on different threats, and calling .assuming on them at the same time.
12:12 smls Is that not allowed?
12:13 timotimo oh, depends on capwrap
12:13 smls ?
12:13 timotimo if they share lexicals they've closed over, that could be problematic
12:13 timotimo but what you have there is a parse error
12:13 timotimo isn't it?
12:14 smls a parser error inside the EVAL that .assuming does, yeah
12:15 timotimo the assuming method doesn't write to $! attributes at least
12:15 timotimo and also doesn't call anything much on $self
12:15 timotimo so it'd surprise me if it's not reentrant, so to speak
12:15 timotimo you could try doing the .assuming up front and see if it makes any difference
12:16 smls timotimo: Unfortunately I can't reliably reproduce it. It has only happened twice so far.
12:17 timotimo ah, of course :(
12:17 timotimo there's also a cross-thread-write error log thingie for moarvm that'd yell at you when you do things that may be troublesome; no clue how noisy that usually is with regards to false-positives
12:18 smls Sound useful, how can I activate that?
12:19 smls Also, is there a non-mutating form of .assuming?
12:19 smls (The name suggests it would return a new closure anyway. The mutating form should have been called .assume)
12:21 timotimo give me a second.
12:21 timotimo MVM_CROSS_THREAD_WRITE_LOG  Log unprotected cross-thread object writes to stderr
12:21 timotimo ^- from moar --help
12:21 smls thanks
12:24 pierre_ joined #perl6
12:25 uruwi joined #perl6
12:28 smls m: for (^200).race(batch=>1) {  ({ 1 + $_ }).assuming(10)()  }
12:28 camelia rakudo-moar f05c77: OUTPUT«Parameter '$a' requires a type object of type Int, but an object instance was passed.  Did you forget a 'multi'?␤␤Parameter '$a' requires a type object of type Int, but an object instance was passed.  Did you forget a 'multi'?␤␤Parameter '$a' requi…»
12:28 timotimo https://github.com/rakudo/rakudo/pull/756  -  review please; it's just about how the rakudo usage help output should look.
12:28 smls timotimo: This golfed code pretty much always fails, and one of the rarer failure modes is the one discussed above.
12:28 timotimo huh!
12:28 smls I guess .assuming on clones of the same closure is really not allowed then.
12:29 timotimo am i allowed to say the error message confuses me?
12:29 * [Coke] waves.
12:29 timotimo greetings, coke
12:29 smls timotimo: Run it a few times, you'll get different error messages... :P
12:32 awwaiid hoelzro (or anyone interested in REPLness): I updated https://github.com/rakudo/rakudo/pull/738 so it now works with jvm. I haven't tried on windows yet to see if that is different.
12:35 Ulti cool
12:36 Ulti is the JVM version of Rakudo also 6.c ?
12:36 jnthn brrt: Well, the end of ->work is used for arg passing
12:36 awwaiid As far as I know that's a goal, though I think there are still some issues. It's working better this month than previously for me :)
12:37 jnthn brrt: And the GC scans its content by looking at the callsite used to pass args
12:37 jnthn brrt: So you can't just stash a value in the end slot really.
12:37 brrt hmmm
12:37 brrt thing is
12:38 brrt i've been reusing that slot in the jit for the return address of istrue in the if_o to istrue-lowering
12:38 brrt now, when we're calling Bool(), we have no args except perhaps the callee
12:38 brrt ehn, invokee
12:39 timotimo ideally, we'd already turn an if_o or istrue_o(?) into the call at spesh time when we know the STable, invocation mode, etc etc
12:39 timotimo same with some other things that have that kind of mode
12:39 brrt that has worked without problems for a long time, it may be so that there is something wrong there in the reframe-jit
12:39 jnthn brrt: Oh, so you're just stashing a value in there?
12:39 brrt aye
12:39 jnthn You'd likely get away with that...
12:40 brrt well, i'd think so
12:40 jnthn I don't see why you'd stop being able to get away with it
12:40 brrt thing is, we're clearly running into an infinite loop
12:40 brrt in reframe-jit, in QRegex EXPR method, somewhere...
12:40 perlpilot joined #perl6
12:41 brrt it's not the new invoksih check, that one works well
12:41 jnthn And you got rid of all the FRAME references?
12:42 timotimo have you been able to find the bounds of that infinite loop?
12:42 jnthn :P
12:43 timotimo that's clearly the wrong way to spell that :D
12:43 timotimo i meant: what values does the IP reach?
12:44 brrt re FRAME, pretty sure yes
12:44 brrt timotimo, i should get that from my debugger
12:44 pierre_ joined #perl6
12:44 ilmari haha, my file(1) says t/harness6: OS/2 REXX batch file, ASCII text
12:44 brrt but it is limited
12:47 timotimo fantastic %)
12:47 [Coke] Ulti: the ideal of the rakudo-j implementation is 6.c; the reality is far behind that.
12:52 brrt this reminds me that JIT debugging options are still pretty il
12:52 brrt limited
12:52 timotimo agreed :(
12:52 timotimo (and profiling with perf and other such tools is also difficult)
12:54 smls m: for (^50).race(batch=>1) {  EVAL(q[ ({1 + $^a}) ]).assuming(10)()  }
12:54 camelia rakudo-moar f05c77: OUTPUT«(signal ABRT)*** Error in `/home/camelia/rakudo-m-inst-2/bin/moar': double free or corruption (fasttop): 0x00000000049f23e0 ***␤======= Backtrace: =========␤/lib64/libc.so.6(+0x730bf​)[0x7ffec6d5b0bf]␤/lib64/libc.so.6(​+0x7892e)[0x7ffec6d6092e]␤/lib6…»
12:55 smls timotimo: ^^ Fails even when I use EVAL to make sure each thread has a different closure.
12:55 smls (That moar crash seems to be camelia-specific; locally it fails with the same failure modes as the previous examples.)
12:56 timotimo oh, very interesting
12:56 timotimo i don't have time to look into it right now, though
12:57 * smls will RT
13:00 khagan joined #perl6
13:00 jameslenz joined #perl6
13:01 masak getting spectest failures in t/spec/S06-other/main-usage.rakudo.moar and t/spec/S32-num/power.rakudo.moar today
13:02 Possum joined #perl6
13:03 RabidGravy joined #perl6
13:03 moritz masak: I got the main-usage failure as well
13:03 moritz masak: the power one, is that really a failure, or passing TODOs?
13:03 masak moritz: oh! passing TODOs.
13:03 masak the framework told me so, and then I forgot.
13:03 huf joined #perl6
13:04 nightfrog joined #perl6
13:07 mattp_ joined #perl6
13:09 kerframil joined #perl6
13:11 Xliff "…expect that there will be no release of Perl 6 suitable for everyday use by regular developers in the foreseeable future." - chromatic, 2013
13:11 Xliff Oh what a difference 3 years makes.
13:11 [Coke] sixfix doesn't need to be using say in the REPL, btw.
13:12 larion joined #perl6
13:13 pmurias chromatic had a pretty precise definition of that, it's interesting if have met it (or how far we are from it)
13:13 ribasushi joined #perl6
13:15 felher joined #perl6
13:15 Khisanth joined #perl6
13:15 masak pmurias: can that definition be found publicly somewhere?
13:18 domm joined #perl6
13:19 Xliff On the whole try/catch issue. Is it the implementation of try/catch that's the problem or how it is used?
13:19 RabidGravy we'd all better stop writing software using perl 6 then
13:19 Xliff Because I believe that you test by exception type and then rethrow everything else in the default case.
13:20 timotimo it's only "try" without catch
13:20 timotimo putting try inside an expression
13:20 Xliff o_O
13:20 Xliff What's the point of "try without catch"?
13:20 RabidGravy Xliff, try on its own because it may inadvertently hide errors you do care about
13:20 Xliff O_o
13:21 brrt Xliff: to not die in the face of errors
13:21 * Xliff looks at the sky and screams "whhhyyyyy"
13:21 brrt it has to do with the psychology of a creature called 'the normal person'
13:21 brrt the kind of people who hit an electrical device to make it work
13:21 Xliff brrt: I am a fan of "die if this specific error", but "die on any error" is something that very rarely will work as expected.
13:21 Xliff I speak from experience.
13:21 geekosaur a spherical person of uniform density?
13:22 brrt incidentally, i do that for devices when i don't want to understand its details
13:22 geekosaur and, sadly, most people do *not* think that way
13:22 Xliff geekosaur, I may vaguely resemble that remark. =P
13:22 * geekosaur may also :p
13:22 timotimo Xliff: do you have your nots reversed there?
13:22 Xliff vaguely spherical, vaguely uniform.
13:22 brrt i *think* the issue here may be that perl6 makes this case really easy, and you shouldn't use it
13:23 RabidGravy if you *shouldn't* use it then it *shouldn't* be in the language
13:24 timotimo --no-preserve-root shouldn't be in rm :)
13:24 Xliff Perl6 - giving you enough rope to succeed almost invariably means giving you enough rope to hang yourself.
13:24 RabidGravy in a lot of cases it is probably not what you want to do
13:24 smls I believe TimToady did argue once for making 'try' only catch X::AdHoc by default
13:24 Xliff Me personally, that's a thin line. However I prefer the flexibility and the responsibility to use things correctly rather than not having it at all.
13:25 RabidGravy yes, but y'know people just love their absolute rules based on opinion
13:26 donaldh joined #perl6
13:27 Xliff I do so love irclogs.
13:27 Xliff http://irclog.perlgeek.de/p​erl6/2015-12-29#i_11795340
13:28 Xliff RabidGravy: Oh. I have all of the read tests done against my (hacky) bindings for libogg and libvorbis.
13:28 Xliff Now comes write tests with libvorbisenc, libvorbis andlibogg.. *_*
13:29 Xliff Once those are done I will write p6 interface in Audio::OggVorbis
13:29 domm joined #perl6
13:30 RabidGravy cool :)
13:30 RabidGravy Xliff++ # making those things so I don't have to :)
13:31 Xliff I have it on GitHub, now but the project is a long way to being ecosystem-ready.
13:31 Xliff https://github.com/Xliff/p6-audio-oggvorbis
13:31 Xliff Comments/Suggestions welcome.
13:32 domm joined #perl6
13:36 uruwi joined #perl6
13:40 Xliff timotimo, LOL - you are correct, sir. I meant "but 'not die on any error'", above.
13:43 mcsnolte joined #perl6
13:43 abraxxa joined #perl6
13:49 khw joined #perl6
13:51 cdg joined #perl6
13:56 takadonet morning all
13:56 cdg joined #perl6
13:57 cschwenz1 joined #perl6
14:00 cschwenz joined #perl6
14:02 MadcapJake Xliff: why not Audio::OggVorbis instead of Audio::LibOggVorbis ?
14:03 RabidGravy well it is entirely possible someone could come up with a completely different implementation :)
14:04 MadcapJake just seems lengthy and "Lib" seems superfluous
14:07 leont_ joined #perl6
14:13 RabidGravy well the same reason I called Audio::Encode::LameMP3
14:14 MadcapJake I don't see a problem with that one, seems well categorized
14:16 RabidGravy it's still early days, I'd go with names that don't preclude making alternative implementations
14:17 tharkun joined #perl6
14:22 grondilu m: my %h; %h<foo> := %h<bar>; %h<bar> = "bar!"; say %h<foo>;
14:22 camelia rakudo-moar f05c77: OUTPUT«(Any)␤»
14:22 * grondilu was hoping the result would be "bar!"
14:22 ptolemarch joined #perl6
14:22 dalek star: c9e9516 | (Steve Mynott)++ | modules/MODULES.txt:
14:22 dalek star: Comment File::Find since its embedded with panda.  Oddly error only
14:22 dalek star: visible on Windows
14:22 dalek star: review: https://github.com/rakudo/star/commit/c9e9516a8d
14:24 jnthn grondilu: You'd need to force vivification of %h<bar> before binding it, otherwise you get a throwaway container that's bound nowhere
14:24 grondilu ok
14:34 cognominal joined #perl6
14:41 dalek star: 0e7dbb2 | (Steve Mynott)++ | / (2 files):
14:41 dalek star: no unix type PATH under windows
14:41 dalek star: review: https://github.com/rakudo/star/commit/0e7dbb2e99
14:41 jack_rabbit joined #perl6
14:42 RabidGravy tadzik, or anyone else with commit on panda https://github.com/tadzik/panda/pull/309 would be a great boon as half my modules are failing right now
14:44 moritz RabidGravy: merging right now
14:44 stmuk_ github doesnt like multi line commit logs :/
14:44 RabidGravy fabulous! moritz++
14:45 ilmari do you mean commit messages without a separate subject line?
14:45 moritz stmuk_: it does, if you follow the convention of putting an empty line after the first one
14:45 stmuk_ ah
14:45 uruwi joined #perl6
14:45 kerframil joined #perl6
14:47 nebuchadnezzar joined #perl6
14:47 RabidGravy I think vim even has a quite smart syntax highlighter for git commit messages, which give a clue how they might wind up
14:48 Xliff MadcapJake, I'm in the process of renaming it to just that. The GitHub repo implies just that.
14:50 MadcapJake Xliff: oops, didn't even notice that :P
14:50 Khisanth joined #perl6
14:51 BooK m: my @a=1,2; say @a; say @a X @a; # what's the difference between () and [] ?
14:51 camelia rakudo-moar f05c77: OUTPUT«[1 2]␤((1 1) (1 2) (2 1) (2 2))␤»
14:51 Xliff MadcapJake, it's OK. I forgive you. =)
14:52 * Xliff re-reads line at 10:48:02 and shakes head at the repitition.
14:53 sjn m: my @a=1,2; say @a.WHAT; say (@a X @a).WHAT;
14:53 camelia rakudo-moar f05c77: OUTPUT«(Array)␤(Seq)␤»
14:53 takadonet where do you report bug for rakudo?
14:54 takadonet is it still https://rt.perl.org/Public/Dist/Display.html​?CSRF_Token=ca5bf202ec3a46b301da8fa359312be6 ?
14:54 RabidGravy BooK, [] is an array, () is a list (or a seq in this case)
14:54 sjn takadonet: http://rakudo.org/tickets/
14:55 takadonet sjn: thanks
14:55 dalek star: f281cd4 | (Steve Mynott)++ | modules/panda:
14:55 dalek star: panda with new JSON::Fast dep
14:55 dalek star: review: https://github.com/rakudo/star/commit/f281cd49cd
14:55 dalek star: e873b77 | (Steve Mynott)++ | modules/doc:
14:55 dalek star: newer docs should be safe
14:55 dalek star: review: https://github.com/rakudo/star/commit/e873b77954
14:56 BooK RabidGravy: I assume in most cases (e.g. for loops) I can use them indifferently
14:56 novavis left #perl6
14:56 BooK m: my @a=1,2; say @a.WHAT; say (my @b=@a X @a).WHAT;
14:56 camelia rakudo-moar f05c77: OUTPUT«(Array)␤(Array)␤»
14:56 BooK mkay
14:57 RabidGravy interchangeably yes
14:57 RabidGravy you can use them indifferently if you want but meh ;-)
14:57 domidumont joined #perl6
14:59 tomboy64 joined #perl6
14:59 moritz ... but I don't care if you do :-)
15:04 aries_liuxueyang joined #perl6
15:04 stmuk_ I'm starting to think R* should just include p6doc, panda and maybe zef :/
15:06 stmuk_ and just be called "perl 6"
15:06 Xliff BooK: I think any List or Seq is coerced into an Array when assigned to a variable.
15:07 Xliff m: my @a = (1,2,3,4); say @a.WHAT
15:07 camelia rakudo-moar f05c77: OUTPUT«(Array)␤»
15:07 jnthn Note quite
15:07 jnthn *not
15:07 Xliff m: (1,2,3,4).WHAT
15:07 camelia rakudo-moar f05c77: ( no output )
15:07 jnthn An Array is something you can store things into
15:07 jnthn And assignment is copying
15:07 Xliff m: say (1,2,3,4).WHAT
15:07 camelia rakudo-moar f05c77: OUTPUT«(List)␤»
15:07 jnthn my @a = 1..5; my @b = @a; @a[3] = 42; say @b;
15:07 ilmari my $a = (1,2,3,4); say $a.WHAT
15:08 jnthn m: my @a = 1..5; my @b = @a; @a[3] = 42; say @b;
15:08 camelia rakudo-moar f05c77: OUTPUT«[1 2 3 4 5]␤»
15:08 Xliff m: say ((1,2,3,4) X (3, 6)).WHAT
15:08 ilmari m: my $a = (1,2,3,4); say $a.WHAT
15:08 camelia rakudo-moar f05c77: OUTPUT«(Seq)␤»
15:08 camelia rakudo-moar f05c77: OUTPUT«(List)␤»
15:08 jnthn Note that @b doesn't reflect the change in @a because assignment works that way
15:08 ufobat is there a problem with nativecall and filehandles? i am just wondering why Net::PCAP (in perl5 as well) doesn't have pcap_fopen_offline
15:09 Xliff ufobat, what do you mean?
15:09 Xliff jnthn, I meant to imply the assignment. Sorry if that was unclear.
15:09 ufobat both Net::PCAP in perl5 and perl6 have not implemented the pcap function "pcap_fopen_offline" and i am wondering why
15:10 ufobat Net::Pcap, sorry
15:10 jnthn Xliff: np, it's just that "coerce" is a tad under-specific :)
15:10 jnthn So figured I'd try to clarify a bit :)
15:12 Xliff Ahh...
15:13 Xliff And here I was trying to sound knowledgeable.
15:13 Xliff m: my @a = [(1, 2), (3, 4), (5, 6, 7)]; say @a[2].WHAT;
15:13 camelia rakudo-moar f05c77: OUTPUT«(List)␤»
15:14 Xliff m: my @a = [(1, 2), (3, 4), (5, 6, 7)]; say @a[2].WHAT; my @b = a[1]; say @b.WHAT
15:14 camelia rakudo-moar f05c77: OUTPUT«5===SORRY!5=== Error while compiling /tmp/i2XsKrGCWE␤Undeclared routine:␤    a used at line 1␤␤»
15:14 Xliff m: my @a = [(1, 2), (3, 4), (5, 6, 7)]; say @a[2].WHAT; my @b = @a[1]; say @b.WHAT;
15:14 camelia rakudo-moar f05c77: OUTPUT«(List)␤(Array)␤»
15:14 RabidGravy ufobat, it could be implemented, there isn't a particular problem it's just fiddly
15:15 Xliff OK. So the behavior I was expecting was correct.
15:15 ufobat good to know
15:15 leont_ joined #perl6
15:18 ZoffixW joined #perl6
15:18 ZoffixW m: my $text = "### Perl 5\nSome code\n## Perl 6\nMoar code\n"; my @titles = $text.comb(/^^ <?after '#'+ \s> (.+?) $$/); .say for @titles;
15:18 camelia rakudo-moar f05c77: ( no output )
15:18 ZoffixW Why doesn't this match, yet if I remove '^^' then it works?
15:20 moritz ZoffixW: because of the \n
15:21 ZoffixW moritz, doesn't it make a new "line", hence the start/end of line anchors would work?
15:21 moritz ZoffixW: <?after '#'> doesn't match, because the previous character was a \n, not a #
15:21 ZoffixW The docs also say "The ^^ assertion matches [...] either at the start of the string, or after a newline character."
15:22 moritz ZoffixW: maybe you want <?before> instead?
15:23 ZoffixW Nah, I want <?after .. but now I see why it's failing. <after is zero-width. But then, why does this fail too, if I put the ^^ inside the <?after?
15:23 ZoffixW m: my $text = "### Perl 5\nSome code\n## Perl 6\nMoar code\n"; my @titles = $text.comb(/<?after ^^ '#'+ \s> (.+?) $$/); .say for @titles;
15:23 camelia rakudo-moar f05c77: ( no output )
15:23 moritz ZoffixW: what do you want to achieve?
15:24 ZoffixW moritz, I want the result to be @titles = 'Perl 5', 'Perl6';
15:24 Xliff 'Perl 5', 'Perl 6'
15:25 * Xliff knows what its like to suffer from a defective space bar.
15:25 ZoffixW right
15:26 moritz m: my @lines = "### Perl 5\nSome code\n## Perl 6\nMoar code\n".lines; for @lines.rotor(2 => -1) { say .[1] if .[0] ~~ /^'#'/ }
15:26 camelia rakudo-moar f05c77: OUTPUT«Some code␤Moar code␤»
15:26 ZoffixW heh. But I want with .comb
15:26 moritz and it's not what you want, right?
15:26 ZoffixW Right.
15:27 moritz m: say "### Perl 5\nSome code\n## Perl 6\nMoar code\n".comb(/^^'#'+\s* <( \N+ /).perl
15:27 camelia rakudo-moar f05c77: OUTPUT«("Perl 5", "Perl 6").Seq␤»
15:27 moritz ZoffixW: better? :-)
15:28 ZoffixW Yeah, thanks. Now I juse need to read up on what <( and \N+ are :)
15:28 moritz <( starts the match
15:28 moritz \K if you know p5 regexes
15:29 moritz and \N is the opposite of \n
15:29 moritz a non-newline character
15:29 ZoffixW Though I'm still curious why my version with <?after didn't work.
15:29 ZoffixW moritz, thanks. That makes sense
15:29 ZoffixW m: my $text = "### Perl 5\nSome code\n## Perl 6\nMoar code\n"; my @titles = $text.comb(/<?after ^^ > (.+?) $$/); .say for @titles;
15:29 camelia rakudo-moar f05c77: OUTPUT«␤Some code␤␤## Perl 6␤␤Moar code␤»
15:29 ZoffixW ^ first line is missing :S
15:33 psch m: say +("\n" ~~ / ^^ /)
15:33 camelia rakudo-moar f05c77: OUTPUT«0␤»
15:33 psch m: say +("a\nb" ~~ / ^^ /)
15:33 camelia rakudo-moar f05c77: OUTPUT«0␤»
15:33 psch m: say +("a\nb\n" ~~ / ^^ /)
15:33 camelia rakudo-moar f05c77: OUTPUT«0␤»
15:34 psch oh duh
15:34 ZoffixW ?
15:34 psch not capturing anything of course reports 0 captures... :)
15:34 ZoffixW Ah
15:34 psch m: say +("\n" ~~ / (^^) /) # not sure we *can* capture that..?
15:34 camelia rakudo-moar f05c77: OUTPUT«0␤»
15:35 Xliff m: my @a = ("a\nb\n" ~~ m:g/ ^^ /); say @a
15:35 camelia rakudo-moar f05c77: OUTPUT«[「」 「」]␤»
15:35 Xliff Ooorrr...
15:35 psch m: say +("\n" ~~ / [^^ (<?>)]+ /) # not sure we *can* capture that..?
15:35 Xliff m: say ("a\nb\n" ~~ m:g/ ^^ /);
15:35 camelia rakudo-moar f05c77: OUTPUT«Memory allocation failed; could not allocate 94656 bytes␤»
15:35 camelia rakudo-moar f05c77: OUTPUT«(「」 「」)␤»
15:35 psch well, yeah, that should be a timeout i guess
15:35 psch i mean, it makes sense
15:36 * psch slowly steps away from the zero-width assertions
15:36 ZoffixW :D
15:36 Xliff They would be useful if I could ever get them to work like want them to!
15:37 * psch .oO( "sir, please put down the kleene star!" )
15:37 tadzik moritz++
15:37 Xliff s/like/like I/
15:38 psch i just occassionally braino, like above :S
15:54 dalek ecosystem: 71e841b | RabidGravy++ | META.list:
15:54 dalek ecosystem: Rename META file for AccessorFacade
15:54 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/71e841b65e
16:01 MadcapJake tadzik: how do I keep separate my panda for rakudobrew and one for rakudo?
16:02 telex joined #perl6
16:04 takadonet m: for 1..8 -> $core {   next if $core %4 !=0; say $core;}
16:04 camelia rakudo-moar f05c77: OUTPUT«Cannot modify an immutable Int␤  in block <unit> at /tmp/ltAhBcPWVO line 1␤␤»
16:05 takadonet m: for 1..8 -> $core {   my $temp = $core; next if $temp %4 !=0 ; say $core;}
16:05 camelia rakudo-moar f05c77: OUTPUT«Cannot modify an immutable Int␤  in block <unit> at /tmp/q_mOvqF1an line 1␤␤»
16:06 takadonet what I am missing?
16:06 ZoffixW m: for 1..8 -> $core {   next if $core % 4 != 0; say $core;}
16:06 camelia rakudo-moar f05c77: OUTPUT«4␤8␤»
16:06 ZoffixW takadonet, spaces :)
16:06 takadonet ZoffixW: ..... bloody hell!
16:06 takadonet thanks
16:07 ZoffixW I wonder what it's being interpreted as...
16:07 ZoffixW m: my $x; say $x !=0;
16:07 camelia rakudo-moar f05c77: OUTPUT«True␤»
16:07 ZoffixW m: my $x; say $x != 0;
16:07 camelia rakudo-moar f05c77: OUTPUT«Use of uninitialized value of type Any in numeric context  in block <unit> at /tmp/vmuw7mllk0 line 1␤False␤»
16:09 takadonet Was just about to report it as a bug
16:12 awwaiid $core % 4 != 0   --->    $core !%% 4 # I think
16:13 awwaiid %% means "even multiple of", and thus !%% means "not an even multiple of"
16:13 * ZoffixW would just use unless ... %%
16:13 awwaiid m: for 1..8 -> $core {   next if $core !%% 4; say $core }
16:13 camelia rakudo-moar f05c77: OUTPUT«4␤8␤»
16:14 ZoffixW Well, it might be a bug that !=0 is doing something weird. It almost like it's trying to do the same type of stuff as +=, except with the ! operator.
16:14 * ZoffixW reports it
16:17 ZoffixW Ah, $a !=$b, behaves as $a = $b and returns !$b as result
16:17 stmuk_ http://pl6anet.org/drop/rak​udo-star-2016.04-RC3.tar.gz
16:17 ZoffixW stmuk_++
16:17 stmuk_ testing on Windows welcomed - if nothing serious pops up I'm planning on releasing that in 12 hrs or so
16:18 awwaiid ZoffixW: I looked at perl6 --target=parse -e 'my $x; say $x !=0', and ... yep.
16:20 awwaiid !==0 works in that case :)
16:20 gregf_ m: (1..8).grep: {   next unless $_ %% 4; .say }
16:20 camelia rakudo-moar f05c77: OUTPUT«4␤8␤»
16:20 ZoffixW Reported: https://rt.perl.org/Ticket/Display.html?id=127988
16:21 ZoffixW m: (1..8).grep(* %% 4)>>.say
16:21 camelia rakudo-moar f05c77: OUTPUT«4␤8␤»
16:22 gregf_ oh, that next is not needed :|
16:22 gregf_ m: (1..8).grep: {   $_ %% 4 && .say }
16:22 camelia rakudo-moar f05c77: OUTPUT«4␤8␤»
16:22 gregf_ heh.. ZoffixW++
16:22 uruwi joined #perl6
16:23 wamba joined #perl6
16:23 gregf_ refactoring++
16:23 takadonet gregf_: original script little more complex then that :)
16:28 Xliff Can you make Buf/Blob/Array mimic a file stream in Perl6?
16:30 Xliff stmuk_, Can Rakudo Start live in harmony with Strawberry Perl?
16:30 Xliff s/Start/Star/
16:31 ZoffixW m: (0, 4 ... * > 100).say
16:31 camelia rakudo-moar f05c77: OUTPUT«(0 4 8 12 16 20 24 28 32 36 40 44 48 52 56 60 64 68 72 76 80 84 88 92 96 100 104)␤»
16:31 moritz Xliff: what do you mean by "mimic"?
16:32 stmuk_ Xliff: currently that's just a source distro with basic windows support - its likely some of the nativecall modules like linenoise might not work depending on compiler
16:32 Xliff Well, ideally I want to write one entry point into an interface I am writing.
16:32 stmuk_ Xliff: if you could try building with strawberry and report any issues of a gist posted here that would help
16:32 stmuk_ s/of/on
16:32 Xliff So I want to be able to run this Bufs, Blobs, Arrays and file streams.
16:33 Xliff stmuk: OK. Rebuilding now.
16:33 moritz Xliff: sounds like you want something like p5's IO::All
16:34 moritz I don't think such a thing has been written yet for Perl 6
16:36 stmuk_ Xliff: I'm travelling shortly but will read this scrollback later
16:37 jjido_ joined #perl6
16:39 sno joined #perl6
16:43 _mg_ joined #perl6
16:45 Xliff moritz++ # Thanks!
16:55 ponbiki joined #perl6
16:55 Xliff The hurdles I have to go through to get rakudobrew to work on Windows.
16:58 grondilu m: say (class {}) // "not defined?"
16:58 camelia rakudo-moar f05c77: OUTPUT«not defined?␤»
16:59 grondilu m: say Int.defined
16:59 camelia rakudo-moar f05c77: OUTPUT«False␤»
16:59 * grondilu needs to review the semantics of &[//]
17:00 moritz &[//] probably doesn't short-circuit
17:02 smls moritz: TimToady made [ ] with || // and friends short-circuit, shortly before the 6.c release
17:02 smls m: say [//] 42, (say "here")
17:02 camelia rakudo-moar f05c77: OUTPUT«42␤»
17:03 moritz smls: rakudo disagrees with you
17:03 smls ?
17:04 smls It did not execute the  (say "here")
17:05 ilmari m: say [&&] 42, (say "here")
17:05 camelia rakudo-moar f05c77: OUTPUT«here␤True␤»
17:05 ilmari m: say [&&] False, (say "here")
17:05 camelia rakudo-moar f05c77: OUTPUT«False␤»
17:05 MadcapJake m: [//] Nil, Nil, (say 'here');
17:05 camelia rakudo-moar f05c77: OUTPUT«here␤»
17:07 MadcapJake m: say (class {}).defined; say (class{}).new.defined; # grondilu
17:07 camelia rakudo-moar f05c77: OUTPUT«5===SORRY!5=== Error while compiling /tmp/7p4QP88Akj␤Whitespace required after keyword 'class'␤at /tmp/7p4QP88Akj:1␤------> 3say (class {}).defined; say (class7⏏5{}).new.defined; # grondilu␤»
17:07 MadcapJake m: say (class {}).defined; say (class {}).new.defined; # grondilu
17:07 camelia rakudo-moar f05c77: OUTPUT«False␤True␤»
17:08 [Coke] stmuk: what do you mean, no PATH under windows?
17:08 geekosaur yeh, I was wondering about that... a class would be a type object
17:09 geekosaur thought they said "unix-like".. .which would mean :-separated
17:10 Xliff Error while building. Detailes here: https://gist.github.com/Xliff/8​3bddb9af82e862570d602b330811ff8
17:12 pmurias joined #perl6
17:14 MadcapJake Why do I keep getting "IO::Path requires named arguments only" error when it clearly allows you to provide a single string/IO argument
17:14 maybekoo2 joined #perl6
17:14 jjido_ joined #perl6
17:15 smls m:  say IO::Path.new(5);  say IO::Path.new(5, 10)
17:15 camelia rakudo-moar f05c77: OUTPUT«IO::Path is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in method new at src/RESTRICTED.setting line 32␤  in block <unit> at /tmp/Rh2thN3Apr line 1␤␤»
17:16 MadcapJake that even works smls, it just concats it onto $*CWD
17:16 MadcapJake oh but the second one doesn't and gives the same named args only error
17:16 MadcapJake hmmm
17:16 firstdayonthejob joined #perl6
17:16 smls It's an LTA error message. Might be worth to RT it.
17:17 dalek doc: 26bd494 | (Jan-Olof Hendig)++ | doc/Type/Dateish.pod:
17:17 dalek doc: Added documentation for the weekday-of-month method
17:17 dalek doc: review: https://github.com/perl6/doc/commit/26bd494957
17:19 MadcapJake smls: https://rt.perl.org/Ticket/Display.html?id=1279​89&amp;results=8dfc06b6335d5261cea72c6818e5712c
17:19 smls MadcapJake++
17:19 Ricimer joined #perl6
17:25 smls_ joined #perl6
17:39 dha joined #perl6
17:40 ZoffixW joined #perl6
17:41 pmurias hmm, when we reach 100 nqp test how should they be numbered?
17:41 [Coke] can't we just keep going
17:41 [Coke] ?
17:42 llfourn unicode!
17:43 RabidGravy I wrote a script to renumber tests spaced out by 100 and left padded with zeroes the other day
17:44 ZoffixW rename 's/^(\d+\d+)(?!\d)/0$1/' *
17:44 ZoffixW m: my %things = 'moo=meow ping=pong'.comb(/(\w+) '=' (\w+)/, :match).map({ $_[0] => ~$_[1] }); say %things
17:44 camelia rakudo-moar f05c77: OUTPUT«{moo => meow, ping => pong}␤»
17:44 ZoffixW Is there a more concise way to write the above? Preferably with .comb, but I'll take other methods too?
17:45 ZoffixW Err... \d\d not \d+\d+
17:46 mst maybe some sort of .flatten.pairs_to_hash type thing?
17:46 mst maybe not conciser but prettier, maybe
17:46 zakharyas joined #perl6
17:46 ZoffixW .comb is itching for a :captures flag... Where it returns a list of all the $0, $1, $2 ... etc captures
17:46 Khisanth joined #perl6
17:48 ZoffixW m: my %h = 'moo=meow ping=pong'.comb(/(\w+) '=' (\w+)/, :match)>>.flat.flat>>.Str; say %h
17:48 camelia rakudo-moar f05c77: OUTPUT«{moo => meow, ping => pong}␤»
17:48 ZoffixW mst++
17:48 ZoffixW Still, kinda roundabout, especially when you compare it to Perl 5's:    my %h = 'moo=meow ping=pong' =~ /(\w+)=(\w+)/
17:50 ZoffixW m: my %h = 'moo=meow ping=pong'.comb(/(\w+) '=' (\w+)/, :match)>>.Slip.>>.Str; say %h
17:50 camelia rakudo-moar f05c77: OUTPUT«{moo => meow, ping => pong}␤»
17:52 mst ZoffixW: you missed a 'g' on the perl5 version, I think
17:52 ZoffixW Yeah, I did
17:52 ZoffixW It's still much shorter even with /g :)
17:53 mst how come it needs all of >>.flat.flat>..Str ?
17:53 mst that's a bit beyond my current comprehension
17:53 ZoffixW .comb with :match returns a bunch of Match objects.
17:53 ZoffixW And apparently when you coerce them into a list, you get a list of captures.
17:54 MadcapJake mst: .map(.flat).flat.map(.Str)
17:54 llfourn m: 'moo=meow ping=pong'.comb(/(\w+) '=' (\w+)/, :match).say
17:54 camelia rakudo-moar f05c77: OUTPUT«(「moo=meow」␤ 0 => 「moo」␤ 1 => 「meow」 「ping=pong」␤ 0 => 「ping」␤ 1 => 「pong」)␤»
17:54 * dha is still waiting for a programming language that can handle having just one instruction: DWIM
17:55 MadcapJake >>.method equivalent to .map(*.method)
17:56 mst ah, right, so the first .flat just turns it into one list per match and the recond one flattens it entirely?
17:57 ZoffixW Yeah
17:57 ZoffixW But you still get Match objects, so that's why .Str is there too
17:58 Actualeyes joined #perl6
18:03 smls_ MadcapJake: Isn't  >>.method  closer to  .deepmap(*.method)  ?
18:03 jack_rabbit joined #perl6
18:03 llfourn m: my %h = q|moo=meow ping=pong|.comb(/$<key>=\w+ "=" $<value>=\w+/, :match).map({.<key> => .<value>.Str}); say %h.perl # clearer
18:03 camelia rakudo-moar f05c77: OUTPUT«{:moo("meow"), :ping("pong")}␤»
18:04 CIAvash m: say 'moo=meow ping=pong'.split([' ','=']).hash
18:04 camelia rakudo-moar f05c77: OUTPUT«{moo => meow, ping => pong}␤»
18:04 ZoffixW CIAvash, that's incorrect. Your `ping` key is ` ping` key.
18:05 ZoffixW Oh
18:05 ZoffixW Sorry, I missed the ' '. But still.
18:05 mst oh hey something that does have a hash form ;)
18:05 ZoffixW :D
18:05 MadcapJake smls_: yeah you're right
18:06 perlawhirl joined #perl6
18:06 perlawhirl Zoffix: this is how i've always done string pairs to hashes...
18:07 perlawhirl m: my %things = [=>] 'moo=meow ping=pong'.split('='); say %things;
18:07 camelia rakudo-moar f05c77: OUTPUT«{moo => meow ping => pong}␤»
18:07 ZoffixW m: dd [=>] 'moo=meow ping=pong'.split('=')
18:07 camelia rakudo-moar f05c77: OUTPUT«:moo("meow ping" => "pong")␤»
18:07 perlawhirl or... just in case separators are in your 'value' string ... .split('=', 2)
18:08 perlawhirl hmm... .words too then :D
18:08 ZoffixW I guess that's another way to go, but it's not the equivalent of the Perl 5's version [and doesn't use .comb]...
18:09 * ZoffixW is writing an article, so those two bits are more important than they should be :)
18:10 perlawhirl m: dd 'moo=meow ping=pong'.words.map({ [=>] .split('=') });
18:10 camelia rakudo-moar f05c77: OUTPUT«(:moo("meow"), :ping("pong")).Seq␤»
18:11 perlawhirl ahh... didn't see you say 'preferably with comb'
18:12 ZoffixW Hm. I started writing a proposal to add :captures, but can't come up with any sane behavior (should it return a List for each set? What about named captures?): Here's what I wrote so far, if anyone wants to take the torch: https://gist.github.com/zoffixznet​/b88f63a20e4b0eb2bede859eb86b0c54
18:12 uruwi joined #perl6
18:12 ZoffixW ».Slip.».Str ain't too bad
18:13 vendethiel- (why not map?)
18:14 psch ZoffixW: Match exists to deal with ambiguity of having positional and named captures... :)
18:15 ZoffixW Right, which makes :captures pointless :P
18:15 psch +the
18:15 ZoffixW vendethiel-, more typing? :)
18:15 vendethiel- .map(*.Slip.Str) isn't that bad, really :P
18:15 ZoffixW ».Slip».Str both shorter and sexier :)
18:15 * vendethiel- politely disagrees
18:16 ZoffixW :D
18:16 vendethiel- the good thing is, both work :).
18:17 psch and a .Slip.Str is fast either way, amirite
18:17 dalek ecosystem: f11e8db | RabidGravy++ | META.list:
18:17 dalek ecosystem: Rename META file for XDG::BaseDirectory
18:17 dalek ecosystem: review: https://github.com/perl6/e​cosystem/commit/f11e8db2ad
18:22 Actualeyes left #perl6
18:25 perigrin /w 74
18:26 Ven joined #perl6
18:28 cdg joined #perl6
18:30 molaf joined #perl6
18:42 dha So... If I wanted to know what directory my program thinks it's in at the moment, I would think I would use - from what I can find searching for "dir" at doc.perl6.org - IO::Spec::curdir
18:42 RabidGravy $*CWD
18:42 dha But It's not working in any way I can think of using it.
18:42 dha Ah. So, does curdir actually work at all?
18:43 RabidGravy m: say $*SPEC.curdir
18:43 camelia rakudo-moar f05c77: OUTPUT«.␤»
18:43 dha Ah. So IO::Spec methods would be used via $*SPEC?
18:44 RabidGravy yes, but it doesn't mean pwd, it returns '.' to mean "who do I talk about the current directory" :)
18:44 ZoffixW dha, yeah, $*SPEC is the appropriate IO::Spec::* object for the current OS
18:45 RabidGravy or how even
18:45 RabidGravy similarly
18:45 RabidGravy m: say $*SPEC,updir
18:45 camelia rakudo-moar f05c77: OUTPUT«5===SORRY!5=== Error while compiling /tmp/t7J7yKgGLR␤Undeclared routine:␤    updir used at line 1. Did you mean 'chdir', 'indir', 'mkdir', 'pair', 'tmpdir'?␤␤»
18:45 RabidGravy m: say $*SPEC.updir
18:46 camelia rakudo-moar f05c77: OUTPUT«..␤»
18:46 dha Ah, ok, $*SPEC is covered in the full IO::Sped doc.
18:46 RabidGravy yeah
18:47 dha but if you search for curdir, it just gives you the curdir parts of IO::Spec. Hm. that looks like a problem I don't see an easy solution for.
18:49 ZoffixW dha, what problem?
18:49 ZoffixW m: $*CWD.say
18:49 camelia rakudo-moar f05c77: OUTPUT«"/home/camelia".IO␤»
18:49 tharkun joined #perl6
18:50 dha The problem is that searching for that is problematic if one doesn't already know to look for it.
18:50 dha And that, if you search for curdir, you don't see the bit in the full IO::Spec doc that says you need to access IO::Spec methods via $*SPEC
18:50 ZoffixW I s'pose. It's listed under Variables: http://docs.perl6.org/languag​e/variables#Dynamic_variables
18:51 dha So, not a problem in how it works, but a problem for people looking for things.
18:51 ZoffixW Yeah
18:51 RabidGravy maybe "are you looking for $*CWD?" could help
18:51 dha ZoffixW - right, but again, you need to know you're looking for a variable, not a function/method
18:51 hankache joined #perl6
18:52 dha RabidGravy - if we could make that work in a useful way, sure. :-)
18:52 RabidGravy just in the curdir pod
18:53 hankache good evening #perl6
18:53 ZoffixW \o
18:54 dha Hm. Yeah, that could work. except there are several OS-specific curdirs that come up if you search for curdir, so I'm not sure how that would work. that, though, is more me not knowing how the doc.perl6.org search works than anything, I imagine.
18:56 RabidGravy I don't know how it works either :)
18:57 leont_ There are various algorithms, with various edge cases
18:57 [Coke] When the site is built, all the searchable things are put into a static JS block.
18:57 dha RabidGravy - that's somehow comforting. :-)
18:58 ZoffixW For one, you can use X<foo|section,explanation> tags to index bits. I think a good way to solve the above problem would be to use that form for all the special variables. Alas, looking at the page, it seems like POD tags inside the table aren't parsed
18:58 RabidGravy no I could never work out how to fix that
19:00 ecocode joined #perl6
19:03 CIAvash m: say 'moo=meow ping=pong'.comb(/\w+/).hash
19:03 camelia rakudo-moar f05c77: OUTPUT«{moo => meow, ping => pong}␤»
19:03 CIAvash ZoffixW: Does this count? ↑
19:05 ZoffixW CIAvash, sure :D Thanks
19:08 dalek doc: 3b7440d | (Jan-Olof Hendig)++ | doc/Type/Dateish.pod:
19:08 dalek doc: Added documentation for method week-number and wrote some code examples for is-leap-year and days-in-month
19:08 dalek doc: review: https://github.com/perl6/doc/commit/3b7440df09
19:09 skids joined #perl6
19:18 mr-foobar joined #perl6
19:25 ZoffixW New blog post: "Perl 6: Comb It!" http://blogs.perl.org/users/zoffix​_znet/2016/04/perl-6-comb-it.html
19:26 mst "Your code is a tangle, might I suggest .comb, sir?"
19:28 Xliff Hummm…...
19:28 Xliff Looks like jnthn beat me with Audio::Sndfile
19:29 Xliff Ah well. I've started. I may as well finish.
19:31 psch Xliff: not jnthn, RabidGravy
19:31 Xliff Oh. LOL! Same name.
19:32 Xliff Any idea when (un)?pack will move out of the experimental phase?
19:32 RabidGravy audio::sndfile doesn't do compressed audio
19:32 Xliff RabidGravy, Ahhh.
19:32 RabidGravy the most complex it does is flac
19:33 timotimo Xliff: it'll need an implementation first :)
19:34 Xliff timotimo, you're kidding me? That's still NYI (Not yet implemented)
19:34 Juerd timotimo: And before that, perhaps some specification :)
19:34 Xliff Aaieee!
19:34 Juerd Xliff: pack/unpack is unspecified, perhaps mostly an oversight.
19:34 * Xliff wonders how he's going to do WAV header parsing without it.
19:34 Juerd Xliff: Well, there's something in place, just not feature complete.
19:34 RabidGravy it's partially implemented, no-one likes the way it works
19:34 Xliff I could always cheat and use Inline::Perl5
19:35 timotimo yes, partially implemented, but that implementation will (hopefully) go away before the feature goes non-experimental
19:35 Xliff >.>
19:35 RabidGravy Xliff, you can use Audio::Sndfile :)
19:35 Xliff <.<
19:35 Juerd If you're interested in pack/unpack, could you read https://gist.github.com/Ju​erd/ae574b87d40a66649692/ and comment if you have any thoughts on that design?
19:36 Xliff RabidGravy, yes. And that is on my list of possibilities. However using a module that can read/write Ogg/Vorbis to test one that will read/write Ogg/Vorbis seems rather...err... meta.
19:36 Xliff I'd like Audio::OggVorbis to have as few dependencies as possible.
19:36 * Xliff goes to read Juerd's gist
19:37 CIAvash ZoffixW: You can also use the match method instead of matching with comb: `'moo=meow ping=pong'.match(/(\w+) '=' (\w+)/, :g)`
19:37 RabidGravy Sndfile can't read/write ogg vorbis
19:39 Xliff RabidGravy, says so here -> http://www.mega-nerd.com/libsndfile/#Features. There's a footnote right after the table that states: "From version 1.0.18, libsndfile also reads and writes FLAC and Ogg/Vorbis."
19:40 dha ZoffixW - nice article. Also, that's a big comb.
19:41 Xliff Juerd: By "byte-prefixed" do you mean "<byte> <data>" where <byte> is the length of the data?
19:42 Juerd Xliff: Line number?
19:42 Xliff 44
19:43 Juerd Oh, byte *length* prefix. That's the length in number of bytes, prefixed as some number
19:43 timotimo does the byte length prefix also have a byte length prefix length prefix?
19:43 Juerd This number could have any encoding, e.g. uint32 or uint8. The length prefix itself can thus be one or multiple bytes.
19:43 RabidGravy Xliff, well I never, I must have had an older version when I first made it :)
19:43 Xliff OK. I am reading this right, then.
19:43 Juerd timotimo: Templates can be nested, so that is possible.
19:43 timotimo OK
19:44 timotimo oh, that's your design from back then!
19:44 Xliff RabidGravy, LOL!
19:44 Juerd timotimo: Yes, that I never had time for to implement.
19:44 Juerd Not that I know enough low-level p6/nqp to even dare...
19:45 RabidGravy I'd just make it in Perl 6 in the first place
19:45 RabidGravy pack & unpack are
19:45 Juerd Yes, and that makes them unusably slow.
19:46 RabidGravy well there's the problem
19:46 Juerd One of several :)
19:46 timotimo Juerd: my ($s, $i) = $blob.decode([ "latin1", uint16 ]);  # FAILS  -  btw, why does this fail? why doesn't it just find the first null byte and then unpack a uint16
19:47 Juerd timotimo: Because I didn't want to specify that latin1 cannot include null bytes. Instead, null-termination will need to be indicated explicitly.
19:47 Xliff timotimo, I was just about to ask that.
19:47 timotimo ah
19:48 Juerd timotimo: Good point, though! I only considered \0 strings for encoding, and thought that Nil could perfectly handle that. But for decoding, something else is needed.
19:48 Xliff Juerd: So how does the other one work, then? "my ($n, $s) = $blob.decode([ num, "latin1" ]);"
19:48 Juerd Xliff: That reads to the end of the input
19:48 Juerd Xliff: Non-length-specified types can be specified at the end of the template
19:48 RabidGravy but to go back to the original question pack/unpack aren't going anywhere
19:49 Xliff So "my ($n, "latin1", $n) = $blob.decode([num, "latin1", num])" will fail?
19:49 Juerd Xliff: Yes.
19:49 Xliff kk
19:50 RabidGravy there is software that uses them *which was made before everyone moaned them into being marked experimental*
19:50 _ramix_ joined #perl6
19:50 Xliff BUT! "my ($n, $s, $n) = $blob.decode([num, uint8 => "latin1", num])" is valid?
19:50 Juerd RabidGravy: It had to be made experimental because there's no way the current design could be repaired without breaking compatibility.
19:50 Juerd Xliff: Indeed.
19:51 Xliff RabidGravy, Oooh! So the "experimental" stuff is the result of groaning?
19:51 RabidGravy yeah
19:51 Xliff I'm SAVED!
19:51 Juerd Why 'moaning' and 'groaning'?
19:52 Xliff Still will need to taint my module with "use experimental" but I don't feel so bad about it, now.
19:53 Juerd Xliff: It's just an indication that your software *will* break once these features are touched.
19:53 Juerd Practically any change to this will be incompatible.
19:53 Xliff And I will just have to accept the responsibility to fix it when that happens.
19:53 RabidGravy well, that's what it was. there isn't an alternative implementation, and the functionality is required
19:53 Xliff Because parsing binary headers will be a bitch without it.
19:54 Juerd RabidGravy: So should we have gone with the broken and unfixable thing we have now, without indicating that it will break?
19:54 _4d47 joined #perl6
19:55 Juerd You could argue that the release was rushed because the spec and implementation were incomplete, but imho a release is a mostly symbolic thing anyway.
19:55 Juerd No piece of software has ever been perfect, especially at 1.0
19:56 RabidGravy so how come Net::AMQP was working fine for a year using it before all that?
19:56 Juerd Oh, really? How can something be broken if it worked for a particular purpose?
19:57 RabidGravy er, you've lost me
19:57 dogbert2 o/ #perl6
19:58 Juerd RabidGravy: Your argument seems to be that Net::AMQP having workend, means that pack/unpack is sufficient to not be experimental.
19:58 _ramix_ Hi. We have the Spanish version of perl6intro: http://es.perl6intro.com. Enjoy it!
19:58 dogbert2 doc question
19:59 dotnessv joined #perl6
19:59 Juerd It's a stub at best. Useful and it would suck if we didn't have it, but not anything we can build future versions on. Not a weird situation, considering that it was built without specification.
19:59 dha yay! someone other than me has a doc question! :-)
19:59 dogbert2 the 'write' method in IO::Socket has the following documentation 'Writes the supplied buffer to the socket, thus sending it to other end of the connection. The string version is method send.'
20:00 RabidGravy my argument is that it does what it does sufficiently well for something quite complicated to work
20:00 [Coke] RabidGravy: are you saying it's not experimental?
20:00 dogbert2 There is no method 'send' in the source as far as I can tell. Should it in fact be 'print'?
20:00 Juerd RabidGravy: Yes, but that doesn't necessarily mean it's good enough to take forward. There are many things that it doesn't do, but cannot be made to do without breaking compatibility.
20:01 [Coke] dogbert2: Channel has a send, FWIW.
20:01 Juerd RabidGravy: That a specific example doesn't exercise those missing features doesn't mean a thing. Obviously, it if needed those features, the module might not have existed.
20:01 dha Perhaps we should encourage people not to think "experimental" doesn't mean "doesn't actually work"...
20:02 dogbert2 [Coke]: yup, but there's no suck thing in src/core/IO/Socket.pm
20:02 RabidGravy I'd actually go for something completely different, which isn't pack/unpack at all
20:02 dogbert2 *such
20:02 [Coke] dha: some docs on "is experimental" are probably in order if we don't have them, sure.
20:02 Juerd RabidGravy: So would I. Have you seen my gist at https://gist.github.com/Ju​erd/ae574b87d40a66649692/ yet? I went with encode and decode, just like character encodings, because that's what number encodings are: encodings.
20:03 RabidGravy as it is, I've stopped the MIDI file module because of the uncertainty
20:03 RabidGravy Juerd, I saw it before.
20:04 Juerd NB: if someone has a git account and can add a comment that terminator-specified decoding is a required feature, that would be welcome
20:04 Juerd I don't have my phone with me and I need that to login at github...
20:05 timotimo OK
20:05 Juerd Thanks :)
20:06 timotimo there you go
20:06 Juerd I'll think up some way to fit it into the design
20:06 Juerd First thought is "\0" => "latin1"
20:07 Juerd But I'll think about it some more because I don't like that.
20:08 timotimo will we have something like "\r\n\r\n" => "latin1" for HTTP header section, too?
20:08 Juerd I think HTTP headers should be approached as text, not binary :)
20:08 RabidGravy yeah
20:09 Juerd I like "latin1\0" better, but it might be nice to support arbitrary delimiters, maybe even bracketing ones.
20:10 Xliff That will make it…interesting…to parse.
20:11 timotimo yes
20:11 timotimo well, we'd really like to have something fast and short to type to split a buffer at a multi-element delimiter
20:11 Xliff Juerd: also encode/decode are already used in Buf and Str.
20:12 Juerd Xliff: Yes, my design intends to extend that
20:13 Juerd Xliff: The rationale behind this is that string encodings and number encodings can be treated as one thing.
20:13 Xliff Ahh.
20:13 Xliff Makes sense.
20:13 Juerd Both are ways of encoding numbers anyway
20:13 Juerd timotimo: Er... I think we already have that: .split
20:14 timotimo on blobs?
20:14 Juerd If it doesn't exist, it should :)
20:14 Juerd m: my $b = Blob.new(65, 13, 10, 65); say $b.split(Blob.new(13, 10))
20:14 camelia rakudo-moar f05c77: OUTPUT«Use of uninitialized value of type Any in string context␤Any of .^name, .perl, .gist, or .say can stringify undefined things, if needed.  in block <unit> at /tmp/eGPvlvvg_t line 1␤Cannot call split(Blob, Blob); none of these signatures match:␤  in bl…»
20:15 Juerd Meh :(
20:15 RabidGravy it should, it's usually implemented with some subbuf thing
20:16 cdg joined #perl6
20:17 AlexDaniel joined #perl6
20:24 AlexDaniel psch: https://rt.perl.org/Ticket/Display.html?id=127980
20:25 dha joined #perl6
20:26 tailgate how does perl perl6 look for modules? If I want to import a module in the directory lib/foo/bar.pm6 how would I do that? Does it have to be under "lib"?
20:27 dolmen joined #perl6
20:27 Xliff Juerd, looks good. I've made a comment on your gist.
20:27 AlexDaniel tailgate: what about perl6 -Ilib/foo/
20:27 timotimo shouldn't -Ilib work just as well? then you'd have to use foo::bar
20:28 Xliff It's much easier to understand than pack/unpack.
20:28 Xliff And would work for my use-case.
20:28 Xliff With one issue, which I bring up in the comments.
20:28 _4d47 left #perl6
20:29 Juerd Xliff: Thanks for your time
20:30 Xliff Juerd, no problem. Thanks for your thoughts! ;)
20:31 * moritz fails to Apache
20:31 * Xliff wonders if Apache had it's head scalped... or if Apache was the one doing the scalping.
20:31 Xliff moritz was unclear.
20:32 moritz Xliff: it's the one not doing the redirect :(
20:32 Xliff What are you trying to redirect?
20:32 Xliff mod_rewrite?
20:32 moritz http://perlpunks.de/paste/show/571e7eda.3187.86
20:32 moritz yes
20:33 moritz I'm trying to redirect all HTTP traffic to HTTPS, except for the URLs that the lets-encrypt/ACME protocol uses for domain verification
20:33 AlexDaniel dogbert2++ for working on documentation
20:34 moritz and it doesn't redirect anything
20:34 moritz and I'm using pretty much exactly the same code for a different domain, where it works
20:34 timotimo ugh, is there some tool that outputs the exact configuration that applies with all things that come from other sources, too?
20:35 timotimo like the "calculated css" thing inside chrome's dev tools for css rules
20:36 psch AlexDaniel: well, i'm pretty sure that can be a really interesting discussion
20:37 moritz timotimo: well, firebug does it too
20:37 AlexDaniel psch: yea!
20:37 psch i'm not quite sure if i know enough arguments to stick with my position though...
20:37 moritz timotimo: but outside the browser? I'm not aware of any tools
20:37 psch m: say 2 ~~ %( 0 => 1, 2 => 3 )
20:37 camelia rakudo-moar f05c77: OUTPUT«True␤»
20:37 psch m: say <a b c> ~~ (**, "c")
20:37 camelia rakudo-moar f05c77: OUTPUT«True␤»
20:37 Xliff moritz: For this I wonder if your RewriteCond is off. You might want "RewriteCond %{HTTPS} off", instead
20:37 timotimo how do people debug apache without something like that :\
20:37 psch AlexDaniel: note that http://design.perl6.org/S03.html#Smart_matching didn't speculate on $item ~~ $list at all
20:38 moritz Xliff: this is only the virtualhost for port 80, so no need for that
20:38 Xliff timotimo, we read log files.... LOTS AND LOTS of log files.
20:38 [Coke] so does sawyer X hang out on freenode anywhere?
20:38 psch i think that's the strongest argument i have.  $item ~~ $list does not have any meaningful behavior, it's just False out of principle it feels
20:38 Xliff moritz, then drop the RewriteCond?
20:38 AlexDaniel psch: I'd love to have M metaop though
20:39 Xliff If that's the only host for port 80 then the rewrite is implicit.
20:39 moritz Xliff: no, that's needed for the lets-encrypt domain verification URLs
20:39 psch AlexDaniel: what does that do?
20:39 Xliff So that's why !well-known is there?
20:39 moritz Xliff: it's not the only host
20:39 Xliff Coz I couldn't find it in the mod_rewrite docs.
20:39 moritz Xliff: ! is just a negation
20:39 psch AlexDaniel: i don't quite grasp your snippets in the comment... :)
20:40 AlexDaniel psch: well, it's for comparing lists
20:40 moritz Xliff: and well-known is a regex I match against the URLs that I want to exclude from the redirect
20:40 moritz the URLs I want to exlude look like /.well-known/acme-challenge/evaGxfAD​s6pSRb2LAv9IZf17Dt3juxGJ-PCt92wr-oA
20:41 AlexDaniel psch: with an explicit op to do comparisons. Much like you do in “$x eq any(…)” case
20:42 Xliff moritz: "RewriteCond %{REQUEST_URI} /^\.well-known/"
20:42 Xliff Your regexp isn't in that paste.
20:42 Xliff I'm running on guesswork here.
20:43 moritz Xliff: "well-known" *is* the regex
20:44 Xliff But it sounds like your Cond isn't matching. Have you turned up the LogLevel?
20:44 psch AlexDaniel: what's the general semantics?  i mean, you mention that your example doesn't account for different length of lists, how does the propose metaop M deal with that?
20:44 psch +d
20:45 psch oh, and why doesn't hyper do that?
20:45 psch m: my @a = ^4; my @b = ^6; say (@a xx *) == (@b xx *)
20:45 camelia rakudo-moar f05c77: OUTPUT«Cannot .elems a lazy list␤  in block <unit> at /tmp/yZrxAIhv8W line 1␤␤Actually thrown at:␤  in block <unit> at /tmp/yZrxAIhv8W line 1␤␤»
20:45 psch err
20:45 Xliff moritz: OIC.
20:45 moritz Xliff: the rewritecond is a red herring; even if I remove it, no rewrite happens
20:45 psch m: my @a = ^4; my @b = ^6; say (@a) <<[==]>> (@b)
20:45 camelia rakudo-moar f05c77: OUTPUT«[True True True True False False]␤»
20:45 Xliff moritz: Turn up your LogLevel and see what's actually going on.
20:46 Xliff When (what should be) common sense fails, log everything.
20:46 Xliff I hate debugging crazy rewrite rules.
20:46 psch AlexDaniel: well, i don't think i understand the need nor the intent behind a list-comparison metaop... :)
20:46 Xliff Mainly because logging is the only debugging tool you have.
20:47 moritz argl
20:48 moritz and mod_rewrite "of course" dropped RewriteLog
20:48 Xliff It's LogLevel, now
20:48 moritz yes, and will log all the other noise that I'm not interested in
20:48 moritz HATE
20:48 timotimo well, just replace the apache setup with a few hundred lines of node.js code
20:48 RabidGravy I worked at a certain large media organization where everything was rewrite rules, did my head in
20:49 timotimo node.js outperforms apache anyway, because apache was developed before async was discovered
20:49 Xliff timotimo, o_O
20:49 psch AlexDaniel: don't take this as shooting down, though.  i'm fairly sure i just don't understand what exactly you're proposing... :/
20:50 timotimo Xliff: that comes from a pretty funny internet video
20:50 ugexe al gore discovered async in 2001
20:51 psch oh boy, the $item ~~ $hash case can make for a wonderful $item ~~ $list idiom, actually
20:51 psch m: my @a = <foo bar baz>; say "foo" ~~ %(@a.antipairs)
20:51 camelia rakudo-moar f05c77: OUTPUT«True␤»
20:51 psch there, "is the item in the list" with smartmatch
20:52 moritz is there some weird magic that if you have a .htaccess file that rewrite stuff in the virtual host config isn't applied?
20:53 Xliff Are there rewrite rules in the .htaccess file?
20:53 moritz yes
20:54 Xliff Can you paste those?
20:54 moritz Xliff: https://github.com/moritz/perlgee​k.de/blob/master/source/.htaccess
20:54 psch AlexDaniel: in any case, i'll reply properly to the ticket tomorrow which at least my arguments, even if i'm not sure i'll actually be able to argue a specific position...
20:55 Xliff "RewriteRules" before "RewriteEngine on" :/
20:56 moritz ... and it doesn't error out
20:56 moritz wow
20:57 Xliff moritz: Is this a devel server or production?
20:57 Xliff If devel, then move the .htaccess file out of the way so you can debug your problem in the clear.
20:57 moritz Xliff: prod
20:57 Xliff Then move the .htaccess file back in and see if it still breaks.
20:57 Xliff moritz: :/
20:57 moritz or I just move the redirect to the .htaccess file
20:58 Xliff Always best to move other shit out of the way when debugging a specific RewriteCond/RewriteRule block.
20:58 Xliff OOps! Sorry about the language.
20:58 Xliff Getting tired I am.
20:59 dha Yeah, I mean... mentioning DEBUGGING.
20:59 Xliff I know rite!
20:59 * Xliff washes mouth out with Raid.
20:59 * Xliff dies.
20:59 mst pretty sure #perl6 cares a lot more about you not being an asshole than not saying the word, on the whole
20:59 mst Xliff: yeah, lvm is not designed for human ingestion
21:01 moritz seems to work in the .htaccess file
21:01 moritz well, mystery unsolved, problem solved
21:01 timotimo yay
21:01 Xliff Wow
21:01 moritz time for sleep
21:01 Xliff moritz++
21:02 timotimo it was because of the wrong location of RewriteEngine on?
21:02 AlexDaniel psch: yeah, thanks :)
21:02 moritz timotimo: I have no idea. Probably not
21:02 timotimo oh, OK
21:02 moritz I guess it inherited the RewriteEngine On from the vhost config, or something
21:02 Xliff timotimo, No. I think if there is an .htaccess file with Rewrite directives it ignores anything in the virtual host config.
21:02 moritz there are days when I think I shouldn't software.
21:02 timotimo urgh!
21:02 timotimo good rest, moritz :)
21:03 Xliff Or it could just be the presence of the .htaccess file
21:03 Xliff I haven't Apache'd since 2.2
21:03 moritz thanks everybody
21:03 Xliff Good night, moritz
21:04 timotimo what do you webserver these days, Xliff?
21:04 timotimo nginx has risen up in popularity over the last years i hear
21:04 teatime http://paste.debian.net/plain/440861 ← halp.  fails at the "Function Composition" example with "Preceding context expects a term, but found infix = instead" (@:43)
21:04 timotimo but i've kind of liked lighttpd in the mean time
21:06 timotimo teatime: i think it wants you to terminate the "sofar"
21:06 timotimo with just =finish it works
21:07 timotimo but clearly the error message is bogus as hell
21:07 teatime wat... I only did that to separate out the rest of the stuff from the other examples
21:07 teatime to golf for reporting purposes... and created new error, hooray me :/
21:07 Xliff timotimo, I don't! I've webservered maybe 2 things in the past 3 years and it was Apache 2.2 because they couldn't upgrade to 2.4 because...breakage!
21:07 timotimo :)
21:08 timotimo is apache 2.2 still being bugfixed and securityfixed?
21:08 Xliff Sometimes I miss it.
21:08 teatime how did you get it to work?  I added =finish to the end of the file, also tried =end, getting same error?
21:08 Xliff Then it passes.
21:08 timotimo not the end of the file
21:09 timotimo replace =begin sofar with =finish
21:09 teatime aye yeah just figured that out
21:13 polyfloyd joined #perl6
21:17 timotimo and the error you're getting is probably just because you've not specified a value for s in your A.new
21:22 teatime timotimo: heh, I'm trying to figure out how to.  should I have a new() or a BUILD ?
21:22 timotimo the default new you'll get just passes on all named parameters to the BUILDs
21:23 timotimo if you want to get by entirely without new and BUILD, you'd "has $.s" instead of "has $!s"
21:23 geekosaur BUILD. new should only be overridden in very special cases sinceyou need to handle superclass building and iirc roles yourself
21:23 teatime timotimo: and that makes the attribute directly rw from outside the class ?
21:24 timotimo no
21:24 timotimo for that you have to "is rw"
21:24 timotimo private attributes are mostly about "this isn't part of the API"
21:25 timotimo we've always said if you set the value of "s" directly from the constructor and even give its name, why is it private in the first place?
21:27 sortiz joined #perl6
21:27 masak I'm not sure I fully buy that argument
21:28 masak partly because the one who creates the object and the one who uses it might be two different consumers with different access to its innards
21:28 timotimo you can rent the argument if you want to
21:29 timotimo after 3 months i'll let you decide if you want to continue renting, buy it properly, or drop the deal altogether
21:29 timotimo (of course in the latter case you'll have to return the argument, and pay for any repairs necessary to restore it to what it was when you started renting)
21:30 masak another consideratum: object construction sort of happens at the *edge* of the object's life cycle, technically before it starts being all encapsulation...y and stuff
21:31 timotimo good point
21:33 jnthn The best argument, to me, is the simple one that we decided we'd like to aid refactorability by making sure that you can refactor any $!foo without having to consider anything outside of the class body.
21:34 jnthn Private methods work out the same
21:34 masak yes, that is still a strong argument
21:35 mst timotimo: what masak said about different consumers
21:36 mst if I want to expose an interface object to the outside world with a reference to a guts object, I need to pass the guts object in at construction time
21:36 mst in perl5 I usually do "has _foo => (is => 'ro', init_arg => 'foo');"
21:36 timotimo nothing prevents you from making the constructor private and "trusts" for something else :)
21:36 timotimo we do have an ecosystem module that provides the equivalent of init_arg if i'm not mistaken
21:37 mst sure, but a private constructor doesn't affect the "if you set it directly, why is it private" question
21:37 timotimo mhh, OK
21:38 jnthn If you want to have a non-accessor'd attribute assigned from a named parameter, it's just a BUILD submethod away. There's even a parameter binding syntax to let you do it declaratively.
21:38 mst I'm not expressing a specific opinion, just poking holes in an argument I don't believe holds water in practice
21:38 timotimo right, that's incidentally what teatime is using in their code right now - what jnthn just mentioned
21:38 zakharyas joined #perl6
21:38 mst jnthn: yep, and I have no problem with that. you're assuming I was making a stronger argument than what I actually said, I think
21:39 mst pattern matching a nuanced position to a more absolutist version you've argued against before is such an annoying failure mode of brains (mine included)
21:39 jnthn mst: I was actually reacting to "we have an ecosystem mdoule to do X" :P
21:40 mst jnthn: init_arg isn't the same thing as that.
21:40 jnthn Ah, fair enough
21:40 mst the specific use I put it to is basically equivalent
21:40 jnthn What other uses can it have?
21:40 mst apart from the action-at-a-distance-ness, depending on how you look at it
21:41 mst init_arg => undef lets you have a public attribute that isn't settable via the constructor
21:41 mst and sometimes you're emulating somebody else's new() protocol
21:41 mst are the two that immediately spring to mind
21:42 jnthn In the latter, you want to take a different name than your attribute?
21:42 mst right
21:42 mst it's not honestly something you want very often
21:42 jnthn submethod BUILD(:it's-name($!my-name)) { }
21:42 jnthn :)
21:42 jnthn uh, *its
21:42 timotimo jnthn: did you notice i put more work into the "create code from a buildallplan" branch? any chance you'd know when you could have a look at it? since it's failing in a hard-to-debug way for me ;(
21:42 jnthn Damn, I am tired :P
21:43 mst ah, well, in that case it's just aesthetics as to whether you prefer it in BUILD or as an annotation on the attribute
21:43 timotimo hm. maybe it'd be a good idea to just dump the qast of the code i generate for later inspection
21:43 jnthn timotimo: Sometimes after I've finished banging my head against the GC bugs my torture testing turned up, maybe :)
21:43 mst I suspect but cannot yet confirm that BUILD will be fine for me
21:43 timotimo yeah, let's dump a blob of qast for pretty much every class in the core setting
21:43 timotimo that doesn't sound like a firehose of information at all
21:44 jnthn timotimo: Just check if an env var is set and only dump in that case?
21:46 timotimo well, loading the core setting fails, so i can't run any simpler code than the core setting through this yet
21:46 timotimo i can, however, turn off actually installing the method when an env var isn't set
21:46 ZoffixWin joined #perl6
21:46 ZoffixWin joined #perl6
21:46 jnthn Right :)
21:47 timotimo also, can you explain to me what code 13 does? it seems to just call a getattr; is it to trigger autovivification of attributes?
21:47 timotimo it's a no-op in BUILDALL, but it does that in BUILD_LEAST_DERIVED
21:47 tony-o ZoffixWin : for Data::Dump - you do realize that Match.gist doesn't output the same as .perl ?
21:48 ZoffixWin m: say ('foobar' ~~ m/foo/).gist
21:48 camelia rakudo-moar f05c77: OUTPUT«「foo」␤»
21:48 jnthn timotimo: Yeah, it just does a getattr
21:48 ZoffixWin m: say ('foobar' ~~ m/foo(bar)/).gist
21:48 camelia rakudo-moar f05c77: OUTPUT«「foobar」␤ 0 => 「bar」␤»
21:49 jnthn timotimo: If you git blame the line that added it, you'll see a commit message describing the bug it fixed
21:49 ZoffixWin tony-o, I guess... the above .gist is what I'd want it to output like with the proposed option enabled. I think the same applies to Pair objects too
21:49 jnthn It was in the crazy run-up-to-Christmas bugfixing, which is a bit of a blur :)
21:49 ZoffixWin Or maybe I'm thinking of something else that barfs up a whole ton of methods when Dumped
21:50 * jnthn goes for sleep :)
21:50 jnthn 'night all
21:50 ZoffixWin night
21:50 timotimo OK
21:50 * timotimo isn't totally sure when we BUILD_LEAST_DERIVE; it seems to me like we almost always  BUILDALL
21:50 * timotimo greps the source
21:51 timotimo oh, mostly for role mixination
21:51 spider-mario joined #perl6
21:58 masak 'night, #perl6
22:00 timotimo gnite masak
22:03 teatime how can I get the class's name from inside new()
22:03 teatime self.^name says "Cannot look up attributes in a type object"
22:04 kid51 joined #perl6
22:04 teatime :8
22:05 ponbiki joined #perl6
22:05 timotimo well, inside new you don't have a self
22:05 xinming joined #perl6
22:05 timotimo er, what am i saying
22:05 timotimo m: say Str.^name
22:05 camelia rakudo-moar f05c77: OUTPUT«Str␤»
22:05 timotimo why wouldn't that work?
22:06 sortiz m: class Foo { method new { say ::?CLASS.^name } }; Foo.new;
22:06 camelia rakudo-moar f05c77: OUTPUT«Foo␤»
22:06 TEttinger joined #perl6
22:07 teatime timotimo: I thought self would be the class inside new() (instead of the instance)
22:08 timotimo yeah, it is
22:08 timotimo how it depends on what you want in the case of derived classes
22:08 timotimo because they will inherit "method new" unles they override it
22:08 shadowpaste joined #perl6
22:08 teatime m: m: class Foo { method new { say self.^name } }; Foo.new;
22:08 camelia rakudo-moar f05c77: OUTPUT«Foo␤»
22:08 teatime wtf
22:09 timotimo if you use ::?CLASS, you'll get the class that the method was derived from; if you use self.^name, you'll get the name of the class that ended up being called
22:10 tony-o ZoffixWin: are you looking for that to happen by default for just those two types or do you want to pass in :gist or :perl when you do the data dump?
22:10 vike joined #perl6
22:12 Sgeo joined #perl6
22:12 ZoffixWin tony-o, I want to pass :gist so all objects would be dumped with .gist. A name of an object is enough for me, I don't need to see all of its methods. I imagine some folks like the current behaviour, hence I propose an option, not default
22:12 tony-o okay, cool - i'm coming up with a test file for it and i'll update you in a bit - estimated 10 to 15 minutes
22:13 ZoffixWin No rush :) I'm about to go gaming or movies
22:14 timotimo what do you game these days?
22:16 ZoffixWin timotimo, ummm.. hard to say: http://i.imgur.com/uwiDHc2.png
22:16 timotimo haha
22:16 timotimo do you have any go-to games these days?
22:16 dalek doc: 616ac07 | (Jan-Olof Hendig)++ | doc/Type/IO/Socket.pod:
22:16 dalek doc: Changed reference from method send (removed in 2015) to method print
22:16 dalek doc: review: https://github.com/perl6/doc/commit/616ac074e8
22:17 ZoffixWin not really. I'm just playing through a bunch
22:18 timotimo steam says i have 183 games
22:18 ZoffixWin Doing `Wolfstein: The New Order`, the first `Bioshock`, `South Park: The stick of truth`... then I'll probably start 2nd Witcher. Though I pre-ordered the newest DOOM and it comes out on May 13th... And No Man's Sky comes out some time in summer
22:18 Xliff Yikes!
22:18 Xliff I drool for No Man's Sky
22:18 ZoffixWin Oh, and I got "Singularity" yesterday that looks interesting too
22:18 Xliff I drool badly.
22:18 ZoffixWin Me too :)
22:19 teatime http://paste.debian.net/plain/440871  ← This prints 'D(D(D(D(0))))', but I was hoping for 'D(C(B(A(0))))'
22:19 Xliff I will probably need to EOL my 2 SLI'd GTX 550 for it.
22:19 Xliff *sob*
22:19 timotimo i'm frightened it'll really end up only being Walking Around Simulator 2016
22:19 timotimo Spore Edition™
22:19 ZoffixWin hah
22:19 Xliff LOL, "timo" x 2
22:20 ZoffixWin I think I'd be OK with that. The only thing I'm worried about (looking at the trailers) is your walking speed is super slow.. I don't want to feel like I'm moving through molases :/
22:20 teatime wait, BUILD is supposed to be a submethod
22:20 ZoffixWin teatime, yeah
22:20 teatime I wanted this in new(), but I don't know how to set private attributes from new()
22:20 tony-o ZoffixWin: update has been sent to DD with a [currently] undocumended flag of :gist
22:21 timotimo teatime: the thing is, you don't have "self" as the instance inside new yet. you'll have to bless first to create the instance
22:21 Xliff timotimo, It depends on the conflict and the crafting. If they do both right, the game will be epic.
22:21 teatime right
22:21 timotimo mhm
22:21 Xliff I mean. I grok crafting. I play Factorio fer crissakes.
22:21 avenj joined #perl6
22:22 Xliff I was addicted to it for two months, then I haven't played it again.
22:22 timotimo my top games by time spent playing them are natural selection 2 (420 hours, haha), starbound (98 hours), mass effect 2 (73 hours), portal 2 (53 hours), and planetary annihilation (44 hours)
22:23 Xliff Natural Selection 2?
22:23 Xliff Starbound, ME2, P2 are classics.
22:23 timotimo i'm surprised i played as much PA as i did. i don't enjoy its economy stuff much
22:23 timotimo haven't played NS2 in a long while, though
22:23 lizmat joined #perl6
22:23 Xliff Planetary Annihilation had such promise, but it didn't deliver.
22:23 timotimo it's an asymmetric team-based shooter + RTS
22:23 tony-o ZoffixWin: it's also documented, now - lmk what you think pls
22:23 timotimo yeah, and titans doesn't do enough to make up for it
22:24 tony-o (when you've time, obviously)
22:24 Xliff Nope.
22:24 * Xliff looks up Singularity
22:24 timotimo oh, the game where you're an AI that has become sentient and has to evade getting detected/deleted?
22:25 ZoffixWin Don't think so: http://store.steampowered.com/app/42670/
22:25 timotimo oh, that one
22:25 Xliff 2010
22:25 ZoffixWin Yeah, it's dated
22:25 Xliff I thought there was a more recent game named that.
22:25 ZoffixWin :)
22:25 timotimo where the main character has a time manipulation "gun" thingie
22:26 Xliff That's Quantum Break
22:26 frobisher joined #perl6
22:26 Xliff Which I am totally not interested in. Since it is artificially limited to Windows 10 because.... DX12!
22:27 timotimo as soon as wine gets DX12 support that translates to vulkan or opengl, you can run it on windows 8 :P
22:27 Xliff Which MS could have brought to Win7, but... it's Microsoft. Artificially induced obsolescence!
22:27 Xliff Please. I puke when I look at anything Metro-based.
22:27 Xliff Why would I want to tolerate MORE of it?
22:28 timotimo OK, win 7 then
22:28 tomboy64 joined #perl6
22:28 Xliff =)
22:28 grondilu joined #perl6
22:28 grondilu m: say 1 !== 2 !== 1
22:28 camelia rakudo-moar f05c77: OUTPUT«False␤»
22:28 grondilu m: say 1 !== 2 !== 3
22:28 camelia rakudo-moar f05c77: OUTPUT«True␤»
22:28 Xliff I'd do Ubuntu if support for my SLI'd 550's wasn't so unstable.
22:29 grondilu m: say [!==] 1, 2, 3, 1, 5
22:29 camelia rakudo-moar f05c77: OUTPUT«True␤»
22:29 timotimo if you ever have people over to play, towerfall: ascension and assult android cactus are great; AAC also works very well with just one player
22:30 teatime http://paste.debian.net/plain/440876  ← getting closer.  how do I bless though.
22:30 timotimo self.bless(*%args)
22:30 timotimo er, |%args
22:30 grondilu how can I test that all elements of an array are different?  @a == @a.unique would work I guess but it's a bit dull
22:30 teatime I want to mutate their value first
22:30 timotimo you could have just used your BUILD and supplied a default value for the :$!s parameter :)
22:31 timotimo oh, good point
22:31 grondilu somehow I was hoping [!==] would do the job
22:31 timotimo it sadly can't do the job, as it doesn't go across all elements
22:31 Xliff Wow! Assault Android Cactus is bullet-hell at its most basic! :p
22:31 timotimo only the bosses are actually bullet hell, the rest just spams random bullets :P
22:32 timotimo and it has the nice twist with the "battery" mechanic
22:32 timotimo also has fantastic music
22:32 teatime hrm, I'd've expected  [==] ($a, $b, $c)  ≡  $a == $b == $c
22:32 ZoffixWin tony-o, hmm... I guess it's my fault for forgetting that in Perl 6 everything is an object... Now, the methods are gone, which is good, but readability of the output also decreased because, well.. an Array and Hash are objects in Perl 6: https://gist.github.com/zoffixznet​/b3db53a570576b1b662cd26c3d397f39
22:32 ZoffixWin tony-o, in my mind, I envisioned something more like this: https://metacpan.org/pod/Acme​::Dump::And::Dumper#SYNOPSIS
22:33 teatime timotimo: can you tell me what's wrong w/ my new()'s :/
22:33 timotimo let's see
22:33 grondilu m: say "123415" ~~ / (\d)+ <?{ $0 == $0.unique }> /;
22:33 camelia rakudo-moar f05c77: OUTPUT«「5」␤ 0 => 「5」␤»
22:33 ZoffixWin You get all your basic structures like normal and objects just named. No giant lists of methods or guts.
22:33 ZoffixWin Not sure if that's even possible in Perl 6 though (unless you check against all of the built in types or something)
22:33 timotimo you'll still need a build submethod to grab the s named parameter passed to bless and put it into the private attribute
22:34 grondilu m: say "123415" ~~ / (\d)+ /;
22:34 camelia rakudo-moar f05c77: OUTPUT«「123415」␤ 0 => 「1」␤ 0 => 「2」␤ 0 => 「3」␤ 0 => 「4」␤ 0 => 「1」␤ 0 => 「5」␤»
22:34 grondilu m: say "123415" ~~ / (\d)+ <?{ $0[] == $0[].unique }> /;
22:34 camelia rakudo-moar f05c77: OUTPUT«「5」␤ 0 => 「5」␤»
22:34 AlexDaniel m: say 42[]
22:34 camelia rakudo-moar f05c77: OUTPUT«42␤»
22:34 tony-o ZoffixWin: i need to think about how to accomplish that without just hardcoding 'when * ~~ Match, ignore XYZ methods'
22:34 teatime timotimo: isn't there a default one that does that?
22:34 AlexDaniel m: say (42[]).WHAT
22:34 camelia rakudo-moar f05c77: OUTPUT«(Int)␤»
22:34 Xliff timotimo: Last word from me on %topic<games>. Nothing will ever beat the System Shock series. They might come close, but best sci-fi game ever.
22:34 timotimo only for public attributes, no?
22:35 teatime aha
22:35 timotimo i've only played 90% of system shock, never system shock 2
22:35 timotimo but i did play bioshock
22:35 Xliff They don't 'em like that anymore.
22:35 Xliff Bioshock didn't give me the same feel. I just didn't get into the setting.
22:35 timotimo btw, there's #perl6-gaming for games discussion (and also perhaps game development)
22:35 Xliff Ooh! Might join. Later.
22:36 grondilu m: say .all ~~ .one given <1 2 3 1>
22:36 camelia rakudo-moar f05c77: OUTPUT«Ambiguous call to 'infix:<===>'; these signatures all match:␤:(Int:D \a, Int:D \b)␤:(Str:D \a, Str:D \b --> Bool)␤  in block <unit> at /tmp/VDLbu2jVQx line 1␤␤»
22:36 Xliff Or now. Now is good.
22:36 grondilu m: say .all == .one given <1 2 3 1>
22:36 camelia rakudo-moar f05c77: OUTPUT«all(one(True, False, False, True), one(False, True, False, False), one(False, False, True, False), one(True, False, False, True))␤»
22:36 Xliff <- Nap
22:36 grondilu m: say so .all == .one given <1 2 3 1>
22:36 camelia rakudo-moar f05c77: OUTPUT«False␤»
22:36 grondilu m: say so .all == .one given <1 2 3 6>
22:36 camelia rakudo-moar f05c77: OUTPUT«True␤»
22:36 grondilu m: say so .all == .one given <1 2 3 3 6>
22:36 camelia rakudo-moar f05c77: OUTPUT«False␤»
22:36 grondilu m: say so .all == .one given <1 2 3 7 6>
22:36 camelia rakudo-moar f05c77: OUTPUT«True␤»
22:37 teatime does that look like:  submethod BUILD { :$!s }
22:37 grondilu m: say "123415" ~~ / (\d)+ <?{ $0.all == $0.one }> /;
22:37 camelia rakudo-moar f05c77: OUTPUT«「23415」␤ 0 => 「2」␤ 0 => 「3」␤ 0 => 「4」␤ 0 => 「1」␤ 0 => 「5」␤»
22:37 teatime it keeps saying "Cannot look up attributes in a type object" at the line w/ bless.
22:37 AlexDaniel m: say 2..8 ~~ 1.5..8
22:37 camelia rakudo-moar f05c77: OUTPUT«True␤»
22:38 grondilu .all == .one looks like a hack.  Not sure I can do that reliably.
22:38 timotimo teatime: can you give me your guaranteed latest code?
22:38 teatime yes
22:39 timotimo 'k
22:39 teatime http://paste.debian.net/440878/
22:39 timotimo OH!
22:39 timotimo you're using "$!s => self"
22:39 timotimo that's not going to work
22:39 timotimo the self doesn't matter
22:39 timotimo the $!s on the LHS of the => does
22:39 teatime self.^name is looking for 'A'
22:40 XliffNap m: say 1.5...8;
22:40 camelia rakudo-moar f05c77: OUTPUT«(1.5 2.5 3.5 4.5 5.5 6.5 7.5)␤»
22:40 AlexDaniel so… thot's a bug?
22:40 AlexDaniel that*
22:41 grondilu m: say so .one == .all given <1 2 3 7 6 >
22:41 camelia rakudo-moar f05c77: OUTPUT«True␤»
22:41 grondilu m: say so .one == .all given <1 2 3 7 6 2>
22:41 camelia rakudo-moar f05c77: OUTPUT«False␤»
22:41 AlexDaniel grondilu: what are you trying to do?
22:41 grondilu checking if all elements are different
22:41 AlexDaniel m: say [==] <1 2 3 7 6 2>
22:41 camelia rakudo-moar f05c77: OUTPUT«False␤»
22:41 AlexDaniel m: say [==] <1 2 3 7 6>
22:41 camelia rakudo-moar f05c77: OUTPUT«False␤»
22:41 timotimo if not @a == @a.unique, i'd've @a == @a.Set
22:42 AlexDaniel m: say [!=] <1 2 3 7 6>
22:42 camelia rakudo-moar f05c77: OUTPUT«True␤»
22:42 AlexDaniel m: say [!=] <1 2 3 7 6 2>
22:42 camelia rakudo-moar f05c77: OUTPUT«True␤»
22:42 teatime timotimo: if you call A.new("0"), I'm wanting that to set $!s to 'A(0)'.
22:42 AlexDaniel hmm
22:42 AlexDaniel right…
22:42 timotimo yeah, and $!s => blah is not the way to d oit
22:42 timotimo because that'll try to get the value of $!s and put it as the .key of the Pair
22:42 tomboy64 joined #perl6
22:42 teatime then how.  tell me the right way.  I've tried like 12 different iterations of attempts :)
22:42 timotimo and on top of that, it won't be a named argument at all, it'll be a Pair in a positional argument
22:43 timotimo s => blah
22:43 teatime ok
22:43 timotimo for named arguments, all the sigils are dropped for you
22:43 timotimo so when you have :$!s in your signature (as is the case in BUILD), you'll just pass a named argument with the name "s"
22:44 teatime omfg it finally works
22:44 teatime timotimo++
22:44 AlexDaniel m: say so <1 2 3 7 6>.Bag.values.any > 1
22:44 camelia rakudo-moar f05c77: OUTPUT«False␤»
22:44 AlexDaniel m: say so <1 2 3 7 6 2>.Bag.values.any > 1
22:44 camelia rakudo-moar f05c77: OUTPUT«True␤»
22:44 grondilu yeah I was considering Bag as well
22:44 grondilu m: say "123415" ~~ / (\d)+ <?{ $0.Bag.values.none > 1 }> /;
22:44 camelia rakudo-moar f05c77: OUTPUT«「5」␤ 0 => 「5」␤»
22:45 grondilu m: say "123415" ~~ / (\d)+ <?{ $0[].Bag.values.none > 1 }> /;
22:45 camelia rakudo-moar f05c77: OUTPUT«「5」␤ 0 => 「5」␤»
22:45 jjido joined #perl6
22:46 grondilu m: "123415" ~~ / (\d)+ <{ say $0.Bag.values }> /;
22:46 camelia rakudo-moar f05c77: OUTPUT«(6)␤(6)␤(6)␤(6)␤(6)␤(6)␤(5)␤(5)␤(5)␤(5)​␤(5)␤(4)␤(4)␤(4)␤(4)␤(3)␤(3)␤(3)␤(2)␤(2)␤(1)␤»
22:46 grondilu wth
22:46 teatime timotimo: inside methods, when do you use $.a and when $!a
22:46 teatime or anyone; sorry :)
22:46 timotimo depends on whether you wish derived classes to be able to change what you get
22:46 XliffNap $.a if it is defined as "$.a" and you are reading.
22:46 XliffNap "$!a" otherwise.
22:47 timotimo well, yeah, you can write to $!a even if the accessor isn't "rw"
22:47 teatime timotimo: that's interesting... expound?
22:47 timotimo $.a is sugar for "self.a"
22:47 AlexDaniel m: say $_ eqv .unique given <1 2 3 7 6 2>
22:47 camelia rakudo-moar f05c77: OUTPUT«False␤»
22:47 AlexDaniel m: say $_ eqv .unique given <1 2 3 7 6>
22:47 camelia rakudo-moar f05c77: OUTPUT«True␤»
22:47 timotimo and accessors are also just methods generated for you by default for $.foo
22:47 XliffNap timotimo, yeah. jnthn++ explained that to me.
22:47 grondilu I use $!a everywhere even when defined as $.a, caus' it makes things easier if I want to change my mind about it being public.
22:48 tony-o timotimo: how would i tell if the method is public?
22:49 timotimo it's public if and only if it doesn't start with a !
22:50 tony-o does ^methods report private methods?
22:50 tony-o i don't think it shows !methods
22:50 timotimo probably not, no
22:51 timotimo but i assume .^private_methods exists
22:51 tony-o ah, DD is only doing .^methods
22:52 AlexDaniel psch: it feels like 42 ~~ (42,) should be true according to S03
22:52 AlexDaniel psch: unless I'm reading that incorrectly
22:53 AlexDaniel psch: “The Any entries in the first column indicate a pattern that either doesn't care about the type of the topic” and then it goes “Any         Positional lists are comparable   $_[] «===» X[]”
22:53 AlexDaniel psch: this has no practical value though
22:55 AlexDaniel psch: another interesting one is “Positional  Regex     attempted any/all/cat   FAIL, point user to any/all/cat/join for LHS”
22:55 AlexDaniel psch: so perhaps $item ~~ list should do the same thing – point user to any/all
22:56 timotimo that'd be a good solution, i think
22:56 timotimo except it's dreadfully slow :)
22:57 AlexDaniel timotimo: good solution? Then what about “Any         Hash      hash contains object    X{$_}:exists”
22:57 AlexDaniel according to that we can similarly have $item ~~ list with the same semantics
23:00 timotimo *shrug*, language design of smartmatch is a topic i'm not willing to dabble in :)
23:01 tomboy64 joined #perl6
23:06 teatime http://paste.debian.net/plain/440883  ← ok, this works, and does what I want.  am I still doing anything wrong?  :)
23:07 timotimo you could write o => $o as :$o instead
23:08 timotimo and you could give $o in the method new a ? so it'll allow users to call .new() instead of having to .new(Any) to get the '_'
23:09 teatime .new() seems work
23:09 teatime but I'm assuming it's the default one
23:10 timotimo ah, because you defined it multi, yeah, ok
23:13 AlexDaniel grondilu: want some craziness? :)
23:13 AlexDaniel m: my @a = <2 3 7 6 2 5>; say ?any((for @a -> $x { @a ~~ (**,$x,**,$x,**) }))
23:13 camelia rakudo-moar f05c77: OUTPUT«True␤»
23:13 AlexDaniel m: my @a = <2 3 7 6 9 5>; say ?any((for @a -> $x { @a ~~ (**,$x,**,$x,**) }))
23:13 camelia rakudo-moar f05c77: OUTPUT«False␤»
23:14 timotimo oh lord :D
23:14 timotimo beautiful
23:14 _28_ria joined #perl6
23:14 timotimo i didn't know ~~ does backtracking when a list is on the RHS
23:16 timotimo .u 🐈
23:16 yoleaux U+1F408 CAT [So] (🐈)
23:17 * teatime finally settles on http://paste.debian.net/plain/440886
23:18 TEttinger .u FAP
23:18 yoleaux U+A0D4 YI SYLLABLE FAP [Lo] (ꃔ)
23:19 dalek doc/hash-block: 0712be4 | (Dabrien 'Dabe' Murphy)++ | doc/ (2 files):
23:19 dalek doc/hash-block: Document "Hash vs. Block" Gotcha
23:19 dalek doc/hash-block:
23:19 dalek doc/hash-block:     my %fruits = apple => 'McIntosh', pear => 'Bartlett';
23:19 dalek doc/hash-block:     given (%fruits) {
23:19 teatime which prints  'D $d = D.new(C.new(B.new(A.new(Any))))'  and that's a suitable demo.
23:19 dalek doc/hash-block:       my $fails = { red => $_<apple>, green => $_<pear> };
23:19 dalek doc/hash-block:       say $fails.WHAT;          # Block
23:19 dalek doc/hash-block:       say $fails<red>;          # ERROR: Type Block does not support associative indexing
23:19 dalek doc/hash-block:     }
23:19 dalek doc/hash-block: review: https://github.com/perl6/doc/commit/0712be40fc
23:22 sue joined #perl6
23:22 AlexDaniel m: my @a = <2 3 7 6 8 5>; say ?@a.map(->$x {@a~~(**,$x,**,$x,**)}).any
23:22 camelia rakudo-moar f05c77: OUTPUT«False␤»
23:22 AlexDaniel m: my @a = <2 3 7 6 2 5>; say ?@a.map(->$x {@a~~(**,$x,**,$x,**)}).any
23:22 camelia rakudo-moar f05c77: OUTPUT«True␤»
23:23 teatime http://paste.debian.net/plain/440889 ← now, less important, but is there an easy way to make the method chaining example (line just above =finish) actually work ?
23:23 teatime to somehow coerce $a.one() into one($a)
23:23 timotimo yeah, you just have to $a.&one
23:23 timotimo then you can also drop the parens
23:25 BenGoldberg joined #perl6
23:25 teatime sick.
23:25 atweiden joined #perl6
23:27 cognominal joined #perl6
23:27 AlexDaniel ZoffixWin: “Supply an integer and you'll get a list of strings at most that many characters long, receiving a shorter string when there are not enough characters left.“
23:28 AlexDaniel ZoffixWin: hmmm… wrong?
23:28 AlexDaniel ah, it's correct
23:28 timotimo yeah, it's rotor where you'd have to :partial
23:29 AlexDaniel :/
23:30 Herby_ joined #perl6
23:31 Herby_ Afternoon, #perl6!
23:31 Herby_ o/
23:31 timotimo yo
23:31 AlexDaniel well it's understandable. I guess that if someone is using rotor then he may rely on indexes, which may result in weird things if accidentally he gets a list that is not quite the right size
23:31 timotimo yeah
23:33 grondilu what is the best style:  Foo::CompoundWord or Foo::Compound-Word ?
23:33 travis-ci joined #perl6
23:34 travis-ci Doc build passed. Dabrien 'Dabe' Murphy 'Document "Hash vs. Block" Gotcha
23:34 travis-ci https://travis-ci.org/perl6/doc/builds/125709617 https://github.com/perl6/doc/commit/0712be40fcc9
23:34 travis-ci left #perl6
23:34 AlexDaniel m: dd ‘Hello world’.comb(‘’)
23:34 camelia rakudo-moar f05c77: OUTPUT«("", "", "", "", "", "", "", "", "", "", "", "").Seq␤»
23:34 verzit joined #perl6
23:34 atweiden is it possible for a token/regex in a grammar to read from a grammar attribute?
23:35 atweiden e.g m: grammar Sample { has Str @.tokens; token sample { <{ say '[DEBUG] @.tokens ', @.tokens.perl; {| $_ for @.tokens} }> } }; my Str @tokens = '/John\sDeere.*/', '/:i computer.*/'; @tokens .= map({ .substr(1, *-1) }); my Str $content = 'John Deere'; say Sample.new(:@tokens).parse($content, :rule<sample>);
23:35 grondilu m: 13 ~~ / :my $var = 13; (\d+) <?{ $0 == $var }> /;
23:35 camelia rakudo-moar f05c77: ( no output )
23:35 grondilu m: say 13 ~~ / :my $var = 13; (\d+) <?{ $0 == $var }> /;
23:35 camelia rakudo-moar f05c77: OUTPUT«「13」␤ 0 => 「13」␤»
23:35 atweiden m: grammar Sample { has Str @.tokens; token sample { <{ say '[DEBUG] @.tokens ', @.tokens.perl; {| $_ for @.tokens} }> } }; my Str @tokens = '/John\sDeere.*/', '/:i computer.*/'; @tokens .= map({ .substr(1, *-1) }); my Str $content = 'John Deere'; say Sample.new(:@tokens).parse($content, :rule<sample>);
23:35 camelia rakudo-moar f05c77: OUTPUT«[DEBUG] @.tokens Array[Str].new()␤Nil␤»
23:35 grondilu m: say 12 ~~ / :my $var = 13; (\d+) <?{ $0 == $var }> /;
23:35 camelia rakudo-moar f05c77: OUTPUT«Nil␤»
23:37 teatime heh, ==> $a doesn't work... should have seen that coming.
23:37 AlexDaniel m: dd ‘’.comb(‘’)  # http://i1.kym-cdn.com/photos/ima​ges/original/000/471/542/069.jpg
23:37 camelia rakudo-moar f05c77: OUTPUT«("",).Seq␤»
23:38 frobisher joined #perl6
23:38 timotimo feed operators operate with slurpy positional arguments, they probably want to have an @foo at the end
23:39 teatime right
23:41 tardisx joined #perl6
23:43 Actualeyes joined #perl6
23:46 pdcawley joined #perl6
23:50 dalek star: 6bfd13c | (Steve Mynott)++ | tools/star/release-guide.pod:
23:50 dalek star: note 2016.04 release in release-guide.pod
23:50 dalek star: review: https://github.com/rakudo/star/commit/6bfd13c81e
23:53 BenGoldberg m: sub foo { say $^y, $^x }; foo( 1, 2 );
23:53 camelia rakudo-moar f05c77: OUTPUT«21␤»
23:55 cognominal joined #perl6
23:59 * BenGoldberg wonders, does any language other than perl6 have anything resembling $^foo?

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo