Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2009-12-29

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:05 sjohnson rakudo:  my $str = "cow"; if $str != "pig" or "chicken" { print 1; }
00:05 p6eval rakudo 77bf8c: 1
00:05 sjohnson rakudo:  my $str = "cow"; if $str != "pig" or "cow" { print 1; } else { print 2; }
00:05 p6eval rakudo 77bf8c: 1
00:06 rjbs rakudo: my $str = "cow"; if $str != "pig" or "hen" { print 1; } else { print 2; }
00:06 p6eval rakudo 77bf8c: 1
00:06 rjbs "cow" is true, presuambly.
00:07 rjbs rakudo: my $str = "cow"; if $str != "pig" | "cow" { print 1; } else { print 2; }
00:07 sjohnson rakudo:  my $str = "cow"; if $str == "pig" or "cow" { print 1; } else { print 2; }
00:07 p6eval rakudo 77bf8c: 2
00:07 p6eval rakudo 77bf8c: 1
00:07 sjohnson oops
00:07 rjbs you want | to get the junction, iirc.
00:07 sjohnson rakudo:  my $str = "cow"; if $str == "pig" or "cow" { print '1-sj'; } else { print '2-sj'; }
00:07 p6eval rakudo 77bf8c: 1-sj
00:07 sjohnson rakudo:  my $str = "cow"; if $str == "pig" or "hen" { print '1-sj'; } else { print '2-sj'; }
00:07 p6eval rakudo 77bf8c: 1-sj
00:07 sjohnson hmmmmmmmmmmmmmmm
00:07 rjbs now, try with |
00:07 sjohnson k
00:08 sjohnson rakudo:  my $str = "cow"; if $str == "pig" | "hen" { print '1-sj'; } else { print '2-sj'; }
00:08 p6eval rakudo 77bf8c: 1-sj
00:08 rjbs oh well.
00:08 rjbs time to get off the bus.
00:08 sjohnson heh
00:08 sjohnson i know there's sort of an (3 < $i < 6) type syntax in p6
00:09 sjohnson i wonder if my animal example works in p6 somehow
00:09 ash_ rakudo: my $a = 'cow'; if $a ~~ 'hen'|'cow' { say 1; }
00:09 p6eval rakudo 77bf8c: 1␤
00:10 ash_ rakudo: my $str = "cow"; if $str ~~ "pig" | "hen" { print '1-sj'; } else { print '2-sj'; }
00:10 p6eval rakudo 77bf8c: 2-sj
00:10 sjohnson ash_: do you know if this is exactly the same internals as writing a (pig|hen) regex?
00:11 sjohnson or if it's trying two separate comparisons, as i hope it is doing
00:11 ash_ it should be 2 different comparisions
00:11 sjohnson ash_++ # smart
00:11 ash_ rakudo: say ('pig' | 'hen').WHAT;
00:11 p6eval rakudo 77bf8c: Junction()␤
00:11 ash_ that should be doing a Str smart matched to a Junction
00:12 sjohnson rakudo: say /(pig|hen)/.WHAT
00:12 p6eval rakudo 77bf8c: Regex()␤
00:12 sjohnson rakudo: say {(pig|hen)}.WHAT
00:12 p6eval rakudo 77bf8c: Block()␤
00:12 sjohnson say (m{moose}).WHAT
00:12 ash_ there is a big list of smartmatch precedence in one of the specs i think S03
00:13 sjohnson rakudo: say ('pig' or 'hen').WHAT;
00:13 p6eval rakudo 77bf8c: Str()␤
00:14 ash_ rakudo: say 'pig' or 'hen';
00:14 p6eval rakudo 77bf8c: pig␤
00:15 ash_ thats strange, i still don't see why my $str = "cow"; if $str == "pig" | "hen" { print '1-sj'; } else { print '2-sj'; } returned 1-sj
00:16 sjohnson probably because "hen" returns true
00:16 ash_ i think junctions need to be used with smart match '~~'
00:16 sjohnson rakudo:  my $str = "cow"; if $str == "pig" | "0" { print '1-sj'; } else { print '2-sj'; }
00:16 p6eval rakudo 77bf8c: 1-sj
00:16 cotto joined #perl6
00:16 sjohnson hmm.......
00:16 colomon sjohnson: you're using == for Str
00:16 sjohnson not sure actually
00:16 colomon shouldn't it be eq?
00:16 sjohnson ahh yes
00:16 sjohnson too much PHP programming today
00:17 ash_ lol totally forgot about that
00:17 sjohnson rakudo:  my $str = "cow"; if $str eq "pig" | "0" { print '1-sj'; } else { print '2-sj'; }
00:17 p6eval rakudo 77bf8c: 2-sj
00:17 sjohnson rakudo:  my $str = "cow"; if $str eq "pig" | "hen" { print '1-sj'; } else { print '2-sj'; }
00:17 p6eval rakudo 77bf8c: 2-sj
00:17 sjohnson thansk colomon
00:17 sjohnson <--- jaded PHP eyes today
00:18 ash_ i have been looking at javascript all day, i was about to suggest ===
00:19 sjohnson heh
00:20 sjohnson i was trying to do some .vimrc coding today
00:20 sjohnson using a bunch of == signs
00:20 sjohnson unfortunately, easy2lrn documentation with nice real-life examples wasn't easy to come by
00:20 sjohnson decided to quit wasting work-time
00:27 ash_ joined #perl6
00:30 sjohnson rakudo:  my $i = 30;  if 4 < $i < 50 { print 1; }
00:30 p6eval rakudo 77bf8c: 1
00:30 sjohnson rakudo:  print (4 < 5).WHAT
00:30 p6eval rakudo 77bf8c: Bool()
00:30 sjohnson rakudo:  print (4 < 5 < 40).WHAT
00:30 p6eval rakudo 77bf8c: Bool()
00:33 colomon Anyone have a quick pointer to the spec discussion on "so" (formerly "true"?)?
00:34 ihrd1 joined #perl6
00:34 ihrd1 left #perl6
00:35 colomon errr... I see S03, anything else?
00:39 diakopter colomon: I think http://groups.google.com/group/perl.perl6.language/msg/f2f1bf301e6b859b
00:39 colomon Another question: is it expected subst will evaluate its $replacement in the context of the Regex match that it is being substituted for?
00:40 colomon diakopter: thanks!
00:42 Techjar joined #perl6
00:49 Teckjar left #perl6
00:52 ash_ left #perl6
00:56 Student joined #perl6
01:18 dalek rakudo/ng: da89dd6 | (David Romano)++ | src/c (2 files):
01:18 dalek rakudo/ng: Remove &infix:<x> in cheats and update version in Any-str.pm
01:18 dalek rakudo/ng: modified:   src/cheats/str-ops.pir
01:18 dalek rakudo/ng: modified:   src/core/Any-str.pm
01:18 dalek rakudo/ng: review: http://github.com/rakudo/rakudo/commit/da89dd60444253462c46a8e1b37eb112a5bad336
01:18 dalek joined #perl6
01:20 colomon So many ng patches from unobe++ that dalek broke.  Yay!
01:23 sjohnson heheh
01:24 dalek joined #perl6
01:26 stephenlb joined #perl6
01:26 rgrau joined #perl6
01:26 orafu joined #perl6
01:27 synth joined #perl6
01:33 Exodist joined #perl6
01:33 jferrero joined #perl6
01:33 trondham joined #perl6
01:33 jan_____ joined #perl6
01:33 patspam joined #perl6
01:33 omega_ joined #perl6
01:33 PacoLinux joined #perl6
01:33 slavik joined #perl6
01:33 buubot joined #perl6
01:33 lisppaste3 joined #perl6
01:33 parduncia joined #perl6
01:33 eiro joined #perl6
01:33 ssm joined #perl6
01:33 omega__ joined #perl6
01:33 sjohnson std: local $goose;
01:33 p6eval std 29401: Potential difficulties:␤  Variable $goose is not predeclared at /tmp/2Vqf82o4VK line 1:␤------> [32mlocal $goose[33m⏏[31m;[0m␤Undeclared routine:␤       'local' used at line 1␤ok 00:01 105m␤
01:35 explorer__ joined #perl6
01:36 explorer__ joined #perl6
01:36 avar joined #perl6
01:36 literal joined #perl6
01:37 explorer__ joined #perl6
01:39 agentzh joined #perl6
01:54 eiro joined #perl6
01:55 parduncia joined #perl6
01:55 ssm joined #perl6
01:56 Exodist joined #perl6
01:56 trondham joined #perl6
01:56 jan_____ joined #perl6
01:56 patspam joined #perl6
01:56 PacoLinux joined #perl6
01:56 slavik joined #perl6
01:56 buubot joined #perl6
01:56 lisppaste3 joined #perl6
01:57 omega joined #perl6
01:58 literal joined #perl6
01:59 avar joined #perl6
02:00 Alias joined #perl6
02:00 literal joined #perl6
02:03 omega joined #perl6
02:04 xinming joined #perl6
02:08 omega_ joined #perl6
02:16 jaldhar joined #perl6
02:25 payload joined #perl6
02:37 idemal joined #perl6
02:37 idemal left #perl6
02:37 idemal joined #perl6
02:41 d4l3k_ joined #perl6
02:42 baest_ joined #perl6
02:44 cotto_w0rk joined #perl6
02:45 jrockway joined #perl6
02:45 drbean joined #perl6
02:45 LionMadeOfLions joined #perl6
02:45 perigrin joined #perl6
02:46 cls_bsd joined #perl6
02:46 zamolxes joined #perl6
02:46 simcop2387 joined #perl6
02:48 partisan joined #perl6
02:48 yahooooo joined #perl6
02:50 agentzh joined #perl6
02:50 synth joined #perl6
02:50 IllvilJa joined #perl6
02:50 justatheory joined #perl6
02:50 drbean___ joined #perl6
02:50 dbrock joined #perl6
02:50 hatseflats joined #perl6
02:50 cotto_w0rk joined #perl6
02:50 LionMadeOfLions joined #perl6
02:51 LionMadeOfLions joined #perl6
02:51 cotto_working joined #perl6
02:53 Lorn joined #perl6
02:53 hatseflats joined #perl6
03:08 sjohnson rakudo: if -e '/bin/ls' { print 1 }
03:08 p6eval rakudo 77bf8c: 1
03:08 sjohnson rakudo: if (-e | -r '/bin/ls') { print 1 }
03:08 p6eval rakudo 77bf8c: Could not find non-existent sub r␤in Main (file src/gen_setting.pm, line 324)␤
03:11 sjohnson bad example..
03:17 diakopter std: if -e '/bin/ls' { print 1 }
03:17 p6eval std 29401: [31m===[0mSORRY![31m===[0m␤Missing block at /tmp/LjNhPHxYDQ line 1:␤------> [32mif -e [33m⏏[31m'/bin/ls' { print 1 }[0m␤    expecting any of:␤       infix or meta-infix␤      infix stopper␤    parameterized block␤      standard stopper␤ terminator␤FAILED 00:01 105m␤
03:17 colomon Isn't it something like
03:17 colomon std: if '/bin/ls' ~~ :e { print 1 }
03:17 colomon now?
03:17 p6eval std 29401: ok 00:01 105m␤
03:18 diakopter rakudo: if '/bin/ls' ~~ :e { print 1 }
03:18 p6eval rakudo 77bf8c: 1
03:18 diakopter rakudo: if '/bin/ls' ~~ :d { print 1 }
03:18 p6eval rakudo 77bf8c:  ( no output )
03:18 diakopter rakudo: if '/bin/ls' ~~ :d { print 1 } else { print 0 }
03:18 p6eval rakudo 77bf8c: 0
03:18 diakopter rakudo: if '/bin/ls' ~~ :z { print 1 } else { print 0 }
03:18 p6eval rakudo 77bf8c: Method ':z' not found for invocant of class 'Str'␤in Main (file src/gen_setting.pm, line 324)␤
03:19 diakopter rakudo: if '/bin/ls' ~~ :f { print 1 } else { print 0 }
03:19 p6eval rakudo 77bf8c: 1
03:19 diakopter rakudo: if '/bin/ls' ~~ :F { print 1 } else { print 0 }
03:19 p6eval rakudo 77bf8c: Method ':F' not found for invocant of class 'Str'␤in Main (file src/gen_setting.pm, line 324)␤
03:19 diakopter cool
03:20 sjohnson hmm
03:20 sjohnson is :e a symbol?
03:20 sjohnson say :e.WHAT
03:20 sjohnson rakudo:  say :e.WHAT
03:21 p6eval rakudo 77bf8c: Pair()␤
03:21 sjohnson rakudo:  say :e.perl
03:21 p6eval rakudo 77bf8c: "e" => 1␤
03:21 sjohnson rakudo: if '/bin/ls' ~~ :e | :d { print 1 } else { print 0 }
03:21 p6eval rakudo 77bf8c: 1
03:21 sjohnson rakudo: if '/bin/ls' ~~ :e & :d { print 1 } else { print 0 }
03:21 p6eval rakudo 77bf8c: 0
03:23 sjohnson rakudo:  say (:e).WHAT
03:23 p6eval rakudo 77bf8c: Pair()␤
03:24 sjohnson rakudo:  say (:e).perl
03:24 p6eval rakudo 77bf8c: "e" => 1␤
03:25 _jaldhar joined #perl6
03:25 parduncia joined #perl6
03:25 ssm joined #perl6
03:26 cotto_working joined #perl6
03:27 hatseflats joined #perl6
03:27 omega__ joined #perl6
03:30 parduncia joined #perl6
03:30 ssm joined #perl6
03:30 Exodist joined #perl6
03:30 trondham joined #perl6
03:30 jan_____ joined #perl6
03:30 patspam joined #perl6
03:30 PacoLinux joined #perl6
03:30 slavik joined #perl6
03:30 buubot joined #perl6
03:30 lisppaste3 joined #perl6
03:31 avar joined #perl6
03:32 literal joined #perl6
03:34 cotto_working joined #perl6
03:34 LionMadeOfLions joined #perl6
03:34 agentzh joined #perl6
03:34 synth joined #perl6
03:34 IllvilJa joined #perl6
03:34 justatheory joined #perl6
03:34 LionMade1fLions joined #perl6
03:34 cotto_w0rk joined #perl6
03:47 JimmyZ joined #perl6
03:48 cotto_working joined #perl6
03:48 parduncia joined #perl6
03:48 ssm joined #perl6
03:49 sjohnson darn net splits
03:49 LionMadeOfLions joined #perl6
03:50 parduncia joined #perl6
03:50 ssm joined #perl6
03:53 Exodist joined #perl6
03:53 trondham joined #perl6
03:53 jan_____ joined #perl6
03:53 patspam joined #perl6
03:53 PacoLinux joined #perl6
03:53 slavik joined #perl6
03:53 buubot joined #perl6
03:53 lisppaste3 joined #perl6
03:53 literal joined #perl6
03:53 avar joined #perl6
04:05 cotto_w0rk joined #perl6
04:05 LionMade1fLions joined #perl6
04:05 agentzh joined #perl6
04:05 synth joined #perl6
04:05 IllvilJa joined #perl6
04:05 justatheory joined #perl6
04:13 parduncia joined #perl6
04:13 ssm joined #perl6
04:18 parduncia joined #perl6
04:18 ssm joined #perl6
04:21 Exodist joined #perl6
04:21 trondham joined #perl6
04:21 jan_____ joined #perl6
04:21 patspam joined #perl6
04:21 PacoLinux joined #perl6
04:21 slavik joined #perl6
04:21 buubot joined #perl6
04:21 lisppaste3 joined #perl6
04:21 literal joined #perl6
04:23 agentzh joined #perl6
04:23 synth joined #perl6
04:23 IllvilJa joined #perl6
04:23 justatheory joined #perl6
04:23 avar joined #perl6
04:38 mikehh joined #perl6
05:21 diakopter TimToady: hihi
05:21 FalseVinylShrub joined #perl6
05:23 meppl joined #perl6
05:24 racheldaBROWN joined #perl6
06:12 Baggio_ joined #perl6
06:15 synth joined #perl6
06:18 racheldaBROWN joined #perl6
07:01 Baggio_ joined #perl6
07:07 mberends joined #perl6
07:18 mberends phenny, tell pmurias the V8 scons fails with errors on Ubuntu 9.10 gnu c++ 4.4.1
07:18 phenny mberends: I'll pass that on when pmurias is around.
07:58 szabgab joined #perl6
08:02 Baggio_ joined #perl6
08:07 praveenraj joined #perl6
08:09 praveenraj left #perl6
08:14 ejs joined #perl6
08:17 bryan[c1] joined #perl6
08:19 kangu joined #perl6
08:20 mberends hi bryan
08:25 ejs1 joined #perl6
08:29 rgrau joined #perl6
08:31 iblechbot joined #perl6
08:43 meneldor joined #perl6
09:00 Chillance joined #perl6
09:00 meneldor hello guys :)
09:25 meppl joined #perl6
09:30 Su-Shee joined #perl6
09:31 Su-Shee good morning
09:33 diakopter Su-Shee: hi
09:39 JimmyZ joined #perl6
09:41 kaare joined #perl6
09:47 TiMBuS joined #perl6
09:55 ejs2 joined #perl6
09:55 synth joined #perl6
10:01 mikehh joined #perl6
10:41 Baggio_ joined #perl6
10:43 betterworld joined #perl6
10:52 payload joined #perl6
11:00 Baggio_ joined #perl6
11:15 masak joined #perl6
11:39 rodi joined #perl6
11:53 bluescreen joined #perl6
11:59 ruoso joined #perl6
12:15 ejs2 joined #perl6
12:20 Baggio_ joined #perl6
12:25 masak I'm having loose thoughts of announcing another prize for Perl 6 software.
12:25 masak any ideas what would make a good prize?
12:25 masak the theme, I mean, not the amount of money.
12:29 sbp first full reimplementation of awk in perl6
12:30 masak :)
12:31 masak the good things about the wiki prize were, off the top of my head, (1) that it seemed pretty much unattainable at the time (2006), (2) that doing it required collaboration between several people, (3) that doing it caused bugs to be found and features to be developed.
12:34 hejki masak: you know stuff about parrot internals ey?
12:34 masak hejki: whoever told you that is a liar and a coward. :)
12:34 hejki ahh
12:35 masak seriously, I don't know that much.
12:35 hejki i was just drawing conclusions about your operator status on #parrot :P
12:35 hejki dang..
12:35 masak yes... making me op on #parrot was a strange move.
12:35 hejki i didn't receive any reply concerning my S_ISLNK-macro patches :|
12:35 hejki only thing i got in response was "i don't know.." :P
12:36 masak hejki: so, you have complete patches and would like them to be committed, is that it?
12:36 masak or you have patches and would like comment on them?
12:36 hejki i have patches which seem to be done in a correct manner, however the S_ISLNK-macro doesn't seem to work as intended
12:37 hejki and i could've used some debugging help from someone aware of parrot internals
12:37 hejki i.e. am i missing some file, am i doing something awfully wrong.. etc
12:37 masak nod.
12:38 hejki ye
12:38 masak my best advice is to persist on #parrot.
12:38 hejki plus i'm a bit sick now.. caught a xmas-flu
12:38 hejki ye
12:38 hejki i think i'll take a more deep dive into it after i get better
12:38 masak the people there know their stuff, but they're awake and avaliable at different times of the day.
12:38 hejki all the mucus makes me think slow
12:39 hejki good thing about my patches are that the :l -implementation i patched locally for rakudo is returning different values after my patches applied to parrot :)
12:39 masak :)
12:39 hejki (i.e. it's not calling the S_ISREG-macro anymore, but instead calls the S_ISLNK-macro i defined. it's just not WAI :))
12:40 hejki also i think i need to take some time to check out ng-branch and examine it
12:40 hejki (if i'm gonna try and make the {open,close,read}dir-stuff)
12:42 masak hejki++ # rich in initiative
12:43 hejki karma hejki
12:43 hejki ;<
12:44 masak lambdabot used to do that, but of late, it has strangely crept below our threshold of bot etiquette, so it got booted.
12:45 pmurias joined #perl6
12:45 pmurias mberends: could you nopaste the errors?
12:45 phenny pmurias: 07:18Z <mberends> tell pmurias the V8 scons fails with errors on Ubuntu 9.10 gnu c++ 4.4.1
12:46 Guest75254 joined #perl6
13:07 takadonet joined #perl6
13:07 takadonet morning all
13:09 plainhao joined #perl6
13:19 masak` joined #perl6
13:22 pmurias joined #perl6
13:23 takadonet hey masak
13:25 Exodist joined #perl6
13:25 trondham joined #perl6
13:25 PacoLinux joined #perl6
13:25 slavik joined #perl6
13:25 buubot joined #perl6
13:25 lisppaste3 joined #perl6
13:25 literal joined #perl6
13:25 avar joined #perl6
13:27 Student joined #perl6
13:27 ruoso joined #perl6
13:29 Guest75254 joined #perl6
13:29 TiMBuS joined #perl6
13:32 payload1 joined #perl6
13:33 payload joined #perl6
13:33 parduncia joined #perl6
13:33 ssm joined #perl6
13:38 xinming_ joined #perl6
13:41 anonymous joined #perl6
13:41 anonymous ehlo
13:43 takadonet hello
13:43 colomon \o
13:47 colomon masak: funny you should mention a prize.  My wife was just telling me I should ask to see if anyone had $work they needed done in the next three days.  :)
13:49 avar joined #perl6
13:49 literal joined #perl6
13:49 Exodist joined #perl6
13:49 trondham joined #perl6
13:49 PacoLinux joined #perl6
13:49 slavik joined #perl6
13:49 buubot joined #perl6
13:49 lisppaste3 joined #perl6
13:50 avar joined #perl6
13:50 cognominal joined #perl6
13:51 anonymous is rakudo a kind of VM for perl? Or is that parrot?
13:52 hejki that's parrot. rakudo is an interpreter that runs on parrot. at least that's how i've understood it :)
13:53 colomon hejki is correct
13:53 orafu joined #perl6
13:54 hejki rakudo might be a compiler on parrot as well (instead of interpreter), atm i'm not sure if compiling actually works - so i'm not sure if it deserves to be called a compiler :P
13:54 Guest75254 joined #perl6
13:54 literal joined #perl6
13:56 xinming_ joined #perl6
13:58 colomon It definitely compiles to PIR, which is the Parrot VM's language.
13:58 colomon http://tomasp.net/blog/accelerator-life-game.aspx
13:58 anonymous thx
13:58 colomon I'm pondering how to implement Life relatively efficiently in p6...
13:59 anonymous implementing life is indeed a difficult thing ... ;)
13:59 anonymous sry
14:00 anonymous nm
14:05 rodi colomon: I have implemented some other cellular automata in Perl6, though nothing approaching relative efficiency.
14:06 rodi In theory, autothreading should be a big boost on any cellular automata, but the current implementations don't (yet) benefit from it much.
14:06 hejki colomon: woot.. how do i compile something into PIR?
14:06 hejki colomon: and shouldn't parrot be able to make PIR -> runnable binarry?
14:06 hejki s/rry/ry/;
14:09 colomon hejki: gotta run, alas, but look at the build stuff in a proto package like SVG... "standard" Configure.pm builds to pir.
14:09 colomon actually, that is done in Test.pm in standard RAkudo build, too.
14:09 colomon afk
14:10 hejki oh
14:10 hejki nice.. i'll check it out at some point. TFTI
14:16 kangu joined #perl6
14:21 masak colomon: I don't know about work that needs to be done, but I would like to set expectations/goals/dreams a bit higher with a slightly ambitious prize.
14:22 masak I'm thinking fairly long-term, like the wiki prize was.
14:27 bluescreen joined #perl6
14:32 patspam joined #perl6
14:40 rgrau` joined #perl6
14:50 Baggio_ joined #perl6
14:53 parduncia joined #perl6
14:53 ssm joined #perl6
15:09 Student joined #perl6
15:15 KyleHa joined #perl6
15:24 hejki masak: ~~ :l implementation done with the File.'is_link' -method call :)
15:24 masak \o/
15:24 hejki care to test out and possibly push it? it's not pretty, but at least it seems to WAI for me
15:25 masak feel free to nopaste.
15:26 hejki http://pastie.org/760061
15:26 hejki based on my test-script it should work correctluy
15:26 hejki s/uy$$/y/;
15:26 iblechbot joined #perl6
15:27 hejki woot.. file.pmc's is_link-method actually does use S_ISLNK-macro :D
15:27 hejki guess the PMC-stuff is kept separate from opcodes
15:28 hejki (see src/pmc/file.pmc row 146 ->)
15:28 hejki funny :)
15:30 masak the patch looks OK to me.
15:30 masak applying.
15:32 masak pushed. hejki++
15:33 dalek rakudo/master: db84bc0 | masak++ | src/builtins/any-str.pir:
15:33 dalek rakudo/master: [src/builtins/any-str.pir] implemented :l
15:33 dalek rakudo/master: Patch courtesy of Heikki Meht�nen (hejki++).
15:33 dalek rakudo/master: review: http://github.com/rakudo/rakudo/commit/db84bc06990c37b93fe987dcffab4ed9bf31de92
15:35 SmokeMachine joined #perl6
15:35 ejs joined #perl6
15:43 KyleHa Yay for patches.
15:46 masak indeed.
15:46 hejki well i kinda need 'em in something i'm making :)
15:46 hejki same goes with the {open,close,read}dir-stuff
15:46 hejki it seems to be harder and bigger operation to implement tho :)
15:48 masak what are you making?
15:49 hejki something that offers file operations such as finding, recursive listing and stuff
15:49 hejki a helper library for future projects
15:50 hejki (i'm kinda used to one i used back with perl5 :))
15:50 hejki nothing big/stupendous
15:51 hejki wouldn't be hard to make with the qx{ls -l}-way either, i just don't think using hack-a-rounds in a non-complete language is worse than actually putting in some effort and possibly implement features someone else might need in the future as well
15:54 masak I like that attitude.
15:55 jan___ joined #perl6
15:56 hejki heh.. doing things "properly" should be the de facto attitude imo :)
15:56 Psyche^ joined #perl6
15:56 KyleHa There's something recursive about that statement, but I'm too distracted to restate it properly.
15:57 masak yes. I default to 'doing things properly', but often fold to 'getting things working, like, now'.
15:57 hejki masak: that's usually my way in the "real world applications" i.e. work-assignments
15:58 hejki masak: but what comes to OSS, i prefer not folding into the simpler way :)
15:58 masak :)
15:58 hejki i'm not paid for what i do, so i just might do it properly and not care about the time spent :)
15:59 hejki and if it in the best case scenario promotes perl6 progress .. well that could be analogised into a HUGE xmas-bonus :)
15:59 masak I often have a short-term goal which would get lost or diluted if I followed up on all 'proper' leads. so I often just leave a '# RAKUDO' comment and move on.
15:59 masak oh, but I almost always make sure there's at least an RT ticket. :)
15:59 hejki i could do that too. but i've documentend the library i'm making and i know what i need for it (that's missing from rakudo :))
16:00 hejki this way i get a nice "todo"-list for myself about features i could try implementing into rakudo :)
16:02 masak rakudo: print(print (5+2)+10)
16:02 p6eval rakudo 77bf8c: 171
16:02 masak perl6: print(print (5+2)+10)
16:02 p6eval elf 29415, pugs, rakudo 77bf8c: 171
16:02 masak why does Perl 6 print 171 here, while perl prints 711? http://perlmonks.org/?node_id=814766
16:03 masak oh, I see it now.
16:03 colomon how can 711 be right?
16:03 masak colomon: it's because of the parsing of whitespace after function names.
16:03 masak colomon: it's 7 and then 11.
16:03 masak 5 + 2 == 7
16:03 colomon I see.
16:04 masak and 1 (the result of print) + 10 == 11
16:04 masak Perl 6 implementations print 17 and then 1.
16:04 colomon glad to know my instincts agree with Perl 6 here.  :)
16:05 rjbs Well, the right answer is: don't do that
16:05 colomon What was the story on the wiki prize?  I think that must have been before my time hanging around here.
16:05 masak I'll write on PerlMonks (in a sufficiently respectful/humble tone) that Perl 6 aligns its results better with the poster's expectations. :)
16:06 masak colomon: http://www.perlfoundation.org/perl6/index.cgi?conrad_schneiker http://yapc.tv/2008/ye/lt/lt2-01-masak-vilkund-november/
16:06 hejki thus perl6 is a natural DWIM-language
16:06 hejki :>
16:06 colomon masak: thanks
16:07 masak hejki: yes, that's the idea. though Perl 6 has its own pitfalls, to be sure.
16:08 colomon I certainly never think of print or say as proper functions, really.  I would never put parens around their arguments, for instance.
16:08 hejki anything that is supposed to have one objective way and is dealt with subjective randomness has its own pitfalls and caveats :P
16:11 ash_ joined #perl6
16:15 hejki rakudo: sub ö { say "foo" }; ö()
16:15 p6eval rakudo db84bc: foo␤
16:15 hejki rakudo: sub ♬ { say "foo" }; ♬()
16:15 p6eval rakudo db84bc: Malformed routine definition at line 2, near "\u266c { say \"f"␤in Main (file <unknown>, line <unknown>)␤
16:15 colomon masak: that was a terrific lightning talk.
16:16 colomon molasses-ware!!!
16:16 colomon only glancingly touched on the prize issue.
16:16 hejki not all unicode is supported yet?
16:16 colomon :)
16:16 colomon rakudo
16:17 colomon rakudo: sub prefix:<♬>($note) { say $note; }; ♬"A";
16:17 p6eval rakudo db84bc: A␤
16:17 masak colomon: thanks. well, the prize was only a minor part of why we did it. :)
16:18 colomon I'm sure.  You had to be brave souls to try to do anything with Rakudo that early.
16:18 colomon has the wiki prize not been won yet, then?
16:18 colomon http://www.perlfoundation.org/perl6/index.cgi?conrad_schneiker
16:28 masak colomon: http://use.perl.org/~masak/journal/38601
16:30 colomon "I'm crashing Rakudo today, so that it won't crash for you tomorrow. That’s how I like to think of it."  ;)
16:30 masak still is. :)
16:31 SmokeMachine joined #perl6
16:31 KyleHa joined #perl6
16:31 bluescreen joined #perl6
16:31 trondham joined #perl6
16:31 PacoLinux joined #perl6
16:31 slavik joined #perl6
16:31 buubot joined #perl6
16:31 lisppaste3 joined #perl6
16:31 literal joined #perl6
16:31 avar joined #perl6
16:32 ash_ masak is a bug finding robot, with a bit of a chatbot duct taped on
16:33 colomon Occurs to me that when I get depressed about Rakudo's current rate of progress, I should just remember what it was like a year ago.  :)
16:33 KyleHa Hey, five bugs shy of 600.  Time flies when you're writing code.
16:34 KyleHa Yeah, a year ago there were probably only like 300 open bugs.
16:34 rjbs Progress+
16:34 rjbs Progress++
16:37 masak it was easier to get an overview when there were only 300 :) nowadays I'm not as sure how many duplicates I'm submitting.
16:39 hejki is there any articles on reasons for unicode-motivation?
16:50 masak hejki: in trying to parse the noun phrase 'reasons for unicode-motivation', I fail.
16:51 hejki i'll rephrase: is there any articles on why unicode is our friend and not a foe :)
16:51 mrallen1 joined #perl6
16:51 rjbs I don't think anyone ever thought that was in question.
16:51 masak me neither.
16:51 rjbs What's the alternative?
16:51 rjbs ASCII?
16:52 masak EBCDIC.
16:52 rjbs EBCDASCIIC
16:52 xalbo perl6: regex test-case {foo}; say "foo" ~~ /<test-case>/;
16:52 p6eval rakudo db84bc: Confused at line 2, near "~~ /<test-"␤in Main (file <unknown>, line <unknown>)␤
16:52 p6eval ..pugs: *** ␤    Unexpected "-"␤    expecting subroutine parameters, ":", "is" or "{"␤    at /tmp/cXtBbBhMPZ line 1, column 11␤
16:52 p6eval ..elf 29415: Undefined subroutine &GLOBAL::test called at (eval 129) line 3.␤ at ./elf_h line 5881␤
16:53 masak xalbo: Rakudo seems to choke on the '-'. that's a known bug.
16:53 arnsholt hejki: The short answer is that it's the only truly interoperable character set
16:53 xalbo Ok.  I couldn't find it in the bug tracker.
16:53 hejki well i think there should be something to govern pros and cons of using unicode
16:54 hejki i know of some perl5 actives who strongly disagree with the unicode-syntax
16:54 arnsholt If you want a single document with Greek, Cyrillic and Latin text all in one, there isn't really anything else that works
16:54 masak xalbo: http://rt.perl.org/rt3/Ticket/Display.html?id=64464
16:55 arnsholt Sure, there's an additional burden for those who have to implement it, but it simply is the best solution for text encoding
16:56 xalbo masak: Thanks!  Here I was searching for "hyphen" and "identifier".
16:56 pmichaud good morning, #perl6
16:56 masak xalbo: I searched for 'regex', narrowed to the 'perl6' queue, and then just visually scanned the 50 or so remaining hits.
16:56 colomon o/
16:56 masak pmichaud: morning!
17:00 xinming joined #perl6
17:02 pugs_svn r29416 | kyle++ | [t/spec] Test for RT 71704: "x !! y" should be a parse error
17:02 pugs_svn r29417 | kyle++ | [t/spec] Test for RT 71702: lethal reverse range in charset
17:02 pmichaud (silence)  ...what it something I said?  ;-)
17:02 pugs_svn r29418 | kyle++ | [t/spec] Test for RT 71706: Null PMC Access
17:03 pmichaud *was
17:03 masak pmichaud: I have questions for you, but I didn't want to overwhelm you :)
17:04 pmichaud ah.
17:04 pmichaud yeah, I decided I needed a bit of a break this past week.  :-|
17:04 masak that's allowed, last time I checked the rules. :)
17:05 masak good time of year for a break, at that.
17:05 iblechbot joined #perl6
17:05 pmichaud well, I also figure the next four months are likely to be pretty full :-)
17:05 masak that sounds likely, yes.
17:06 mkb_ joined #perl6
17:06 ash_ is that because rakudo*?
17:06 pmichaud ash_: yes.
17:08 ash_ i am already planning on at least 1 app I am going to write with it, well already working on it, but hit a wall, so... just waiting till either I can figure out how to help fix the bug, or someone else beats me to it
17:08 parduncia joined #perl6
17:08 ssm joined #perl6
17:08 trondham joined #perl6
17:08 PacoLinux joined #perl6
17:08 slavik joined #perl6
17:08 buubot joined #perl6
17:08 lisppaste3 joined #perl6
17:08 literal joined #perl6
17:08 avar joined #perl6
17:08 masak ash_: what's the bug?
17:09 ash_ role's with ^methods don't get their ^methods added to the RoleHOW properly in ng
17:10 ash_ so, you can't override things like ^compose
17:10 ash_ which is something i'd need to override
17:11 masak ah.
17:11 masak I'm surprised you're writing apps with ng already.
17:12 ash_ well, Master branch rakudo doesn't let me do some of the things i wanted to with roles, plus if ng is going to replace master one day i figured i might as well get it working with that
17:13 masak nod.
17:14 masak I'm not saying it's the wrong things to do. just that it might be a bit of a... bumpy ride. at least before ng lands.
17:14 ash_ eventually, its supposed to be role based persistence, so you can just add the role to an object (hopefully both at runtime and at class composition time) and it gets some magic .save and .^get methods
17:15 cdarroch joined #perl6
17:15 masak cool.
17:15 pmichaud afk, lunch
17:17 mrallen1 joined #perl6
17:17 SmokeMachine joined #perl6
17:17 KyleHa joined #perl6
17:17 bluescreen joined #perl6
17:18 ash_ hopefully, tonight or tomorrow I might try tackling the issue of ^methods getting added to the RoleHOW of a role properly, (and ClassHOW for classes because those don't work currently either)
17:19 takadonet ash_: what app are you writing?
17:20 ash_ eventually, its supposed to be role based persistence, so you can just add the role to an object (hopefully both at runtime and at class composition time) and it gets some magic .save and .^get methods
17:20 ash_ well, maybe i shouldn't call it an app, more a library
17:21 takadonet sounds like my project :)
17:21 masak why the hat on .^get?
17:21 masak proto objects != metaclasses.
17:24 ash_ masak: well, my intention is to do Class.^get(id); so you can do like Book.^get(:author => "A guy");
17:24 ash_ eventually
17:25 masak yes...
17:25 parduncia joined #perl6
17:25 ssm joined #perl6
17:25 masak ...but you can do that without the metaclass ^ -- just put the method on the class, as usual.
17:25 masak and call it with Class.get(id)
17:26 ash_ well, i thought Class.method()'s where really meta class methods
17:26 masak no, they're ordinary instance methods.
17:26 ash_ http://perlcabal.org/syn/S12.html#Class_methods
17:27 masak it's just that the instance happens to be an uninitialized proto-object representing the class.
17:27 ash_ ah, i think i am mis-reading that section
17:27 masak rakudo: class A {}; say A.new.isa(A)
17:27 mrallen1 joined #perl6
17:27 KyleHa joined #perl6
17:27 bluescreen joined #perl6
17:27 p6eval rakudo db84bc:  ( no output )
17:27 trondham joined #perl6
17:27 PacoLinux joined #perl6
17:27 slavik joined #perl6
17:27 buubot joined #perl6
17:27 lisppaste3 joined #perl6
17:28 literal joined #perl6
17:28 masak locally, 1.
17:28 masak rakudo: class A {}; say A.isa(A)
17:28 masak locally, also 1.
17:28 p6eval rakudo db84bc:  ( no output )
17:28 ash_ rakudo i think still timesout when you use classes
17:28 masak that's because the object A is acutally an instance of the class A.
17:28 masak ash_: aye.
17:28 ash_ ng: class A { }; say A.isa(A);
17:28 p6eval ng 4e4d82: 1␤
17:29 SmokeMachine joined #perl6
17:29 masak in general, meta classes are only needed when you want to change the way OO in Perl 6 behaves.
17:29 ash_ ng: class A { method get { return 'a' } }; my A.get;
17:29 p6eval ng 4e4d82: In "my" declaration, typename A must be predeclared (or marked as declarative with :: prefix) at line 1, near ".get;"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (src/stage0/HLL-s0.pir:328)␤
17:29 ash_ oops
17:29 ash_ ng: class A { method get { return 'a' } }; say A.get;
17:29 p6eval ng 4e4d82: a␤
17:30 avar joined #perl6
17:30 ruoso joined #perl6
17:30 ash_ ng: class A { method get { return self} }; say A.get;
17:30 p6eval ng 4e4d82: A()␤
17:30 ash_ hmmm
17:31 ash_ so... self in some cases is an instance or a class then?
17:31 masak it's an instance.
17:31 ash_ ng: class A { method get { return 'a' } }; my $a = A.new; say $a.get; say A.get;
17:31 p6eval ng 4e4d82: a␤a␤
17:31 masak it just gets printed as 'A()'
17:31 ash_ ng: class A { method get { return self } }; my $a = A.new; say $a.get; say A.get;
17:31 p6eval ng 4e4d82: A()␤
17:31 masak because that's the common way objects get stringified.
17:32 ash_ ah
17:32 masak I don't know why the last one only prints one line.
17:32 masak it should have printed two identical lines.
17:32 * masak tests locally
17:33 ash_ $a is returning ''
17:34 ash_ ng: class A { method get { return self }; method Str { 'a' } }; my $a = A.new; say 1, $a.get; say 2, A.get;
17:34 p6eval ng 4e4d82: 1a␤2A()␤
17:34 ash_ ng: class A { method get { return self }; method Str { 'a' } }; my \$a = A.new; say 1, \$a.get; say 2, A.get.WHAT;
17:34 p6eval ng 4e4d82: Malformed my at line 1, near "\\$a = A.ne"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (src/stage0/HLL-s0.pir:328)␤
17:35 ash_ ng: class A { method get { return self }; method Str { 'a' } }; my \$a = A.new; say 1, \$a.get; say 2, A.get().WHAT;
17:35 p6eval ng 4e4d82: Malformed my at line 1, near "\\$a = A.ne"␤current instr.: 'perl6;HLL;Grammar;panic' pc 500 (src/stage0/HLL-s0.pir:328)␤
17:35 ash_ ng: class A { method get { return self }; method Str { 'a' } }; my $a = A.new; say 1, $a.get; say 2, A.get().WHAT;
17:35 p6eval ng 4e4d82: 1a␤2A()␤
17:35 masak there's something funny going on there.
17:36 ejs joined #perl6
17:37 ash_ ng: class A { }; say A; say A.WHAT; say A.WHAT.WHAT;
17:37 p6eval ng 4e4d82: A()␤A()␤A()␤
17:37 ash_ and on it goes, thats odd
17:37 ash_ i think i ran into this before
17:38 masak well, that last one is fine.
17:38 masak .WHAT returns the proto-object.
17:39 masak but I don't see why the custom .Str shouldn't get called on the proto-object as well.
17:39 ash_ ng: class A { }; say (A.^parents).WHAT;
17:39 p6eval ng 4e4d82: Method 'WHAT' not found for invocant of class 'ResizablePMCArray'␤current instr.: '_block14' pc 29 (EVAL_1:0)␤
17:39 ash_ hmm
17:40 ash_ it leaked a parrot object into ng, thats no good
17:40 masak or why, without a custom .Str, the program `say A.new.get; say A.get` prints only one line.
17:40 masak ash_: yeah. too bad we don't report ng failures as bugs...
17:40 ash_ does Mu's .Str return ''?
17:41 ash_ isn't it Mu that all objects inherit from in ng?
17:42 masak yeah, directly or indirectly.
17:42 arnsholt I think so
17:42 masak most normal objects inherit from Any, which inherits from Mu.
17:46 ash_ i think it has to do with 1's an instance object and 1's a proto-object
17:48 masak well, they're not supposed to be that different. :)
17:49 rjbs what is .^parents?  parent classes of the thing's WHAT?
17:49 rjbs is there an easy place for me to get that answer for myself?
17:50 ash_ S12
17:50 ash_ http://perlcabal.org/syn/S12.html talks about .^ methods
17:51 masak rjbs: also see http://use.perl.org/~JonathanWorthington/journal/39455
17:51 ash_ .^parents should return a list of parents of the object, and .WHAT should return the type whatever it is, like 5.WHAT returns Int
17:52 rjbs is that because the OO is sorta prototype-based?
17:52 ash_ $obj.^method(); methods are actualy translated into $obj.HOW.method($obj);
17:52 rjbs Does S12 describe the MOP?
17:52 rjbs (Sorry, I should look at this myself; I'm distracted and in a meeting. :))
17:53 ash_ ummm S12 mentions the MOP but i think thats still kinda changing, it just talks about the OO setup
17:53 masak rjbs: yes, Perl 6 is sorta prototype-based. no, S12 hints at the MOP but doesn't fully describe it.
17:53 rjbs Ok.  Thanks!
17:53 ash_ you can do prototype based if you want, or classical inheritance too
17:53 masak rjbs: the best descriptiong of the MOP to date is jnthn's document, somewhere in the ng branch.
17:54 ash_ docs/metamodel.pod
17:54 ash_ in the ng branch
17:54 masak nod.
17:54 masak http://github.com/rakudo/rakudo/blob/ng/docs/metamodel.pod
17:54 rjbs thanks, I'll try to make time to read it; I look forward to it
17:55 masak it's a good read.
17:55 masak I'm currently reading through the Moose tests in order to contrast and compare.
17:56 masak hey, the declining visitor trend for the advent blog has been broken. yesterday and today, it turned upwards again! :)
17:56 masak guess people are back to work. :P
17:57 ash_ i liked the advent calendar, there should be a countdown calendar for rakudo*
17:58 dbrock joined #perl6
17:59 ash_ use.perl.org's layout looks funny in Chromium 4 in OS X...
17:59 takadonet masak: good to hear. I vist the advent calendar all the bloody time
18:01 justatheory joined #perl6
18:20 diakopter hmm
18:20 takadonet masak: How many visitor are we getting for the advent calendar per day? Couple hundred? thousand?
18:20 masak couple hundred.
18:21 moritz_ takadonet: we had 40k page views in 23 days or so
18:21 diakopter that accounts for the couple hundred rss aggregator servers
18:21 masak it was more or less an even thousand per day after it stabilized after the slashdotting.
18:21 masak moritz_: oh hai
18:21 hejki rakudo: say 40_000/23;
18:21 p6eval rakudo db84bc: 1739.13043478261␤
18:21 takadonet good old slashdotting
18:22 masak then on the 21st it started plummetting, at 100 per day. and yesterday it turned upwards again.
18:22 masak guess people got temporarily distracted by the holidays.
18:23 mdxi a page (like the about page) which lists all the entries in chronological order, with a precis for each, might be nice
18:24 mdxi or maybe that would be better as a capping entry? dunno.
18:24 takadonet mdxi: http://perl6.cz/wiki/Perl_6_and_Parrot_links#2009
18:24 moritz_ I thought we had such a thing already
18:25 mdxi apparently there is
18:26 masak food &
18:27 colomon First page of the Advent calendar is a table of contents with each day in it.  No precis, though.
18:28 moritz_ http://perl6advent.wordpress.com/2009/12/01/perl-6-advent-calendar/
18:28 moritz_ it wouldn't hurt to link to that page somewhere in the navigation bar
18:28 moritz_ but I have to run for food, sorry that I can't do it myself
18:28 diakopter also, it'd be nice if that page had a '2009' in the title
18:28 moritz_ bye
18:36 nbrown joined #perl6
18:50 supernovus joined #perl6
18:55 simcop2387 joined #perl6
18:56 supernovus is it possible to export constants, for reuse in other classes? Something like:  constant HI is export = "Hello world";  (which doesn't currently work in Rakudo main)
18:59 TimToady supernovus: STD does it, but I don't think rakudo does yet
18:59 TimToady std: onstant HI is export = "Hello world";
18:59 p6eval std 29401: [31m===[0mSORRY![31m===[0m␤Preceding context expects a term, but found infix = instead at /tmp/Y107MUmAAD line 1:␤------> [32monstant HI is export =[33m⏏[31m "Hello world";[0m␤FAILED 00:01 105m␤
18:59 TimToady std: constant HI is export = "Hello world";
18:59 p6eval std 29401: ok 00:01 105m␤
19:01 supernovus TimToady: thanks, it seemed like something that should work. I'll try it out on the 'ng' branch and see what it does :-)
19:07 rjbs what does the eject symbol stand for in the p6eval output?
19:08 jferrero joined #perl6
19:08 KyleHa rjbs: That dingus at the end is the newline char.
19:09 KyleHa rakudo: say 'hi';
19:09 TimToady the eject symbol is the current parse position
19:09 p6eval rakudo db84bc: hi␤
19:09 KyleHa rakudo: print 'hi';
19:09 p6eval rakudo db84bc: hi
19:09 colomon I'm pretty sure constant doesn't work yet in ng.
19:10 TimToady and if you're on a colored output, separates the green "parsed okay" section from the red "didn't parse" section
19:10 colomon At least, my last attempts to define pi as a constant there failed.
19:10 rjbs TimToady: thanks
19:11 rjbs I think I'd realized that once before in an example wher eit was clearer, and I was frustrated at not remembering what it was :)
19:11 TimToady we put the eject symbol there for people who are red/green colorblind, in fact
19:14 supernovus colomon: okay, thanks. In master it seems constant declaration works, and it doesn't complain if you add the 'is export' but when you import the module into another package, it doesn't recognize the exported symbols.
19:14 takadonet TimToady: What about people that are fully colorblind? :)
19:14 TimToady then they'll have to avoid using the ⏏ shape in their program :)
19:14 TimToady so that it remains distinctive
19:15 TimToady or they can change it via env vra
19:15 TimToady *var
19:15 takadonet well looks like I will be doing that then
19:18 justatheory_ joined #perl6
19:19 TimToady you don't like the eject symbol?  it seems rather appropriate, in a basebally 'you're outta here' sense  :)
19:21 TimToady or in a jet fighter sense, now that I think of it...
19:21 ash_ so, with methods on a class, is there a way to tell if its the class calling it vs an instance? like MyClass.method() vs $instance.method()
19:22 TimToady specced that you can subtype the invocant with :U and :D, but NYI
19:22 colomon in the former case self is not defined?  (he guessed)
19:23 colomon :U and :D?
19:23 TimToady undefined and defined subset types, basically
19:23 TimToady method foo (Mytype:U $self: @args) will only match undefined $self
19:24 TimToady but yes, you could test self.defined
19:24 mdxi clearly we need a glyph LEFT POINTING REFEREE HOLDING ALOFT PENALTY CARD or similar
19:24 kangu joined #perl6
19:25 ash_ ng: class A { method foo { self.defined } }; say A.foo; say A.new.foo;
19:25 p6eval ng 4e4d82: 0␤1␤
19:25 ash_ okay, cool
19:25 ash_ thanks, didn't know about that
19:26 TimToady decommuting from Seattle Children's... &
19:26 colomon Just got a message (comment approval, but I don't know if I should) asking what the license is on the p6 Advent calendar.
19:27 colomon don't think we ever addressed that....
19:29 lisppaste3 joined #perl6
19:29 KyleHa joined #perl6
19:45 thowe joined #perl6
19:54 payload joined #perl6
19:57 ash_ is there anywhere in the spec that talks about having to do things  like use strict; on every file? is there a way to specify a folder or something that it will apply to?
19:58 ash_ or maybe a namespace?
20:01 Tene ash_: strict is on by default.
20:01 Tene ash_: I don't know of any implementation that support turning strict off.
20:02 ash_ but can you specify your own things to that will be included in multiple files? so you only have to do it once
20:02 Tene Oh.  Dunno.
20:21 sjohnson p6 Q: is there a "!when" to the given / when structure?  like... "not" or "no" "didnot" or something
20:21 snearch_ joined #perl6
20:22 mberends sjohnson: default { ... } should do it
20:23 mberends http://perlcabal.org/syn/S04.html#Switch_statements
20:26 ash_ how are attributes inherited in perl 6? are 'our' type variables shared between parent's and children?
20:27 colomon sjohnson: you mean "when not" or default?
20:27 sjohnson colomon: when not yeah
20:28 sjohnson much like if / unless
20:28 sjohnson is when not the way?
20:28 colomon good question
20:29 colomon There is a !~~ (or is it !~  ?)
20:29 colomon to go with smartmatch.  But I don't know how to access it from a when statement.
20:30 ash_ $_ right?
20:30 ash_ you'd do: when $_ !~~ something { ... }  i think
20:31 spinclad i think 'if $_ !~~ ...' instead of when; when still means 'if $_ ~~ ...'
20:32 spinclad but that loses the implicit succeed
20:33 sjohnson indeed
20:33 sjohnson <-- worried
20:34 ash_ well, when blocks still have the ability to jump to the next block and default, so if your in a given i don't see why not to use when
20:34 sjohnson also the implicit $_
20:35 sjohnson ash_: the thought came to me when doing some p5 given/whens, and i realized that i kind of wanted to do   when not (-f)
20:35 sjohnson err, bad example
20:35 spinclad when !:f, if that worked
20:35 sjohnson yeah
20:35 sjohnson just realized that p6 trick
20:36 spinclad when :f(0), maybe
20:36 ash_ yeah, i see your point
20:36 sjohnson would be kind of cool to do a   when not (:f) as i use "unless" like this all the time, and i figure whoever blessed {} us with unless might be nice enough to consider this too
20:36 ash_ there is an: if $_ ~~ ... but not an: unless $_ ~~ ...
20:38 sjohnson i enjoy the happiness if not having to write the $_ part
20:38 diakopter std: :!e!$_ # what does this mean
20:38 p6eval std 29401: ok 00:01 105m␤
20:38 sjohnson and the ! i suppose too
20:38 spinclad iwbni '~~ !<pattern>' meant '!~~ <pattern>', then 'when !<pattern>' would do it
20:39 ash_ macro prefix:<when not>(*$var) { return 'when $_ !~~' ~ $var; }
20:39 ash_ okay that macro probably wouldn't work but eh /shrug
20:40 ash_ a 'when not' makes sense if you consider when to equate to if $_ ~~
20:41 sjohnson woudln't the when not simply be "if $_ !~"
20:42 ash_ sjohnson: you can probably bring it up in the mailing list, i am sure other's would agree that a 'when not' (maybe not by that name) makes sense to have
20:42 sjohnson thanks for the support ash_++
20:42 sjohnson and encouragement
20:43 ash_ from S03: A negated smart match is spelled !~~.
20:43 sjohnson ... and tip
20:43 sjohnson :)
20:43 ash_ i am not sure what !~ would do
20:43 ash_ not + stringify?
20:44 sjohnson only one way to find out
20:45 sjohnson rakudo:  say ~!"1000"
20:45 p6eval rakudo db84bc: 0␤
20:45 sjohnson rakudo:  say (~!"1000").WHAT
20:45 p6eval rakudo db84bc: Str()␤
20:45 sjohnson looks like your guess is correct
20:45 sjohnson educated guess that is
20:45 colomon rakudo: say !~"1000";
20:45 p6eval rakudo db84bc: 0␤
20:46 colomon rakudo: say (!~"1000").WHAT
20:46 p6eval rakudo db84bc: Bool()␤
20:46 sjohnson oops i got it backwards
20:47 sjohnson oopsie daisy
20:48 sjohnson rakudo say (5!).WHAT
20:48 sjohnson rakudo: say (5!).WHAT
20:48 p6eval rakudo db84bc: Confused at line 2, near "!).WHAT"␤in Main (file <unknown>, line <unknown>)␤
20:48 sjohnson i thought there was a fib. sequence thing with the !
20:49 ash_ sjohnson: not built in by default, but you can write one easy
20:49 sjohnson ahh i just thought it was in there that's all
20:49 ash_ http://perlgeek.de/blog-en/perl-6/custom-operators-in-rakudo.html
20:49 ash_ moritz_++
20:55 ash_ so, here's an odd question. If you define methods on a role with ^ in the name, and compose that into a class, should those methods be added to the classes HOW?
20:56 sjohnson do you mean "how should..." as your question?
20:57 ash_ well, should they be added into the class at all?
20:58 sjohnson not sure
20:59 ash_ i suppose if you didn't want them added to the class you could call them submethods instead of methods
21:01 hejki rakudo: say ((4,9,16)>>.sqrt == (2,3,5))
21:01 p6eval rakudo db84bc: 1␤
21:01 hejki rakudo: say (((4,9,16)>>.sqrt) == (2,3,5))
21:01 p6eval rakudo db84bc: 1␤
21:02 hejki rakudo: say ((4,9,16)>>.sqrt).WHAT)
21:02 p6eval rakudo db84bc: Syntax error at line 2, near ")"␤in Main (file <unknown>, line <unknown>)␤
21:02 hejki rakudo: say ((4,9,16)>>.sqrt).WHAT
21:02 p6eval rakudo db84bc: Array()␤
21:02 hejki a side effect?
21:02 hejki rakudo: ((4,9,16)>>.sqrt).say
21:02 p6eval rakudo db84bc: 234␤
21:03 lisppaste3 mberends32 pasted "V8 build failure log for pmurias" at http://paste.lisp.org/display/92785
21:04 hejki or am i just drunk? :P
21:04 spinclad ash_: but how would you call them, when $obj.^method(...) means $obj.HOW.method($obj,...) instead?
21:04 hejki rakudo: my @ar = 1,2,3; my @ar2 = 1,2,3; say @ar == @ar2; say @ar === @ar2;'
21:04 p6eval rakudo db84bc: Syntax error at line 2, near "'"␤in Main (file <unknown>, line <unknown>)␤
21:04 hejki rakudo: my @ar = 1,2,3; my @ar2 = 1,2,3; say @ar == @ar2; say @ar === @ar2;
21:04 p6eval rakudo db84bc: 1␤0␤
21:05 ash_ spinclad: you can do RoleName.^method;
21:06 spinclad which is RoleName.HOW.method(RoleName...) ?
21:06 spinclad $obj."^method" might work
21:07 spinclad if you can shoehorn the defn into the right place
21:07 colomon hejki: what were you trying to do back there?
21:07 ash_ spinclad: i am not sure i understand the problem your talking about
21:08 hejki colomon: in the sqrt-part? i get an array from (4,9,16)>>.sqrt and i try to == compare it to another array (2,3,5) but it prints 11
21:08 hejki 1*
21:08 spinclad the problem of referring to a method named '^method'
21:08 ejs joined #perl6
21:09 colomon hejki: 1 is the printable version of Bool::True
21:09 hejki sure
21:09 hejki but mine should return 0
21:09 spinclad ah, nm, i misread your question from the start.  SRY.
21:10 colomon Oh, == doesn't work on arrays
21:10 hejki woot
21:10 ash_ spinclad: lets work with an example, so i am referring to if you did: role Foo { method ^bar { } }; class Fooz does Foo { }; then you can do Foo.^bar;
21:10 colomon you're comparing +(2,3,4) with +(3,4,5)
21:10 colomon which is 3 in both cases
21:10 hejki ahh
21:10 colomon (ie, the length of the array)
21:10 hejki how to compare arrays then?
21:10 colomon say (2,3,4) === (3, 4,5)
21:10 colomon (maybe?)
21:10 colomon rakudo: say (2,3,4) === (3, 4,5)
21:10 hejki nope
21:10 p6eval rakudo db84bc: 0␤
21:11 hejki that checks if they're the SAME array
21:11 colomon rakudo: say (2,3,4) === (2,3,4)
21:11 p6eval rakudo db84bc: 0␤
21:11 hejki yes
21:11 colomon oh!
21:11 colomon rakudo: say ((2,3,4) >>==<< (3, 4, 5)).perl
21:11 p6eval rakudo db84bc: [Bool::False, Bool::False, Bool::False]␤
21:12 hejki rakudo: say (1,2,3) eqv (1,2,3); say (1,2,3) eqv (2,3,4)
21:12 p6eval rakudo db84bc: 1␤0␤
21:12 colomon rakudo: say (2, 3, 4) cmp (3, 4, 5)
21:12 hejki :)
21:12 p6eval rakudo db84bc: Multiple Dispatch: No suitable candidate found for 'cmp', with signature 'PP->I'␤in Main (file <unknown>, line <unknown>)␤
21:12 hejki eqv
21:12 hejki that works
21:12 colomon there you go.  :)
21:13 hejki ye :)
21:13 hejki == is more logical tho ..
21:14 ash_ hejki: you can do an infix == if you want to compare 2 lists
21:14 hejki sure
21:14 hejki and map it as eqv :>
21:14 hejki "map"
21:14 hejki first i thought it was some bug in rakudo, but i just had a severe brainfart going on
21:15 hejki time for bed now.. laters dudes o/
21:15 sjohnson cya!
21:15 colomon ash_: do you mean hyper ==   ?
21:16 ash_ ah, i see the issue, ==, !=, <, <=, >, >= all convert to Num before comparing
21:16 ash_ eq ne lt le gt ge all convert to Str before comparing
21:17 ash_ http://perlcabal.org/syn/S03.html#Chaining_binary_precedence talks about those operators
21:18 ash_ lol, again it boils down to the fact that you almost always can use ~~ and get the right comparison
21:18 ash_ rakudo: say (1, 2, 3) ~~ (1, 2, 3); say (1, 2, 3) ~~ (1, 2, 4);
21:18 p6eval rakudo db84bc: 1␤0␤
21:18 colomon go smartmatch!
21:21 sjohnson rakudo: say (1, 3, 2) ~~ (1, 2, 3);
21:21 p6eval rakudo db84bc: 0␤
21:21 s1n joined #perl6
21:22 y3llow joined #perl6
21:23 sjohnson rakudo: say (1, 3, 2).sort ~~ (1, 2, 3);
21:23 p6eval rakudo db84bc: 1␤
21:24 pmurias joined #perl6
21:25 pmurias ash_: you could write your own module which would include a bunch of things
21:29 ash_ pmurias: so you don't have to do 'use strict' or w/e in everything?
21:32 trondham hm.. how to run an external command and gather the output, like "open my $foo, '-|', '/bin/ls'; while (<$foo>) ..." in perl5?
21:41 colomon trondham: qx{/bin/ls}
21:41 colomon at least, I've got an old p6 script lying around that does that.  :)
21:41 colomon that returns the entire result as a string.
21:42 trondham colomon: ah, thanks :)
21:45 pmurias ash_: use strict is on on default
21:47 pmurias ash_: you can minimalise to boilerplate to one line "with use ash_::favourite_modules;"
21:52 ash_ pmurias: and just have my own folder ash_/favorite_modules.pm in ~/.perl6lib i guess
22:03 pmurias ash_: that might depend on the implementation, but something similiar should work
22:04 ash_ rakudo currently checks your ~/.perl6/lib fold in addition to its normal search path
22:04 ash_ s/fold/folder
22:09 soupdragon joined #perl6
22:32 stephenlb joined #perl6
22:34 dryden joined #perl6
22:40 rachelBROWN joined #perl6
22:49 mberends pmurias: hi, V8 build error log in http://paste.lisp.org/display/92785
22:51 dryden i was wondering if there exists a major fork in the Perl6 effort attempting to simply create the next version of the current Perl with very few changes...like a Perl with Moose like classes built into the core language, blocks/procs (..that might be difficult), more sugar, slightly better performance,...nothing too major.
22:51 rjbs No.
22:51 rjbs That's called Perl 5.
22:52 rjbs Perl 5 is not going to get Moose-like classes as part of the VM, pretty much period.  It has Moose.  Components are better than core features.
22:52 dryden i see. well thank you.
22:52 rjbs I'm not sure what you mean by blocks/procs as contrasted with coderefs, specifically.  It has Coro and other coroutine systems.
22:53 rjbs "more sugar" - there is constant discussion of more sugar for some things, which sometimes goes in and sometimes doesn't.
22:53 rjbs and "better performance" is *always* on the agenda.
22:54 payload joined #perl6
22:56 dryden by blocks and procs, i was referring to ruby's support for passing code blocks which is fairly awesome. but I see your point.
22:58 ash_ dryden: you can make anonymous blocks in perl 5 already, which are perfectly acceptable parameters for functions
22:59 dryden Oh well thank you ash_, it was stupid of me to put that on my little list. I feel rather silly now.
23:00 ash_ have you tried rakudo?
23:00 jferrero joined #perl6
23:00 Alias drbean, the call_a_function( $param1, sub { whatever } ) has worked for about 10 years
23:01 dryden ah i'm sad to say...i have not yet tried rakudo
23:01 Alias (in Perl 5 that is)
23:01 Alias dryden, what OS are you on?
23:02 dryden i'm currently using my xp partition.
23:02 soupdragon left #perl6
23:02 soupdragon joined #perl6
23:02 Alias drbean, if you install the Padre Standalone distro of Strawberry, and the Perl 6 plugin, it will automatically drop in Rakudo pre-built for you
23:02 ash_ if you like perl, its definitely worth trying out, read over the specs a bit to see what all is in it. a lot of it already works in rakudo
23:02 sjohnson a lot of huge improvements for sure
23:03 ash_ http://perlcabal.org/syn/ have the specs, i'd recommend at least glancing at a few, even if you don't plan on install rakudo right now
23:03 dryden thank you, i'll do that, i've been meaning to try rakudo.
23:04 ash_ rakudo: say "this also calls rakudo, if our in irc";
23:04 p6eval rakudo db84bc: this also calls rakudo, if our in irc␤
23:05 dryden wow that's awesome.
23:05 rjbs Rakudo is oodles of fun, even just to play in the repl.
23:05 rjbs when I finally start writing classes, I expect oodleplexes
23:05 dryden haha
23:06 ash_ multi-methods are probably my favorite part of perl 6
23:06 ash_ that and custom operators
23:06 ash_ rakudo: sub postfix:<!>(Int $x) { [*] 1..$x }; say 5!;
23:06 p6eval rakudo db84bc: 120␤
23:06 rjbs I like how well it all seems to hang together.
23:06 dryden that is so sweet
23:07 dryden i don't like how people like guido van rossum poke fun at the perl6 project for it's development time.
23:07 ash_ oh, and take a gander at the http://perl6advent.wordpress.com/
23:07 dryden good languages time to develop.
23:08 dryden thank you
23:08 ash_ rakudo: for^20{my ($a,$b)=<AT CG>.pick.comb.pick(*); my ($c,$d)=sort map {6+4*sin($_/2)},$_,$_+4; printf "%{$c}s%{$d-$c}s\n",$a,$b}
23:08 p6eval rakudo db84bc:      G  C␤      CG␤     G C␤   C    G␤ G     C␤ G     C␤ A   T␤  TA␤ AT␤ A   T␤ C     G␤  A     T␤   C    G␤     C G␤      CG␤    T   A␤  A     T␤ G     C␤ T    A␤ T  A␤
23:08 ash_ awww, i forgot p6eval removes new lines
23:09 ash_ i like that one, its from day 16
23:09 ash_ of the advent calendar
23:09 dryden sweet
23:10 ash_ joined #perl6
23:20 dryden hmm I'm trying to think of a fun question to ask this community of developers. I think i finally thought of a few. When did you first discover Perl? were you excited? what did you make/write?
23:20 cognominal joined #perl6
23:24 elmex dryden: 1999, no, an irc bot
23:25 diakopter dryden: 2003, kinda, spamassassin plugins/mods
23:25 dryden awesome
23:26 diakopter dryden: you?
23:27 dryden hmm...2005, yes very excited, and i wrote a project manager for the robotics team.
23:29 dryden i was very inexperienced, still am.
23:31 dryden wow you guys must be very experienced programmers, no wonder i'm so nervous.
23:32 diakopter ?
23:32 sjohnson dryden: i use perl mostly to make a *nix shell 100 times less of a headache
23:34 payload1 joined #perl6
23:34 dryden that awesome! i tried writing a commandline physics calculator in perl recently..it was lame.
23:38 rjbs I think my first Perl (4) program was used to assemble newsfroup posts into easily uudecodeable files.
23:39 dryden how long ago was this?
23:40 sjohnson also write a much better front-end to git than its out-of-the-box commands
23:41 sjohnson which also give me great headaches
23:42 dryden ah yes, all great programming stems from the effort to make life easier/headache free.
23:43 rjbs I dunno, '96?
23:43 dryden wow, that's a long time ago.
23:43 rjbs :'(
23:44 sjohnson i've been programming for only 2 years
23:44 sjohnson in Perl i mean
23:44 sjohnson i'd say flipping through the Camel book was probably the smartest thing i could have done, as far as trying to learn the language
23:44 dryden aww i didn't mean it like that rjbs: you're an experienced perl wizard.
23:44 sjohnson hugme: hug rjbs
23:44 * hugme hugs rjbs
23:44 dryden hugs rjbs
23:45 dryden ah, i love the camel book, i keep borrowing it from the library, i think it's about time i purchase one.
23:46 arnsholt dryden: For my part, 2003 (I think), a bit I think (can't rellay remember), and little bits and pieces mostly (due to my general problems of finishing what I start =)
23:46 arnsholt Add spelling to test
23:47 arnsholt Taste even >.<
23:47 sjohnson dryden: make sure you get the latest edition, though that isn't a challenge to do
23:47 dryden yeah i've lost count of the projects i'm started and haven't finished
23:47 dryden thank you sjohnson, i will.
23:48 arnsholt The Camel book is one of my favourite programming books. It's just so well written
23:48 sjohnson arnsholt: it is very funny too
23:48 arnsholt The K&R C book is another good one
23:48 dryden yeah it is rather funny
23:48 arnsholt sjohnson: Exactly. It's technical without being dry
23:48 sjohnson my brother doesnt "get" the humour in it.  i enjoy reading it and have had a few good laughs from it before
23:48 soupdragon I love the reasoned schemer but I haven't read very many programming books
23:48 eiro someone to tell me what is the ':' char in a regex ?
23:48 sjohnson it's like having your best friend who knows Perl well come over and explain it to you over a few beers
23:49 TiMBuS joined #perl6
23:49 eiro i just found that in S05:
23:49 eiro $string ~~ m/^ \d+ $/;
23:49 eiro $string ~~ m/^ \d+: $/;
23:49 sjohnson probably matches "3:  this is the third item"
23:49 arnsholt No
23:49 sjohnson ... oops
23:49 arnsholt In Perl 6 regexes : means something
23:49 eiro (difference between regex and token)
23:49 arnsholt 'sec
23:50 arnsholt Anything non-alphanumeric has to be backslashed now
23:50 eiro i'm trying to find the doc... would be in S05 too :=
23:50 dryden "You can't use colon for a regex delimiter any more. That's because regex modifiers may now be placed in front of a regex construct" -S05
23:51 arnsholt eiro: Under backtracking control, fourth bullet point
23:51 arnsholt It forces no backtracking to the preceding atom
23:52 sjohnson dryden: run perldoc perlbook for more info
23:52 eiro thanks to you all :)
23:52 arnsholt So /\d+:/ will eat up all consecutive whitespace and never backtrack into them
23:52 eiro arnsholt, i'm reading the doc and test it now.
23:53 dryden oh sweet, thanks sjohnson!
23:57 sjohnson dryden: for a great example of my favourite use of perl, it is allowing this:  http://pastebin.com/f76fff53a
23:57 sjohnson i have dozens upon dozens of userland perl hacks like this, that drastically reduce my headaches at work :)
23:58 rjbs hooray for hugs.
23:58 arnsholt sjohnson: Funky. You've aliased ls to some Perl script, I assume?
23:58 eiro arf ... is there a "backtrack for dummies" somewhere ?
23:58 rjbs I wish we had a bot that could give me a nap.
23:58 rjbs or debug my Inform code.
23:58 sjohnson indeed i have
23:59 arnsholt eiro: The Camel book describes it pretty well
23:59 sjohnson hugme: nap rjbs
23:59 dryden sorry, i was away, thanks again sjohnson
23:59 arnsholt In the regex chapter, there's a section on it (entitled "The little engine that could(n't)" if memory serves)
23:59 sjohnson oh ya and ls 0k  # works as ls -l too :)

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

Perl 6 | Reference Documentation | Rakudo