Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2014-02-04

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:01 raydiak r: say [1,2,3,4,5][4,3,2,1][1,2,3][2,1][1]
00:01 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«3␤»
00:12 perigrin_ joined #perl6
00:20 timotimo i made a tiny bit of progress on little_big_int \o/
00:23 kst joined #perl6
00:28 PonderingDonkey can reduction operators be used at the end of a list?
00:29 PonderingDonkey so instead of:  [+] 1..100 we have something like (1..10).[+]
00:34 smls p: say (1..10).reduce(&[+]);  # you can do this
00:34 camelia rakudo-parrot 4a74e7: OUTPUT«55␤»
00:35 smls p: say (1..10).reduce(&infix:<+>);   # long form
00:35 camelia rakudo-parrot 4a74e7: OUTPUT«55␤»
00:43 skids joined #perl6
00:50 bjz joined #perl6
00:51 PonderingDonkey nice. thanks
01:04 jeffreykegler joined #perl6
01:24 btyler joined #perl6
01:25 TimToady_ p: say (1..10).reduce(*+*)
01:25 camelia rakudo-parrot 4a74e7: OUTPUT«55␤»
01:25 TimToady_ at bit shorter
01:25 TimToady_ but &[+] is probably faster
01:35 raiph joined #perl6
01:38 bloonix joined #perl6
01:45 timotimo humans align to words anyway
01:50 ggoebel1113 joined #perl6
01:58 jnap joined #perl6
02:01 kbaker joined #perl6
02:01 clsn__ On my other computer, my \x=20 works but my \φ=20 doesn't and I can't figure out why.  Must be something weird in the compiling.
02:02 timotimo libicu?
02:07 aindilis joined #perl6
02:07 clsn__ I dunno.  I'm not too worried about it, I guess, since it plainly isn't a bug in rakudo or anything.
02:14 clsn__ r: subset Even of Int where * % 2; my Even $e; $e=2; say $e.succ;
02:14 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«Type check failed in assignment to '$e'; expected 'Even' but got 'Int'␤  in block  at /tmp/tmpfile:1␤␤»
02:15 clsn__ r: subset Even of Int where * % %2; my Even $e; $e=2; say $e.succ;
02:15 camelia rakudo-parrot 4a74e7: OUTPUT«use of uninitialized value of type Nil in numeric context  in block  at /tmp/tmpfile:1␤␤Divide by zero using infix:<%>␤  in method sink at gen/parrot/CORE.setting:12235␤  in method BUILDALL at gen/parrot/CORE.setting:918␤  in method bless at ge…»
02:15 camelia ..rakudo-moar 4a74e7: OUTPUT«use of uninitialized value of type Nil in numeric context␤Divide by zero using infix:<%>␤  in block  at src/gen/m-CORE.setting:12218␤  in sub infix:<%> at src/gen/m-CORE.setting:4404␤  in sub infix:<%> at src/gen/m-CORE.setting:4012␤  in sub infi…»
02:15 camelia ..rakudo-jvm 4a74e7: OUTPUT«use of uninitialized value of type Nil in numeric context␤Divide by zero using infix:<%>␤  in method sink at gen/jvm/CORE.setting:12214␤  in method BUILDALL at gen/jvm/CORE.setting:923␤  in method bless at gen/jvm/CORE.setting:842␤  in method new …»
02:15 clsn__ argh, irc client eating my percent signs.
02:15 clsn__ r: subset Even of Int where * %%2; my Even $e; $e=2; say $e.succ;
02:15 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«3␤»
02:15 clsn__ That's probably right... though I find myself wondering if "4" isn't a better answer.  It's probably right as is.
02:20 Sqirrel joined #perl6
02:25 clsn__ Hmm.  But tricky to make a sub that will do the other thing.  Have to run the parameter's refinement on the local var somehow.
02:27 raiph joined #perl6
02:28 clsn__ Yay.  sub subsucc(\x) { my $n=x; $n=$n.succ; my $w=x.VAR.of.^refinement; $n=$n.succ while !$w($n); $n }.  Have to pull the code into a var so it doesn't get an invocant.
02:33 Sqirrel_ joined #perl6
02:35 Sqirrel joined #perl6
02:46 kaleem joined #perl6
02:47 rurban joined #perl6
03:09 btyler joined #perl6
03:10 colomon r: subset Even of Int where * %%2; my Even $e; $e=2; say $e.WHAT; say $e.succ.WHAT
03:10 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«(Int)␤(Int)␤»
03:10 colomon r: subset Even of Int where * %%2; my Even $e; $e=2; say $e.WHAT; $e =.succ; say $e.WHAT
03:10 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«(Int)␤(Even)␤»
03:11 colomon r: subset Even of Int where * %%2; my Even $e; $e=2; say $e.WHAT; $e =.succ; say $e.WHAT; say $e
03:11 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«(Int)␤(Even)␤(Even)␤»
03:11 colomon r: subset Even of Int where * %%2; my Even $e; $e=2; say $e.WHAT; $e = $e.succ; say $e.WHAT; say $e
03:11 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«(Int)␤Type check failed in assignment to '$e'; expected 'Even' but got 'Int'␤  in block  at /tmp/tmpfile:1␤␤»
03:13 clsn__ Yeah, I've been experimenting etc... You can get the subset by looking at the .VAR.of of the variable.  I was just tinkering with something like that on parameters, and then the sub would introspect...
03:14 clsn__ It's kind of dumb though (the latter thing I'm playing with).  Subsets in signatures get translated to parameters with constraints, which is okay, but if you know the subset when you're writing the signature you might as well just put the condition inside the code rather than have to introspect to find it.  You shold know it already.
03:17 btyler joined #perl6
03:17 tokuhirom joined #perl6
03:23 japhb__ .tell pmichaud Congratulations to @child[1], and good luck to @child[0]!
03:27 colomon clsn__: sorry, got distracted there. seems to me the problem is there's no reason the where clause should be simple.
03:28 colomon gh, kebard j sped wrkng agan.  :(
03:37 BenGoldberg .ping
03:38 BenGoldberg No bot around listening for .tell
03:41 lue oh wow, even preflex is gone.
03:42 colomon clsn__: what I was trying to say...
03:44 colomon r: subset SmallPrime of Int where { $_ < 100 && $_.is-prime }; my SmallPrime $sp = 2; $sp = $sp.succ; say $sp; $sp = sp.succ;
03:44 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/tmpfile�Undeclared routine:�    sp used at line 1��»
03:44 colomon r: subset SmallPrime of Int where { $_ < 100 && $_.is-prime }; my SmallPrime $sp = 2; $sp = $sp.succ; say $sp; $sp = $sp.succ;
03:44 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«3␤Type check failed in assignment to '$sp'; expected 'SmallPrime' but got 'Int'␤  in block  at /tmp/tmpfile:1␤␤»
03:45 * colomon wonders why he doesn't always use his external Mac keyboard, much nicer typing on it than the MBP's keyboard.
03:46 colomon afk # got to try to finish reading Republic of Thieves so I can start reading Steles of the Sky.
03:57 aindilis` joined #perl6
04:00 uvtc joined #perl6
04:01 uvtc jnthn , thanks for posting your recent 2014 fosdem slides. :) Aside from the content itself, they were quite entertaining. Great images in there.
04:02 uvtc phenny, are you still around?
04:03 uvtc bots, roll call!
04:06 uvtc (jnthn, I meant to imply that the content was great and interesting on its own.)
04:15 jeffreykegler joined #perl6
04:19 rurban joined #perl6
04:21 jnap joined #perl6
04:36 uvtc Not sure exactly what would make for a suitable GSoC project, but it would be nice to have a Kate syntax description file for Perl 6, such that some more editors could highlight P6, as well as Pandoc.
04:39 japhb__ I added a number of additional GSoC project ideas just now.
04:39 japhb__ uvtc: You should add yours to the existing doc!
04:40 uvtc Would the syntax definition file idea be suitable for a GSoC project though? Not sure of the specific GSoC goals I suppose.
04:41 [Coke] moritz: etoomuchdayjob
04:42 uvtc Hm. Seems like maybe not suitable. That is to say, you probably want coding projects which benefit the student a bit more...
04:47 uvtc Is there already a site with some of those nice svg plots showing Perl 6 impl performance data over time?
04:49 uvtc I thought there was one for Rust. Maybe <http://huonw.github.io/isrustfastyet/>. Could've sworn there was another one for some $other-lang...
04:49 diakopter js
04:49 diakopter arewefastyet.con
04:50 uvtc Ah. Thanks, diakopter . I think that was it.
04:50 diakopter you know, the language that's a few thousand times more used than rust :)
04:50 diakopter (also from mozilla)
04:50 uvtc hehehe. Yes, that obscure language slipped my mind. :)
04:51 uvtc Well, anyhow, I'd rather see a Perl 6 tutorial than a perf site. But though it might be worth mentioning as a potential idea for GSoC.
04:51 uvtc s/though/thought/
04:53 Sqirrel_ joined #perl6
04:54 Sqirrel joined #perl6
04:57 uvtc Oh. Right. There's perl6/bench-scripts. Wasn't someone running them at some point and graphing the data? Maybe [Coke] ?
05:00 japhb__ uvtc: I'm editing the ideas list now -- did you want me to put that in the list for you?
05:01 uvtc I don't remember if an "are we fast yet?" site was already done in the past, and then scrapped for whatever reason.
05:02 uvtc Also, I think I still have my commit bit, though it's not been sharpened in some time. :)
05:02 uvtc japhb__, Thanks for asking, regardless. :)
05:04 rurban joined #perl6
05:05 japhb__ uvtc: timotimo and I recently (and several others in the past) have asked for an arewefastyet or speed.pypy styled site, based on perl6-bench (which may need some minor improvements to support such a thing, and will definitely need more tests).
05:05 japhb__ I think it would be an excellent GSoC project.
05:06 jeffreykegler left #perl6
05:07 japhb__ OK, I've committed my latest ideas.  uvtc, you're up.  :-)
05:12 lue "hasn't been implemented in any backend yet ... could implement this in the JVM or the MoarVM backend."  well then :)
05:15 uvtc japhb__, Ok, added that GSoC idea. :)
05:16 uvtc All the bots are on vacation it seems. Sipping digital martinis on some luxury virtual cruise.
05:22 jnap joined #perl6
05:26 masak morning, #perl6
05:28 diakopter masak: g'morn
05:29 japhb__ uvtc: expanded.  :-)
05:30 uvtc japhb__, Nice.
05:30 japhb__ raydiak: OK, that's a doozy of a pull request.  It may take me a day or two to get that reviewed.
05:38 berekuk joined #perl6
05:39 uvtc left #perl6
05:50 krunen joined #perl6
05:53 PonderingDonkey why is this producing different results:
05:53 PonderingDonkey r: my %hash = (3=>"C",1=>"A",2=>"Z") ; .say for %hash.sort
05:53 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«"1" => "A"␤"2" => "Z"␤"3" => "C"␤»
05:53 PonderingDonkey r: my %hash = (3=>"C",1=>"A",2=>"Z") ; %hash.sort>>.say
05:53 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«"3" => "C"␤"1" => "A"␤"2" => "Z"␤»
05:54 PonderingDonkey does >> still operating on the "unsorted"  list
05:56 PonderingDonkey simarly
05:56 PonderingDonkey r: my @=(5,3,4); @a.sort.say
05:56 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/tmpfile�Variable '@a' is not declared�at /tmp/tmpfile:1�------> [32mmy @=(5,3,4); @a.sort.say[33m�[31m<EOL>[0m�    expecting any of:�        ÃƒÂ¢Ã¢â€šÂ¬Ã‚¦Ã‚»
05:57 PonderingDonkey r: my @a=(5,3,4); @a.sort.say
05:57 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«3 4 5␤»
05:57 PonderingDonkey r: my @a=(5,3,4); @a.sort>>.say
05:57 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«5␤3␤4␤»
05:57 PonderingDonkey concurrency?
05:59 PonderingDonkey different results in term of ordering
06:05 TimToady_ correct, you may rely only on the ordering of values returned--you may not rely on the order of side effects
06:05 TimToady_ and IO is a side effect
06:06 TimToady joined #perl6
06:10 PonderingDonkey thanks
06:15 masak "First off, you're in for a lot of work…years of work…most of which will be wandering in the desert." -- http://www.drdobbs.com/architecture-and-design/so-you-want-to-write-your-own-language/240165488
06:15 TimToady if you ain't Moses, don't start :)
06:16 kurahaupo_mobile joined #perl6
06:19 * masak .oO( let's not split hairs^Wseas here )
06:19 rurban joined #perl6
06:21 lue masak: "The first tool that beginning compiler writers often reach for is regex. Regex is just the wrong tool for lexing and parsing" obviously never seen Perl 6 :P
06:23 jnap joined #perl6
06:23 masak lue: well, there *is* a distinction between "regex" and "parser" ;)
06:24 masak I had a talk about that, but it seems I didn't put it online... :/
06:26 masak well, not as a PDF, at least.
06:26 masak lue: see here: https://github.com/masak/talks/blob/master/lpw-2011-small-languages/slides
06:26 lue masak: to be fair, I've only ever seriously used regexes in Perl 6, so that may affect my personal connotations of what regexes are :)
06:27 masak hehe.
06:27 masak lue: I have a prototypical anti-example for you: http://daringfireball.net/projects/markdown/
06:28 masak lue: go ahead and have a peek at the Perl 5 code that drives that parser/emitter.
06:28 lue To the point where one of my "eventually" projects is a libp6regex for C++. I just like P6 regexes (and grammars) too much I guess :)
06:28 masak that's exactly how *not* to use regexes for parsing.
06:28 tadzik good morning!
06:28 masak tadzik! \o/
06:29 masak lue: don't get me wrong -- that .pl file is very successful, and heavily used. I use it for my blog. but it's not the way to parse a language. Perl 6 grammars would have been much better.
06:29 [Sno] joined #perl6
06:30 masak lue: this is a much better way to parse it: https://github.com/gildor478/ocaml-markdown/blob/master/src/Markdown.ml
06:31 nebuchad` joined #perl6
06:32 DrEeevil joined #perl6
06:32 kaare__ joined #perl6
06:33 ashleyde1 joined #perl6
06:34 Gothmog__ joined #perl6
06:34 bloonix_ joined #perl6
06:39 PerlJam joined #perl6
06:40 lee__ joined #perl6
06:40 moritz \o
06:40 tadzik hello
06:40 retupmoca joined #perl6
06:40 tadzik moar, moar ideas to GSoC page!
06:41 tadzik is there a plan to start as a Rakudo org?
06:43 xenoterracide joined #perl6
06:45 lue joined #perl6
06:46 woolfy joined #perl6
06:50 kaleem joined #perl6
06:51 masak lue: I maded you a talk PDF: http://masak.org/carl/lpw-2011-small-languages/talk.pdf :)
06:52 masak there's still a lot of context missing -- things I said out loud that are not in the slides -- but I think the basic idea of "don't use regexes, write real parsers" comes through.
06:54 alexghacker joined #perl6
06:59 masak guten morgen, moritz
07:16 SamuraiJack joined #perl6
07:25 darutoko joined #perl6
07:27 TimToady1 joined #perl6
07:40 * masak is on a train
07:41 * diakopter is not on a train
07:41 masak the train got stuck after another (slower) train, and the service manager on board was being very passive-aggressive about it on the PA system.
07:41 masak saying things like "apparently they don't feel like letting us past" and "we called traffic control, and they were spectacularly unhelpful about the whole thing"
07:42 diakopter "maybe we should get out and push"
07:45 dmol joined #perl6
07:50 rurban joined #perl6
07:50 regreg joined #perl6
07:59 FROGGS joined #perl6
08:01 rindolf joined #perl6
08:06 zakharyas joined #perl6
08:17 Ven joined #perl6
08:20 darutoko- joined #perl6
08:24 jnap joined #perl6
08:33 pdcawley joined #perl6
08:36 raydiak japhb__: yeah, sorry if I made work for you; hadn't seen you chat for a while, and didn't want to keep bugging with questions, so I just kinda went with it; there are rough spots and plenty to discuss at some point, but I figured doing it would be better than not :)
08:39 yakudza joined #perl6
08:46 ribasushi joined #perl6
08:47 ribasushi what the hell...
08:47 ribasushi can someone see what was my quit message?
08:47 ribasushi no idea how I fell off...
08:48 raydiak last one I see for you is a split
08:48 raydiak it's been raining DDoSes on freenode lately
08:48 ribasushi ah, that may have been why
08:56 Ven r: say [1, 2].WHICH
08:56 camelia rakudo-moar 4a74e7: OUTPUT«Array|139746001520328␤»
08:56 camelia ..rakudo-jvm 4a74e7: OUTPUT«Array|1668028044␤»
08:56 camelia ..rakudo-parrot 4a74e7: OUTPUT«Array|7540192417656216563␤»
08:57 diakopter p: say 7540192417656216563.is-prime
08:57 camelia rakudo-parrot 4a74e7: OUTPUT«False␤»
08:59 moritz masak++ # slides
09:00 SamuraiJack joined #perl6
09:00 ribasushi joined #perl6
09:07 woolfy Wow, Damian Conway does a course on Perl 6 in Switzerland on April 9: http://it.oetiker.ch/consulting/courses/2014.en.html
09:07 tadzik nice!
09:08 dayangkun joined #perl6
09:15 Ven Is there a feature perl6 doesn't have you wish it had ? ;D
09:15 moritz does "speed" count as a feature?
09:16 moritz mature IO system
09:18 Ven moritz: "speed" is implementation-dependant
09:18 Timbus i was going to answer but moritz cut me off :<
09:19 Timbus ill add 'lower memory requirements' then
09:19 Ven then again, that doesn't seem to be specifically tied to the language
09:19 Timbus or language features eh
09:19 rurban joined #perl6
09:19 Timbus oh*
09:20 tadzik IO, IO
09:20 Ven yeah, else it's not specifically related to the language.
09:20 moritz and honestly, I'm not entirely happy with our current object initialization system
09:21 Ven moritz++ # I can agree some parts seem tricky for not much reason
09:22 Ven p: say +^1
09:22 camelia rakudo-parrot 4a74e7: OUTPUT«-2␤»
09:22 Timbus uhm... i would have liked less strange coroutines i guess, but the current concurrency (woah) spec really fills in that hole
09:25 jnap joined #perl6
09:26 Ven Timbus++ # I'd like to see different keywords, need to finish reading the syn about concurrency
09:33 kaleem_ joined #perl6
09:38 dakkar joined #perl6
10:07 zakalwe joined #perl6
10:26 jnap joined #perl6
10:27 tadzik looks like twitter is pretending to be iOS7 now
10:27 yoleaux joined #perl6
10:27 FROGGS yoleaux: \o/
10:28 tadzik fsvo of leaux :P
10:29 FROGGS hehe
10:30 tadzik it's a funny world we live in, where I say "fsvo of leaux" and it's perfectly understandable in some circles :)
10:34 timotimo o/
10:41 yves_ joined #perl6
10:41 FROGGS joined #perl6
10:43 mtj_ joined #perl6
10:44 fridim_ joined #perl6
10:47 tadzik \o
10:58 * timotimo added a peephole optimizer to the GSoC ideas
10:58 FROGGS O.o
11:01 diakopter joined #perl6
11:03 timotimo the last time i looked, i didn't see very obvious optimization opportunities, but i was looking at the output of some nqp or rakudo source file
11:03 timotimo it'd be better to look at some custom code instead
11:06 telex joined #perl6
11:07 tadzik . o O ( Python for MoarVM )
11:09 tadzik well, domain-specific hilighting is on my "somebody do this" list, but hardly Perl6 related
11:10 timotimo what does that imply?
11:10 tadzik well, I'm not particularly fond of syntax hilighting. But it'd we awesome to have vim hilighting based on profiling, or test coverage
11:10 tadzik so you don't need an additional viewer for those
11:19 SamuraiJack joined #perl6
11:27 jnap joined #perl6
11:30 timotimo i have a key binding + function that highlights lines based on their indentation level with grayscale
11:31 timotimo also, vim has support for icons to be placed on the left side in the gutter
11:35 molaf joined #perl6
11:35 eiro joined #perl6
11:43 pecastro joined #perl6
11:47 dmol joined #perl6
11:57 kaleem joined #perl6
11:59 rurban joined #perl6
12:12 denis_boyun joined #perl6
12:22 sunnavy joined #perl6
12:23 JimmyZ joined #perl6
12:27 jnap joined #perl6
12:28 xinming joined #perl6
12:30 wingfold joined #perl6
12:35 atroxaper joined #perl6
12:48 rindolf joined #perl6
12:48 Ven r: 0, 1, *+* ... * > 100
12:48 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: ( no output )
12:49 Ven r: say 0, 1, *+* ... * > 100
12:49 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«0 1 1 2 3 5 8 13 21 34 55 89 144␤»
12:50 Ven not sure I understand that. I thought `$^a ... $^b > $^c` means "execute $^a for $^b..$^c"
12:51 timotimo er .. wha?
12:51 Ven *s03*
12:51 timotimo how did you get to $^a from that?
12:51 moritz Ven: the series operator is a bit more involved than that
12:52 moritz r: say 1, 2, 4 ... * > 1000
12:52 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«1 2 4 8 16 32 64 128 256 512 1024␤»
12:53 Ven it can ... "guess" the difference ?
12:53 moritz yes
12:53 moritz m: say 1, 3, 5 ... 11
12:53 camelia rakudo-moar 4a74e7: OUTPUT«1 3 5 7 9 11␤»
12:54 Ven m: say 1, 5 ... 100
12:54 camelia rakudo-moar 4a74e7: OUTPUT«(timeout)»
12:54 Ven m: say 1, 5 ... 30
12:55 camelia rakudo-moar 4a74e7: OUTPUT«(timeout)»
12:55 timotimo m: say (1, 5 ... 100)[^20]
12:55 camelia rakudo-moar 4a74e7: OUTPUT«1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77␤»
12:55 timotimo it never hits 100, or 30
12:55 Ven 1, 5 ... > 100
12:55 xinming_ joined #perl6
12:55 timotimo needs a * to create a closure
12:55 Ven m: 1, 5 ... * > 100
12:55 camelia rakudo-moar 4a74e7: ( no output )
12:55 Ven m: say 1, 5 ... * > 100
12:56 camelia rakudo-moar 4a74e7: OUTPUT«1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 81 85 89 93 97 101␤»
12:56 Ven Damn I'm used to my REPL
12:56 Ven m: say 1, 5 ...^ * > 100
12:56 timotimo :)
12:56 camelia rakudo-moar 4a74e7: OUTPUT«1 5 9 13 17 21 25 29 33 37 41 45 49 53 57 61 65 69 73 77 81 85 89 93 97␤»
12:56 Ven timotimo++ # ^ is used to discard the first non-matching value
12:56 Ven m: 1, 2, 5 ... * > 30
12:56 camelia rakudo-moar 4a74e7: OUTPUT«Unhandled exception: Unable to deduce sequence␤   at src/gen/m-CORE.setting:10811  (/home/p6eval/rakudo-inst-2/languages/perl6/runtime/CORE.setting.moarvm:throw:129)␤ from src/gen/m-CORE.setting:12212  (/home/p6eval/rakudo-inst-2/languages/perl6/runtim…»
12:57 timotimo the first matching value, actually
12:57 Ven uh, yeah.
12:58 Ven did not negate the correct part of the sentence
12:59 Ven m: [1] + (0, 5 ... 100)[1..*]
12:59 camelia rakudo-moar 4a74e7: ( no output )
12:59 Ven m: say [1] + (0, 5 ... 100)[1..*]
12:59 camelia rakudo-moar 4a74e7: OUTPUT«21␤»
13:00 Ven m: say [1] Z (0, 5 ... 100)[1..*]
13:00 camelia rakudo-moar 4a74e7: OUTPUT«1 5␤»
13:00 Ven m: say (0, 5 ... 100)[1..*].perl
13:00 camelia rakudo-moar 4a74e7: OUTPUT«(5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100)␤»
13:01 Ven m: say [1].append (0, 5 ... 100)[1..*]
13:01 camelia rakudo-moar 4a74e7: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/3JHA2k_Cxx�Two terms in a row�at /tmp/3JHA2k_Cxx:1�------> [32msay [1].append [33m�[31m(0, 5 ... 100)[1..*][0m�    expecting any of:�        method arguments�        postfix�    ÃƒÂ¢Ã¢â€šÂ¬Ã‚¦Ã‚»
13:01 timotimo you want the , operator
13:01 timotimo r: say (1, (0, 5 ... 100))
13:01 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«1 0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100␤»
13:02 timotimo r: say (1, (0, 5 ... 100)).perl
13:02 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«(1, (0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100).list)␤»
13:02 timotimo r: say (1, (0, 5 ... 100)).list.perl
13:02 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«(1, 0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 100).list␤»
13:02 Ven that's nested, isn't it ?
13:02 timotimo you don't need .list if you assign it to an @ variable or iterate over it
13:02 timotimo because those operations impose a flattening context
13:02 timotimo for (1, (0, 5 ... 20)) { say "v: $_" }
13:02 timotimo m: for (1, (0, 5 ... 20)) { say "v: $_" }
13:02 camelia rakudo-moar 4a74e7: OUTPUT«v: 1␤v: 0␤v: 5␤v: 10␤v: 15␤v: 20␤»
13:03 Ven Uhm ... I'm not sure I like automatic flattening
13:04 timotimo it's just that the , operator in this case doesn't impose any sort of context and you'll have to decide for yourself
13:04 timotimo .tree and .lol and .item are your friend
13:04 timotimo (not your food)
13:05 Ven .
13:05 Ven m: (1,).^name.say; [1].^name.say;
13:05 camelia rakudo-moar 4a74e7: OUTPUT«Parcel␤Array␤»
13:06 Ven I don't get the need for both "lists" and "arrays"
13:06 timotimo the big difference is containers
13:06 timotimo i constantly confuse which one is which, though :P
13:06 timotimo m: my $foo = [1, 2, 3]; my $bar := $foo[1]; $bar = 100; say $foo
13:06 camelia rakudo-moar 4a74e7: OUTPUT«1 100 3␤»
13:07 timotimo m: my $foo = (1, 2, 3).list; my $bar := $foo[1]; $bar = 100; say $foo
13:07 camelia rakudo-moar 4a74e7: OUTPUT«No such method 'STORE' for invocant of type 'Int'␤  in block  at /tmp/LTZ8bhLV69:1␤␤»
13:07 timotimo as you can see, the list does not have a container we can use for binding
13:09 rurban joined #perl6
13:09 timotimo does that help you any?
13:09 Ven timotimo: Yeah, that does. I really dislike the idea that everything is a ref, though.
13:09 moritz native types aren't refs
13:10 Ven yeah but that's an Int here, right
13:10 Ven or is that because of := ?
13:10 timotimo no, it does create an Int
13:10 tadzik I think you'll find that it doesn't bother you as much as you think it would :)
13:10 timotimo unless you specifically ask for an int, you get an Int
13:12 Ven well, the thing I really dislike is that, if 2 different lists share an element at pos. 0, if you modify $list[0], $list2 would be different too
13:12 timotimo you only get that if you :=, though
13:13 tadzik r: my @a = (1, 2, 3); my @b = @a; @b[0] = 5; say @a.perl
13:13 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«Array.new(1, 2, 3)␤»
13:13 tadzik r: my @a = (1, 2, 3); my @b = @a; @b[0]++; say @a.perl
13:13 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«Array.new(1, 2, 3)␤»
13:13 Ven m: my $val := 1; $l = [$val, 2, 3]; my $l2 = [$val, 5, 6]; $l[0] = 100; say $l2.perl
13:13 camelia rakudo-moar 4a74e7: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/m39ZzIq_f6�Variable '$l' is not declared�at /tmp/m39ZzIq_f6:1�------> [32mmy $val := 1; $l[33m�[31m = [$val, 2, 3]; my $l2 = [$val, 5, 6]; [0m�    expecting any of:�        postfix�»
13:13 tadzik now you're forcing it
13:13 Ven m: my $val := 1; my $l = [$val, 2, 3]; my $l2 = [$val, 5, 6]; $l[0] = 100; say $l2.perl
13:13 camelia rakudo-moar 4a74e7: OUTPUT«[1, 5, 6]␤»
13:14 tadzik why would you do binding in the first place?
13:14 Ven better keep away from := then
13:14 timotimo the assignment you did to $l and $l2 copied the target of the container into a new container
13:14 timotimo (that's what arrays do)
13:15 timotimo you have to ask for binding much more explicitly for it to happen to you
13:15 timotimo and when it happens, you will very rarely be surprised
13:15 Ven I don't get the distinction between list and array nor the need for it in the first place. It seems weird to have several types of sets
13:16 timotimo at least you're not asking for WTH there is a Parcel on top of that as well :P
13:16 Ven I'll add that question then
13:16 timotimo haha :D
13:17 timotimo well, one thing i have to say is that there's a rewrite of the synopsis for lists and friends coming up
13:17 timotimo that's the reason why Nil still disappears in flattening context on rakudo; we're waiting until all changes to the list synopsis are done before changing big things around in the implementation
13:18 moritz ... assuming that such a mythical condition is every fulfilled
13:18 Ven But is there a "better" container ? Why does list require "@" while arrays dont ?
13:18 timotimo list does not require @
13:19 moritz Ven: the sigils are about what flattens
13:19 moritz so you can put anything into a $ that can be put into a @
13:19 moritz it just won't flatten when you iterate over it
13:19 Ven okay -- need some paracetamol ...
13:19 timotimo r: my %foo := (1, 2, 3).list; say %foo # what the hell are you doing?!
13:19 camelia rakudo-moar 4a74e7: OUTPUT«Type check failed in binding; expected 'List' but got 'Associative'␤  in any bind_error at src/vm/moar/Perl6/Ops.nqp:216␤  in block  at /tmp/tmpfile:1␤␤»
13:19 camelia ..rakudo-parrot 4a74e7, rakudo-jvm 4a74e7: OUTPUT«Type check failed in binding; expected 'Associative' but got 'List'␤  in block  at /tmp/tmpfile:1␤␤»
13:19 moritz http://doc.perl6.org/language/containers
13:20 timotimo haha
13:20 timotimo wat :D
13:20 moritz that's my attempt to provide a cohesive picture
13:20 timotimo that's funny
13:20 moritz it's also sad :(
13:20 timotimo no, i meant the output of camelia there
13:20 moritz yes
13:20 timotimo i have an idea why it might happen, though
13:21 Ven OKAY - so @ means that everything will be flattened. At least for lists.
13:21 Ven m: my $a = (1, (2, (3, 4))); for $a { .perl.say }
13:21 camelia rakudo-moar 4a74e7: OUTPUT«$(1, (2, (3, 4)))␤»
13:21 Ven .
13:22 moritz m: my @a = (1, (2, (3, 4))); say .perl for @a
13:22 camelia rakudo-moar 4a74e7: OUTPUT«1␤2␤3␤4␤»
13:22 Ven yeah, cause @ is flattening. I understand that now. But what if I *don't* want to flatten ?
13:22 moritz then you could use .tree, for example
13:23 moritz r: say (1, (2, (3, 4))).tree.perl
13:23 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«LoL.new(1, $(2, (3, 4)))␤»
13:23 moritz that $(...) will prevent the list from flattening when you iterate over it
13:23 timotimo there we go.
13:23 Ven okay. So that's just on one level, right ?
13:23 moritz m: say .perl for (1, (2, (3, 4))).tree
13:23 camelia rakudo-moar 4a74e7: OUTPUT«1␤$(2, (3, 4))␤»
13:23 timotimo oh, i need to create a meme picture with a cat now.
13:23 moritz Ven: right
13:24 kaleem joined #perl6
13:24 Ven if I want a structure to act as I nested it, is there an alternative to .tree that is recursive ?
13:24 timotimo http://takelessons.com/blog/wp-content/uploads/2013/07/happy-cat.gif  "invisible rakudo commit"
13:24 timotimo or rather "invizibl rakduo comit"
13:25 [Coke] moritz: mark keating just sent out a message about TPF submitting as a member org for GSOC
13:25 moritz [Coke]: thanks, I've seen it
13:25 Ven .perl.say for [1, [2, [3, 4]]];
13:25 Ven m: .perl.say for [1, [2, [3, 4]]];
13:25 camelia rakudo-moar 4a74e7: OUTPUT«[1, [2, [3, 4]]]␤»
13:25 FROGGS [Coke]: and we are welcome to add our P6 tasks
13:26 Ven m: .perl.say for [1, [2, [3, 4]]].tree;
13:26 camelia rakudo-moar 4a74e7: OUTPUT«1␤[2, [3, 4]]␤»
13:26 Ven m: [1, [2, [3, 4]]].tree.perl.say;
13:26 camelia rakudo-moar 4a74e7: OUTPUT«(1, [2, [3, 4]]).list␤»
13:26 [Coke] I imagine we should decide if we want to try going our own way.
13:26 timotimo yeah, tree listifies the outermost thingie and keeps all other things deeply-nested
13:26 [Coke] but if all we have to do is come up with ideas and let mark k. be the admin, that sounds vaguely winny.
13:27 moritz [Coke]: it does, if TPF actually gets in
13:27 timotimo m: [1, [2, [3, 4]]].lol.perl.say;
13:27 camelia rakudo-moar 4a74e7: OUTPUT«LoL.new(1, [2, [3, 4]])␤»
13:27 timotimo wow, that took a while.
13:28 moritz does anybody remember on which host dalek usually runs, and as which user?
13:28 timotimo shouldn't your irclog tell you?
13:28 jnap joined #perl6
13:28 timotimo from the joins/parts/quits?
13:29 moritz well, not the ones on the web
13:29 moritz those don't track anything but nicks
13:29 FROGGS my brane says host07, but do not trust my brane
13:30 moritz and my irssi doesn't log joins and leaves
13:30 * timotimo fixed the order of got/expected
13:30 Ven timotimo: I probably need to write some perl to get the gist of it. At first sight it really seems confusing and unnatural
13:31 timotimo it confused me a whole lot at the beginning, too
13:31 Ven thanks for bearing with me, timotimo++ && moritz+=
13:31 moritz timotimo: shouldn't it simply throw the right exception type, and then methodd message takes care of
13:31 FROGGS FreeNode-#perl6.log:Sep 30 12:54:54 *dalek (~dalekbot@feather3.perl6.nl) hat #perl6 betreten
13:31 FROGGS moritz: ^^
13:31 moritz FROGGS: do you have anything from this year too? :-)
13:32 FROGGS hold on
13:32 timotimo moritz: it does throw the typed exception
13:32 timotimo but it goes via the registration mechanism
13:32 Ven Looking forward to a possible rewrite about LoLs etc
13:32 timotimo and *that* registers a sub with *positional* arguments
13:32 FROGGS irc.perl.org-#parrot.log:Feb 01 13:12:34 *d4l3k_ (~dalekbot@feather3.perl6.nl) hat #parrot betreten
13:32 FROGGS irc.perl.org-#parrot.log:Feb 01 13:18:23 *d4l3k_ (~dalekbot@feather3.perl6.nl) hat #parrot betreten
13:32 moritz FROGGS: thanks
13:32 FROGGS yw
13:33 dalek joined #perl6
13:35 Ulti Ven what languages do you know other than Perl6?
13:36 Ven Ulti: asm, c, c++, c#, java, scala, tcl, ruby, js, php; for the most part
13:37 ajr joined #perl6
13:37 Ulti right so how do you deal with int[] Vector<Integer> ArrayList<Integer> LinkedList<Integer> in Java?
13:37 Ven yea
13:37 Ulti int[] is super different to all the others
13:38 Ven I think arrays in java are a mistake
13:40 Ulti but even C right, you have a linked list of structs or you can have an array of them
13:40 Ven but yes, every container has different implementations. They however have the same API and don't have a backed-in syntax
13:41 Ulti and by array I dont necessarily mean something statically used and on the stack, you can malloc enough room for N structs in a row, or you can wrap a struct in some other struct with a null pointer and some pointers for previous and next in the list etc.
13:41 Ven yes, you have linked lists, double linked lists, etc, but the only one who gets its own syntax is the array
13:41 Ulti Perl6 just has a different set of oddball things which are more homogenous in syntax
13:41 Ven you don't a[1] on double linked list, for example
13:42 Ulti which is both confusing, but most of the time you dont notice because the syntax works for you rather than against you
13:42 Ulti Ven you could if you could overload the [] operator ;)
13:42 Ven not in C
13:42 Ulti sure
13:43 Ven and then again, that's library-wise, not a special *syntax*
13:43 Ven there's not <[]> to create a linked list and >[]< to create a vector
13:44 Ven I thought I'd look at a simple example like conway's game of life. It seems to use "Array is dim (5, 5)"
13:46 Ven m: my @life = Array of bit is dim (20, 20) is default(0); @life.perl.say
13:46 camelia rakudo-moar 4a74e7: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/PuLNQTZxcQ�Two terms in a row�at /tmp/PuLNQTZxcQ:1�------> [32mmy @life = Array [33m�[31mof bit is dim (20, 20) is default(0); @l[0m�    expecting any of:�        postfix�        i…»
13:46 Ulti also the word list and array is fairly well defined in general, list implies something containers/pointers-in-a-line like rather than the actual bits of data being in a line... usually to get around wanting different types of things in a line for the most part
13:46 Ulti parcels are what get me in Perl6
13:46 Ven m: my Array of bit @life is dim (20, 20) is default(0); @life.perl.say
13:46 camelia rakudo-moar 4a74e7: OUTPUT«[31m===[0mSORRY![31m===[0m�Type 'Array' is not declared�at /tmp/Y7zHUY2WfL:1�------> [32mmy Array of [33m�[31mbit @life is dim (20, 20) is default(0);[0m�Malformed my�at /tmp/Y7zHUY2WfL:1�------> [32mmy Array of [33m�[31mbit @lif…»
13:47 Ven wut
13:48 moritz the error message is wrong
13:48 moritz it probably actually stubmles over 'bit' not being a known type
13:48 moritz m: bit
13:48 camelia rakudo-moar 4a74e7: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/2oyyhTMsAm�Undeclared routine:�    bit used at line 1��»
13:48 diakopter m: my Array[bit] @life is dim (20, 20) is default(0); @life.perl.say
13:48 Ven m: my Array of Int @life is dim (20, 20) is default(0); @life.perl.say
13:48 camelia rakudo-moar 4a74e7: OUTPUT«===SORRY!===␤Cannot invoke null object␤»
13:48 camelia rakudo-moar 4a74e7: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/DmSPwlU61F�Can't use unknown trait 'is dim' in a variable declaration.�at /tmp/DmSPwlU61F:1�------> [32mmy Array of Int @life is dim (20, 20) [33m�[31mis default(0); @life.perl.say[0m�…»
13:48 Ulti also sized arrays aren't a thing yet either right?
13:49 Ven Ulti: that's from http://www.perlmonks.org/?node_id=253366
13:51 moritz Ven: don't trust Perl 6 advice (and especially syntax) from 2003
13:51 kbaker joined #perl6
13:51 Ven oh whoops. Should check date first !
13:51 Ulti heh
13:51 moritz back then, there was basically nothing implemented of Perl 6, and the syntax was just a though in the wind
13:52 Ulti yeah the spec changes more often than once every 11 years atm :3
13:52 Ven I guess I just got used to advent gifts :p
13:53 Ulti hmmm
13:54 Ulti m: my Array of Int @life; @life = ((0) x 2 ).item x 2; say @life.perl;
13:54 camelia rakudo-moar 4a74e7: OUTPUT«Type check failed in assignment to '@life'; expected 'Array[Int]' but got 'Str'␤  in method REIFY at src/gen/m-CORE.setting:8363␤  in method reify at src/gen/m-CORE.setting:7252␤  in method reify at src/gen/m-CORE.setting:7235␤  in method reify at …»
13:54 Ulti m: my Array[Int] @life; @life = ((0) x 2 ).item x 2; say @life.perl;
13:54 camelia rakudo-moar 4a74e7: OUTPUT«Type check failed in assignment to '@life'; expected 'Array[Int]' but got 'Str'␤  in method REIFY at src/gen/m-CORE.setting:8363␤  in method reify at src/gen/m-CORE.setting:7252␤  in method reify at src/gen/m-CORE.setting:7235␤  in method reify at …»
13:54 moritz Ulti: this can never work, because (0 x 2).item isn't declare as Array[Int]
13:55 Ulti ahh ok
13:55 Ulti also its stringafying too
13:55 Ulti which I didnt expect
13:55 moritz oh right, use xx instead
13:55 moritz x is string repetition
13:55 moritz xx is list repetition
13:55 Ulti m: my Array @life; @life = ((0) xx 2 ).item x 2; say @life.perl;
13:55 camelia rakudo-moar 4a74e7: OUTPUT«Type check failed in assignment to '@life'; expected 'Array' but got 'Str'␤  in method REIFY at src/gen/m-CORE.setting:8363␤  in method reify at src/gen/m-CORE.setting:7252␤  in method reify at src/gen/m-CORE.setting:7235␤  in method reify at src/g…»
13:56 Ulti doh two x!
13:56 Ulti m: my Array @life; @life = ((0) xx 2 ).item xx 2; say @life.perl;
13:56 camelia rakudo-moar 4a74e7: OUTPUT«Type check failed in assignment to '@life'; expected 'Array' but got 'List'␤  in method REIFY at src/gen/m-CORE.setting:8363␤  in method reify at src/gen/m-CORE.setting:7252␤  in method reify at src/gen/m-CORE.setting:7235␤  in method reify at src/…»
13:56 diakopter now that just kills me
13:56 Ulti heh and need to arrayafy
13:56 Ulti o___O
13:56 Ven m: say ((0 xx 5).item xx 5).perl
13:56 camelia rakudo-moar 4a74e7: OUTPUT«((0, 0, 0, 0, 0).list.item, (0, 0, 0, 0, 0).list.item, (0, 0, 0, 0, 0).list.item, (0, 0, 0, 0, 0).list.item, (0, 0, 0, 0, 0).list.item).list␤»
13:56 Ulti m: my @life; @life = ((0) xx 2 ).item xx 2; say @life.perl;
13:56 camelia rakudo-moar 4a74e7: OUTPUT«Array.new((0, 0).list.item, (0, 0).list.item)␤»
13:56 Ulti \o/
13:56 Ulti sort of
13:56 Ulti lol
13:56 moritz currently I recommand against using typed arrays
13:56 diakopter lol indeed
13:57 Ulti LoL even
13:57 moritz r: my @live = [0 xx 5] xx 3; @live[1, 2] = 1; say @live.perl
13:57 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«Array.new([0, 0, 0, 0, 0], 1, Any)␤»
13:57 moritz r: my @live = [0 xx 5] xx 3; @live[1][2] = 1; say @live.perl
13:57 diakopter wait, why are those .item calls deferred in the .perl output?
13:57 camelia rakudo-parrot 4a74e7, rakudo-jvm 4a74e7, rakudo-moar 4a74e7: OUTPUT«Array.new([0, 0, 0, 0, 0], [0, 0, 1, 0, 0], [0, 0, 0, 0, 0])␤»
13:58 moritz deferred?
13:58 Ven moritz++ # cleanest !
13:59 regreg joined #perl6
14:00 Ulti also the arrayest
14:01 Ven I like arrays
14:01 Ven Not to write my own Game of life
14:01 diakopter I like trains
14:02 Ven I like turtles
14:02 moritz turtles like you!
14:03 Ven and they say "hello !"
14:03 Ulti dont the more efficeint game of life implementations avoid allocating the whole world as a 2D array though, we need some fresh syntax in Perl6 for Octree or something more 2Deee
14:04 Ulti is there a unicode character for an octopus leg?
14:04 FROGGS moritz: http://wiki.enlightenedperl.org/gsoc2014/ideas
14:04 FROGGS I put our stuff there too
14:04 moritz we don't need syntax for everything :-) Sometimes plain old method calls are fine :-)
14:04 moritz FROGGS++
14:04 Ulti U+1F419
14:04 diakopter .u 1F419
14:04 yoleaux U+1F419 OCTOPUS [So] (🐙)
14:05 Ulti emoji win on OSX :3
14:05 araujo joined #perl6
14:05 diakopter fail on my OSX
14:07 Ven $*OS eq 'MSWin32' ?? 'cls' !! 'clear' ==> shell;
14:08 Ven @.grid.map(*.join).join("\n") # that's how I perl
14:09 atroxaper joined #perl6
14:09 Ven Okay, that's enough perl for now, headaches. I'll read your article later, moritz
14:09 bjz joined #perl6
14:10 moritz :-)
14:10 Ven Thanks all, really ! :)
14:18 jnap joined #perl6
14:34 masak r: my @live = [0 xx 5] xx 3; @live[1, 2] = 1; say @live.perl
14:34 masak moritz: did you mean @live[1; 2] ?
14:34 camelia rakudo-parrot 44ab3c, rakudo-jvm 44ab3c, rakudo-moar 44ab3c: OUTPUT«Array.new([0, 0, 0, 0, 0], 1, Any)␤»
14:40 moritz masak: not sure what I meant, besides "thinko"
14:41 bluescreen10 joined #perl6
14:42 masak ;)
14:42 kaleem joined #perl6
14:44 btyler joined #perl6
14:48 Timbus <Ven> if I want a structure to act as I nested it, is there an alternative to .tree that is recursive
14:49 Timbus isnt that...
14:49 Timbus flat?
14:49 colomon oooo, Octree module.  Hmmm....
14:49 Timbus my mind
14:49 Ven Timbus: not sure what you mean
14:50 TimToady1 .tree is *supposed* to be recursive, but it currently has the desired semantics of lol
14:50 Ven oh.
14:50 skids joined #perl6
14:50 Ven so it's just a "not-currently-working-as-indented" case?
14:51 TimToady1 nodnod
14:51 FROGGS Ven: that sounds like an invitation to rakudo core hacking :o)
14:51 Ven FROGGS: do-does it ?
14:51 FROGGS hehe
14:51 FROGGS yeah :o)
14:52 Ven o-oh, I see
14:53 Ven lot of stuff I don't know in the compiler :D
14:53 FROGGS ohh, rakudo is not that hard to grok
14:54 FROGGS it is written in "our" language, you see
14:54 Ven I see. I've worked with self-hosted compilers before, so that doesn't surprise me that much :)
14:55 FROGGS cool!
14:55 Ven I get "nom" is the dev branch ?
14:55 FROGGS no, it is the master branch
14:55 FROGGS Ven: what is your compiler experience ooc?
14:55 Ven FROGGS: mainly coffeescript/livescript
14:56 Ven also hacked a bit on MRI (ruby)
14:56 FROGGS cool
14:56 TimToady1 oh, I guess .tree is specced to default to .lol
14:56 TimToady1 that's silly
14:57 Ven there's one on List and one on Any
14:57 Ven (what's that :D:)
14:58 TimToady1 :D allows only happy values, : marks invocant
14:58 TimToady1 self
14:58 Ven uuu
14:58 TimToady1 where happy really means "definite", or instantiated, or some such
14:59 TimToady1 anyway, leaves out the type objects
15:00 Timbus type objects werent happy about not being allowed in
15:00 FROGGS there is alse :U for undefined, and in theory :T for type objects
15:00 Ven ah yes, nqp doesn't allow for non-primitive type checks right ?
15:01 masak Ven: "nom" is the integration branch. dunno if that's what you mean by "dev branch".
15:01 Ven masak: I mean "where you work"
15:01 masak Ven: basically, if it passes all the old and new spectests, you can put the commit on nom.
15:01 masak Ven: if it doesn't, you normally shouldn't.
15:01 masak Ven: even if it does, sometimes you want to work in a (shared or private) branch.
15:02 masak and later rebase/merge with nom.
15:03 Timbus m: (1, (2, 3, (4, 5))).tree[1][2].perl.say
15:03 camelia rakudo-moar 44ab3c: OUTPUT«4␤»
15:04 Timbus so, that should be 4, 5 eh
15:04 Ven that'd be sweet :)
15:04 * TimToady1 is respeccing .tree to make .tree default to .tree(*)
15:04 Ven m: (1, (2, 3, (4, 5))).tree(*)[1][2].perl.say
15:04 camelia rakudo-moar 44ab3c: OUTPUT«Cannot call 'tree'; none of these signatures match:␤:(Any:U: *%_)␤:(Any:D: *%_)␤:(Any:D: Cool $count, *%_)␤:(Any:D: &c, *%_)␤  in method tree at src/gen/m-CORE.setting:1569␤  in block  at /tmp/auh4NFzXBQ:1␤␤»
15:05 TimToady1 which in turn means apply .item everywhere
15:05 Ven TimToady1: if you happen to fix that rakudo-side, mind linking the commit ?
15:12 dalek specs: 977e82f | larry++ | S (2 files):
15:12 dalek specs: respec tree to default to all levels
15:12 dalek specs:
15:12 dalek specs: also some initial Seq extirpation
15:12 dalek specs: review: https://github.com/perl6/specs/commit/977e82f426
15:13 Timbus (1, (2, 3, (4, 5))).tree(100).perl # well that was scary to type into the repl
15:14 Ven well.
15:14 Ven m: (1, (2, 3, (4, 5))).tree(*).perl.say
15:14 camelia rakudo-moar 44ab3c: OUTPUT«Cannot call 'tree'; none of these signatures match:␤:(Any:U: *%_)␤:(Any:D: *%_)␤:(Any:D: Cool $count, *%_)␤:(Any:D: &c, *%_)␤  in method tree at src/gen/m-CORE.setting:1569␤  in block  at /tmp/yNblzQr8eU:1␤␤»
15:16 Timbus m: (1, (2, 3, (4, 5))).tree(2).perl.say
15:16 camelia rakudo-moar 44ab3c: OUTPUT«((1,).list.item, LoL.new(2, 3, $(4, 5)).item).list␤»
15:16 * FROGGS .oO( ar ee es pee ee see RESPEC! )
15:17 treehug88 joined #perl6
15:18 daniel-s joined #perl6
15:19 Ven oh but the 1 gets nested too
15:20 alester joined #perl6
15:21 Ven m: .perl.say for (1, (2, 3, (4, 5))).tree(2)
15:21 camelia rakudo-moar 44ab3c: OUTPUT«(1,).list.item␤LoL.new(2, 3, $(4, 5)).item␤»
15:21 Ven m: .^name.perl.say for (1, (2, 3, (4, 5))).tree(2)
15:21 camelia rakudo-moar 44ab3c: OUTPUT«"List"␤"LoL"␤»
15:21 Timbus m: (1, (2, 3, (4, 5))).tree(2)[0].say
15:21 camelia rakudo-moar 44ab3c: OUTPUT«1␤»
15:21 Ven I'd expect that to be Int[nl]LoL
15:22 Ven m: (1, (2, 3, (4, 5))).tree(2)[0].^name.say
15:22 camelia rakudo-moar 44ab3c: OUTPUT«List␤»
15:23 Timbus not dwimming. demand a refund
15:23 Timbus i want my fun back
15:26 Timbus but yeah, .tree needs some sprucing up
15:27 TimToady1 hmm, maybe I'm using * backwards
15:28 Timbus its symmetrical tho ;o
15:28 TimToady1 maybe it should mean I don't care what's below this
15:28 TimToady1 so stop at this level
15:28 isBEKaml joined #perl6
15:29 TimToady1 otherwise repeat the final mapper
15:29 Timbus no i like it as is. whatever is down there, tree it'
15:29 kaleem joined #perl6
15:32 Ven m: (1)succ
15:32 camelia rakudo-moar 44ab3c: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/nhkjRYbnGD�Two terms in a row�at /tmp/nhkjRYbnGD:1�------> [32m(1)[33m�[31msucc[0m�    expecting any of:�        postfix�        infix stopper�        infix or meta-infix�     …»
15:33 TimToady1 m: 1.succ
15:33 camelia rakudo-moar 44ab3c: ( no output )
15:33 TimToady1 m: 1.succ.say
15:33 camelia rakudo-moar 44ab3c: OUTPUT«2␤»
15:33 Adriaaan joined #perl6
15:34 TimToady1 we only have 1 alpha postfix
15:34 TimToady1 m: say 1i
15:34 camelia rakudo-moar 44ab3c: OUTPUT«0+1i␤»
15:35 masak m: sub postfix:<j>($n) { $n\i }; say 1j
15:35 camelia rakudo-moar 44ab3c: OUTPUT«0+1i␤»
15:35 masak \o/
15:36 masak m: sub postfix:<j>($n) { $n\i but role { method gist { "0+1j" } } }; say 1j
15:36 camelia rakudo-moar 44ab3c: OUTPUT«Not enough positional parameters passed; got 1 but expected 3␤  in method BUILD at src/gen/m-CORE.setting:10182␤  in method BUILD_LEAST_DERIVED at src/gen/m-CORE.setting:941␤  in sub infix:<but> at src/gen/m-CORE.setting:16131␤  in sub infix:<but> …»
15:37 masak pff.
15:37 Ven Need to read about `but`
15:37 ajr joined #perl6
15:37 Ven I've read it was supposed to be a contrary to `else`, IIRc
15:37 masak Ven: using it for drive-by mixing-in here.
15:37 Timbus not quite..
15:38 Ven looks like scala's with
15:38 masak m: say (5 but False); say ?(5 but False)
15:38 camelia rakudo-moar 44ab3c: OUTPUT«5␤False␤»
15:38 Timbus yeah
15:39 masak m: my $special-int = 42 but role { method greet { say "OH HAI" } }; say $special-int; $special-int.greet
15:39 camelia rakudo-moar 44ab3c: OUTPUT«42␤OH HAI␤»
15:39 masak m: my $special-int = 42 but role { method greet { say "OH HAI" } }; say $special-int.mro
15:39 camelia rakudo-moar 44ab3c: OUTPUT«No such method 'mro' for invocant of type 'Int+{<anon>}'␤  in block  at /tmp/QKe1JqyzKl:1␤␤»
15:39 Ven r: my @a = 42; @a.perl.say
15:39 masak m: my $special-int = 42 but role { method greet { say "OH HAI" } }; say $special-int.^mro
15:39 camelia rakudo-parrot 44ab3c, rakudo-jvm 44ab3c, rakudo-moar 44ab3c: OUTPUT«Array.new(42)␤»
15:39 camelia rakudo-moar 44ab3c: OUTPUT«(Int+{<anon>}) (Int) (Cool) (Any) (Mu)␤»
15:40 masak that last example shows how it's implemented. (anon subclass)
15:40 Ven masak++ # really cool, especially with subset. I like structural typing !
15:40 treehug88 joined #perl6
15:40 timotimo Ven: did you see my ADT module yet? :3
15:40 masak :)
15:41 masak timotimo++ # ADT module
15:41 Ven timotimo: told you I used it to bait friends onto perl 6 :D
15:41 timotimo oh! you did!
15:42 Ven timotimo: you should put up a repo description, btw
15:43 masak timotimo: it'd be fun to work on that missing EXPORT feature together.
15:43 ajr joined #perl6
15:43 masak timotimo: I also looked at that and thought "ooh, that'd be a nice use for a DSL instead of an intert specification string".
15:49 Ven masak++ # agreed about the DSL ! ; timotimo++ # watched your repo !
15:50 masak Ven: my brain is currently in those parts of spec-land, pondering.
15:50 masak basically, I think I discern three levels of language extension/modification:
15:50 masak (a) only need subroutines (so-called "internal DSL" by some)
15:50 Ven needs reader macros HA
15:51 masak (b) need macros (maybe to change program flow, or insert checking/analysis)
15:51 masak (c) need a whole different sublanguage (because the syntax is different enough that macros aren't enough)
15:51 masak it'd be nice to collect a few examples on each level. I'm gearing up to write blog posts about that, too.
15:53 moritz m: my $x; 'abc' ~~ /$x=(ab)/; say $x
15:53 camelia rakudo-moar 44ab3c: OUTPUT«===SORRY!===␤Error while compiling op bind: QAST::Block with cuid cuid_1_1391529188.76986 has not appeared␤»
15:53 moritz m: my $x; 'abc' ~~ /$x=(ab)/; say $x
15:53 camelia rakudo-moar 44ab3c: OUTPUT«===SORRY!===␤Error while compiling op bind: QAST::Block with cuid cuid_1_1391529195.38929 has not appeared␤»
15:53 moritz m: 'abc' ~~ /$<x>=(ab)/; say $<x>
15:53 camelia rakudo-moar 44ab3c: OUTPUT«「ab」␤␤»
15:54 raiph joined #perl6
15:54 TimToady1 std: my $x; 'abc' ~~ /$x=(ab)/; say $x
15:54 camelia std 09dda5b: OUTPUT«ok 00:01 127m␤»
15:54 TimToady1 n: my $x; 'abc' ~~ /$x=(ab)/; say $x
15:54 camelia niecza v24-109-g48a8de3: OUTPUT«[31m===[0mSORRY![31m===[0m��Non-Match bindings NYI at /tmp/2rh2e31Bkj line 1:�------> [32mmy $x; 'abc' ~~ /$x=(ab)[33m�[31m/; say $x[0m��Unhandled exception: Check failed��  at /home/p6eval/niecza/boot/lib/CORE.setting line 150…»
15:55 TimToady1 r: my $x; 'abc' ~~ /$x=(ab)/; say $x
15:55 camelia rakudo-moar 44ab3c: OUTPUT«===SORRY!===␤Error while compiling op bind: QAST::Block with cuid cuid_1_1391529311.00125 has not appeared␤»
15:55 camelia ..rakudo-jvm 44ab3c: OUTPUT«===SORRY!===␤setcodeobj can only be used with a CodeRef␤»
15:55 camelia ..rakudo-parrot 44ab3c: OUTPUT«===SORRY!===␤Could not find sub cuid_1_1391529308.45272␤»
15:55 masak time for a LTA rakudobug?
15:55 TimToady1 well, I believe it's specced to Just Work
15:55 moritz m: 'abc' ~~ /^ @<x>=.+ $ /; say $/
15:55 * masak submits rakudobug
15:55 camelia rakudo-moar 44ab3c: OUTPUT«Nil␤»
15:55 masak std: 'abc' ~~ /$x=(ab)/; say $x
15:56 camelia std 09dda5b: OUTPUT«[31m===[0mSORRY![31m===[0m�Variable $x is not predeclared at /tmp/BMQCFR0dVk line 1:�------> [32m'abc' ~~ /[33m�[31m$x=(ab)/; say $x[0m�Variable $x is not predeclared at /tmp/BMQCFR0dVk line 1:�------> [32m'abc' ~~ /$x=(ab)/; say [33m�[31m$…»
15:56 masak std: 'abc' ~~ /$x=(ab)/
15:56 camelia std 09dda5b: OUTPUT«[31m===[0mSORRY![31m===[0m�Variable $x is not predeclared at /tmp/KrehdSr98u line 1:�------> [32m'abc' ~~ /[33m�[31m$x=(ab)/[0m�Check failed�FAILED 00:01 126m�»
15:56 timotimo moritz: does that compile error also appear with --optimize=0?
15:56 timotimo or =off
15:56 moritz m: 'abc' ~~ /^ $<x>=(.)+ $ /; say $<x>
15:56 TimToady1 r: my $x; 'abc' ~~ /(ab) { $x = $0 }/; say $x
15:56 camelia rakudo-moar 44ab3c: OUTPUT«「a」␤ 「b」␤ 「c」␤␤»
15:56 camelia rakudo-parrot 44ab3c, rakudo-jvm 44ab3c, rakudo-moar 44ab3c: OUTPUT«「ab」␤␤»
15:57 moritz m: 'abc' ~~ /^ $<x> = (.)+ $ /; say $<x>
15:57 camelia rakudo-moar 44ab3c: OUTPUT«「a」␤ 「b」␤ 「c」␤␤»
15:57 TimToady1 m: 'abc' ~~ /^ $<x>=.+ $ /; say $<x>
15:57 camelia rakudo-moar 44ab3c: OUTPUT«「abc」␤␤»
15:57 moritz m: 'abc' ~~ /^ $<x> = (.)+ $ /; say $<x>.elems
15:57 camelia rakudo-moar 44ab3c: OUTPUT«3␤»
15:58 * TimToady1 usually uses [] instead of () to avoid giving the impression that $0 is set
15:59 TimToady1 m: 'abc' ~~ /^ <x=:Any>+ $ /; say $<x>
15:59 camelia rakudo-moar 44ab3c: OUTPUT«「a」␤ 「b」␤ 「c」␤␤»
15:59 TimToady1 there's a use for :Any :)
15:59 timotimo i have no idea what that does
16:00 FROGGS :Any is a unicode property lookup
16:00 PerlJam random thought: Just now it strikes me as weird that [] doesn't capture while () does capture.   [] are used in arrays and capturing is just like indexing into an array.
16:00 timotimo oh!
16:00 timotimo of course
16:00 timotimo not the perl6 type
16:00 FROGGS no
16:00 colomon What does the Unicode property mean?
16:00 FROGGS Anything
16:00 TimToady1 we decided we could fight the history of () in regexland
16:00 TimToady1 *n't
16:01 colomon like .   ?
16:01 TimToady1 yes
16:01 TimToady1 <:Any> is just an explicit way to write .
16:02 moritz m: 'abbbb' ~~ / (b ** 0..3)/; say ~$0;
16:02 camelia rakudo-moar 44ab3c: OUTPUT«␤»
16:02 masak r: say ?( 'aaa' ~~ m:g/a/ )
16:02 camelia rakudo-parrot 44ab3c, rakudo-jvm 44ab3c, rakudo-moar 44ab3c: OUTPUT«False␤»
16:02 TimToady1 moritz: that's correct
16:03 SamuraiJack joined #perl6
16:03 FROGGS moritz: position wins
16:03 TimToady1 r: say ('aaa' ~~ m:g/a/).WHAT
16:03 camelia rakudo-parrot 44ab3c, rakudo-jvm 44ab3c, rakudo-moar 44ab3c: OUTPUT«(Bool)␤»
16:03 FROGGS masak's example is weird though
16:04 masak lizmat++ # .made
16:04 FROGGS I've seen it on p6u a minute ago too
16:04 masak FROGGS: think it might be doing smartmatching twice, or something.
16:04 TimToady1 r: $_ = 'aaa'; say (m:g/a/).WHAT
16:04 Psyche^ joined #perl6
16:04 camelia rakudo-parrot 44ab3c, rakudo-jvm 44ab3c, rakudo-moar 44ab3c: OUTPUT«(List)␤»
16:04 masak right.
16:04 TimToady1 that wants to return a pseudo Match
16:04 FROGGS :/
16:04 TimToady1 so that the smartmatcher knows it's done
16:05 masak basically, Perl 6 straightens out a waterbed wrinkle there, which surprises people.
16:05 masak TimToady1++'s solution might work.
16:05 TimToady1 it's really OKness in disguise
16:05 masak as long as it's in disguise, it's probably fine :P
16:05 TimToady1 but it's specced by merely listing the types that behave like Bool
16:06 TimToady1 without making it generalizable :(
16:09 zakharyas joined #perl6
16:14 TimToady1 masak: it's not clear where the boundary between your (b) and (c) is.  Where does a reader macro (is parsed) fit?  What is the scope of the sublanguage replacement?
16:15 TimToady1 can a macro do what 'use Python;' does?
16:16 TimToady1 and we need to detangle the 'immediate' semantics from the language change semantics
16:16 TimToady1 my \term = 42; is language change without an immediate sub call
16:16 TimToady1 (well, as currently implemented--we could run all identifiers through a common path)
16:18 SamuraiJack_ joined #perl6
16:18 raiph Pop quiz for #perl6: who recently said that the best code is poetry, that “you’re trying to take something that can be described in many, many sentences and pages of prose, but you can convert it into a couple lines of poetry and you still get the essence, so it’s that compression.”
16:19 masak TimToady1: I wish I had more firm answers. but I figure there are some things that the community will consider as being trivially doable by macros, and others where a new braid/bundle of grammar/actions/world is needed.
16:20 masak TimToady1: kind of like the tipping point where one shouldn't do individual regexes anymore, due to diminishing returns.
16:20 masak so in my analogy, regexes : grammars :: macros : slangs.
16:24 diakopter raiph: I give up
16:24 molaf_ joined #perl6
16:25 raiph diakopter: nirvana arguably translates to "i give up", so hopefully u feel great :)
16:25 raiph anyhoo, the new ceo of microsoft
16:25 diakopter figures; not even sentences
16:26 ajr joined #perl6
16:29 masak raiph: I find the best two ways to make that happen are (a) test-first development, and (b) having already implemented the thing 49 times before.
16:29 masak (fsvo 49)
16:32 ajr_ joined #perl6
16:34 smls joined #perl6
16:35 * smls agrees with PerlJam ("Just now it strikes me as weird that [] doesn't capture while () does capture")
16:35 moritz isn't that how other professions do it? You've done 35 pancakes already, you can be pretty confident that the 36th pancake also will be just fine
16:36 smls () is used for simple grouping outside of regexes, so it would be nice to have similar semantics inside regexes
16:36 ajr_ joined #perl6
16:36 FROGGS ohh, please don't change that ó.ò
16:36 smls and [...] sort of looks like a pair of grappling hooks, so perfect for "capture this part"
16:37 moritz don't the {...} look more like grappling hooks?
16:38 smls FROGGS: Would it really be so bad? I mean, there are lots of major changes between traditional regexes and P6 regexes/grammars already.
16:38 smls So you can't copy/paste nbetween the two anyways
16:38 moritz we have an IMMENSE body of Perl 6 regexes written already
16:38 FROGGS smls: do we have to break every bit of P6 code that is "out there" atm?
16:38 moritz mostly notably in a bootstrapped compiler
16:39 moritz and doing such an invase change in a bootstrapped compiler is a real PITA
16:39 masak besides, I don't think the argument for such a change is a very strong one.
16:40 FROGGS exactly, I'd say there must be a very strong reason for changing fundamental things like this
16:40 masak yes, we "break all the [back-compat] that needs breaking", but there's something to be said for (...) or some variant of it meaning "capture" in most dialects of regex syntax.
16:40 moritz and we want the specs to solidfy, not to vaporizes
16:41 smls moritz: Sorry, grappling hook was the wrong word, I meant more like a gripper as an inductrial robotic might have as its "hand"
16:42 FROGGS smls: I understand what you say but IMO having cute parens is not worth it
16:42 masak use Regex::BracketsAndParensExchanged;
16:42 smls lol
16:43 masak it's 2014 and I still don't have my language-modifying modules.
16:43 ajr joined #perl6
16:59 timotimo masak: well, 2014 has only just begun
16:59 smls In an ideal world, any non-negligible benefit could justify a syntax change before the first officially stable release (rather than only a "very strong" benefit), but yeah I understand the pragmatic argument re. existing compilers and modules.
16:59 smls I don't agreee with the compatibility argument though. I think consistency within Perl 6 is better than consistency between parts of Perl 6 and the analogous parts of other languages.
17:02 smls I mean, I myself am a Perl 5 developer with somewhat of a "resistant-to-change" personality, yet I was surprised that this was *not* changed in Perl 6 regexes (considering all the other invasive changes/innovations in that area).
17:02 PerlJam um ... wrt the capturing brackets, I concluded internally right after I had my random thought that we could always put a module out there for people to try that would swap their meanings, so ... what masak said  :)
17:02 kaleem joined #perl6
17:04 smls I'm not a fan of "cosmetic" syntax-changing modules.
17:05 Adriaaan joined #perl6
17:05 smls They fracture the language's ecosystem and make it sifficult to merge code from different sources together
17:06 moritz but the same argument doesn't apply to the fractur in time that a syntax change causes?
17:07 timotimo frakturschrift in perl6? :)
17:09 smls moritz: Well, P6's future lifetime (and amount of usage), will hopefully vastly exceed that of the past
17:09 smls so that the latter would become negligible in comparison
17:09 moritz smls: though history shows that old documents are still easily found with google&co, and such cause confusion
17:10 moritz smls: just today we had a case here in #perl6 where somebody accidentally quoted Perl 6 syntax from 2003
17:10 smls but I do concede that it is not negligible now for the small P6 team to handle,  i.e. thats the pragmatic argument
17:12 smls s/handle/migrate/
17:12 timotimo ==> Successfully installed ADT
17:12 timotimo no test problems :\
17:12 tadzik oh no
17:12 timotimo oh, yikes
17:13 timotimo with ufo and make loudtest i *do* get errors
17:13 tadzik === SORRY === :(
17:16 timotimo i don't understand why the tests don't fail with panda
17:21 tadzik $ perl6 bootstrap.pl --prefix HEREPANDA
17:21 tadzik Usage: bootstrap.pl [--prefix=<Any>]
17:21 tadzik ಠ_ಠ
17:22 moritz ok, straw poll time. I'm sure many of you have read books or tutorials that explained closures. How many of those actually explained at which point a time a closure is instantiated (or "cloned" in p6 speak)?
17:23 moritz tadzik: use --prefix=HEREPANDA instead? :-)
17:23 tadzik I know, it's just not DWIM :)
17:24 moritz patches well done.
17:26 tadzik troo
17:29 tadzik hmm, strange
17:29 smls moritz: Well in P5 one would only think of *anonymous* subroutines as closures, so they would always appear in an expression that is reached during normal control flow. And that's when I always imagined them to be instantiated.
17:29 tadzik https://gist.github.com/tadzik/8808416
17:29 tadzik in line 4, it shows that it loaded a precompiled File::Find
17:29 smls Thouch I don't think the P5 tutorials I read on the subject went into further details on that.
17:30 smls *though
17:30 tadzik but then at the end, it complains that another File/Find.pm is not precompiled
17:31 ajr joined #perl6
17:31 jnthn I agree changing the meaning of (...) now in regex is way too late
17:32 moritz smls: ok, thanks for the data point
17:32 jnthn I also thought we were gonna *add* .made, not remove .ast also...
17:32 benabik joined #perl6
17:35 [Sno] joined #perl6
17:36 tadzik argh
17:36 tadzik I hate precompiling stuff
17:36 vendethiel smls, moritz: I was the one with that 2003 link. I often get perlmonks results from googling and sometimes it's really outdated, I'm not sure to what extent I can use it or not
17:36 moritz vendethiel: that's fine; I just used you as a data point :-)
17:37 vendethiel moritz: WRT closures, not sure what you mean. do you mean when values are captured ?
17:37 ajr_ joined #perl6
17:37 moritz vendethiel: correct
17:38 moritz for example, javascript also has named closures
17:38 vendethiel moritz: rarely explained. Usually it just says it captures "variables".
17:38 vendethiel We get a lot of those questions in JS/coffee
17:38 moritz vendethiel: ok, that matches my own experience
17:39 vendethiel "why when I do a loop to bind buttons, my click always gives me the last number?" but that's mainly because JS doesn't (didn't) have block scope
17:39 moritz vendethiel: does coffee also use the "when the outer scope is entered" mechanism?
17:40 jnthn moritz: I explain closures relatively often. I tend to not talk precisely about when the clone or instantiation happens, but certainly talk about lifetime and the exact scope that is captured.
17:40 vendethiel moritz: we have JS's semantics, with 1 or 2 exceptions (because we don't have explicit `var`, a variable is declared in the highest scope it's defined)
17:40 vendethiel s/defined/assigned/
17:41 jnthn moritz: C# has an over-sharing issue when you write for (var i = 0; i < 10; i++) things.push(x => x + i);
17:41 ajr_ joined #perl6
17:42 jnthn moritz: So I certainly have to give people a good enough mental modle to understand *why* that doesn't do that they want.
17:42 jnthn *model
17:42 vendethiel jnthn++ # same thing here
17:43 jnthn (Worth noting you'll get the same problem in Perl 6 if you use loop, fwiw...)
17:43 * moritz has a distaste for implicitly declared variables
17:43 timotimo that gives 10 closures that all add 10 to the argument?
17:43 vendethiel moritz: oh, I agree
17:43 jnthn timotimo: yes
17:43 ajr_ joined #perl6
17:44 jeffreykegler joined #perl6
17:45 dalek Heuristic branch merge: pushed 40 commits to panda/prefix by tadzik
17:45 jnthn dinner &
17:46 ajr_ joined #perl6
17:46 rom1504 joined #perl6
17:47 raydiak joined #perl6
17:47 silug_ joined #perl6
17:48 ajr_ joined #perl6
17:48 rhr joined #perl6
17:48 [Coke] joined #perl6
17:48 breinbaas joined #perl6
17:48 anocelot joined #perl6
17:49 Ulti joined #perl6
17:49 Util joined #perl6
17:49 obra joined #perl6
17:50 timotimo oh, dalek is back \o/
17:50 simcop2387 joined #perl6
17:52 daniel-s joined #perl6
18:00 SamuraiJack_ joined #perl6
18:01 prammer joined #perl6
18:03 ajr_ joined #perl6
18:06 synopsebot joined #perl6
18:13 denisboyun joined #perl6
18:14 zakharyas joined #perl6
18:15 jeffreykegler left #perl6
18:17 FROGGS joined #perl6
18:18 yogan joined #perl6
18:19 denis_boyun_ joined #perl6
18:20 colomon woah, big changes to panda?
18:21 timotimo no, just a merge of master into a branch i believe
18:21 FROGGS break all the things! /o/
18:22 FROGGS (joke)
18:33 kivutar joined #perl6
18:38 tadzik yeah, I tried to resume work on prefix
18:43 sftp joined #perl6
18:48 ajr joined #perl6
19:14 molaf joined #perl6
19:16 Sqirrel joined #perl6
19:26 Util #ps in 4m
19:33 TimToady joined #perl6
19:34 TimToady yay, I'm me again
19:35 FROGGS \o/
19:35 TimToady had to quit irssi, wouldn't let the nick timeout
19:39 nwc10 in real life too, or are you still on the cough syrup etc?
19:39 rindolf joined #perl6
19:41 [particle] joined #perl6
19:42 TimToady I think I've managed to get off the cough syrup with the aid of a humidifier, but I'm also working on a case of shingles, which I'm supposed to wait for blisters to come up before I go back in
19:42 TimToady and given that I have cephalic shingles, it can get (back into) my eye (for which reason I was blind in one eye for 14 years)
19:43 TimToady but now it's just neuralgia on the top of my head mostly, but it makes it hard to think some of the time
19:43 FROGGS O.O
19:43 TimToady trigeminal nerve, ophthalmic branch
19:44 TimToady the other irritation is that when I cough (and I still do a lot of that), it feels as though the top of my head is going to fly off
19:44 TimToady but I'm hopeful this may be the first day without fever from the flu
19:45 TimToady that's the thing about shingles, it always kicks you when you're already down
19:47 nwc10 E has bronchitis, or keeps getting bronchitis again every time she gets a cold
19:47 nwc10 this is tiring for all of us
19:48 TimToady that's why we do this when we're young :)
20:05 treehug88 joined #perl6
20:07 SamuraiJack_ joined #perl6
20:12 timotimo and then the shingles kick you in the shins :(
20:15 20WAA3Q7G joined #perl6
20:16 treehug88 joined #perl6
20:16 dalek rakudo/wip-openpipe: d62a7b2 | (Tobias Leich)++ | src/core/IO.pm:
20:16 dalek rakudo/wip-openpipe: use openpipe on moar
20:16 dalek rakudo/wip-openpipe: review: https://github.com/rakudo/rakudo/commit/d62a7b26dc
20:16 beastd joined #perl6
20:17 20WAA3Q84 joined #perl6
20:20 daniel-s joined #perl6
20:21 TimToady well, on balance I think I would rather have shingles kick me in the shins than in the head, but I don't get to choose
20:26 jac50 joined #perl6
20:32 jnap joined #perl6
20:33 bjz joined #perl6
20:40 colomon TimToady: :(
20:44 renormalist joined #perl6
21:00 kst joined #perl6
21:01 btyler hi all. just putzing around trying to get a handle on grammars, and decided to make a parser for nginx/apache access logs. can anyone help me figure out why the grammar for 'date' fails but the regex at the bottom matches? https://gist.github.com/kanatohodets/7b3d3188a3588241ffc1#file-parse-pm6-L11
21:04 timotimo before i look, did you have a look at the Grammar::Debugger and Rakudo::Debugger packages?
21:05 timotimo ah, hehe
21:05 timotimo you do $<date>=\[ (.+) \]
21:05 timotimo which means ... assign what matched '[' into $<date> and the stuff after the
21:05 sjn btyler: check out http://perlgeek.de/en/article/debug-a-perl-6-grammar :)
21:05 timotimo '[' goes into $0 and then it matches a ']'
21:10 Alula joined #perl6
21:11 btyler sjn/timotimo: thanks! I guess I was confused about how the $<foo> capture things work. do I stick the 'date' capture inside \[\], then? trying to 'grab all the stuff inside a pair of square braces'
21:13 FROGGS p: say '137.22.189.191 - - [02/Feb/2014:23:37:36 -0600] "GET' ~~ /$<date>=[ '[' .+ ']' ]/
21:13 camelia rakudo-parrot 44ab3c: OUTPUT«「[02/Feb/2014:23:37:36 -0600]」␤ date => 「[02/Feb/2014:23:37:36 -0600]」␤␤»
21:13 timotimo i would suggest .+? instead of .+
21:13 timotimo that should be much, much faster
21:13 timotimo actually, use <-[\]]> instead perhaps
21:13 FROGGS true
21:13 timotimo instead of .
21:13 FROGGS p: say '137.22.189.191 - - [02/Feb/2014:23:37:36 -0600] "GET' ~~ /<date=-[\]]>/
21:13 camelia rakudo-parrot 44ab3c: OUTPUT«「1」␤ date => 「1」␤␤»
21:14 btyler timotimo: ok, moment..think baby perl6 :P what does those variations mean?
21:14 FROGGS p: say '137.22.189.191 - - [02/Feb/2014:23:37:36 -0600] "GET' ~~ /$<date>=[ <-[\]]>+ ]/
21:14 camelia rakudo-parrot 44ab3c: OUTPUT«「137.22.189.191 - - [02/Feb/2014:23:37:36 -0600」␤ date => 「137.22.189.191 - - [02/Feb/2014:23:37:36 -0600」␤␤»
21:14 btyler *do
21:14 FROGGS .+ is greedy, .+? is not
21:15 FROGGS and <-[ ... ]> is a negated charater class
21:15 FROGGS where ... is the actual content
21:16 timotimo yeah, your .* would match until the end of the whole file and then backtrack until it finds a ]
21:16 btyler oh, jeez, ok.
21:17 timotimo meaning you'll get a few thousand lines as the date of your first entry, in the worst case :P
21:31 skids One doesn't generally parse log files as one string.  That's a recipe for high memory footprint.  Best to load and discard lines one by one.
21:34 btyler skids: of course, just messing around :) figured that doing a moving window thing was putting the cart before the horse if I didn't have any notion of how grammars worked
21:37 * skids ponders the concept of lazy matching on a stream.
21:44 colomon skids: once we have lazy strings...
21:46 timotimo moritz++ # answering a barrage of questions on the mailing list
21:49 skids colomon: right, but what does $/ look like during the match...
21:49 colomon skids: hmmm
21:52 kaare__ joined #perl6
21:58 erkan joined #perl6
21:58 arlinius joined #perl6
21:59 treehug88 joined #perl6
22:19 BenGoldberg joined #perl6
22:20 rurban joined #perl6
22:22 kivutar joined #perl6
22:24 treehug88 joined #perl6
22:33 treehug88 joined #perl6
22:38 lue masak: at parts that slideshow reads like someone trying too hard to impress with buzzwords :P "strictness!" "symbol tables!" "lexical scoping!"
22:42 lue ooh, didn't know .ast became .made recently
23:07 timotimo lue: that was literally today
23:12 timotimo oh, actually, the day just changed a few minutes ago on my timezone
23:13 raiph joined #perl6
23:18 huf_ joined #perl6
23:24 molaf joined #perl6
23:30 corecatcher joined #perl6
23:31 skids joined #perl6
23:31 jnap joined #perl6
23:32 lizmat joined #perl6
23:34 Alula joined #perl6
23:39 xenoterracide joined #perl6
23:40 Adriaaan joined #perl6
23:44 berekuk joined #perl6

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

Perl 6 | Reference Documentation | Rakudo