Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2011-02-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:11 molaf_ joined #perl6
00:12 molaf left #perl6
00:15 MayDaniel left #perl6
00:17 arlinius joined #perl6
00:30 fhelmberger joined #perl6
00:35 baest_ joined #perl6
00:36 coldhead` joined #perl6
00:36 kolibrie_ joined #perl6
00:39 coldhead left #perl6
00:39 baest left #perl6
00:39 kolibrie left #perl6
00:39 literal left #perl6
00:39 literal joined #perl6
00:48 hanekomu_ left #perl6
00:49 jaldhar joined #perl6
00:51 sji left #perl6
00:54 nsh_ left #perl6
00:55 nsh joined #perl6
01:24 tty234 joined #perl6
01:34 aindilis left #perl6
01:55 jaldhar left #perl6
01:55 jaldhar joined #perl6
01:58 jferrero left #perl6
02:00 noganex_ joined #perl6
02:03 noganex left #perl6
02:04 lopaway is now known as lopnor
02:07 HarryS left #perl6
02:23 rhr left #perl6
02:25 rhr joined #perl6
02:43 cdarroch left #perl6
02:44 whiteknight left #perl6
03:14 leprevost joined #perl6
03:18 HarryS joined #perl6
03:30 BinGOs left #perl6
03:30 BinGOs joined #perl6
03:37 donri joined #perl6
03:45 Khisanth left #perl6
04:06 envi joined #perl6
04:21 nymacro joined #perl6
04:21 mtk left #perl6
04:23 Su-Shee_ joined #perl6
04:26 JimmyZ joined #perl6
04:27 Su-Shee left #perl6
04:29 mtk joined #perl6
04:41 nymacro left #perl6
04:45 GinoMan joined #perl6
04:47 leprevost left #perl6
04:58 stifynsemons joined #perl6
05:00 sftp left #perl6
05:01 sftp joined #perl6
05:06 jpr5 left #perl6
05:06 arlinius left #perl6
05:07 jpr5 joined #perl6
05:08 flatwhatson left #perl6
05:09 flatwhatson joined #perl6
05:10 rhr left #perl6
05:11 rhr joined #perl6
05:14 satyavvd joined #perl6
05:16 JimmyZ left #perl6
05:30 kaare_ joined #perl6
05:30 Chillance left #perl6
05:32 lopnor is now known as lopaway
05:52 * Tene prods jnthn
05:56 arlinius joined #perl6
05:57 envi left #perl6
06:02 justatheory left #perl6
06:05 envi joined #perl6
06:06 jevin left #perl6
06:06 stifynsemons left #perl6
06:10 Bzek left #perl6
06:14 drbean left #perl6
06:16 kanishka joined #perl6
06:18 Bzek joined #perl6
06:19 justatheory joined #perl6
06:26 xinming_ joined #perl6
06:28 xinming left #perl6
06:34 justatheory left #perl6
06:35 drbean joined #perl6
06:50 drbean left #perl6
06:50 drbean joined #perl6
06:51 donri left #perl6
06:59 justatheory joined #perl6
07:03 justatheory left #perl6
07:04 mux left #perl6
07:04 mux joined #perl6
07:04 y3llow left #perl6
07:05 y3llow_ joined #perl6
07:05 y3llow_ is now known as y3llow
07:10 masak joined #perl6
07:10 masak good morning, zebras!
07:10 * masak is on a train
07:11 jdhore or are you ON A BOAT!?
07:13 masak I'm on a horse.
07:15 jdhore woot! meme fight!
07:17 masak I accidentally your meme fight.
07:18 dalek rakudo: 39cbefe | worr++ | src/core/IO/Stat.pm:
07:18 dalek rakudo: Fixed some stat bugs
07:18 dalek rakudo:
07:18 dalek rakudo: - added isreg
07:18 dalek rakudo: - added islnk
07:18 dalek left #perl6
07:18 masak dalek: wuss!
07:18 jdhore I made you a meme fight...but it eated it.
07:18 jdhore *i
07:19 dalek joined #perl6
07:19 masak oh wait, maybe not dalek's fault...
07:19 masak except in the sense that it caused the flood.
07:20 masak I made you a commit summary... but freenode eated it. :(
08:01 masak left #perl6
08:01 masak joined #perl6
08:11 tadzik hello zebrae
08:13 mberends @zebrae.hello();
08:13 masak .greet() for @zebrae;
08:15 tadzik how are you guys doing?
08:15 mberends exceedingly well :)
08:17 tadzik masak: are those new IO additions speced?
08:19 masak tadzik: I have no idea. I don't care much for the current IO spec.
08:19 tadzik fair enough
08:20 masak I figgered if it helps someone in their pragmatism, so much the better.
08:20 masak we'll need to do an overhaul at some point anyway.
08:20 rhr left #perl6
08:20 tadzik I'm excited 'cos the whole File::Tools is useless now, and I didn't like that code anyway :)
08:20 masak :)
08:20 tadzik it will make My New Secret Project easier to deplo... Whoops! :)
08:21 masak :P
08:21 masak if we have a big setting, we might as well have the tools we want in it.
08:22 tadzik maybe it'll be good to hide then in some namespace, not to keep so many generally-named functions like move, copy etc?
08:23 mberends definitely. namespace pollution sucks.
08:23 masak oh, were they functions? I didn't realize.
08:23 masak thought they were methods on IO.
08:23 tadzik oh well
08:23 tadzik hmm
08:23 mberends shopping &
08:23 tadzik maybe I didn't realize :)
08:23 masak however, namespace pollution in Perl 6 is a smaller problem than in other languages.
08:23 masak since the whole setting is overridable.
08:24 masak even augmentable, thanks to multis \o/
08:24 tadzik wow, gravatars scale quite well. I accidentally zoomed github 1000% or something, and they look very nice
08:26 masak` joined #perl6
08:30 masak left #perl6
08:30 masak` is now known as masak
08:31 masak Spotify as such is quite a fantastic piece of tech. on a train it feels miraculous.
08:32 satyavvd left #perl6
08:33 snarkyboojum hello peeps
08:33 masak snarkyboojum! \o/
08:34 snarkyboojum masak-san! o/
08:34 tadzik snarkyboojum! \o/
08:34 snarkyboojum heh
08:34 masak snarkyboojum: how are things over at your side?
08:34 snarkyboojum a bit crazy, but never a dull moment :D
08:35 snarkyboojum you?
08:35 masak I figure I'll have dullness when I retire :P
08:35 snarkyboojum excellent attitude :)
08:35 masak so, yeah. same.
08:35 snarkyboojum tadzik: oh and hello!
08:35 snarkyboojum started a new job which uses $java heavily :O
08:36 snarkyboojum not sure whether that was the right move, but oh well
08:36 masak Java is kind of cute in its limitedness.
08:36 masak its lack of proper closures can hurt a bit sometimes.
08:36 snarkyboojum masak: I like that :) I'd add -  "In a set-top box kind of way"
08:36 masak :P
08:37 snarkyboojum masak: my first exposure to java was in 1997 or so, and I'm pleased to say, I can still understand it heh
08:37 masak snarkyboojum: try to code Java like everything you wrote in it is a form of sarcasm. that might help :)
08:37 tadzik what is some good resource to learn Java?
08:37 snarkyboojum tadzik: the bruce eckel books used to be good
08:38 masak tadzik: the JLS is online; it's good, if a bit heavy.
08:38 masak tadzik: "Effective Java" is very, very good.
08:38 tadzik I didn't quite like the longness TBH (Thinking)
08:38 tadzik masak: as a start?
08:38 masak tadzik: for you, yes.
08:38 masak tadzik: I know you're not a beginner.
08:38 tadzik will investigate
08:39 snarkyboojum come to think of it, the Thinking in Java books might be a tad out of date now
08:39 snarkyboojum nfi, but they were free at the time :)
08:40 masak tadzik: if you're ever curious about Java generics, there's a 20-page PDF online somewhere which covers them very well. the official tutorial for the Collections Framework is required reading, too.
08:40 tadzik well, about Thinking I was disturbed, for I didn't want to learn OOP from the ground up. I wanted to learn Java, and Eckel spend dozens of dozens of pages expalaining OOP on the example of a LightBulb
08:40 masak (also online and freely accessible)
08:41 snarkyboojum tadzik: that's true.. probably a little beginnerish, or a tad dry
08:41 masak tadzik: that's where "Effective Java" is good. it assumed you're familiar with OO languages, and just teaches you how to make good use of Java.
08:41 masak *assumes
08:41 tadzik cool
08:42 snarkyboojum sweet - might check it out myself
08:42 tadzik shame it's not in my library, or maybe translated
08:42 snarkyboojum tadzik: how goes ecosystem tools etc?
08:42 masak by extension, anything that Josh Bloch has touch has a sheen of quality to it.
08:42 masak touched*
08:43 tadzik snarkyboojum: that's the Secret Project :)
08:43 snarkyboojum tadzik: I'd noticed talk of such - sounds interesting :)
08:47 Khisanth joined #perl6
08:47 hanekomu joined #perl6
08:48 hanekomu left #perl6
08:58 masak shucks. lots of electrical outlets on the train -- none of them works, it seems. :/
08:59 moritz_ good morning
09:03 masak left #perl6
09:20 Alias joined #perl6
09:35 _twitch joined #perl6
09:37 Khisanth left #perl6
09:51 araujo left #perl6
10:07 donaldh joined #perl6
10:07 donaldh left #perl6
10:09 Mowah joined #perl6
10:22 Su-Shee_ is now known as Su-Shee
10:25 kanishka left #perl6
10:33 Alias_ left #perl6
10:54 kanishka joined #perl6
11:05 moritz_ S12 has one mention of SUPER::
11:06 moritz_ is that a fossile?
11:06 whiteknight joined #perl6
11:07 M_o_C joined #perl6
11:11 MayDaniel joined #perl6
11:11 MayDaniel left #perl6
11:11 MayDaniel joined #perl6
11:12 Alias_ joined #perl6
11:13 Alias left #perl6
11:27 tadzik moritz_: seen the new IO additions?
11:31 moritz_ tadzik: yes
11:31 * moritz_ wonders if File::Find should be turned into dir(:recursive)
11:32 tadzik moritz_: how do you feel about making those subs methods, to not polulute the namespace?
11:33 tadzik also, isn't rm a duplicate of unlink?
11:33 tadzik (with better code actually, but still)
11:33 tadzik I plan to mess with it a bit and push it as a branch to discuss
11:52 tadzik dalek: stop slacking off
11:53 dalek rakudo: 4cd9b96 | tadzik++ | src/core/IO.pm:
11:53 dalek rakudo: Remove rm() as a duplicate of unlink(), but adopt its code into unlink()
11:53 dalek rakudo: review: https://github.com/rakudo/rakudo/commit/4cd9b96ccb
11:53 dalek rakudo: 93cfad9 | tadzik++ | src/core/IO.pm:
11:53 dalek rakudo: Make the new IO subs methods, so they don't pollute the namespace. Also DRY in link() a bit
11:53 dalek rakudo: review: https://github.com/rakudo/rakudo/commit/93cfad94e5
11:54 tadzik hmm, turns out I pushed to master (:
12:09 mtk left #perl6
12:17 mtk joined #perl6
12:22 nymacro joined #perl6
12:33 masak joined #perl6
12:34 masak moritz_: yes, the 'SUPER::' in S12 is a fossil. (we've discussed it before)
12:36 masak` joined #perl6
12:36 masak` what's odd about it is that it seems to be aware of its replacements, 'nextsame' et al.
12:36 masak` maybe there was a transition period during which both were spec'd.
12:39 masak left #perl6
12:39 masak` is now known as masak
12:41 kanishka left #perl6
12:42 alex____ joined #perl6
12:42 masak left #perl6
12:43 M_o_C left #perl6
12:49 alex____ left #perl6
12:56 tadzik moritz_: http://perlgeek.de/blog-en/perl-6/notes-from-yapc-hackathon.html ~~ s/bee/be/ # unless it's a pun
13:07 cjk101011 joined #perl6
13:08 Eevee left #perl6
13:09 donri joined #perl6
13:11 Eevee joined #perl6
13:14 Rotwang joined #perl6
13:18 Eevee left #perl6
13:20 tadzik phenny: tell masak have a pull request
13:20 phenny tadzik: I'll pass that on when masak is around.
13:21 Eevee joined #perl6
13:27 Eevee left #perl6
13:28 Khisanth joined #perl6
13:29 Eevee joined #perl6
13:34 colomon left #perl6
13:34 donri left #perl6
13:35 colomon joined #perl6
13:37 cjk101011 left #perl6
13:40 Eevee left #perl6
13:41 Eevee joined #perl6
13:43 orafu left #perl6
13:46 Alias_ left #perl6
13:47 Eevee left #perl6
13:48 Eevee joined #perl6
13:49 tadzik rakudo: say foo for []; # insn't that wrong?
13:50 p6eval rakudo 93cfad: OUTPUT«Could not find sub &foo␤  in <anon> at line 22:/tmp/vzIiF6gvxv␤  in main program body at line 1␤»
13:50 tadzik leh
13:50 tadzik rakudo: say 'foo' for []; # insn't that wrong?
13:50 p6eval rakudo 93cfad: OUTPUT«foo␤»
13:51 cjk101011 joined #perl6
13:54 Eevee left #perl6
13:55 Eevee joined #perl6
13:55 flussence rakudo: say [].so
13:55 p6eval rakudo 93cfad: OUTPUT«Bool::False␤»
13:56 flussence dunno where that one loop comes from
13:56 flussence rakudo: say $_.perl for []
13:56 p6eval rakudo 93cfad: OUTPUT«[]␤»
13:56 flussence hm
13:56 flussence rakudo: say $_.perl for [1..3]
13:56 p6eval rakudo 93cfad: OUTPUT«[1, 2, 3]␤»
13:56 flussence oh, it's treating the [] as a single item
13:57 flussence that seems like how perl5 would handle [], I'm not sure it is wrong...
13:57 tadzik definitely not DWIM
13:57 flussence unless [] and () are supposed to be identical.
13:57 flussence yeah, agree with that.
13:59 tadzik for does something "for each element of an array", imho
14:01 Eevee left #perl6
14:03 moritz_ note that [] is "an array in a scalar", not just "an array"
14:04 Eevee joined #perl6
14:06 tadzik ok. Supposedly I have %hash = { foo => [] }; and I want to iterate over the elements of foo. How do I write the for so it does no iterations?
14:06 moritz_ no iterations? you don't write the for-loop :-)
14:07 tadzik :)
14:07 moritz_ rakudo: say .perl for { a=>1, b=> 2}
14:07 p6eval rakudo 93cfad: OUTPUT«{"a" => 1, "b" => 2}␤»
14:07 moritz_ that's a single iteration
14:08 tadzik example from the battlefield: a Module has a dependencies key, a module installer wants to install all the dependencies. Of course, when { dependencies => [] } there should be no iterations, no installations. But for $module<dependencies> will try to install an array []
14:08 flussence [].list ?
14:08 tadzik not helping iirc
14:08 tadzik rakudo: say 'foo' for [].list; # insn't that wrong?
14:09 p6eval rakudo 93cfad:  ( no output )
14:09 tadzik hrm
14:09 tadzik maybe it is, and I'm wrong
14:09 tadzik nevermind then
14:10 moritz_ or s/list/flat/ for that matter
14:20 tadzik jnthn++ # Test::mock
14:35 satyavvd joined #perl6
14:37 rgrau joined #perl6
14:40 Eevee left #perl6
14:41 Eevee joined #perl6
14:42 tadzik moritz_: btw, what do you think about my last commits?
14:51 rhr joined #perl6
14:51 moritz_ tadzik: I've only checked the messages... methods seem fine to me
14:52 am0c joined #perl6
14:54 tadzik a'right
14:56 envi left #perl6
15:03 rhr left #perl6
15:04 rhr joined #perl6
15:13 araujo joined #perl6
15:13 nymacro left #perl6
15:24 risou joined #perl6
15:26 GinoMan left #perl6
15:28 cjk101011 left #perl6
15:35 cjk101011 joined #perl6
15:37 donri joined #perl6
15:43 kanishka joined #perl6
15:43 JimmyZ joined #perl6
15:46 mberends left #perl6
15:49 MayDaniel left #perl6
15:51 zby_home_ joined #perl6
15:52 MayDaniel joined #perl6
15:56 orafu joined #perl6
16:03 JimmyZ moritz_: https://github.com/rakudo/rakudo/pull/16, I just pull a request, please take a look when you are free.
16:04 MayDaniel_ joined #perl6
16:05 moritz_ JimmyZ: I think I'd prefer it if didn't went away immediately, but rather threw a helpful error
16:05 moritz_ JimmyZ: but I can do that on top of your commit
16:05 MayDaniel left #perl6
16:05 JimmyZ moritz_: great, thanks ;)
16:06 moritz_ (and it needs to be !*.defined in the undef error message)
16:09 JimmyZ yes, though I am not sure about it.
16:11 MayDaniel_ left #perl6
16:16 Patterner left #perl6
16:18 guidj0s joined #perl6
16:18 Psyche^ joined #perl6
16:18 Psyche^ is now known as Patterner
16:19 * JimmyZ ponders someday he will be the release manager
16:20 guidj0s left #perl6
16:20 BinGOs relgineer
16:21 justatheory joined #perl6
16:22 stifynsemons joined #perl6
16:31 JimmyZ_ joined #perl6
16:32 JimmyZ left #perl6
16:32 JimmyZ_ is now known as JimmyZ
16:42 tty234 left #perl6
16:49 MayDaniel joined #perl6
16:50 JimmyZ left #perl6
16:52 stifynsemons left #perl6
16:59 sji joined #perl6
17:03 satyavvd left #perl6
17:03 cjk101011 left #perl6
17:07 risou_ joined #perl6
17:08 cjk101011 joined #perl6
17:09 risou left #perl6
17:10 kanishka left #perl6
17:11 stifynsemons joined #perl6
17:12 MayDaniel left #perl6
17:12 stifynsemons left #perl6
17:14 leprevost joined #perl6
17:19 justatheory left #perl6
17:19 justatheory joined #perl6
17:21 MayDaniel joined #perl6
17:23 justatheory left #perl6
17:24 kanishka joined #perl6
17:29 kanishka left #perl6
17:31 mberends joined #perl6
17:41 Trashlord left #perl6
17:41 mikehh left #perl6
17:43 kanishka joined #perl6
17:47 Trashlord joined #perl6
17:48 leprevost left #perl6
17:51 dalek roast: 76534ab | moritz++ | S16-filehandles/ (4 files):
17:51 dalek roast: be less paranoid about the actual return value of unlink, just evaluate it in boolean context
17:51 dalek roast: review: https://github.com/perl6/roast/commit/76534ab35a
17:52 dalek rakudo: 6437553 | moritz++ | t/spectest.data:
17:52 dalek rakudo: run two more test files
17:52 dalek rakudo: review: https://github.com/rakudo/rakudo/commit/6437553d93
17:52 dalek rakudo: c2403f2 | zhuomingliang++ | src/ (6 files):
17:52 dalek rakudo: removed *.notdef
17:52 dalek rakudo:
17:52 dalek rakudo: (with small corrections from moritz_)
17:52 dalek rakudo: review: https://github.com/rakudo/rakudo/commit/c2403f212e
18:01 kanishka left #perl6
18:02 Chillance joined #perl6
18:11 frettled left #perl6
18:12 frettled joined #perl6
18:19 dalek rakudo: a3df1e3 | moritz++ | build/PARROT_REVISION:
18:19 dalek rakudo: bump PARROT_REVISION for testing
18:19 dalek rakudo: review: https://github.com/rakudo/rakudo/commit/a3df1e397a
18:20 risou_ left #perl6
18:38 skangas left #perl6
18:39 stepnem left #perl6
18:40 justatheory joined #perl6
18:41 sji left #perl6
18:43 dju joined #perl6
18:45 dju left #perl6
18:45 dju joined #perl6
18:47 dalek rakudo: 41313b7 | tadzik++ | Configure.pl:
18:47 dalek rakudo: Use generational_gc. It's not good to get rid of the 4-% speedup
18:47 dalek rakudo: review: https://github.com/rakudo/rakudo/commit/41313b7ab6
18:47 stepnem joined #perl6
18:47 tadzik bleah, typo
18:51 tadzik at least 41313b7 looks nice
18:54 gdey joined #perl6
18:54 jdhore tadzik, what do you mean by: It's not good to get rid of the 4-% speedup  ?
18:56 masonkramer joined #perl6
18:57 tadzik jdhore: without this commit, we weren't using Parrot's generational gc, which gives about 40% speedup to the spectest run
18:57 jdhore ah, I know those parts, i've never seen 40+% as 4-%
18:58 jdhore So I was thinking like 4%? -4% (made it 4% worse)?...what?
18:59 gdey left #perl6
19:00 gdey joined #perl6
19:00 gdey_ joined #perl6
19:03 colomon tadzik: I thought we'd been using the new gc for about a week now?
19:03 am0c left #perl6
19:04 tadzik colomon: nah, Parrot people made it optional rather than default
19:04 tadzik and I noticed that we didn't notice
19:05 gdey left #perl6
19:06 colomon I thought we saw a 30% speed up then, though.
19:06 tadzik we did
19:06 tadzik for it was default for a while
19:06 tadzik in new PARROT_REVISION it's not
19:07 flussence ooh, faster spectest? time to see if I can beat my 7:30 time...
19:07 jdhore Actually, that's incorrect
19:08 jdhore moritz_++ just built his own parrot with gen_gc2 enabled for testing
19:08 tadzik moritz_: can you provide more details?
19:09 * colomon is confused...
19:10 jdhore I say this because i actually looked at the entire commitdiff for the gen_gc2 branch merge and it specifically said that it did not set it as the default GC.
19:11 tadzik https://github.com/parrot/parrot/commit/e0a4faf7018dd1aabb19dc78d40b714f3cbfbdd4
19:11 jdhore that doesn't seem to be setting it to gms by default
19:12 jdhore or unsetting it FROM gms by default
19:12 moritz_ jdhore: when I bumped PARROT_REVISION to RELEASE_3_1_0-184-ga8596df, it sped up rakudo significantly
19:12 tadzik oh wait
19:12 tadzik https://github.com/parrot/parrot/commit/a81c3fc9b2435
19:12 jdhore moritz_, really? Just by bumping it?
19:12 tadzik looks like it is the default
19:12 jdhore ah
19:13 jdhore appears so
19:13 tadzik I'm tracking the parrot git log, Justin Case
19:13 tadzik or I'll just check this file on master
19:14 tadzik yeah, it's the default, my bad
19:14 * tadzik reverts
19:15 moritz_ jdhore: well, I also needed to recompile parrot and rakudo... :-)
19:16 jdhore Well yes :P
19:17 tadzik hmm, I accidentally used some -i switch to git, but it turned out alright
19:18 tadzik nice, I got a good-looking sha1 again :)
19:18 moritz_ git reset --hard origin/master # if you want to rever everything to "normal"
19:19 gdey_ left #perl6
19:19 dalek rakudo: 6cf6166 | tadzik++ | Configure.pl:
19:19 dalek rakudo: Revert the last commit, turns out gms is the default on Parrot
19:19 dalek rakudo:
19:19 dalek rakudo: This reverts commit 41313b7ab669248b28177990a297c06092eae397.
19:19 dalek rakudo: review: https://github.com/rakudo/rakudo/commit/6cf6166710
19:22 plobsing left #perl6
19:23 flussence :( smolder.parrot.org gives me a HTTP 500 for the TAP upload
19:24 flussence "465 wallclock secs"... not quite 7½ minutes, but close.
19:27 gdey joined #perl6
19:54 justatheory left #perl6
19:55 _twitch left #perl6
19:58 _twitch joined #perl6
20:01 moritz_ flussence: the 500 happened to me too, from time to time
20:02 moritz_ flussence: it seems that the submission system can't handle the large number of requests by some automatic smoking farms
20:02 tadzik http://nopaste.snit.ch/34348 -- what was a workaround for that?
20:02 moritz_ BUILD($!a) iirc
20:03 tadzik right, thanks
20:03 tadzik ...is that one of the things 6model will fix?
20:03 tadzik hmm hmm
20:19 justatheory joined #perl6
20:28 stifynsemons joined #perl6
20:34 _twitch left #perl6
20:36 moritz_ python has something nice
20:37 moritz_ it's something like sprintf, but with named placeholders
20:37 gdey left #perl6
20:37 moritz_ I've been wanting something like that for Perl 6 for quite some time
20:37 moritz_ I consider stealing it
20:38 flussence what's the syntax? is it like named SQL placeholders?
20:38 flussence (":name")
20:38 moritz_ ":(name)s"
20:38 moritz_ where s is the format
20:38 moritz_ and name the name
20:38 flussence oh, looks like a good idea...
20:39 moritz_ $ >>> print "foo %(bar)s baz" % { "bar": "BAR" }
20:39 moritz_ foo BAR baz
20:39 moritz_ before I learned about it, I thought about %name:s
20:39 flussence a lot more readable than %1$d all over the place...
20:40 flussence (there's something like this in ICU, I think...)
20:40 moritz_ fwiw I learned about it here: http://www.korokithakis.net/tutorials/python
20:40 moritz_ I've been thinking about that in the context of my error message grant
20:40 moritz_ because I want to make it easy to customize messages, and to include arbitrary information
20:41 moritz_ so I want to have something like a hash
20:41 moritz_ which contains lots of context for the error
20:41 flussence http://userguide.icu-project.org/formatparse/messages#TOC-MessageFormat
20:41 moritz_ and the error message can then say something like "Type check failed for assignment; got %(actual)s, expected %(constraint)"
20:42 flussence ICU seems to have numbered params and wordy types... guess it's not the same thing
20:42 moritz_ so it will just look into the context hash for 'actual' and 'constraint', and passes the rest to sprintf
20:43 flussence (are we going to end up with a java-like exception class hierarchy :)
20:43 moritz_ I don't know enough Java to answer that
20:43 moritz_ but I think classification > tree
20:44 flussence PHP does a similar thing... it resembles the diagram in `perldoc perllexwarn`
20:45 moritz_ and I don't think that the classification needs to be implemented through inheritance or role composition
20:45 moritz_ but I'm not yet sure how exactly it should look like
20:46 moritz_ (which is why I applied for a grant, and haven't written it all down :-)
20:47 flussence well, you've probably got a better idea of how to do it right than I would, so I'll be quiet :)
20:47 moritz_ well, most of my ideas are very abstract
20:47 moritz_ I thought alot about it, but I haven't talked too much about it
20:49 cjk101011 left #perl6
20:50 stifynsemons left #perl6
20:50 cjk101011 joined #perl6
20:56 stifynsemons joined #perl6
20:58 bacek left #perl6
20:59 moritz_ https://gist.github.com/845617 # simplist implementation
20:59 moritz_ *simplistic
21:02 tadzik very nice
21:02 tadzik . o O ( use Python::Sprintf }
21:03 moritz_ well, I'm now pondering what the best way is to include in in Perl 6
21:04 moritz_ maybe it should be a .fmt feature, or something
21:04 moritz_ I'm sure masak++ will have an opinion about that
21:05 aindilis joined #perl6
21:05 tadzik named fmt? nmft?
21:05 tadzik bleh
21:06 moritz_ no, in fmt directly
21:07 tadzik http://nopaste.snit.ch/34352 -- any idea what's wrong here?
21:07 * tadzik is trying to workaround Rakudobugs
21:09 moritz_ stupid question: is there a reason to not just use  has $.c = 666; ?
21:09 tadzik well, that's when the 'submethod BUILD' was failing
21:09 tadzik I'll see
21:09 moritz_ I guess that it's the //= bug
21:09 tadzik huh, seems like that easy way works
21:10 moritz_ rakudo: my $x = 1; $x //= say("SHOULD NOT PRINT"); say $x
21:10 p6eval rakudo 6cf616: OUTPUT«SHOULD NOT PRINT␤1␤»
21:10 bacek joined #perl6
21:10 rgrau left #perl6
21:14 scientistybkim joined #perl6
21:15 tadzik I must say I find Python's documentation syntax superior to POD
21:15 tadzik in terms of ease of writing
21:16 scientistybkim left #perl6
21:16 tadzik maybe there's a need for a parser script generating POD from something similar
21:16 kaare_ left #perl6
21:17 stifynsemons left #perl6
21:18 flussence markdown would be nice
21:18 flussence .oO( embedded mkd in pod would be really nice... )
21:19 tadzik nah, I think of "just add a q{ some string } in your method body and it will produce POD describing the method name, params and what's in q{}"
21:19 tadzik loads of POD in class definitions neither look good, nor are pleasant to write
21:19 stifynsemons joined #perl6
21:32 flussence that's covered by #= and .WHY, iirc
21:32 flussence (current parsing of those comments is a bit broken though)
21:32 tadzik .WHY?
21:33 tadzik hah, that's impossible to find in perlcabal.org/syn/ :)
21:33 tadzik ack to the rescue
21:34 tadzik oh, that .WHY is exactly what I wanted
21:38 tadzik hmm, why would like to have `mkdir 'foo', :p`, like we have `mkdir -p foo` in unices?
21:39 donri moritz_: Python has a new formatting language also
21:39 donri Which IMO is cleaner
21:39 * moritz_ would like mkdir :recursive or something
21:39 moritz_ donri: do you have a link to that?
21:40 donri http://docs.python.org/library/string.html#format-string-syntax
21:41 donri {} is like %s, {0} can reorder positionals, {name} for named
21:41 Mowah left #perl6
21:47 zby_home_ left #perl6
21:50 envi joined #perl6
21:58 cjk101011 left #perl6
22:00 tadzik hmm. Is there anything like BUILD in Moose? submethod BUILD is not exactly what I want, as when I write my own BUILD I have to set attributes myself. Is there a way to have a BUILD, or anything else, like Moose has?
22:06 MayDaniel left #perl6
22:08 justatheory left #perl6
22:09 justatheory joined #perl6
22:10 plobsing joined #perl6
22:27 * [Coke] skips review.
22:31 colomon left #perl6
22:37 justatheory left #perl6
22:45 [Coke] left #perl6
22:56 [Coke] joined #perl6
22:56 sorear tadzik: I do not beleive so
22:57 sorear Moose has a lot of stuff that Perl 6 needs to steal back
22:57 sorear (AFAICT I am completely alone in this view)
23:04 donri I think moritz_ or someone said something similar the other day
23:14 stifynsemons left #perl6
23:15 stifynsemons joined #perl6
23:23 colomon joined #perl6
23:24 jdhore I personally still don't see the appeal of OOP at all
23:24 colomon It's great in the small
23:24 jdhore hmm?
23:24 colomon OOP
23:25 * colomon hopes he didn't miss important context there.
23:25 jdhore <colomon> It's great in the small  <--- This sentence makes no sense to me.
23:25 colomon object-oriented programming is great in the small.
23:25 colomon Certain things are perfectly represented as objects.
23:26 jdhore I don't get what you mean by "in the small"...In the small-scale?
23:26 colomon Hmmm...
23:27 colomon I guess the easiest explanation is that I feel you should make the things that are naturally objects into objects, and then the rest of your code should be a blend of functional and imperative programming using those objects.
23:28 flussence or abbreviated: "it's ok to use main::"
23:28 colomon So for instance, in a CAD program, you'd be crazy to NOT use objects to define your curves.
23:29 colomon but I think the idea that your main function (flussence++) should be in an object is 95% insane.
23:30 colomon Which I guess means I feel p6 gets it right: you need both methods and subs.  :)
23:32 donri With multidispatch there's no need for classes or methods, just types
23:32 donri Haskell kinda
23:33 colomon bah, arguing whether you've got a type or an object is just splitting hairs, IMO.
23:34 donri sure, but 'object' usually implies more (such as methods)
23:35 colomon afk # gotta put the boy to bed
23:36 lue joined #perl6
23:36 donri tell him good night from random person on the internet
23:36 lue hello citizebras! o/
23:49 ymasory_ joined #perl6

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

Perl 6 | Reference Documentation | Rakudo