Camelia, the Perl 6 bug

IRC log for #perl6, 2012-03-15

Perl 6 | Reference Documentation | Rakudo | Niecza | Specs

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

All times shown according to UTC.

Time Nick Message
00:24 fsergot joined #perl6
00:31 tokuhiro_ joined #perl6
00:32 tokuhiro_ joined #perl6
00:32 overrosy joined #perl6
00:58 fsergot joined #perl6
01:07 wolfman2000 joined #perl6
01:09 lestrrat joined #perl6
01:11 Vespakoen joined #perl6
01:12 scott___ joined #perl6
01:39 jlaire masak: "optimaztion" @ http://strangelyconsistent.​org/blog/t3-addition-chains
01:49 jlaire http://strangelyconsistent​.org/p6cc2011/t3/zbiciak/ "The code uses a mixture of K&R and Allman style."
01:49 jlaire \n{ for functions is K&R
02:11 cognominal why masak's blogs entry are coming from the future? I wish he could do so with source code.
02:11 jlaire and btw, from wikipedia: "A number of other papers state that finding a single addition chain is NP-complete, citing this paper, but it does not claim or prove such a result."
02:38 fsergot joined #perl6
03:47 lestrrat joined #perl6
03:58 leprevost joined #perl6
04:00 orafu joined #perl6
04:02 leprevost_ joined #perl6
04:20 overrosy joined #perl6
04:27 havenn joined #perl6
04:29 envi_ joined #perl6
04:43 sporous joined #perl6
04:43 tyatpi joined #perl6
05:00 overrosy joined #perl6
05:17 eternaleye joined #perl6
05:27 birdwindupbird joined #perl6
05:29 xinming joined #perl6
05:35 stepnem joined #perl6
05:41 overrosy joined #perl6
05:46 kaleem joined #perl6
05:53 birdwind1pbird joined #perl6
06:23 mdupont joined #perl6
06:26 birdwind1pbird joined #perl6
06:31 mdupont joined #perl6
06:46 wtw joined #perl6
06:46 libertyp1ime joined #perl6
06:48 libertyprime joined #perl6
06:52 overrosy joined #perl6
07:10 NamelessTee joined #perl6
07:16 awwaiid_ joined #perl6
07:16 birdwind1pbird joined #perl6
07:17 gfldex_ joined #perl6
07:32 kaleem joined #perl6
07:37 moritz \o
08:12 mj41 joined #perl6
08:33 shachaf_ joined #perl6
08:44 nightlord joined #perl6
08:52 odoacre_ joined #perl6
09:02 pernatiy joined #perl6
09:25 tadzik o/
09:29 moritz good morning tadzik. It's quiet here today.
09:29 tadzik a bit, yes
09:32 envi_ joined #perl6
09:42 eviltwin_b joined #perl6
09:43 am0c joined #perl6
09:43 jevin joined #perl6
09:47 masak good antenoon, #perl6
09:47 tadzik good afternoon masak
09:48 tadzik ...hey!
09:48 tadzik it's even morning
09:48 masak :P
09:48 masak not really.
09:48 geekosaur joined #perl6
09:48 tadzik impossibru
09:48 tadzik 10:48:58
09:49 tadzik where is thee if it's afternnon already?
10:00 masak now there's a bit of a semantic confusion here, I notice.
10:00 masak just because it's not morning anymore does not mean it has turned into afternoon.
10:00 masak maybe it does mean that in Polish. it sorta does in Swedish. it doesn't, as far as I know, in English.
10:01 masak the problem being, of course, that there's no real established word for "the time after morning but before noon".
10:01 masak but I'm pretty sure you can't say "good morning" when it's 11 o'clock.
10:01 masak ...and now I feel like Sheldon Cooper :P
10:02 tadzik in Polish you never say "dobre rano" or "dobre popołudnie". It's always "good day", or sometimes "dobry wieczór", when it's dark already
10:02 moritz ... unless you're a student. Then "good morning" works perfectly fine at 11am
10:02 tadzik yes
10:02 tadzik and breakfast on 1 PM is just fine
10:04 masak phenny: pl en "dobre rano, dobre popołudnie, dobry wieczór"?
10:04 phenny masak: "good morning , good afternoon, good evening" (pl to en, translate.google.com)
10:04 * masak thought so
10:04 masak phenny: eo en "rano"?
10:04 phenny masak: "frog" (eo to en, translate.google.com)
10:04 masak :P
10:04 tadzik :P
10:04 tadzik phenny: "poranek"?
10:04 phenny tadzik: "morning" (pl to en, translate.google.com)
10:04 tadzik that's less ambigous
10:05 masak "poranek" sounds cute.
10:05 moritz phenny: "vormittag"?
10:05 phenny moritz: "morning" (de to en, translate.google.com)
10:05 moritz eeks
10:05 masak moritz: there's the problem.
10:05 moritz aye
10:05 masak it's too inexact.
10:05 kaleem joined #perl6
10:05 tadzik masak: "poranek" sounds a bit like "after rano"
10:05 moritz antenoo describes t
10:05 moritz *it better
10:05 moritz but I guess that's not a common word in english, is it? :-)
10:06 moritz I mean, outside of #perl6 :-)
10:06 masak nope.
10:06 masak it just sounds good. :)
10:06 tadzik masak: the Dictionary of Polish Language describes "poranek" as "time just after the sunrise"
10:06 moritz only 40k hits on google
10:06 tadzik or rather "the beginning of the day, just after sunrise"
10:06 masak phenny: en pl "dawn"?
10:06 phenny masak: "świt" (en to pl, translate.google.com)
10:06 tadzik yeah, świt
10:07 tadzik oh wait
10:07 tadzik "świt" is actually "just before sunrise"
10:07 tadzik TIL
10:07 masak moritz: 40k ought to be good enough for any neologism :)
10:07 moritz curiously I've been in  police stop-and-search operation just past midnight, and they greeted me with "good morning"
10:08 masak maybe they were police students.
10:08 dakkar joined #perl6
10:09 masak dakkar: good morning.
10:09 moritz :-)
10:09 tadzik moritz: is it the same one I've seen?
10:09 daxim joined #perl6
10:10 dakkar masak: thank you, although I suspect your tab-key misdirected you salutation :)
10:10 masak dakkar: no, just experimenting with time-of-day greetings. but I sincerely meant the "good" part ;)
10:13 dakkar masak: thank you twice then :) and yes, it's morning here in London
10:18 moritz tadzik: no
10:19 felher good morning # /me is a student so he can say that :)
10:20 tadzik eek. If my HDD throws IO errors and hangs when I try to compile parrot, it's time to get a new one, right? :/
10:20 bonsaikitten yep
10:20 tadzik crap
10:22 masak also time to think about what sits on that HDD that you haven't backed up yet.
10:22 tadzik yeah, the answer is "like, all my life"
10:22 tadzik which is scary
10:23 tadzik it seems to hang only on writes
10:23 masak dakkar: in England in common speech, does it cease to be morning exactly at noon, or slightly before?
10:23 tadzik and please, don't say "so far"
10:23 bonsaikitten tadzik: welp, get new disk, restore from backups
10:23 masak tadzik: I don't have to. you know what to do.
10:24 tadzik yes. Which company produces nice SSDs?
10:25 geekosaur several
10:25 * geekosaur likes micron/crucial...
10:31 xinming joined #perl6
10:34 tadzik okay, I got a 120gb OCZ
10:34 * tadzik goes to the store for some dvds
10:34 dakkar masak: I'm not sure… I think it's fuzzy
10:37 masak :)
10:48 pmurias joined #perl6
10:52 masak this seems relevant: it's not just about improving the language, it's about lots of non-functional aspects that together provide the experience for the end user: http://blog.empathybox.com/post/19​126121307/scala-macros-oh-god-why
10:56 xinming joined #perl6
11:02 arnsholt masak: Yeah, I had a similar thought
11:03 arnsholt Certainly compiler speed and error messages and such are important, but macros are a very impressive/powerful feature
11:04 [Coke] masak: "good morning" at 11 is informal and ok. "good day" is proper. IME.
11:05 [Coke] ooh, we have someone on channel in London. sadly, probably still too far away for a visit in Leeds.
11:07 masak [Coke]: I once read a book about various Swedish-English cultural clash issues. a Swede saying "good morning" at 11 o'clock, thereby quietly shocking her British host, was one of the clashes.
11:07 [Coke] oh, british people are just crazy.
11:07 [Coke] True story.
11:07 colomon joined #perl6
11:07 tadzik :)
11:08 [Coke] As an American, an adopted New Yorker, former resident of the great (big) state of Texas... good morning at 11 am is fine with me.
11:09 mikec what? weird
11:10 mikec i'm fine with good morning as long as it's in daylight hours
11:10 [Coke] mikec: where are you at/from?
11:11 * [Coke] should clarify, not only is 11am good morning nice, it's a heckuva lot better than the 6:45 good morning I just got. ugh. why am I even UP now?
11:11 huf i've never noticed english speakers make the distinction between morning and pre-noon
11:11 huf dont even know what it'd be called ;)
11:11 mikec hehe
11:11 mikec england :)
11:12 huf my first language has this distinction so "morning" always felt strange tome
11:12 masak maybe there are two distinct usages of "good morning". one meaning being "oh hai, I just woke up" (possible at any time of the day), the other being "the sun is rising at my geographical location, and I think it's a pretty good sunrise".
11:12 mikec haha
11:12 huf i think "good morning" works at any time before noon, which i've always felt odd
11:12 mikec and at work "oh hai, this is the first time i've seen you today"
11:13 huf but this is just different mappings of concepts accross languages or something
11:13 masak mikec: surely if you happen upon a co-worker at 4 o'clock in the afternoon, you don't greet her with "good morning"?!
11:13 * [Coke] is often lazy and just says "mornin'. Afternoon."
11:13 [Coke] masak: if I did, she would certainly not be "quietly shocked".
11:13 mikec masak: i guess 4 is a bit too late
11:14 masak huf: there's a nice example of how Italian has a word meaning something between "a group of trees" and "a forest", which doesn't map nicely to many other languages.
11:14 huf masak: hungarian doesnt have a word for "frown"
11:15 huf which i wasnt aware of until i learned english...
11:15 masak neither does Swedish, I think.
11:15 masak phenny: en hu "frown"?
11:15 phenny masak: "homlokát ráncolja" (en to hu, translate.google.com)
11:15 masak phenny: en sv "frown"?
11:15 phenny masak: "frown" (en to sv, translate.google.com)
11:15 masak bogus translation.
11:15 huf the .hu translation isnt too bad, but it literally means "furrowed brows"
11:16 masak huf: also the fact that many languages (Italian, Russian, IIRC) consider "blue" and "light blue" to be distinct enough to have proper names. we think this is funny and quirky, but we have absolutely no problem with distinguishing "light brown" as "yellow".
11:16 masak huf: also, Hungarian is funny because it has two words for "red"!
11:16 huf :)
11:16 huf and even we dont know the logic :)
11:16 masak it's "pirosh", and... what, again?
11:17 huf piros and vo:ro:s
11:17 masak ah.
11:17 moritz masak: I've just read that scalar article you linked to. Very interesting for us indeed.
11:17 masak vörös?
11:17 huf yeah
11:17 masak huf: I know that one of them is used for color of hair and blood, and in general "natural" things. is that about right?
11:18 masak I'm pretty sure "piros" is for the traffic light color.
11:18 huf masak: well, flowers are natural and they're piros
11:18 masak dang. :)
11:18 huf but the earth is voros, and so's blood
11:18 masak oh, there's the mixup between red and brown, too.
11:18 huf the commie flag is voros, but the red in the current .hu flag is piros
11:18 huf no. logic. at. all. :D
11:19 moritz and I'm pretty sure that the topic that sjn++ and the other folks set for the Oslo hackathon aims at the same direction: we need to improve the whole Perl 6 experience, not just the language
11:19 szbalint vörös is slightly pinker than piros :)
11:19 huf pinker?
11:19 huf it's browner if anything
11:19 masak Mandarin calls brown sugar 红糖 ("red sugar")
11:19 szbalint darker maybe
11:19 szbalint hard to describe :)
11:20 huf but still, red soviet flag vs red white green flag
11:20 huf same color, different word
11:20 masak szbalint: that's because there is no distinction! arrgh! :)
11:20 szbalint masak: colours are hard
11:20 huf you can treat it as an irregular word that manifests differently depending on context :D
11:20 huf and then it's not two words, but one
11:21 szbalint huf: to frown = fancsali képet vág?
11:21 * masak is reminded of http://blog.xkcd.com/2010/0​5/03/color-survey-results/
11:21 arnsholt The words for colour are quite interesting. All languages have words for black and red, and there's a hierarchy of words after that
11:21 huf szbalint: that, or "lefele gorbul a szaja"? *shrug*
11:21 xinming joined #perl6
11:21 moritz arnsholt: you don't happen to know a good overview page for that?
11:21 arnsholt (For words that are properly colour-words, not words like orange, which describes the color of oranges)
11:21 huf arnsholt: what, some dont have "white"?
11:22 masak arnsholt: I hear the order is black/white scale, red (meaning just "color" at this point), blue&green, refinement.
11:22 * arnsholt goes digging for references
11:22 masak it'd be interesting to tie this to biological factors.
11:23 arnsholt Red is the colour we perceive the best, which has been suggested as an explanation
11:23 masak ooh: http://en.wikipedia.org/wiki/Disting​uishing_blue_from_green_in_language
11:24 huf i used to mix up blue and green for a while when i was little...
11:24 arnsholt Yeah, that fits with what I've read. If a language has a separate word for green, they also have blue
11:25 arnsholt Latin and (ancient) Greek for example has one word for blue/green
11:25 moritz huf: me too. I insisted that traffic lights were blue :-)
11:26 arnsholt http://en.wikipedia.org/wiki/Basic_Color​_Terms:_Their_Universality_and_Evolution is the paper I've been reading about
11:27 geekosaur there are some places where they are, or at least are visibly bluer than in other places
11:38 masak they're actually blue in Japan.
11:38 masak I recall there being some cultural reason for that, but I might be misremembering.
11:38 flussence .oO( this blue LED fad has gone *too far*! )
11:39 NamelessTee joined #perl6
11:40 jnthn good morning, #perl6
11:40 jnthn ;-)
11:42 tadzik hello jnthn
11:48 benabik joined #perl6
11:50 moritz oh hai jnthn
11:56 colomon \o
11:58 bbkr is anyone working on URI module resurrection on NOM?
11:59 tadzik o/
11:59 tadzik bbkr: doesn't it work?
12:01 bbkr no, it doesn't. and Perl without set of network modules is pretty much worthless :( i'm thinking about fixing this module if nooone else is working on it.
12:01 tadzik hmm
12:03 * tadzik has no machine to try to run it or fix it right now
12:03 tadzik star: use LWP::Simple
12:03 p6eval star 2012.01: OUTPUT«===SORRY!===␤Could not find LWP::Simple in any of: lib, /home/p6eval/.perl6/lib, /home/p6eval/rakudo-star-2012.01/install​/lib/parrot/3.11.0/languages/perl6/lib, .␤»
12:03 tadzik right
12:03 bbkr this is weird situation - we have awesome language with tons of awesome features and still there is no such basic thing as working HTTP::Request/Response available.
12:04 tadzik there's Bailador::Request/Response :)
12:04 tadzik and if winds will help, I hope to change that situation during GSoC
12:10 bbkr Baliador is PSGI based AFAIK, it is not the same as standalone control over requests and responses
12:10 bluescreen10 joined #perl6
12:11 moritz yes, we should have modules for cookies, request, response, URIs and so on
12:13 bbkr Maybe there should be grants for HTTP:: modules? Those are not core features, I'm aware of that. But without those Perl 6 won't gain popularity.
12:13 moritz I don't really think grants are the solution
12:14 tadzik bbkr: I have an idea for a web-oriented GSoC project, which should show off a bit "Perl 6 ready to do useful stuff"
12:15 moritz I think we have room for at least two such projects
12:15 moritz though it might require some coordination to detangle them in a useful way
12:16 * flussence still intends to implement a PHP-quality web framework for AFD :)
12:16 moritz maybe I should make a small checklist of stuff we should aim to have
12:16 moritz AFD?
12:16 bbkr nice, I'm willing to participate
12:16 tadzik sound like a plan
12:19 flussence moritz: http://irclog.perlgeek.de/​perl6/2012-03-08#i_5263231 :)
12:19 moritz ah
12:22 dalek mu: 107ae9e | moritz++ | misc/web-plan.txt:
12:22 dalek mu: rough plan for what modules we need for web development
12:22 dalek mu: review: https://github.com/perl6/mu/commit/107ae9efd0
12:22 moritz there you go. Feel free to add or edit stuff
12:23 moritz would also be nice to add some info about what we have, and how good and complete it is
12:25 sftp joined #perl6
12:30 sjn Q: Would it be meaningful to send a paper about Perl 6 to these guys here? http://www.dynamic-languages-sym​posium.org/dls-12/cfp/index.html
12:30 sjn give these guys a reason to put Perl (and most importantly, Perl 6) on their radar....
12:31 masak sure.
12:31 sjn pmichaud: This isn't too far from you, is it? :)
12:34 sjn maybe it would be worth spending a little time on jotting together someting for this at the hackathon?
12:34 sjn something*
12:36 M_o_C joined #perl6
12:37 dalek mu: 7f6d1c0 | tadzik++ | misc/web-plan.txt:
12:37 dalek mu: Update misc/web-plan.txt
12:37 dalek mu: review: https://github.com/perl6/mu/commit/7f6d1c0e5a
12:39 dalek mu: 8077dcc | tadzik++ | misc/web-plan.txt:
12:39 dalek mu: Add some info on URI
12:39 dalek mu: review: https://github.com/perl6/mu/commit/8077dccda6
12:39 mdupont joined #perl6
12:40 moritz does that mean that LWP::Simple doesn't work either?
12:41 sisar joined #perl6
12:42 tadzik yes
12:42 moritz eeks
12:42 tadzik or so says "State of modules on nom"
12:43 masak one thing that I've long wanted/planned/dreamt of for Perl 6, is CSS manipulation.
12:43 arnsholt masak: In what sense?
12:43 masak that is, the browser has certain rules for which bits of CSS to apply to which elements.
12:43 masak emulate that, and then enable various "refactorings", or finding dead bits of CSS, etc.
12:44 arnsholt So static analysis of HTML/CSS, in a way?
12:44 masak right.
12:44 masak operations such as "take this inline CSS and turn it into a CSS file with classes and IDs"
12:44 arnsholt Yeah, that might be cool
12:44 masak or "take these five CSS files and turn them into one optimized CSS file"
12:45 masak or just "show me what CSS selectors apply to this element".
12:45 masak I suspect this is outside of a web grant, though.
12:45 masak it'd just be a cool app to have.
12:45 arnsholt Certainly. It'd be a pretty significant undertaking, I think
12:46 flussence I tried writing a grammar based on the CSS3 syntax spec a long time ago... it scared me away pretty fast once I realised the spec wasn't quite sane
12:47 arnsholt What're the problems with it?
12:48 flussence from memory, I think I found statements contradicting each other and gave up then. It seemed to have a horrible equivalent of <.ws> too.
12:49 masak tadzik: Ratel is the low-end solution for HTML templating. Genshi/Hitomi (feel free to rename) is the more high-end one.
12:50 flussence (plus, rakudo was slow as molasses back then...)
12:50 masak tadzik: I believe having both is a good idea.
12:50 tadzik sure
12:50 tadzik it's just that only the low-end solution works for now :)
12:50 masak oh, that's a pity.
12:51 mtk joined #perl6
12:51 grondilu joined #perl6
12:52 masak but I guess I agree with the sentiment of starting from working stuff. :)
12:52 tadzik :)
12:52 grondilu perl6: package Foo { our multi bar { say "ok" } }; Foo::bar;
12:52 p6eval pugs b927740: OUTPUT«ok␤»
12:52 p6eval ..niecza v15-4-g1f35f89: OUTPUT«Potential difficulties:â�¤  &bar is declared but not used at /tmp/tSKejnuOxD line 1:â�¤------> [32mpackage Foo { our multi bar [33mâ��[31m{ say "ok" } }; Foo::bar;[0mâ�¤â�¤okâ�¤Â»
12:52 p6eval ..rakudo 34b7b1: OUTPUT«Could not find symbol 'Foo::&bar'␤  in block <anon> at /tmp/oy7NCa08PA:1␤␤»
12:53 grondilu please guys do something about this "our multi" thing.
12:58 masak grondilu: do you know if it's been RT'd?
12:58 masak a cursory search doesn't find it.
12:58 grondilu I'm pretty sure it was
12:59 grondilu I mean, last time I complained, someone said there was a ticket.
13:01 moritz yes, it's been RTed
13:01 masak ok, fine.
13:03 moritz r: package Foo { our proto bar(|$) { * }; multi bar { say 'ok' } }; Foo::bar
13:03 p6eval rakudo 34b7b1: OUTPUT«ok␤»
13:03 moritz easy enough to work around if you want
13:05 grondilu nom: sub contfrac($x) { gather { take my $a = $x.Int; take &?ROUTINE(1/($x - $a)) unless $x == $a } }; say contfrac(pi)[^5]
13:05 p6eval rakudo 34b7b1: OUTPUT«3 7 15 1 292␤»
13:05 grondilu this continuous fractions stuff is pretty neat :)
13:09 moritz fwiw I can easily see where the 'our multi' bug is coming from
13:09 moritz in Actions.pm method routine_def
13:09 grondilu can you fix it?
13:09 moritz there's a check for   if $*MULTINESS eq 'multi' {
13:10 moritz and the check for   if $*SCOPE eq 'our' happens only in the else-branch
13:11 moritz I fear I can't
13:11 moritz because I don't know the desired semantics
13:12 moritz consider
13:12 moritz proto a(|$) { * }; multi a(somesig) {  }; package Foo { our multi a() { } }
13:12 moritz what does that mean?
13:13 moritz one candidate of a multi is added to the package table, but the proto isn't?
13:13 moritz that kind of turns the proto and candidate relation upside down
13:13 masak interesting.
13:13 jnthn multis are never installed anywhere other than the dispatch list of a proto.
13:14 moritz so, what does that do?
13:14 moritz auto-gen a proto to be our'ed?
13:14 moritz (but not installed in the lexical scope?)
13:14 moritz I'd... rather forbid that case, and require you to use a proto with 'our'
13:14 grondilu perl6: package Foo { our proto bar { * }; our multi bar { say "ok" } }; Foo::bar;
13:14 p6eval pugs b927740, rakudo 34b7b1: OUTPUT«ok␤»
13:14 p6eval ..niecza v15-4-g1f35f89: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Two definitions found for symbol ::GLOBAL::Foo::&barâ�¤â�¤  first at ??? line 0â�¤  second at ??? line 0 at /tmp/bGKDT2d4Gm line 1:â�¤------> [32moo { our proto bar { * }; our multi bar [33mâ��[31m{ say "ok" } }; Foo::bar;[0mâ�¤â�¤Pote…
13:15 jnthn If it's gonna work, the auto-gen proto would get our scope, yeah
13:15 grondilu nom: package Foo { our proto bar(|$) { * }; our multi bar { say "ok" } }; Foo::bar;
13:15 p6eval rakudo 34b7b1: OUTPUT«ok␤»
13:15 grondilu I see
13:15 moritz I mean, we can make the case work where no outer proto is found
13:16 * grondilu didn't know a proto was assumed where declaring a multi
13:16 moritz you only ever call protos and only-subs when you write someting like a()
13:17 moritz and if it's a proto, the proto re-dispatches to one of the &a candidates
13:17 jnthn Note that our scope implies lexical installation also
13:18 jnthn So our multi ... need only mean "if you happen to auto-gen a proto because there's none already in this lexical scope, then also install it as our scope"
13:18 grondilu that would make sense
13:19 jnthn And if you're silly enough to do multi foo() { }; our multi foo($a) { }; then you won't get what you want at all, but tough luck.
13:19 jnthn Well, if you write that you don't know what you want. :)
13:19 moritz which is why I'd propose a helpful error message
13:19 grondilu I just want to use a sub with polymorphism, outside from its package
13:20 moritz then an 'our proto' is the safes approach
13:20 grondilu ok
13:21 jnthn moritz: Well, in that case we always forbid "our multi" consistently.
13:21 jnthn And if you want that, write an our proto
13:21 jnthn Then just "multi foo() ..."
13:21 jnthn In fact, scope declarators on individual candidates are pretty senseless anyway
13:21 jnthn So maybe we should just always complain. :)
13:22 moritz ok, I'll do that
13:22 moritz complaining is something I'm good at these days :-)
13:22 masak :P
13:22 benabik And if you want non-default scoping on the protos, declare the proto explicitly?
13:22 moritz correct
13:22 benabik What is the default scope on protos anyway?  my?
13:22 moritz yes
13:22 moritz just like ordinary subs
13:25 grondilu why is that by the way?  I think a default "our" would be nice.
13:26 moritz we don't nearly look as often into package tables as perl 5 did
13:26 moritz so you don't get much benefit from our-subs
13:26 moritz the cleaner approach is to explicitly import/export the subs to where you want them
13:26 grondilu but exporting messes up the local lexical scope. In Perl5, it is discouraged.
13:27 moritz erm, what?
13:27 moritz which lexical scope is messed up?
13:27 moritz oh, and we can do better than p5 at importing (at least in theory :-)
13:27 grondilu well, isn't there a motto saying:  "don't export anything" ?
13:27 moritz grondilu: no, the motto is just "don't export anything *BY DEFAULT*"
13:27 pernatiy joined #perl6
13:28 moritz we have to think about how much sense that makes in the context of p6
13:29 grondilu I just like to be explicit about where the routine I use come from.  If I have a foo function in a Bar package, I like to call it Bar::foo
13:29 moritz I guess currently we're a bit biased towards exporting too much stuff by default, simply because importing selectively doesn't work well yet
13:29 skids joined #perl6
13:31 masak grondilu: all you have to do to refer to it as Bar::foo is to mark the sub or proto as 'our'.
13:32 grondilu yeah I get it.  But I wish it was "our" by default.
13:33 grondilu In other words, I don't think strict encapsulation is necessary for packages.
13:33 benabik Then all your multis would be, essentially, public by default.
13:33 grondilu benabik: yes
13:34 benabik It's generally better to have the default be the safe option.  And having to explicitly mark what functions users can call is safer so internal functions don't accidentally get exposed.
13:34 benabik (IMNSHO)
13:35 grondilu I can understand that for classes.  But in my opinion packages should more "relaxed".
13:35 grondilu s/should/& be/
13:36 grondilu and doing so, P6 package would behave more like P5 packages.
13:37 moritz we want to avoid that kind of special-casing
13:38 benabik Packages can have internal functions too.  Thought should go into the external API, rather than just giving access to everything all the time.
13:38 benabik Maybe someone can add a `use our` or something to make that easy for you.  :-D
13:39 grondilu yes, or an adverbial form for declaring packages.
13:39 grondilu something like:  package Foo :visibility<public> { ... }
13:40 moritz package Foo { use default :scope<our>; ... }
13:40 grondilu yes
13:41 grondilu that would make me happy :)
13:41 dalek rakudo/forbid-our-multi: b4caaa4 | moritz++ | src/ (2 files):
13:41 dalek rakudo/forbid-our-multi: forbid scopes on individual multi candidates
13:41 dalek rakudo/forbid-our-multi: review: https://github.com/rakudo/rakudo/commit/b4caaa41fe
13:43 grondilu nom: package Foo { use default :scope<our>; sub talk { say "hello" }; Foo::talk;
13:43 p6eval rakudo 34b7b1: OUTPUT«===SORRY!===␤arglist case of use not yet implemented. Sorry. ␤at /tmp/amyc_tetyb:1␤»
13:44 grondilu perl6: package Foo { use default :scope<our>; sub talk { say "hello" } }; Foo::talk;
13:44 p6eval rakudo 34b7b1: OUTPUT«===SORRY!===␤arglist case of use not yet implemented. Sorry. ␤at /tmp/bNj8eTfoh9:1␤»
13:44 p6eval ..pugs b927740: OUTPUT«pugs: *** No such subroutine: "&require_default"␤    at /tmp/GP55fv07eq line 1, column 1␤»
13:44 p6eval ..niecza v15-4-g1f35f89: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤'use' with arguments NYI at /tmp/BTVRHZtVAA line 1:â�¤------> [32mpackage Foo { use default :scope<our>[33mâ��[31m; sub talk { say "hello" } }; Foo::talk;[0mâ�¤â�¤Potential difficulties:â�¤  &talk is declared but not used at /tmp/B…
13:44 moritz nope, was pure speculation on my part
13:44 grondilu ok, I was not sure
13:48 felher "forbid scopes on individual multi candidates"? Does that mean one won't be able to do someting like ' sub do-something { my postfix:<!>(MyStrangeRepresentationOfInt $a) { .... }; more code }' anymore, because postfix:<!> is a multi and i have my-scope on that special multi-candidate?
13:48 benabik Hm.
13:48 nnunley joined #perl6
13:48 benabik Is there a way to create a new proto that includes all the protos from another version of itself?
13:48 simcop2387 joined #perl6
13:50 * felher better backlogs in case he just missed something and got "forbid ..." totally out of context :)
13:54 moritz felher: no, first your postfix isn't a multi, and second 'my' is still allowed
13:55 felher moritz: it should be a multi. I just forgot it ;). But since my is still allowed i'm happy in any case :)
13:55 felher moritz: thanks :)
13:55 masak felher: you must do either 'my sub' or 'my multi'.
13:55 moritz or 'my multi sub' :-)
13:56 masak yeah, but don't do that ;)
13:56 masak save the long form for 'multi method'.
13:57 snearch joined #perl6
13:57 felher yeah, i wanted to write 'my multi postfix...' :) And i forgot that there is no facultiy-postfix-operators already defined ... :)
14:01 jlaire jaa
14:01 jlaire no onneks zeikkokaan ei oo hereillä
14:02 masak no, onneksi.
14:02 masak jlaire: ww?
14:02 moritz phenny: "no onneks zeikkokaan ei oo hereillä"?
14:02 phenny moritz: "Luckily no zeikkokaan not oo awake" (fi to en, translate.google.com)
14:04 jlaire masak: thanks...
14:04 dalek rakudo/nom: b4caaa4 | moritz++ | src/ (2 files):
14:04 dalek rakudo/nom: forbid scopes on individual multi candidates
14:04 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/b4caaa41fe
14:05 jlaire "well, fortunately zeikko's not awake either"
14:07 kaleem joined #perl6
14:08 dalek roast: eb6edd6 | moritz++ | S32-exceptions/misc.t:
14:08 dalek roast: test X::Declaration::Scope::Multi
14:08 dalek roast: review: https://github.com/perl6/roast/commit/eb6edd6494
14:09 masak the details around this stray phrase, the true identity of zeikko, and the significance of being awake or asleep, are all such that leaving them unspecified only heightens the mystery and intrigue.
14:09 moritz it reminds me a bit of https://en.wikipedia.org/wiki/Carthago_delenda_est
14:10 masak maybe we should rename the END phaser to FINNISH? :P
14:10 bluescreen10 joined #perl6
14:10 tadzik what does a Nordic Funeral and Mortal Combat have in common?
14:10 masak som pun, most likely.
14:10 tadzik Finnish Hymn!
14:10 masak some^
14:10 * masak groans
14:11 masak I'm Nordic but not Finnish, you insensitive clod! :)
14:11 tadzik :)
14:11 jlaire oh my, what have i started
14:12 jlaire opening irc <10s after waking up considered harmful
14:12 moritz jlaire: happens to all of us (starting... stuff)
14:12 benabik s/\<10s after waking up //
14:12 jlaire heh
14:12 moritz just search for 'tsm' in the recent-ish IRC logs :-)
14:13 masak oh my :)
14:19 kaleem joined #perl6
14:35 fsergot joined #perl6
14:39 masak unfortunately, you can't search for 'tsm' with the built-in search function in the IRC logs, due to the three-char limit.
14:39 fsergot hi #perl6 o/
14:39 masak using Google works fine, though.
14:39 masak fsergot! \o/
14:39 xenu joined #perl6
14:39 tadzik hello fsergot
14:50 PacoAir joined #perl6
14:53 NamelessTee joined #perl6
14:56 jnthn Time to go spend O(16 hours) flying (along with O(5 hours) in airports)...back in...at least 24 hours I guess :)
14:56 mikec have fun!
14:58 jnthn o/
15:01 masak have a nice, appropriately offline vacation :)
15:02 sisar re http://rosettacode.org/wik​i/Balanced_brackets#Perl_6, the generated bracket sequence isalways supposed to be well-balanced, or it might produce unbalanced as well ?
15:04 sisar (coz i'm getting only well-balanced ones)
15:05 sisar (the Depth counter solution)
15:05 masak sisar: I think part of the assumption of "balanced brackets" is that they be balanced.
15:06 masak hence the "balanced".
15:06 sisar masak: well, the task description says generate an arbitrary sequence & then check if it is balanced or not
15:07 masak oh!
15:07 masak so it does.
15:08 benabik Does xx thunk the LHS?  if so, it could be <[ ]>.pick(1) xx $n instead
15:08 benabik r: <[ ]>.pick(1) xx 3
15:08 p6eval rakudo b4caaa:  ( no output )
15:08 benabik r: say <[ ]>.pick(1) xx 3
15:08 p6eval rakudo b4caaa: OUTPUT«[ ] [␤»
15:08 benabik r: say <[ ]>.pick(1) xx 10
15:08 p6eval rakudo b4caaa: OUTPUT«] [ [ [ ] [ [ ] ] [␤»
15:08 benabik \o/
15:08 timotimo oh that's cute
15:08 benabik Oh, probably want a .join on there too
15:09 masak or just .roll(10).join
15:09 benabik You might want to explain the generator first, separate from the checks.
15:09 benabik Oh, hey, that's easier.
15:09 benabik r: say <[ ]>.roll(10).join
15:09 p6eval rakudo b4caaa: OUTPUT«[[[[[][[[]␤»
15:10 masak but the problem description says to generate as many [s as ]s
15:10 masak not that it matters much -- it's just an optimization, since these are the only ones that'll ever have a chance to be balanced.
15:10 benabik Hm.  Oh, the current one should do that.  It shouldn't always be balanced though.
15:11 tokuhiro_ joined #perl6
15:11 benabik r: say <[ ]> xx 5).pick(*).join for ^5
15:11 p6eval rakudo b4caaa: OUTPUT«===SORRY!===␤Confused␤at /tmp/Pn3Tn5pXcw:1␤»
15:11 masak it won't always be balanced just because opening and closing brackets are the same amount.
15:11 masak e.g. ]]]]][[[[[
15:11 benabik r: say (<[ ]> xx 5).pick(*).join for ^5
15:11 p6eval rakudo b4caaa: OUTPUT«[][][][][]␤[][][][][]␤[][​][][][]␤[][][][][]␤[][][][][]␤»
15:11 benabik r: say (<[ ]> xx 5).flat.pick(*).join for ^5
15:11 p6eval rakudo b4caaa: OUTPUT«[]]]][[[[]␤]]][[[][][␤]][​[[][][]␤][[]]]][[[␤[][[[]][]]␤»
15:12 masak yeah, rakudobug.
15:12 masak a known one.
15:12 benabik n: say (<[ ]> xx 5).pick(*).join for ^5
15:12 p6eval niecza v15-4-g1f35f89: OUTPUT«]][[][][[]␤]][][[[]][␤[[]​][[]][]␤][]]][[][[␤][[]]][[][␤»
15:12 benabik niecza++
15:13 VZ_ joined #perl6
15:14 moritz r: say <[ ]>.pick xx 5
15:14 p6eval rakudo b4caaa: OUTPUT«] [ [ ] ]␤»
15:14 masak heh, seems I created that "Balanced brackets" page over a year ago. I can't believe I've been obsessed with balanced-bracket strings since February 2011. :)
15:15 masak also, the article now has 54 languages -- that's pretty cool.
15:15 sisar am i so lucky? https://gist.github.com/2044727, all tries resulted in balanced-brackets !
15:15 sisar masak++
15:16 sisar .oO (you forgot your own task definition ? )
15:16 benabik sisar: It's a rakudobug.  It's selecting a random [] pair instead of a random bracket from the pair.  See the different between rakudo and niecza above.
15:16 benabik sisar: You can add a .flat to make rakudo behave.
15:16 masak sisar: seems I forgot my own task definition, yes. it's not the important bit of the task :)
15:16 sisar banabik: oh. thanks.
15:17 sisar masak: :)
15:18 VZ_ left #perl6
15:20 bluescreen10 joined #perl6
15:44 sudokode joined #perl6
15:45 Psyche^ joined #perl6
15:49 kaare_ joined #perl6
16:09 TimToady 'use default' strikes me as an extremely poor name for a pragma
16:10 TimToady pragmas should generally name the thing they're modifying
16:11 benabik use scope :our<sub multi>
16:11 TimToady much improved, though still a bit strange
16:12 TimToady your arg is kinda inside out
16:12 benabik I wanted it to read like "our sub" and "our multi"
16:12 TimToady scope -> multi -> our   is the natural order
16:12 benabik Logically, I suppose it could go the other way 'round.  *shrug*
16:12 TimToady or multi -> scope -> our
16:13 [Coke] TimToady: yes, that one.
16:13 [Coke] use multi :scope<our>
16:14 havenn joined #perl6
16:14 TimToady pragmas is one of those areas where people often settle on the first thing that pops into their heads without thinking whether there's a better option
16:15 TimToady dunno why, something psycho(il)logical
16:16 masak seems a pretty widespread problem in the design of anything software-y.
16:16 masak "anchoring" to the first design/idea/model that comes to mind.
16:17 TimToady yes, but in this case, people don't think of it as OO, I suspect
16:17 TimToady use object :attribute(value)
16:18 TimToady that's how I've been trying to think of it lately, now that I put it into words
16:18 TimToady where "object" might just be some langauge abstraction, but it needs to be the right abstraction
16:18 TimToady not too general, not too specific
16:20 TimToady 'use default' broke the pointer on my specificity gauge
16:20 benabik No reason why it can't be both `use scope` and `use multi :scope`.  The first is more useful to modify many scopes, the second more useful to modify many facts about multis.
16:20 TimToady well, 'scope' is also terriby overgeneral
16:20 TimToady *bly
16:21 geekosaur there is a mindset which sees pragmas as similar to monkey patching and thereby sees no reason to make the logical or hygienic
16:22 TimToady which is, of course, not a good approach to monkey patching either
16:22 masak TimToady: interesting, 'use object :attribute(value)' looks like an RDF triplet
16:23 geekosaur it's not, but there *is* a certain "I'm already breaking the rules, why not?" thing going on in many people's minds
16:23 geekosaur (general psychological thing, I know of various things to try to control it in, hm, other contexts)
16:23 TimToady "Here's a messy room, so I can make it messier." vs "Here's a messy room, maybe I can tidy up a bit."
16:25 geekosaur "nobody'll notice a little more mess"
16:25 TimToady I will admit to being in the first category by inclination, but in the second by choice.
16:26 geekosaur like I said, it's a psychological thing.  traps a lot of people in a lot of circumstances
16:27 geekosaur it *shouldn't* be that way, but it's what actually happens in many cases
16:27 TimToady it even traps language designers from time to time, but sometimes they get better, or at least want to get better :)
16:28 TimToady P6 New Year's Resolution: A place for everything, and everything in its place...
16:28 geekosaur (so what's C++'s excuse?)
16:28 TimToady insufficient laziness
16:29 TimToady the willingness to learn to think like the computer, instead of teaching the computer to think like a person
16:29 * geekosaur ... officially Does Not Like C++ templates
16:30 TimToady but seriously, this was one of the overarching metagoals of the P6 redesign: Hang everything on the right peg, and if there isn't a peg, invent one.
16:30 TimToady twigils are a new peg
16:31 TimToady protos are a new peg
16:31 TimToady lexical pegs are much stronger
16:31 TimToady syntactic categories are new pegs
16:32 TimToady new pegs make new namespaces, and often those names should be thought of as objects in their own right
16:33 TimToady maybe not twigils, but certainly some of the others
16:35 masak I hear this peg metaphor now and then, and I like it.
16:35 masak I realize I haven't given much thought to how it applies to Perl 5, though.
16:35 masak what are some wrong pegs (or non-pegs) that Perl 5 hangs (or doesn't hang) things on?
16:36 doy the whole perl5 object system
16:36 timotimo hm, there is a way to use a different grammar for a block, right? in what synopsis or under what keyword would i have to look for that? it's not in the grammars section of s05 at least
16:36 geekosaur prototypes?  IO syntax?
16:36 masak I can think of one offhand: the "variable will not stay shared warning". Perl 6 doesn't have that one.
16:36 doy prototypes is another, yeah
16:37 masak timotimo: it's never been fully spec'd, I fear. probably something to do with slangs.
16:37 masak timotimo: S02 has some wording about slangs.
16:37 masak std: augment slang Regex {}
16:37 p6eval std 1ad3292: OUTPUT«ok 00:01 108m␤»
16:38 timotimo yeah, it's pretty short
16:38 timotimo could i write a grammar for JSON and do something like my $result = { use MYJSON; [1, 2, 3, 4] }; or something of that sort?
16:39 timotimo essentially the same as my $result = MYJSON.parse("[1, 2, 3, 4]") i'd think
16:40 masak it would require the change of $~MAIN slang to be exported from the MYJSON model out to the calling block.
16:40 timotimo what i'm interested in is 1) get rid of the data as a string, 2.) lift the compiling to actual compile time without having to write a BEGIN block
16:40 masak I don't know of a mechanism for that, but that doesn't mean it's not, or won't ever be, possible.
16:41 timotimo i suppose it's just a bit of food for thought for now then?
16:41 masak well, it's a wishlist feature that comes up now and then.
16:42 masak I really hope it ends up being implemented.
16:42 timotimo ah, of course i wouldn't be the first to come up with that :)
16:45 flussence .oO( module MYJSON { multi sub infix:<:>(Str $key, Any $value) is export { $key => $value }; } )
16:45 tadzik a macro may be better :)
16:46 masak I just found http://norvig.com/lispy.html and I think it's great. probably others here will like it, too.
16:47 timotimo flussence: of course a json grammar/parser is so close to perl itself, that it's not hard to whip up something like that - in my case, i'd have a self-made language-like thingie that i'd like to parse
16:49 flussence I imagine it'd be as straightforward as getting "use v5;" to parse correctly, assuming the grammar part is already done
16:57 sftp_ joined #perl6
16:58 * masak decommutes
17:05 bluescreen10 joined #perl6
17:19 gfldex another nice article about programming programming: http://tagide.com/blog/2012/03/re​search-in-programming-languages/
17:24 bluescreen10 joined #perl6
17:27 MayDaniel joined #perl6
17:32 mdupont joined #perl6
17:41 kaleem joined #perl6
17:42 fglock joined #perl6
18:00 havenn joined #perl6
18:18 Chillance joined #perl6
18:29 buubot_backup joined #perl6
18:48 cbk1090 joined #perl6
18:49 birdwindupbird joined #perl6
18:57 pernatiy joined #perl6
19:09 birdwindupbird joined #perl6
19:29 tokuhiro_ joined #perl6
19:30 tokuhiro_ joined #perl6
19:30 havenn joined #perl6
19:30 cbk1090 joined #perl6
19:40 mj41 joined #perl6
19:50 masak oh, crap, did I do the blog-post-from-the-future thing again? :(
19:50 masak I'm terribly sorry.
19:50 masak that's first on the list of things to fix, by the way.
19:52 benabik huh?
19:52 eternaleye joined #perl6
19:52 eternaleye joined #perl6
20:00 masak benabik: apparently, I made the publishing date of http://strangelyconsistent.​org/blog/t3-addition-chains 2012-*04*-14 :/
20:00 masak which means it'll linger for one month at the top of Planet Perl 6...
20:00 benabik Hey, free self-promotion!
20:01 benabik It's not a bug, it's a feature.
20:01 [Coke] it's not a bug, it's a future.
20:01 tadzik :)
20:01 benabik Coke++
20:01 moritz :-)
20:01 TimToady all you have to do is pretend it was an accident, and we won't think ill of you
20:01 moritz masak: just fix the date, planetsix will pick up the new date eventually, I think
20:02 moritz fwiw my blog platform doesn't publish posts from the future
20:02 moritz it's a nice method to do timed publications
20:03 TimToady if all your publishees live in the same timezone...
20:03 moritz well, yes
20:04 moritz but it's all UNIX timestamps anyway
20:04 masak moritz: hm, yes. adding a check/die for posts from the future would be a very reasonable first step, that I can do now, even.
20:06 masak jlaire: "optimaztion" typo fixed. thank you. jlaire++
20:07 jlaire hehe
20:08 ksi joined #perl6
20:12 masak er, I mean "En ollut hereillä, kun kerroit minulle, mutta onneksi olen hereillä noe." :)
20:13 masak s/ noe//
20:16 birdwindupbird joined #perl6
20:37 arnsholt phenny: "En ollut hereillä, kun kerroit minulle, mutta onneksi olen hereillä noe."?
20:37 phenny arnsholt: "I was not awake when you told me , but fortunately I'm awake noe ." (fi to en, translate.google.com)
20:50 masak the "noe" was a typo of "now", which apparently disappears in translation when spelled correctly.
20:51 masak also, the whole thing was a pastiche of jlaire's ww utterance from earlier today ;)
20:51 jlaire oh, my
20:52 jlaire btw, "now" is "nyt"
20:52 jlaire masak: perfect grammar :)
20:52 * masak does a high-five with Google Translate
20:52 jlaire and "no, onneksi" was a disturbingly natural response
20:52 masak language. it's so simple!
21:00 havenn joined #perl6
21:03 mikemol I think I want to steal Addition Chains as an RC task.
21:03 arnsholt masak: Indeed. All you need is a mirror of the internet and piles of computers =D
21:04 moritz mikemol: then you'll showcase different algorithms, not how the same algorithm is implemented in different languages
21:04 mikemol moritz: Have you seen FizzBuzz?
21:05 moritz mikemol: I probably have, but it's too long ago to remember
21:05 mikemol Anyway, that's not really a problem. Sometimes, the point is more the solution and less how you get there. This lets different paradigms show how they'd reach the same ends, but with different ways of thinking.
21:06 jlaire if someone implemented a complicated algorithm for addition chains, ruby/python folk would point and say how much shorter their brute-force is
21:06 jlaire in fizzbuzz there's no easy/slow vs. complex/fast solutions, they all work
21:07 mikemol jlaire: I've seen a number of people point to RC tasks and crow about either speed or size. When I see it, I reply and point out that that's not the point.
21:08 mikemol If RC users had a focus on example length, we'd have more problems with code golf than we already do. We have less now than we've had in the past, too.
21:08 jlaire yeah, I guess it's not a problem really
21:09 mikemol Though I did see one superb example of a golfer's language. If given the name of an RC task, it performed the goal of the RC task. Otherwise, it behaved as (I think) C.
21:09 jlaire heh
21:12 masak I'd still like to see a Perl 6 translation of Knuth's http://www-cs-faculty.stanford.e​du/~knuth/programs/strongchain.w
21:12 masak whoever translates it can make a great blog post, too ;)
21:12 cbk1090 what do you mean when you all talk about code golf?
21:12 jlaire is there an explanation of that somewhere?
21:12 jlaire I don't like reading .w
21:13 mikemol cbk1090: In golf, the person with the lowest score (number of putts) at the end of the course wins. In code golf, it's number of lines of code.
21:13 jlaire I just implemented Knuth's Dancing Links for a sudoku solver :)
21:13 jlaire (not in Perl 6, though)
21:13 masak cbk1090: we mean "to shorten code as much as possible".
21:13 cbk1090 ok go it
21:13 masak jlaire: I have C/Perl 5/Perl 6 implementations of DLX.
21:13 jlaire mikemol: or even number of characters, usually
21:13 cbk1090 totally understand now!
21:14 masak jlaire: I have no big problem reading .w -- 'course, it's prettier when rendered as TeX output :)
21:14 mikemol jlaire: Don't make me pull out UTF-7 and go number-of-bytes on you. :)
21:14 jlaire :P
21:14 jlaire masak: I guess. maybe I'll give it a try
21:14 mikemol Hm. Actually, I'd have to back UTF-7 with some kind of packing.
21:15 moritz n
21:15 benabik UTF-7?
21:16 moritz from the bad old days
21:16 mikemol Just read about it today. Encoding for Unicode for 7-bit safe environments.
21:16 mikemol https://en.wikipedia.org/wiki/UTF-7
21:16 moritz or more accurately, 8-bit unsafe environments :-)
21:16 benabik And what format is knuth using there?  Looks vaguely like TeX?
21:17 mikemol moritz: My boss and I are in a back and forth about the terminology. Has me all confused. :(
21:17 benabik I'm applying for PhD programs and #perl6 keeps making me feel dumb.  :-/
21:17 jlaire benabik: CWEB
21:17 moritz benabik: never mind. I'm also doing my PhD right now, and often feel dumb around here
21:17 jlaire almost nobody uses it, except Knuth himself
21:18 benabik Oh, that thing.
21:18 skipper joined #perl6
21:18 alester joined #perl6
21:18 arnsholt benabik: I'm doing a PhD as well, and in the same position =)
21:18 lichtkind joined #perl6
21:18 benabik Well, we can all be dumb together!
21:19 masak I'd rather be the dumbest one on #perl6, than the smartest one on almost any other channel.
21:21 benabik Thanks for info, peoples.  I'm off.
21:22 cbk1090 Can someone help me with a perl6 grammar?  I'm trying to make one for data that looks like this: Agoura Hills* 8.750% Los Angeles
21:23 cbk1090 I'm having problems with the city name if it is two or more words
21:24 masak it's not clear to me what the structure of your data is.
21:24 masak two words, an asterisk, a percentage, and two more words? :)
21:24 masak feel free to use http://gist.github.com/ at any point to illustrate your point in two dimensions.
21:25 cbk1090 the city name can be none or more words
21:25 masak what does the asterisk do?
21:25 cbk1090 it is for incorprated citys
21:25 cbk1090 not allways present for every city
21:26 cbk1090 this is what I have for city name so far..
21:26 cbk1090 token city{ \w+  [\( \w+ \)]* [\*]*  }
21:26 masak you're assuming that you'll get whitespace for free.
21:26 masak that's why it isn't working for you.
21:27 masak 'token' doesn't have implicit whitespace. 'rule' does.
21:29 masak r: say so "Agoura Hills* 8.750% Los Angeles" ~~ /^ (\w+ [\h+ \w+]*) '*'? \h+ (\d+\.\d+\%) \h+ (\w+ [\h+ \w+]*) $/
21:29 p6eval rakudo b4caaa: OUTPUT«True␤»
21:30 masak r: "Agoura Hills* 8.750% Los Angeles" ~~ /^ (\w+ [\h+ \w+]*) '*'? \h+ (\d+\.\d+\%) \h+ (\w+ [\h+ \w+]*) $/; say $/[0 .. 2]
21:30 p6eval rakudo b4caaa: OUTPUT«=> <Agoura Hills>␤ => <8.750%>␤ => <Los Angeles>␤␤»
21:30 cbk1090 here is my full regex: git://gist.github.com/2047102.git
21:30 * masak looks
21:31 lichtkind done my daily duties
21:31 masak cbk1090: pro tip: develop grammars with tests.
21:31 masak cbk1090: otherwise, it's far too easy to backslide on some features.
21:32 cbk1090 masak, when I'm a pro and understand the basics I look into that
21:32 cbk1090 I don't even know what grammar test are.
21:32 masak they're regular 'use Test' tests that target your grammar.
21:34 cbk1090 Sorry masak, that is still well beyond my knowlage of perl6
21:34 cbk1090 if I can't find an useable example on the internets then I don't use it.
21:35 cbk1090 really wish there was a "Learning Perl6" book out allready!
21:35 masak I feel inclined to help you learn how to write a grammar with tests.
21:35 tadzik how do you find the "Using Perl 6" book?
21:35 havenn joined #perl6
21:35 masak cbk1090: if you give me 15 minutes, I'll put together a gist for you.
21:36 cbk1090 masak, okay
21:36 cbk1090 tadzik, IMHO, I don't like it.
21:36 cbk1090 needs more basic examples
21:36 masak do go on.
21:37 masak I've heard that criticism before, I'm genuinely interested.
21:37 masak not least because I believe it's correct.
21:37 cbk1090 I don't care for the JASON example
21:37 masak heh :)
21:37 masak no, it's too big a leap from nothing.
21:38 cbk1090 I have the Programming Perl 3rd edition and Learning Perl
21:38 cbk1090 both GREAT books.
21:38 cbk1090 the Perl6 and Parrot essentials is lacking and way dated
21:39 moritz that's why we're working on UP6
21:39 cbk1090 sorry s/JASON/JSON/
21:40 moritz did you read the chapter on regexes before reading the one about grammars?
21:40 cbk1090 yes
21:40 moritz ok
21:41 cbk1090 most of the grammars/regexes I get working are by me doing trial and error processes to see what works.
21:41 masak that's what we all do.
21:41 masak but tests help.
21:41 masak example forthcoming.
21:42 cbk1090 masak, okay
21:42 cbk1090 I would say chapters 3,4,and 5 are good.  still would like to see more examples
21:44 cbk1090 like the using $userInput.Int to change a user input from prompt into an Int.  I learned that the other day here in #perl6.  MADE my life soooo much easier!!
21:50 masak cbk1090: here you go -- https://gist.github.com/2047217
21:50 masak heh, and it took exactly 15 minutes to make :P
21:51 cbk1090 ok I'll take a look at it...
21:54 cbk1090 masak, so the test is this part: ok cityTaxData.parse('Agoura Hills* 8.750% Los Angeles');
21:54 cbk1090 and is test built into Rakudo Star?
21:55 masak they're made available through Test.pm, which comes with Rakudo the compiler.
21:56 masak in fact, Rakudo itself uses Test.pm extensively to run the spectests.
21:56 y3llow joined #perl6
21:56 bruges joined #perl6
21:56 cbk1090 ok I'll try this out...
21:58 y3llow joined #perl6
21:59 cbk1090 so I get 2 lines of output: "ok 1 -" and "ok 2 -"
21:59 masak for the last one? yes.
22:00 masak each ok() call either emits "ok" or "not ok", and then the test number and an optional test description.
22:00 cbk1090 yes on your last example.
22:01 masak the important thing isn't the last example, but more the process of getting there.
22:01 masak the tests drive the coding.
22:01 y3llow joined #perl6
22:02 cbk1090 masak, right I got that part
22:03 y3llow joined #perl6
22:04 cbk1090 masak, how do you set the test description?
22:04 masak just pass a second argument to ok()
22:04 masak or, if you're using is(), a third argument. (since with is() you're testing whether arg1 eq arg2)
22:07 cbk1090 masak, This is the type of stuff that needs to be put into the UsingPerl6 book
22:07 masak agree.
22:08 masak I'll see what I can do.
22:10 cbk1090 Thanks masak I have a new toy to play with....
22:10 cbk1090 masak++
22:10 * masak kowtows
22:21 localhost joined #perl6
22:29 lichtkind is the a method alias of S metaop?
22:30 NamelessTee joined #perl6
22:30 masak good question.
22:31 tadzik masak++ # a helpy hand
22:31 masak it feels like the S metaop is somehow too weird to be captured by a method.
22:31 skids joined #perl6
22:31 broquaint joined #perl6
22:32 * lichtkind found none in s03
22:35 masak well, the problem is, something like [+] or R+ simply wraps around the + without changing its behavior.
22:35 masak whereas S+ actually reaches into the op and changes its behavior.
22:36 masak bad example. take S&& instead.
22:37 masak but maybe I'm wrong. maybe there's a way to write such a method.
22:37 masak someone, prove me wrong. :)
22:41 ApHeX3211 joined #perl6
22:43 bacek_at_work joined #perl6
22:49 preflex joined #perl6
22:49 gfldex std: package P { multi sub new(Int $i){}; multi sub new(Int $i, Int $j){}; }; my $foo = P::new(1,2);
22:49 p6eval std 1ad3292: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Undeclared name:â�¤    'P::new' used at line 1â�¤Potential difficulties:â�¤  $i is declared but not used at /tmp/rz2CoSLaSb line 1:â�¤------> [32mpackage P { multi sub new(Int [33mâ��[31m$i){}; multi sub new(Int $i, Int $j){}; [0mâ�¤  $j is declar…
22:50 gfldex nom: package P { multi sub new(Int $i){}; multi sub new(Int $i, Int $j){}; }; my $foo = P::new(1,2);
22:50 p6eval rakudo b4caaa: OUTPUT«Could not find symbol 'P::&new'␤  in block <anon> at /tmp/1ry8BsCEo6:1␤␤»
22:50 gfldex nom: package P { multi sub newton(Int $i){}; multi sub newton(Int $i, Int $j){}; }; my $foo = P::newton(1,2);
22:51 p6eval rakudo b4caaa: OUTPUT«Could not find symbol 'P::&newton'␤  in block <anon> at /tmp/bFnIfTGYvz:1␤␤»
22:51 gfldex am i doing something unreasonable?
22:51 masak gfldex: you're expecting symbols to show up in the package namespace, but you're not declaring them with 'our'.
22:52 masak gfldex: also, it looks like you're playing OO with packages, which may or may not be unreasonable.
22:53 whiteknight joined #perl6
22:53 gfldex nom: package P { our multi sub newton(Int $i){}; our multi sub newton(Int $i, Int $j){}; }; my $foo = P::newton(1,2);
22:53 p6eval rakudo b4caaa: OUTPUT«===SORRY!===␤Cannot use 'our' with individual multi candidates. Please declare an our-scoped proto instead␤at /tmp/pm2zsSAcfo:1␤»
22:54 gfldex it is very well possible that i'm trying to be clever :)
22:54 gfldex lets see how that works out
22:57 * masak .oO( and that was the last anyone ever heard of gfldex... )
22:57 * gfldex goes x.x
22:58 masak oh no come back I didn't mean it
22:59 gfldex nom: sub postfix:<x.x> (Str $who) { die "$who has died. :(" }; # <-- die-operator
22:59 p6eval rakudo b4caaa:  ( no output )
23:00 masak how macabre.
23:00 gfldex given i just defined it from bejond my grave, i would say so
23:05 ascrazy joined #perl6
23:08 lichtkind allright did some fine fixes for today
23:09 masak lichtkind++
23:14 lichtkind masak: had some pretty ugly things like comparsion and others
23:14 lichtkind try to day dayly a bit for perl 6
23:19 masak yeah.
23:19 masak ...comparison is ugly?
23:25 masak 'night, #perl6
23:30 felher o
23:30 felher o/

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

Perl 6 | Reference Documentation | Rakudo | Niecza | Specs