Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2012-12-26

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 sorear where I live, it will always be today.
00:01 flussence (actually I might be wrong, my NTP's been iffy lately...)
00:03 LlamaRider joined #perl6
00:04 Abcxyz joined #perl6
00:08 masak PerlJam++ # 24th advent post
00:08 masak PerlJam: "Niecza" link doesn't work :/
00:10 masak PerlJam: my $suffix = ' ' x $width - $text.chars - $prefix.chars; # this will not work unless you parenthesize the last three terms
00:11 masak seems I'm wrong. ignore me.
00:11 masak infix:<-> binds tighter than infix:<x>. TIL.
00:14 masak 'night, #perl6
00:15 quester left #perl6
00:16 Targen joined #perl6
01:01 LlamaRider Hi. I just ran into  "     Smartmatch against False always fails; if you mean to test the topic for truthiness, use :!so or *.not or !* instead  "
01:01 LlamaRider I'm indeed comparing False with False and want a true value out. What would be *the* safe way?
01:03 LlamaRider ... good old == seems to work so far
01:04 LlamaRider let me know if I should be using something different
01:06 hypolin joined #perl6
01:07 flussence smartmatch only really makes sense to use if one of the other operators doesn't, and for booleans == is fine
01:09 anuby joined #perl6
01:09 LlamaRider I'm happy I used it, since I am trying to learn as much as I can right now. And getting tripped on smart-matching booleans was a valuable experience.
01:10 LlamaRider though I am sure I don't yet understand the reasoning behind its design.
01:12 flussence I'm confusing myself a bit now...
01:12 flussence rpn: say False ?^ False
01:12 p6eval rakudo c8de2e, niecza v24-12-g8e50362: OUTPUT«False␤»
01:12 p6eval ..pugs: OUTPUT«␤»
01:12 flussence anyone know why that's false but True ?^ True returns Nil?
01:17 rindolf joined #perl6
01:24 rindolf joined #perl6
01:27 raiph joined #perl6
01:52 Patterner I just compiled parrot, nqp and rakudo with clang 3.2. all tests passed. (all from git repos)
02:00 nebuchadnezzar joined #perl6
02:10 nebuchad` joined #perl6
02:43 rindolf joined #perl6
02:44 [Coke] rpn: say True ?^ True
02:44 p6eval rakudo c8de2e: OUTPUT«Nil␤»
02:44 p6eval ..niecza v24-12-g8e50362: OUTPUT«False␤»
02:44 p6eval ..pugs: OUTPUT«␤»
02:44 [Coke] looks like a rakudobug.
03:05 FROGGS joined #perl6
03:08 OuLouFu joined #perl6
04:53 gootle joined #perl6
05:36 telex joined #perl6
05:37 geekosaur joined #perl6
06:24 kaleem joined #perl6
06:41 SamuraiJack joined #perl6
06:58 daniel-s__ joined #perl6
07:11 moritz \o
07:14 xinming joined #perl6
07:18 alec joined #perl6
07:18 alec hello
07:18 alec how can i get perl6?
07:18 alec i'm on ubuntu
07:18 alec i couldn't find a package
07:18 alec i did apt-cache search perl | grep 6
07:18 alec nothing
07:18 alec oh, hi Ayiko
07:19 alec are you the person who did those rosalind.info solutions in perl6?
07:19 alec that's the whole reason i came here
07:19 alec ayiko == 'my darling', does it not?
07:25 sorear alec: try apt-cache search rakudo and apt-cache search niecza
07:25 sorear alec: if neither comes up, you'll have to build from source
07:27 alec yeah
07:27 alec i got rakudo
07:27 alec apt-get installing now
07:27 sorear what version of rakudo?
07:28 sorear if it's older than 2012.06 or so you ought to install from source anyway
07:29 alec 2012.04
07:31 alec sorear: what will i miss out on if i don't build from source?
07:32 sorear I think that falls under "or so"
07:33 sorear bugfixes, feature additions, and performance improvements
07:33 sorear it's a gradual process
07:34 alec ok
07:40 alec i see what you mean about speed
07:43 geekosaur joined #perl6
07:50 geekosaur joined #perl6
07:51 geekosaur joined #perl6
07:53 alec hey, geekosaur
08:23 cognominal joined #perl6
08:29 moritz \o
08:30 dalek star: c2d5e6b | moritz++ | / (3 files):
08:30 dalek star: bump some versions in preparation of 2012.12 release
08:30 dalek star: review: https://github.com/rakudo/star/commit/c2d5e6b4da
08:30 dalek star: c2ee09b | moritz++ | tools/star/Makefile:
08:30 dalek star: new download URLs are rakudo.org/downloads
08:30 dalek star: review: https://github.com/rakudo/star/commit/c2ee09b162
08:30 dalek star: 01e61d2 | moritz++ | docs/announce/2012.12:
08:30 dalek star: 2012.12 star release announcement
08:30 dalek star: review: https://github.com/rakudo/star/commit/01e61d203b
08:31 dalek star: a1b106e | moritz++ | modules/ (8 files):
08:31 dalek star: bump module versions
08:31 dalek star: review: https://github.com/rakudo/star/commit/a1b106ea13
08:36 alec joined #perl6
08:36 alec what does the ~~ operator do?
08:37 alec also, trying to understand how this line works:
08:38 alec for @introns -> $d { $rna ~~ s/$d// }
08:38 FROGGS that is like: for my $d (@introns) { ... } in Perl 5
08:39 alec i don't know perl5
08:39 alec i'm learning perl6 from scratch
08:39 FROGGS ahh, k
08:39 alec i actually know what the code's doing
08:39 FROGGS it iterates over the elements of @introns
08:39 alec i just need it broken down for me
08:39 alec ok
08:40 FROGGS you get the elements as $d
08:40 alec ok
08:40 FROGGS ~~ is smartmatch, it applies the regular expression (regex) to $rna
08:40 alec ahh, handy
08:40 alec that's very cool
08:41 alec i get it
08:41 alec thank you
08:41 alec ok
08:41 kaare_ joined #perl6
08:42 FROGGS you are welcome
08:42 alec what about %conv<UAA UAG UGA> = '' xx 3;
08:42 alec what is is %conv
08:42 alec ?
08:43 FROGGS it's a hash
08:43 alec i know what the code is doing, i just don't know how it does it
08:43 alec aaaaaah
08:43 alec i see
08:43 FROGGS %hash<thing> it a pair with key 'thing'
08:43 alec ok
08:43 FROGGS so, UAA, UAG and UGA are keys
08:43 alec yeah
08:44 alec and '' xx 3?
08:44 FROGGS '' xx 3 is repeating the empty string three times, in list mode, so it returns a list with three empty strings
08:44 alec aaah
08:44 FROGGS you you end up with the hash and all its pairs are initialized with empty strings
08:45 alec yeah
08:45 FROGGS r: say 'a' xx 3
08:45 p6eval rakudo c8de2e: OUTPUT«a a a␤»
08:45 alec aah
08:45 alec r: say '' xx 3
08:45 p6eval rakudo c8de2e: OUTPUT«  ␤»
08:45 FROGGS r:  my %conv<UAA UAG UGA> = '' xx 3; say %conv
08:45 p6eval rakudo c8de2e: OUTPUT«[31m===[0mSORRY![31m===[0m�Shaped variable declarations is not yet implemented. Sorry. �at /tmp/fhVgWR3z6P:1�------> [32mmy %conv<UAA UAG UGA>[33m�[31m = '' xx 3; say %conv[0m�»
08:45 FROGGS uhh
08:46 FROGGS r:  my %conv; %conv<UAA UAG UGA> = '' xx 3; say %conv
08:46 p6eval rakudo c8de2e: OUTPUT«("UAA" => "", "UAG" => "", "UGA" => "").hash␤»
08:46 FROGGS see
08:46 alec oh wow
08:46 alec that's nifty
08:46 alec so xx makes it a list?
08:46 FROGGS r:  my %conv; my $i = 0; %conv<UAA UAG UGA> = $i++ xx 3; say %conv
08:46 p6eval rakudo c8de2e: OUTPUT«("UAA" => 0, "UAG" => 1, "UGA" => 2).hash␤»
08:46 FROGGS enum style
08:46 alec yeah
08:47 FROGGS right, xx returns a list, x would return a str
08:47 alec ok
08:47 FROGGS r: say 'a' x 3
08:47 p6eval rakudo c8de2e: OUTPUT«aaa␤»
08:47 alec is there xxx?
08:47 FROGGS dont thing so
08:47 FROGGS think*
08:47 FROGGS r: say 'a' x ^3
08:47 p6eval rakudo c8de2e: OUTPUT«aaa␤»
08:48 FROGGS r: say ^3
08:48 p6eval rakudo c8de2e: OUTPUT«0..^3␤»
08:48 FROGGS ranges -----^
08:48 FROGGS r: say 'hello' for ^3
08:48 p6eval rakudo c8de2e: OUTPUT«hello␤hello␤hello␤»
08:48 FROGGS r: say 'hello' for 0..2 # same
08:48 p6eval rakudo c8de2e: OUTPUT«hello␤hello␤hello␤»
08:49 quester joined #perl6
08:49 FROGGS alec: you already have the perl6 ebook?
08:49 alec no
08:49 alec didn't know there was one
08:49 alec i just found some code by Ayiko on rosalind.info
08:49 alec and it looked cool
08:50 alec i never learned perl5 or any other perl
08:50 alec but perl6 looks different... kinda suits my thinking style
08:50 alec so i want to learn it
08:50 FROGGS https://github.com/downloads/​perl6/book/2012.05.23.a4.pdf
08:50 alec ok, sweet, i'll get it now
08:51 FROGGS alec: the cool thing about Perl (whether 5 or 6) is that you can almost write in normal english
08:51 FROGGS r: say 'good morning' unless 'it is already late'
08:51 p6eval rakudo c8de2e:  ( no output )
08:52 alec hmm
08:52 alec the thing i like about it so far is that it's sorta unixy
08:52 FROGGS but you can turn it around like in other languages: unless $condition {  ... }
08:52 alec yeah
08:52 FROGGS unixy? in what way?
08:54 FROGGS Perl 5 is some sort of swiss army knife of unixes, but the language itself isnt unixy (dont know what unixy is exactly)
08:55 huf unixy perl is awk, i feel :)
08:55 alec when i look at the way it handles regexes i feel right at home
08:55 FROGGS ahh, yes
08:56 alec i don't like having to import re then re.compile, etc. in python
08:56 FROGGS there is some sort of connection
08:56 FROGGS or use preg_match() like in php
08:56 alec yeah, it all just feels stupid
08:56 FROGGS right
08:56 alec regexes should just be there
08:56 alec i think in regexes
08:57 huf then you have twice as many thoughts as thoughts
08:57 alec lol
08:57 FROGGS r: given 42  { when /\d/ { say 'yeah!' }
08:57 p6eval rakudo c8de2e: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Unable to parse expression in block; couldn't find final '}'â�¤at /tmp/uixThek0_U:1â�¤------> [32mgiven 42  { when /\d/ { say 'yeah!' }[33mâ��[31m<EOL>[0mâ�¤    expecting any of:â�¤        postfixâ�¤        infix or meta-infixâ�¤        infix s…
08:57 FROGGS meh
08:57 FROGGS r: given 42  { when /\d/ { say 'yeah!' }  }
08:57 p6eval rakudo c8de2e: OUTPUT«yeah!␤»
08:57 alec nice
08:57 huf you know the adage, one problem, regex, two problems :)
08:58 FROGGS r: given 42  { when /$<number>=(\d)/ { say $<number> }  }
08:58 p6eval rakudo c8de2e: OUTPUT«「4」␤␤»
08:58 alec hmm
08:59 * alec is falling asleep at the keyboard
08:59 alec night all
09:00 FROGGS gnight
09:02 alec left #perl6
09:03 moritz http://moritz.faui2k3.org/tm​p/rakudo-star-2012.12.tar.gz # R* release candidate
09:04 moritz I'll spend most of the day travelling, so plenty of time for you all to test it
09:08 * FROGGS fetches is right now
09:27 quester left #perl6
09:31 felher good morning, #perl6
09:31 FROGGS morning felher
09:41 Psyche^ joined #perl6
09:46 FROGGS moritz: this commit isnt included in rakudo star, which produces an obs warning: https://github.com/jnthn/grammar-debugger/com​mit/d17355858269e85b396e8d092a39e380c0a16b39
09:46 Kharec joined #perl6
09:54 SmokeMachine joined #perl6
10:18 GlitchMr joined #perl6
10:34 sftp joined #perl6
10:35 FROGGS moritz: forget what I said, there are still |$args in the modules...
11:00 jaldhar_ joined #perl6
11:17 FROGGS phenny: tell jnhtn that I believe that the | must go: https://github.com/jnthn/grammar-debugger​/blob/master/lib/Grammar/Debugger.pm#L40
11:17 phenny FROGGS: I'll pass that on when jnhtn is around.
11:18 FROGGS phenny: tell jnhtn here too: https://github.com/jnthn/grammar-debugge​r/blob/master/lib/Grammar/Tracer.pm#L10
11:18 phenny FROGGS: I'll pass that on when jnhtn is around.
11:30 masak g'day, g'day, #perl6 ;)
11:34 geekosaur joined #perl6
11:35 geekosaur joined #perl6
11:36 FROGGS masak! \o/
11:36 FROGGS :o)
11:36 FROGGS err, hi masak
11:38 masak :D
11:40 masak sorear: I... wasn't entirely accurate. it's always today where I live, too. :)
11:41 FROGGS phenny: tell moritz that the rakudo-star RC looks good to me (ubuntu 12.10 amd64)
11:41 phenny FROGGS: I'll pass that on when moritz is around.
11:41 FROGGS phenny: I love you
11:42 masak FROGGS++ # explaining stuff in the backlog
11:43 FROGGS thanks
11:51 SamuraiJack joined #perl6
12:14 att___ joined #perl6
12:17 rindolf joined #perl6
12:19 masak what's the name of the group { ±1, ±i, ±j, ±k } with quaternion multiplication?
12:20 masak heh. I should be able to figure this out :)
12:21 masak it's either Z_8, Z_4 x Z_2, or Z^3_2.
12:22 masak hm, but none of the cycle graphs for those groups seem right.
12:23 masak oh! was looking at abelian groups :)
12:23 masak here it is: https://en.wikipedia.org/wiki/Quaternion_group
12:28 colomon joined #perl6
12:33 MayDaniel joined #perl6
12:38 odoacre joined #perl6
12:50 spider-mario joined #perl6
12:51 nebuchadnezzar joined #perl6
12:53 fgomez joined #perl6
12:57 nebuchad` joined #perl6
13:20 nebuchadnezzar joined #perl6
13:24 att__ joined #perl6
13:44 rummik joined #perl6
13:51 att__ joined #perl6
13:52 PacoAir joined #perl6
14:01 PacoAir joined #perl6
14:02 PacoAir joined #perl6
14:04 Celelibi joined #perl6
14:12 masak quiet day today :)
14:12 hoelzro everyone's still recovering ;)
14:20 * masak .oO( you're doing it wrong ) :P
14:24 am0c_ joined #perl6
14:26 att__ joined #perl6
14:30 lolage joined #perl6
14:31 masak this season, I'm thankful we don't have this kind of tone on p6c or p6l: http://article.gmane.org/g​mane.linux.kernel/1414106
14:33 am0c_ joined #perl6
14:33 masak I sure hope this "Linus Torvalds" isn't some influential bigshot in that other community, because then people would perhaps be too intimidated to take him aside and tell him he should try harder not to be abrasive on the list.
14:35 tadzik I like how he writes "f*cking", but only sometimes
14:35 tadzik btw, how did you stumble upon that? I wouldn't be surprised if there was /r/LinusGetsAngry ;)
14:36 masak even saw it on twitter the other day.
14:36 masak s/even /
14:37 masak even if the guy Linus is responding to did something really stupid -- and he may have, I dunno -- what Linus writes seems over the top and, frankly, mean.
14:37 masak "you didn't understand the rules? well, as project leader, allow me to set you on fire in public."
14:40 huf he's a bit over the top, but a) that's his style... b) he's communicating to every maintainer with this rant, not just the one specific person and c) for better or worse, being a kernel dev is being responsible no matter what
14:40 huf but yeah, he's not a nice person :)
14:42 masak can't argue with point (a), only deplore it. points (b) and (c) would stand even for a stern but respectful message.
14:45 masak huf: let me put it this way. TimToady, Guido, and matz seem to be genuinely nice leaders. Linus doesn't. why is that? are kernel developers more tough-skinned than FLOSS language developers? do people enjoy it when Linus is being a jerk?
14:46 kaleem joined #perl6
14:47 tadzik mayhaps people secretly admire it. Or by being kernel devs they can be wearing t-shirts saying "I can stand Linus" or something ;)
14:49 arnsholt masak: There's also Theo de Raadt in the kernel camp
14:51 kaleem joined #perl6
14:52 masak tadzik: good point. unfortunately, I think the kind of community where testosterone drives communication also silently turns away lots of potential contributors.
14:53 masak arnsholt: I know nothing about de Raadt. his Wikipedia article only says that he's "outspoken".
14:54 masak tadzik: it's also quite possible the Linux community "created" the Linus persona, because they needed it.
14:55 masak just as it's quite possible the Perl 5 community "created" the p5p atmosphere because they needed it.
14:55 tadzik it turns away some and possibly attracts others
14:55 masak I don't know how probable that hypothesis is, but it's worth considering, and definitely something the Perl 6 community needs to keep in mind in its attempts to construct alternative models of collaboration.
14:56 tadzik if their results were bad then there was probably a horrible mistake made
14:56 arnsholt He doesn't have the swearing turned up to 11, but he rubs people the wrong way in a similar manner I think
14:57 masak tadzik: maybe it's a sign of a large working meritocracy. someone who does good gets commitbits, someone who screws up gets flamed in public.
14:57 masak by the way, I don't doubt that this guy will get second and third chances if he can just lick his wounds and try again. it's not about that.
14:58 masak also, I don't much mind Linus swearing. it's the context in which he expresses himself strongly that turns me off.
15:00 arnsholt Yeah, swearing isn't necessarily a problem. It's how a large part of the message seems to be "you are a failure in every way"
15:01 masak right.
15:02 masak it's as if benevolent-dictatorship were a scarce, precious resource.
15:02 masak and he chooses to use it like this, and that seems... suboptimal.
15:03 huf hmm, i didnt read his rant as "you are a failure in every way"
15:03 LlamaRider joined #perl6
15:03 huf just as "you made a mistake and then put another one on top of it, now stop and think" but in the most uncivil abrupt manner possible
15:03 LlamaRider joined #perl6
15:03 huf it is what it is *shrug*
15:04 LlamaRider o/ #perl6
15:04 masak LlamaRider!
15:04 masak \o/
15:04 tadzik well, I don't mind it all. I may, or may have not if that had any effect on me at all
15:04 masak I've been shouted at by TimToady. but then it took me being a real PITA first. it was hardly unprovoked. it did make me stop and think.
15:05 tadzik as long as the results are good I'll just sit there and watch with a face expression of a bored camel :)
15:05 masak TimToady doesn't swear, except when he's being a linguist ;)
15:05 huf i think in basically any community, someone has to be the ... um.. what's the english word for it
15:05 huf the bogeyman
15:05 masak huf: "bastard"? :)
15:05 huf masak: yeah, kinda.
15:05 masak huf: that's the mst hypothesis.
15:05 huf it's best if the person who plays that role doesnt actually enjoy it too much
15:05 masak right.
15:05 huf and realize they're at least partially playing a role
15:05 huf masak: yeah, mst ;)
15:05 masak it's still being tested around these parts.
15:06 huf i hope this channel manages without this persona, if only to provide variety
15:06 masak we have a bastard role here, but not a resident bastard. the role is more like a hat that people can wear.
15:06 huf :)
15:07 masak over the years, I think I've maybe wore that hat ~3 times.
15:07 masak it's not very needed around here.
15:08 masak our main line of defense is kindness and trying to get through. if that fails, we go all-caps.
15:08 huf :)
15:09 masak but it doesn't fail all that often, and that's the point.
15:09 masak people are much more likely to be defused by a joke and a smile, or a hug, than angry words and scowls.
15:10 huf the honey and the stick :)
15:10 masak then again, it's obvious that kindness gets drowned out when a community scales up.
15:10 huf so does constructive bastardness
15:10 huf sadly, destructive bastardness is what scales well :(
15:10 masak right. it's almost like a Maslow pyramid.
15:11 masak the only time I've had trouble keeping up with the newcomers on this channel was after the release of Rakudo Star.
15:11 masak then I could detect a slight decrease in the kindness discipline. but maybe I imagined things.
15:11 huf how frequently do you get newbies who have vague questions but absolutely refuse to read any existing documentation you point them to?
15:12 masak the tough bit is when newbies start to answer questions from newbies. then you get into a "how is babby formed" kind of situation ;)
15:12 huf oh yeah, that one
15:12 masak huf: we have people who refuse to read existing documentation sometimes, yes.
15:12 masak especially if we point them to the synopses.
15:12 masak which are admittedly a bit opaque.
15:12 huf yes, that's the word i was looking for
15:13 huf i can glean more and more info each time i go back to them :
15:13 huf :)
15:13 huf probably in part because you guys keep fixing it
15:14 * masak .oO( synopses are like trolls, they have layers )
15:15 huf i beg your pardon?
15:15 masak just a deliberate Shrek misquotation ;)
15:16 huf oh. i'm not up to date on shreklore :)
15:16 masak it's from the first movie.
15:19 LlamaRider maybe this is a good place to sneak in a nano-rant about S05 and grammars. The text there is kind of highly non-linear to read through, especially if you make my mistake of entering from http://perlcabal.org/syn/S05.html#Grammars
15:19 LlamaRider -- end-of-rant -- ;-)
15:21 isBEKaml joined #perl6
15:22 isBEKaml phenny: tell moritz thanks for the [doc] cleanups. I was trying to push something that was obviously not up to the mark. :)
15:22 phenny isBEKaml: I'll pass that on when moritz is around.
15:26 Chillance joined #perl6
15:26 masak LlamaRider: well, you're right, of course.
15:26 masak LlamaRider: it's probably better to get an introduction to grammars through some other resource.
15:26 masak S05 is more a reference than anything else.
15:26 skids joined #perl6
15:27 masak I also don't always like its disposition.
15:27 LlamaRider in its defense, it did contain the information I was looking for, though in a very minimal and hinting fashion
15:28 LlamaRider I was trying to understand why rules mess up my single-quoted whitespaces. Ended up figuring out things work if I use tokens instead, but not much more than that.
15:32 masak "in a very minimal and hinting fashion" is a good description of most of the spec. a Camel book it is not.
15:36 moritz isBEKaml: I'm glad you pushed something at all :-)
15:36 phenny moritz: 11:41Z <FROGGS> tell moritz that the rakudo-star RC looks good to me (ubuntu 12.10 amd64)
15:36 phenny moritz: 15:22Z <isBEKaml> tell moritz thanks for the [doc] cleanups. I was trying to push something that was obviously not up to the mark. :)
15:36 isBEKaml moritz: :)
15:36 masak moritz! \o/
15:37 isBEKaml anybody feel that the classes example in p6book is wrong? https://raw.github.com/perl6/book/​master/src/classes-and-objects.pod
15:37 moritz they could be much more awesome. That's sure :-)
15:38 isBEKaml r:https://gist.github.com/4380959
15:38 masak isBEKaml: space after the 'r:'
15:38 isBEKaml huh.. ENOP6EVAL?
15:38 isBEKaml r: https://gist.github.com/4380959
15:38 p6eval rakudo c8de2e: OUTPUT«Nominal type check failed for parameter '@dependencies'; expected Positional but got Array instead␤  in method new at /tmp/YSfEWacEnH:6␤  in block  at /tmp/YSfEWacEnH:27␤␤»
15:39 masak o.O
15:39 isBEKaml that's what I got.
15:39 masak oh, 'Task *@dependencies'.
15:39 isBEKaml yep
15:39 masak yeah, I don't think that works.
15:39 masak there's even an RT ticket for that somewhere.
15:40 isBEKaml heh, we have code that doesn't work in a book! :D
15:41 isBEKaml ofcourse, code doesn't work in a book, but it should outside. :P
15:42 isBEKaml n: https://gist.github.com/4380959
15:42 p6eval niecza v24-12-g8e50362: OUTPUT«Unhandled exception: Unable to resolve method postcircumfix:<( )> in type Any␤  at /tmp/f14vyvZDGm line 17 (Task.perform @ 13) ␤  at /tmp/f14vyvZDGm line 34 (mainline @ 12) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4218 (ANON @ 3) ␤  at /home/p6eval/…
15:44 masak isBEKaml: try to remove the 'Task ' typing of that slurpy, and it should work fine.
15:45 masak here's the RT ticket, by the way: https://rt.perl.org/rt3/Tic​ket/Display.html?id=113964
15:46 isBEKaml masak: No luck. It now takes it to be a Parcel and says there's no such method 'Any' on Parcel
15:46 masak showmethecode
15:47 masak nevermind, I reproduced it.
15:47 masak it got further. that error is in the .perform method.
15:48 isBEKaml r: https://gist.github.com/4380996
15:48 p6eval rakudo c8de2e: OUTPUT«No such method 'Any' for invocant of type 'Parcel'␤  in  at src/gen/BOOTSTRAP.pm:845␤  in  at src/gen/BOOTSTRAP.pm:839␤  in any  at src/gen/BOOTSTRAP.pm:836␤  in method perform at /tmp/qPM2jU5sWY:17␤  in block  at /tmp/qPM2jU5sWY:34␤␤»
15:48 masak oh!
15:49 masak the &!callback attribute is private, so it won't get initialized properly by .bless
15:49 masak neither will @!dependencies, I guess.
15:49 moritz make them public
15:49 masak on it.
15:49 moritz there's really no reason to keep them hidden
15:49 masak then it works.
15:49 isBEKaml masak: but we are passing by name, no?
15:50 masak yeah, but private attributes can't be initialized that way.
15:50 masak sorear doesn't like it.
15:50 masak I can sort of see where he's coming from.
15:50 masak it's more "proper" OO, but it violates people's expectations.
15:52 isBEKaml masak: I don't see the violation here. All I can say is, we init them once and let the object handle it. It's as OO as I see it.
15:54 masak isBEKaml: it exposes the names of private attributes to the outside world, and ties those names to consumer code.
15:55 isBEKaml masak: in that case, we can have aliasing - but that's more work than needed.
15:56 masak if you're an object and the whole outside world is potentially your enemy, by letting consumers initialize your private attributes, you just exposed internal secrets to the enemy.
15:56 masak and you wouldn't be able to refactor private attributes without breaking downstream code.
15:56 isBEKaml masak: yeah, I can see that.
16:00 masak OO language design. it's tricky.
16:00 LlamaRider Q: can P6 grammars be used for generation?
16:00 masak LlamaRider: theoretically, yes.
16:01 masak LlamaRider: I have a proof-of-concept sitting around in an old project called GGE.
16:01 isBEKaml masak: then we ban bless? http://doc.perl6.org/routine/bless
16:01 isBEKaml masak: though that particular applies to public attributes.
16:01 masak bless is what we've been talking about all along.
16:01 masak it's how you create new objects in Perl 6.
16:02 masak .new is just a common name for a method that wraps .bless
16:05 thou joined #perl6
16:06 isBEKaml well, do we have any other way to instantiate new objects?
16:06 arnsholt masak: For generation, did you have any clever ideas for handling interpolated code (other than throwing up your hands and giving up)?
16:07 isBEKaml arnsholt: giving up is considered clever? I didn't know! :D
16:07 masak I did not have any clever ideas. in fact, I can't recall considering that aspect.
16:07 masak it would seem to me that there's only one thing you can do with interpolated code: run it.
16:08 masak but from the flip side, it's not clear to me that every such bit of code would make sense on the generation side of things, if it was originally written for the parsing side.
16:08 arnsholt Yeah, probably. I guess you could try to regenerate until the tests pass =)
16:08 masak so, hm.
16:08 arnsholt But even limited generation would probably be an awesome feature
16:09 arnsholt For things like fuzzers and such it'd be very useful
16:10 masak LlamaRider: here's my proof-of-concept script: https://gist.github.com/908829
16:10 masak the email where I found that says it's using the 'ng-compat' branch of GGE. but this is old code, so no guarantees it'll work in today's Rakudo.
16:12 masak building something like this into actual Perl 6 grammars shouldn't be impossible -- as long as there's some way to extract and introspect regex ASTs.
16:12 masak hm... module idea... :)
16:19 rindolf joined #perl6
16:20 hoelzro what is ss/.../.../ for as opposed to s/.../.../?
16:21 flussence s:samespace
16:21 hoelzro ah ha
16:22 hoelzro I'm guessing that's a regex adverb rather than a general Q form one?
16:22 masak "Linus is the scariest boss ever. And he doesn't even pay you. I'm so glad he's at the helm of Linux." -- support of tadzik's hypothesis that some people like it, at http://www.reddit.com/r/programming​/comments/15dcs0/on_user_program_br​eakage_from_linux_kernel_changes/
16:23 hoelzro ugh
16:23 hoelzro that latest post from him just gets under my skin.
16:23 isBEKaml hoelzro: I bet you haven't seen his antics on youtube (to NVIDIA) :)
16:24 hoelzro isBEKaml: I've heard of them.
16:24 isBEKaml hoelzro: lkml has lots of mails where he routinely drops f-bombs, insults and such.
16:24 hoelzro yeah, he's got a reputation for it
16:25 hoelzro I just don't like how he shits all over people.
16:26 isBEKaml hoelzro: well, kernel folks tend to have thick skins. de Raadt and Linus are just what they are out of that culture.
16:27 hoelzro I don't know if that justifies it...
16:27 masak hoelzro: I felt that his second reply to Mauro was more in line than the first one. and it made me understand a bit better why Linus was upset. still think the first email was too harsh, though.
16:28 hoelzro masak: I haven't seen the second
16:29 isBEKaml hoelzro: I tend to think it's an offshoot from how people treated him - he does get to have his way because linux kernel is his brainchild.
16:29 hoelzro I don't have a problem with him getting his way
16:29 hoelzro and he *is* really good at what he does, and knowledgable
16:30 hoelzro but I think he could get his point across without being a dick
16:30 masak right. that's basically the big question: could he?
16:31 masak oh, and Joyous Kwanzaa, everyone.
16:31 isBEKaml masak: yeah, Mauro acknowledged what he did. I think his mistake was in talking to kernel devs than pulseaudio folks about why they relied on that particular flag. Thinking out loud on high volume lkml lists is out of the ordinary.
16:33 erkan joined #perl6
16:33 erkan joined #perl6
16:34 masak isBEKaml: seems to me Mauro questioned why a userspace component would care about kernel breaking backwards compat, and that's what set Linus off.
16:34 masak (because to Linus, not breaking kernel backwards compat is *the* prime directive)
16:35 masak having a discussion where that is not an assumption makes no sense to him, and he wants to protect kernel development from people who don't get that bit.
16:35 isBEKaml masak: yes, like I said - he could have gained a better picture in talking to pulseaudio folks and then he would have realised that they were breaking backward compatibility, which I believe, he didn't do.
16:36 masak I don't know enough about pulseaudio to have an opinion about that.
16:37 isBEKaml masak: I think Mauro was already fully clued in about the fact that breaking backward compatibility on the kernel side is an absolute no-no, when he's the module lead for his kernel component.
16:39 masak and yet Linus feels a need to remind him.
16:40 isBEKaml masak: yep, reason why it was a genuine mistake on Mauro's part and Linus' overreaction.
16:41 masak *nod*
16:45 fgomez joined #perl6
16:48 alec joined #perl6
16:48 alec hi
16:48 alec can someone explain to me how this line works?
16:50 alec print %conv{ $rna.substr($_, 3) } for 0,3...^$rna.chars-3;
16:50 alec i know roughly what it does, i just can't figure out what the operators do
16:50 alec specifically $_ and ...^
16:51 FROGGS r: my $rna: 'ABABABAB';  0,3...^$rna.chars-3;
16:51 p6eval rakudo c8de2e: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Confusedâ�¤at /tmp/tCjBe6hYUk:1â�¤------> [32mmy $rna:[33mâ��[31m 'ABABABAB';  0,3...^$rna.chars-3;[0mâ�¤    expecting any of:â�¤        colon pairâ�¤Â»
16:51 FROGGS r: my $rna: 'ABABABAB';  say $_ for 0,3...^$rna.chars-3;
16:51 p6eval rakudo c8de2e: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Confusedâ�¤at /tmp/F7mRRL2ddZ:1â�¤------> [32mmy $rna:[33mâ��[31m 'ABABABAB';  say $_ for 0,3...^$rna.cha[0mâ�¤    expecting any of:â�¤        colon pairâ�¤Â»
16:51 FROGGS r: my $rna =  'ABABABAB';  say $_ for 0,3...^$rna.chars-3;
16:51 isBEKaml FROGGS: '='
16:51 flussence ???
16:51 p6eval rakudo c8de2e: OUTPUT«(timeout)»
16:51 FROGGS hmmm
16:51 FROGGS timout?
16:51 flussence oh, heh
16:52 flussence I thought the first line was p6eval :)
16:52 FROGGS r: my $rna =  'ABABABAB';  say $_ for 0..3;
16:52 p6eval rakudo c8de2e: OUTPUT«0␤1␤2␤3␤»
16:52 FROGGS k
16:52 FROGGS r: my $rna =  'ABABABAB';  say $rna.chars
16:52 p6eval rakudo c8de2e: OUTPUT«8␤»
16:52 isBEKaml r: my $rna = 'ABABABAB'; for 0,3 .. ^ $rna.chars -3 { .say }
16:52 masak alec: $_ means "current element" in a for loop or map.
16:53 p6eval rakudo c8de2e: OUTPUT«0␤3␤4␤5␤»
16:53 alec ok
16:53 FROGGS okay, the for loop iterates over 0, and 3 to length of rna minus 3
16:53 masak alec: ...^ means "sequence, but throw away the last element, the one which matches the end condition".
16:53 alec ok
16:53 FROGGS right, $_ is the element in a loop if you dont give it a name via ->
16:53 alec ok
16:53 masak this sequence is a bit risky, because it assumes the $rna string has a multiple-of-three amount of chars.
16:54 isBEKaml r: my $rna = 'ABABABABA'; for 0,3 .. ^ $rna.chars -3 { .say }
16:54 p6eval rakudo c8de2e: OUTPUT«0␤3␤4␤5␤6␤»
16:54 masak FROGGS: and people tend not to use -> with statement-modifier 'for' loops :)
16:54 masak isBEKaml: original example used three dots.
16:54 FROGGS alec: then it does the print before the for loop, simple subtring
16:54 colomon joined #perl6
16:54 masak isBEKaml: and no space between '...' and '^'.
16:54 isBEKaml r: my $rna = 'ABABABABA'; for 0,3...^ $rna.chars -3 { .say }
16:54 p6eval rakudo c8de2e: OUTPUT«0␤3␤»
16:54 masak r: say 0, 3 ...^ 33
16:54 p6eval rakudo c8de2e: OUTPUT«0 3 6 9 12 15 18 21 24 27 30␤»
16:55 isBEKaml masak: yeah, I was wondering why I got back 4 and 5. :)
16:55 masak :)
16:55 alec ahh
16:55 alec i'm starting to see
16:56 alec r: say 0,4...^44
16:56 p6eval rakudo c8de2e: OUTPUT«0 4 8 12 16 20 24 28 32 36 40␤»
16:56 FROGGS alec: cool, is it?
16:56 alec yes, FROGGS
16:56 FROGGS (didnt know that too)
16:57 alec r: say 0,4...44
16:57 p6eval rakudo c8de2e: OUTPUT«0 4 8 12 16 20 24 28 32 36 40 44␤»
16:58 masak right.
16:58 masak alec: just be very aware that if you don't hit that end condition...
16:58 masak ...you fall off the edge and don't come back.
16:58 masak r: say 0, 2, 4 ... 11
16:58 p6eval rakudo c8de2e: OUTPUT«(timeout)»
16:59 masak not a bug. by design.
16:59 alec ok
16:59 alec r: say 0,4...45
16:59 masak same deal.
16:59 p6eval rakudo c8de2e: OUTPUT«(timeout)»
16:59 masak r: say 1, 1.1 ... 2
16:59 p6eval rakudo c8de2e: OUTPUT«1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2␤»
17:00 alec r: say 0,4...^45
17:00 masak same deal.
17:00 p6eval rakudo c8de2e: OUTPUT«(timeout)»
17:00 masak the '^' doesn't protect you from falling off the edge.
17:00 alec k
17:00 alec yeah
17:00 masak aleph_0 minus one is still aleph_0 ;)
17:00 alec yeah
17:02 alec looking now at $rna.substr($_, 3) ... does .substr take 2 args always?
17:03 FROGGS I guess not
17:03 FROGGS r: say 'ABC'.substr(1)
17:03 p6eval rakudo c8de2e: OUTPUT«BC␤»
17:03 FROGGS alec: just try
17:03 FROGGS r: say 'ABC'.substr(1, Inf)
17:03 p6eval rakudo c8de2e: OUTPUT«BC␤»
17:03 masak r: say 'ABC'.substr(1, Inf + 7)
17:03 p6eval rakudo c8de2e: OUTPUT«BC␤»
17:03 FROGGS thats a bit abstract but it is clear what it does
17:05 alec 'EUEO>P'.substr(4,6)
17:05 alec r: say 'EUEO>P'.substr(4,6)
17:05 p6eval rakudo c8de2e: OUTPUT«>P␤»
17:05 alec ok, yeah
17:05 SamuraiJack joined #perl6
17:06 FROGGS r: say 'æðŋ¶ħŧħ'.substr(2,1)
17:06 p6eval rakudo c8de2e: OUTPUT«ŋ␤»
17:06 FROGGS unicode safe^^
17:06 alec r: say 'EUEO>P'.chars-3
17:06 p6eval rakudo c8de2e: OUTPUT«3␤»
17:10 alec r: say 'EUEO>P'.substr(4,3)
17:10 p6eval rakudo c8de2e: OUTPUT«>P␤»
17:10 alec r: say 'EUEO>Pe'.substr(4,3)
17:10 p6eval rakudo c8de2e: OUTPUT«>Pe␤»
17:11 alec r: say 'EUEO>Pepppp'.substr(4,3)
17:11 p6eval rakudo c8de2e: OUTPUT«>Pe␤»
17:12 alec ok
17:12 alec so what does the word shift do?
17:12 alec like there's this line:
17:12 hoelzro so I'm nearly "done" with my pygments lexer for Perl6, and I'd like to get people to test it out. What would be the best way of informing the Perl6 community so they could test it out?
17:12 hoelzro e-mail? blog post?
17:12 alec my $rna = shift @introns;
17:13 alec i know what it does, just don't know how it does it
17:14 FROGGS it retrieves the first array element by removing it and returns it to $rna
17:14 FROGGS I hope that you mean that by "how"
17:17 alec ok
17:17 alec yes
17:17 alec ok, one more thing i can't figure out
17:17 alec how do {} work?
17:17 FROGGS what, a code block?
17:17 alec print %conv{ $rna.substr($_, 3) } for 0,3...^$rna.chars-3;
17:17 alec as in those ones
17:18 FROGGS ahh, %conv is a hash
17:18 alec for @introns -> $d { $rna ~~ s/$d// }
17:18 alec and those ones
17:18 alec the {}
17:18 alec curly braces
17:18 FROGGS you can access the elements by keys, like: %hash<key> or %hash{'key'}
17:18 alec ok
17:18 FROGGS the second one allows you to put functions there, the first one automatically quotes the string
17:19 alec ok
17:19 FROGGS the for loop you posted is like: for RANGE BLOCK
17:19 alec aren't they both for loops?
17:20 FROGGS and the block is surrounded by { and }
17:20 FROGGS ahh, yes
17:20 FROGGS the second for loop I ment
17:20 isBEKaml hoelzro: I don't think we are a big enough community to have preset standards. Why not do both? mail p6u, blog and push it to some of the many news aggregators. :)
17:20 alec ok
17:20 hoelzro isBEKaml: ok =)
17:21 isBEKaml hoelzro++ #pygments
17:21 FROGGS for loop syntax a): for RANGE BLOCK, where BLOCK is { STATEMENT;: STATEMENT }, or b) STATEMENT for RANGE;
17:21 FROGGS the b) is called statement modifier syntax
17:22 FROGGS because the statement comes first
17:22 alec gotcha
17:23 alec yes, i could see the syntax differed slightly...
17:23 FROGGS ohh, forget about the : before STATEMENT, thats a typo
17:23 alec ok
17:24 FROGGS statements are devided by ; and grouped by { }
17:24 alec ok
17:24 FROGGS like in many other popular languages
17:24 Ayiko hi #perl6 :)
17:24 alec yes
17:24 alec hi Ayiko
17:24 alec are you the same Ayiko as wrote rosalind.info solutions?
17:25 Ayiko I see my Rosalind toying got someone interested in perl6 :)
17:25 alec yep
17:25 alec i'm studying the one you wrote for SPLC now
17:25 alec i've pretty much worked out what every line does
17:25 alec i don't know any perl5... perl6 just looks cool though
17:26 FROGGS it does, ya
17:26 Ayiko I do warn you, my tries are not officially approved as the recommended way to write perl6 :)
17:27 alec i figured, Ayiko, but works for me...
17:27 alec i have this song called ayiko stuck in my head now
17:27 Ayiko there's a song? Oo
17:28 alec yeah. i used to listen to it all the time. lemme see if i can find it
17:28 * FROGGS is dancing to paul simon right now... you can call me al
17:30 alec www.youtube.com/watch?v=gI3ymHyXj8k
17:32 Ayiko heh, not too bad :)
17:33 alec brings back memories
17:33 * alec sheds a tear
17:33 FROGGS cant see it in germany -.-
17:33 alec i just split up with my wife, she and i used to listen to that when we lived in cyprus
17:33 Ayiko move a bit to the left, in Belgium it works :)
17:33 alec lol
17:33 hoelzro what's the difference between $?ROLE and ::?ROLE?
17:39 masak hoelzro: the latter returns a Str, according to S28.
17:39 hoelzro I see
17:40 masak feels a little bit useless to me, actually.
17:40 masak since you can get the Str from $?ROLE, I mean.
17:40 masak I move for deletion of '::?ROLE'.
17:40 hoelzro is ::? special?
17:41 hoelzro I'm guessing it's :: for the main namespace + ? for the compiler value?
17:52 pmurias joined #perl6
17:55 hoelzro ok, time for the ultimate test: rakudo/src/Perl6/Grammar.pm!
18:02 masak :)
18:07 masak alec: nice music. thank you.
18:07 lolage joined #perl6
18:07 masak alec: also, it's really nice to see you ask the right questions and get good answers from the channel. keep up the good work. :)
18:11 alec great. i'll just keep studying Ayiko's rosalind.info solutions, then
18:11 alec they're the whole reason i want to learn perl6
18:11 Ayiko oh boy, I'll need to get to work on more solutions then :)
18:11 alec lol
18:11 alec how many have you done?
18:11 alec i was looking at one you did about a week ago
18:12 alec dec 20 it was posted
18:12 isBEKaml 'night, folks!
18:12 alec night
18:12 masak 'night, isBEKaml
18:12 masak Ayiko++ # dragging people in
18:12 Ayiko 34 solved, but 2 without programming, 2 with perl5 due to performance issues :s
18:12 alec ok
18:12 alec i've solved about 7, 2 without programming as well
18:13 alec the first 2
18:13 Ayiko oh, and 5 were done in python due to them being the python intro :)
18:19 Ayiko r: grammar A { regex TOP { { return say "hi"; }};}; A.parse('');
18:19 p6eval rakudo c8de2e: OUTPUT«hi␤»
18:19 Ayiko r: grammar A { regex TOP { { for ^2 { return say "hi"; }}};}; A.parse('');
18:19 p6eval rakudo c8de2e:  ( no output )
18:21 Ayiko r: grammar B { regex TOP { { for ^2 { return say "hi"; }; say ':('; }};}; B.parse('');
18:21 p6eval rakudo c8de2e: OUTPUT«hi␤Can not get attribute '$!storage' declared in class 'Parcel' with this object␤  in method reify at src/gen/CORE.setting:5409␤  in method gimme at src/gen/CORE.setting:5797␤  in method sink at src/gen/CORE.setting:6073␤  in regex TOP at /tmp/DigN8MZ9gK:1␤  in met…
18:23 Ayiko I'm not sure if there are any specs for what to return from a code block or using return to drop out of grammar parsing completely
18:45 werwerwer joined #perl6
18:47 masak Ayiko: generally, {}-style code blocks in rules don't return anything. I think the 'return' there is messing things up for you.
18:49 Ayiko well, the for loop messes it up, my objective is to stop parsing completely
18:49 Ayiko exit works but is a bit too much
18:49 Ayiko I'm guessing <commit> <!> would work, but <commit> is NYI
18:50 arnsholt There's a magic rule to bug out of parsing, IIRC
18:50 arnsholt <panic: "Reason"> I think
18:52 masak STD.pm6 actually implements 'panic' as a method.
18:53 masak it's at STD:6103.
19:00 masak r: repeat while False { "foo" ~~ / 'f' { say "got here" } 'o' { last } / }; say "after the loop"
19:00 p6eval rakudo c8de2e: OUTPUT«got here␤Null PMC access in find_method('sink')␤  in block  at /tmp/RCzcgxM5lQ:1␤␤»
19:00 masak wohoo!
19:00 * masak submits rakudobug
19:00 masak how 'bout that :D
19:01 masak Merry Null PMC Christmas, everybody.
19:15 denisboyun_ joined #perl6
19:24 erkan joined #perl6
19:29 flussence .oO( and a .happy given Year.new )
19:30 masak oh, bet no-one has done this since before Christmas ;)
19:30 masak r: say Date.new
19:30 p6eval rakudo c8de2e: OUTPUT«2013-12-24␤»
19:30 masak :D
19:34 flussence lol
19:35 arnsholt =D
19:37 flussence p.s. useful idiom I found the other day: ".method given Thing.new(gigantic param list)" is easier to understand than normal postfix calls, especially when there's several \n's between those ()'s
19:37 arkydo joined #perl6
19:39 arnsholt Ooh, neat
19:57 cognominal joined #perl6
20:01 GlitchMr joined #perl6
20:13 colomon joined #perl6
20:18 masak Rich Hickey explains reducers in Clojure. http://vimeo.com/45561411 -- sort of a part II of Steele's presentation about conc/parallelism.
20:19 cognominal joined #perl6
20:19 masak a couple of parallels with Perl 6. his 'fold' feels like our 'hyper', for example.
20:22 * moritz always thought a "fold" was more like a reduce
20:23 masak he's doing a little bit of a redefinition trick in introducing "fold".
20:23 GlitchMr I've seen http://thedailywtf.com/Articles/Ou​t-of-All-the-Possible-Answers.aspx - and I thought "what"
20:23 masak he says "there's 'foldl' and 'foldr' and stuff, but my 'fold' is order-agnostic"
20:23 GlitchMr After that, I've seen https://github.com/perl6/perl6-exampl​es/blob/master/euler/prob005-unobe.pl - and I also thought "what"
20:23 GlitchMr I'm going to put my solution. prob005-unobe is way too verbose
20:26 dalek perl6-examples: 30bb349 | (Konrad Borowski)++ | euler/prob005-glitchmr.pl:
20:26 dalek perl6-examples: [euler] add solution for problem 5
20:26 dalek perl6-examples: review: https://github.com/perl6/perl​6-examples/commit/30bb349008
20:26 GlitchMr Enjoy
20:27 ServerSage joined #perl6
20:27 GlitchMr perl6: say [lcm] 1..20
20:27 p6eval rakudo c8de2e, niecza v24-12-g8e50362: OUTPUT«232792560␤»
20:27 GlitchMr Solved.
20:28 masak ;)
20:28 masak that's... pretty.
20:28 masak
20:29 GlitchMr Simple mathematic problem.
20:29 GlitchMr This is what is really short in Perl 6.
20:30 masak at least part of Mr Hickey's idea here seems to be to talk about collections and reducers separately. so collections can have a say on how they are to be reduced. but if they don't want to they don't have to; the reducers will just pick some default strategy.
20:34 arkydo joined #perl6
20:35 GlitchMr I guess it would be short in Haskell too
20:36 GlitchMr Prelude> foldl1 lcm [1..20]
20:36 GlitchMr 232792560
20:36 GlitchMr Close enough
20:38 Kharec joined #perl6
20:44 bruges_ joined #perl6
20:58 hoelzro how *does* one get 1,3...10 to terminate after reaching 10?
20:58 hoelzro I want to create an odd-numbered sequence up to a user-supplied value
20:58 moritz r: say 1, 3 ...^ *>10
20:58 p6eval rakudo c8de2e: OUTPUT«1 3 5 7 9␤»
20:59 hoelzro oh, I see...
20:59 hoelzro that's...really cool.
21:02 masak all the previous solutions turned out to be too special-cased.
21:03 masak this one makes sense, as long as people know about the dangers of triggering actual infinities.
21:03 Targen_ joined #perl6
21:07 hoelzro r: my $divisor = 2; say(* != $divisor && * %% $divisor);
21:07 p6eval rakudo c8de2e: OUTPUT«===SORRY!===␤Error while compiling block : Error while compiling op call: Error while compiling block : Error while compiling op call: Error while compiling op if: if block expects an argument, but there's no immediate block to take it␤»
21:07 hoelzro I take it that more than one * in an anonymous sub isn't legal?
21:08 moritz it is, in general
21:08 moritz and I'm sure you shouldn't get an internal error like that
21:08 hoelzro heh
21:08 moritz but I can imagine that && (which thunks) and * get in each other's way
21:08 moritz r: say (* + *).(2, 40)
21:08 p6eval rakudo c8de2e: OUTPUT«42␤»
21:09 hoelzro any advice for a whatever expression that says "anything divisible by, but not equal to, $divisor"?
21:09 masak 'night, #perl6
21:09 hoelzro o/ masak
21:10 moritz hoelzro: does have to be a whatever-expression?
21:10 moritz just use a block
21:10 moritz { $_ %% $divisor && $_ != $divisor }
21:10 hoelzro moritz: I'm just trying different things out
21:10 moritz note that if you use two stars, they are counted as two different arguments
21:10 hoelzro ah ha
21:11 moritz so it won't work for your case anyway
21:15 Ayiko r: say ((* < 5 and * > 5)(4,6))
21:15 p6eval rakudo c8de2e: OUTPUT«===SORRY!===␤Error while compiling block : Error while compiling op call: Error while compiling block : Error while compiling op call: Error while compiling op call: Error while compiling op if: if block expects an argument, but there's no immediate block to take i…
21:16 moritz r: * == 5 //
21:16 p6eval rakudo c8de2e: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Two terms in a rowâ�¤at /tmp/dNfXbcrAHN:1â�¤------> [32m* == 5 //[33mâ��[31m<EOL>[0mâ�¤    expecting any of:â�¤        postfixâ�¤        infix or meta-infixâ�¤        infix stopperâ�¤Â»
21:16 moritz r: * == 5 // True
21:16 p6eval rakudo c8de2e:  ( no output )
21:16 moritz r: * == 5 // * == 8
21:16 p6eval rakudo c8de2e:  ( no output )
21:16 Ayiko r: say ({* < 5 and $^a > 5}(6))
21:16 p6eval rakudo c8de2e: OUTPUT«True␤»
21:17 moritz r: say (* == 5 // * == 8)(5, 8)
21:17 p6eval rakudo c8de2e: OUTPUT«Too many positional parameters passed; got 2 but expected 1␤  in block  at /tmp/N582co1YRe:1␤␤»
21:17 * moritz submits rakudobug
21:19 colomon n: say (* == 5 // * == 8)(5, 8)
21:19 p6eval niecza v24-12-g8e50362: OUTPUT«True␤»
21:33 REPLeffect joined #perl6
21:33 snearch joined #perl6
21:53 flussence my panda's broke. "No object at index 164", and rebootstrap.pl fails too :(
21:54 cognominal joined #perl6
21:55 moritz rm -rf `perl6 -e 'say %*CUSTOM_LIB<site>`; cd panda; git clean -xdf; # that's basically what I do in such cases
21:56 flussence looks like bootstrap.pl is doing something now... thanks
21:59 thou joined #perl6
22:07 skids joined #perl6
22:08 bbkr I cannot figure out why read on socket returns only 256bytes despite requested length given on 2012.12. it completely breaks LWP::Simple and MongoDB :(
22:10 flussence ARGH
22:10 flussence still broke :(
22:10 hoelzro one can use any delimiter for m/.../ just like q/.../ and rx/.../, right?
22:15 bbkr I cannot figure out why read on socket returns only 256bytes despite requested length given on 2012.12. it completely breaks LWP::Simple and MongoDB :(
22:15 bbkr sorry about duplicate above :)
22:16 Ayiko hoelzro: m{} and m// work, other things I tried fail: (), <>, §§, !!
22:17 hoelzro Ayiko: as far as () goes, you probably need an extra space
22:17 tadzik bbkr: well, should it return _at least_ 256, or _no more than_ 256?
22:17 hoelzro r: $_ = 'foo'; m (o); say $/
22:17 p6eval rakudo c8de2e: OUTPUT«「o」␤␤»
22:18 tadzik I suspect the latter, which will be quite alright
22:18 tadzik but I don't like broken LWP::Simple either ;)
22:18 Ayiko bbkr, that generates test results like: Dubious, test returned 1 (wstat 256, 0x100) when trying to panda install LWP::Simple?
22:18 tadzik yes
22:18 bbkr Ayiko, yes
22:20 bbkr tadzik: there is $sock.read(2048); in the code and it returns Buf with size of 256 despite more bytes available. $sock.read(4) works fine. it has problem with fetching anything above 256 bytes
22:20 Ayiko aha, just got me tripped up too (HTTP::Client fails too, but that tries to fetch http://127.0.0.1:8080/test.txt )
22:22 sorear bbkr: you're supposed to keep calling .read until either it returns zero or you have all the bytes
22:23 bbkr sorear, what is the point of length argument then?
22:23 sorear bbkr: 256 seems a little buggy but in general, packet size limits will prevent you from getting all the data at once, and Berkeley sockets systems will return partial data rather than wait for future packets
22:23 sorear bbkr: allows you to set an upper limit on the amount to read
22:24 tadzik C legacy, eh
22:25 sorear even without the C legacy an upper limit is sometimes useful
22:25 tadzik sure
22:25 sorear like if you have Content-Length data and you want to avoid accidentally reading part of the next headr
22:26 tadzik next header?
22:26 bbkr sorear, looks like meaning of this param was misunderstood in few modules. knowing what it does i'll try to bring LWP::Simple to life
22:26 sorear tadzik: pipelining
22:26 tadzik bbkr: I just got to it :)
22:27 tadzik today I learned about HTTP pipelining :)
22:27 flussence pipelining is turned off by default more often than not :(
22:30 sorear bbkr: i'm telling you what it should do.  whether it actually does that is another matter.
22:31 sorear can you still crash the perl 6 http server by sending a request "BOB / HTTP/1.0\r\n\r\n" ?
22:31 sorear I remember it used to spectacularly mishandle the unknown-request-method error
22:34 tadzik it's possible
22:34 tadzik they can be brought down by an nmap scan too
22:36 bbkr BTW: supernovus created refactored 2.0 branch of HTTP::Client. it's not ready yet but looks very promising and worth including in Star once finished.
22:37 tadzik where did Devel::Trace go :(
22:38 tadzik oh, it just doesn't work with -M
22:40 tadzik and the code doesn't hang when I use it. Crap
22:42 bbkr hm, spec for IO::Socket.read says "Reads and returns $bytes bytes from the handle". not "up to $bytes bytes". so LWP::Simple is using it correctly - read(2048) should return 2048 bytes from the handle if available, not just one chunk of 512 bytes
22:42 flussence (I've half a mind to give up and start using monthly releases of rakudo; I know there were good reasons for no longer using ~/.perl6/ but it's caused nothing but grief for me since then)
22:42 sorear and it doesn't even support HTTP 0.9
22:43 sorear bbkr: that sounds pretty awful
22:43 sorear I wish I had time to rewrite all the specs
22:44 bbkr so is it spec bug (the param means upper limit), or rakudo bug ?
22:46 hoelzro damn; I was hoping to be able to push out a "preview" version of my pygments lexer tonight =(
22:46 hoelzro Grammar.pm says no
22:48 sorear bbkr: my hubris is telling me the spec is wrong and sockets should always follow a Berkeley-esque interface
22:49 bbkr sorear, thanks, i'll fill issue in perl6/specs repo
22:50 tadzik bbkr: well, so, uh, how is this HTTP::Client 2.0? :)
22:50 tadzik I tried fixing LWP::Simple and failed
22:50 tadzik it mostly doesn't hang now, but still fails all the tests
22:51 tadzik and hangs on t/get-unsized.t
22:51 tadzik the code never checks if it should maybe stop read() ing if it returned 0
22:52 tadzik oh, it went through after a few minutes
22:52 bbkr tadzik: it's labeled as "still incomplete and even more broken" :)
22:53 tadzik :)
22:53 tadzik fair enough
22:55 tadzik bbkr: I've made it a bit better (I think) at https://github.com/tadzik/perl6-lwp-simple/
22:55 tadzik if you want to go further with it
23:02 bbkr i'll test it. also worth replacing in Star repo so it won't be released with broken version.
23:09 Targen joined #perl6
23:15 bbkr sorear, read() issue reported in https://github.com/perl6/specs/issues/26
23:22 flussence bah, I give up. Rebuilt after deleting my rakudo install directory entirely and I still get the same error in panda as before.
23:23 tadzik do you still have ~/.perl6 around?
23:23 flussence nope
23:23 tadzik mess in panda directory?
23:23 tadzik I mean the source from where you bootstrap it
23:24 tadzik like leftover .pirs
23:24 flussence I've run git clean -dfx in there a few times, and it's up to date
23:33 lorn joined #perl6
23:35 japhb_ joined #perl6
23:55 flussence okay, I *think* I've got it to work using r 2012.11 from distro packages now...

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

Perl 6 | Reference Documentation | Rakudo