Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2010-08-10

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:18 colomon joined #perl6
00:19 colomon afk but back from vacation!
00:26 CaptTofu joined #perl6
00:46 ashleydev joined #perl6
00:59 cognominal is Nil supposed to be defined?  I have been bitten by something lile
01:00 cognominal rakudo:  class A {};  say A.?a //  "printed if Nil notdefined"
01:00 p6eval rakudo 4bd478: OUTPUT«␤»
01:01 cognominal I can used anyway but that surprised me
01:02 cognominal I meant, " I can use ||"
01:05 dduncan joined #perl6
01:05 drbean joined #perl6
01:09 lkk- joined #perl6
01:09 lkk- does perl6 have Array.scan method ?
01:10 tylercurtis lkk-: what do you want Array.scan to do?
01:11 tylercurtis rakudo: say ([\*] 1, 2, 3, 4, 5).join(', ')
01:11 p6eval rakudo 4bd478: OUTPUT«1, 2, 6, 24, 120␤»
01:12 lkk- tylercurtis: like ruby's , [1,2,3,4,5,6].scan(/../) => got [1,2],[3,4],[5,6]
01:12 Tene lkk-: Not all of us are familiar with Ruby.
01:12 Tene lkk-: What do you want to do that for, exactly?
01:12 * tylercurtis looks up ruby's scan.
01:12 dduncan left #perl6
01:12 lkk- Tene: ok
01:13 lkk- Tene: just ask
01:13 Tene rakudo: say (1..6).map({[$^a,$^b]}).perl
01:13 p6eval rakudo 4bd478: OUTPUT«([1, 2], [3, 4], [5, 6])␤»
01:13 Tene you can do it like that.
01:13 Tene lkk-: I ask, because some things in Perl 6 will do that for you.
01:13 Tene rakudo: for 1..6 -> $a, $b { say "$a -- $b" }
01:14 p6eval rakudo 4bd478: OUTPUT«1 -- 2␤3 -- 4␤5 -- 6␤»
01:14 lkk- Tene: thank you , I see
01:14 Tene map, for, etc. will accept as many parameters as their arity.
01:16 tylercurtis lkk-: is there an Array.scan method in ruby? I get a NoMethod error running your example code with ruby 1.8.6
01:16 lkk- tylercurtis: sorry , that have String.scan
01:17 _macdaddy joined #perl6
01:17 cotto_work joined #perl6
01:17 tuxuday joined #perl6
01:19 tylercurtis lkk-: so, "123456".scan(/../) should be ["12", "34", "56"]?
01:19 lkk- tylercurtis: yes , ruby just has String.scan , 'abcd'.scan(/../) => ["ab", "cd"]
01:19 tylercurtis star: say "123456".comb(/../).perl
01:19 p6eval star 2010.07: OUTPUT«("12", "34", "56")␤»
01:19 lkk- tylercurtis: comb , yes thank you
01:24 rcfox What's the purpose of Str.indent?
01:24 rcfox http://perlcabal.org/syn/S32/Str.html#indent
01:25 plobsing joined #perl6
01:25 rcfox Oh, I guess it might be useful for printing tree, or something.
01:26 rcfox I just had this image of people trying to pretty print code with it.
01:31 flatwhatson joined #perl6
01:44 melte is module importing NYI? as in: perl6 -e 'use Benchmark <timethis>'
01:45 melte star: use Benchmark <timethis>; # modules packaged with the bot?
01:45 p6eval star 2010.07: OUTPUT«===SORRY!===␤Unable to find module 'Benchmark' in the @*INC directories.␤(@*INC contains:␤  /home/p6eval/.perl6/lib␤  /home/p6eval/rakudo-star-2010.07/instal​l/lib/parrot/2.6.0/languages/perl6/lib␤  .)␤»
01:45 melte :(
01:48 tylercurtis rakudo: use Test; plan 5; ok 1, 'testing'; is 4, 5; lives_ok { &*foo(); }; dies_ok { die 1; }; nok False;
01:48 p6eval rakudo 4bd478: OUTPUT«1..5␤ok 1 - testing␤not ok 2 - ␤#      got: '4'␤# expected: '5'␤not ok 3 - ␤ok 4 - ␤ok 5 - ␤# Looks like you failed 2 tests of 5␤»
01:50 sorear module importing?  NYI?  Absolutely not
01:51 melte I mean...importing subs/variables, which does not work for me in the above case
01:51 sorear rcfox: It was designed by me for printing code, yes
01:52 sorear rcfox: extracted from viv
01:52 rcfox viv?
01:52 sorear melte: explicit import lists don't work
01:52 sorear rcfox: the 6->5 converter
01:52 colomon star: use Benchmark;
01:52 p6eval star 2010.07: OUTPUT«===SORRY!===␤Unable to find module 'Benchmark' in the @*INC directories.␤(@*INC contains:␤  /home/p6eval/.perl6/lib␤  /home/p6eval/rakudo-star-2010.07/instal​l/lib/parrot/2.6.0/languages/perl6/lib␤  .)␤»
01:53 colomon star: use benchmark;
01:53 p6eval star 2010.07: OUTPUT«===SORRY!===␤Unable to find module 'benchmark' in the @*INC directories.␤(@*INC contains:␤  /home/p6eval/.perl6/lib␤  /home/p6eval/rakudo-star-2010.07/instal​l/lib/parrot/2.6.0/languages/perl6/lib␤  .)␤»
01:53 melte hm. what is the package syntax for direct access, like perl5 Benchmark::timethis ?
01:53 tylercurtis Benchmark::timethis?
01:53 rcfox sorear: Only using spaces seems rather narrow-minded. That's probably going to sound offensive, but I couldn't think of a nicer way of saying it.
01:53 colomon Rakudo doesn't have a p6 Benchmark module.  Is it in R*?
01:54 rcfox colomon: I don't seem to have it.
01:54 sorear rcfox: indent is designed to do everything I need and nothing I don't
01:54 melte colomon: from modules.perl6.org, I'm playing/fixing my benchmarking
01:54 rcfox sorear: So then why is it in the spec?
01:54 sorear rcfox: I didn't need to indent code with asterisks then.  If you do, submit a RFC on p6l
01:55 sorear rcfox: Ask TimToady
01:55 sorear He's the one who pushed to move it into the spec
01:55 rcfox :\
01:55 CaptTofu joined #perl6
01:56 mantovani guys hi
01:57 mantovani I download rakudo, and when I try do "perl6 --help" I get,
01:57 mantovani nopaste ?
01:57 mantovani paste?
01:57 mantovani don't have bot :(
01:57 mantovani http://nopaste.snit.ch/22656
01:58 mantovani the error ^
01:58 mantovani or perl6 help, perl6 h
02:00 melte tylercurtis: is that's an answer (and not a question), it also doesn't work atm
02:00 tylercurtis melte: if there's a timethis sub in Benchmark, it should.
02:01 rcfox melte: Does 'use Benchmark' work?
02:02 melte rcfox: yes, silly :p
02:02 rcfox Just making sure...
02:02 melte $ perl6 -e 'use Benchmark; timethis(1, sub {}); Benchmark::timethis(1, sub {})'
02:02 melte $ perl6 -e 'use Benchmark; timethis(1, sub {}); Benchmark::timethis(1, sub {})'Can not find sub Benchmark::timethis
02:03 melte hm, weird paste
02:03 rcfox Is timethis declared with 'is export' ?
02:03 melte http://github.com/perlpilot/benchm​ark/blob/master/lib/Benchmark.pm6 for reference
02:03 melte yes
02:04 rcfox Hm.
02:04 sorear Is timethis declared with 'our'?
02:04 melte no
02:04 sorear then Benchmark::timethis won't work.
02:04 melte okay, thanks
02:05 rcfox Why is that?
02:05 melte and in theory if explicit imports worked, I could make that happen?
02:05 sorear melte: Why can't you just use "timethis"?
02:05 melte with something like: use Benchmark :OUR<timethis>
02:06 melte sorear: I can. was just trying to figure out if I could call a different non-exported sub
02:06 sorear melte: non-exported subs are completely private unless declared our
02:07 sorear you can't even request them with import lists
02:07 melte okay
02:13 anarchomaniac joined #perl6
02:20 [particle] melte: read synopsis 11 for more details
02:23 araujo joined #perl6
02:26 melte [particle]: thanks, I was browsing it
02:28 melte it'd be hard to find another resource anywhere, at the moment, that would explain the syntax for importation
02:30 agentzh joined #perl6
02:35 bwinkler joined #perl6
02:39 LaVolta joined #perl6
03:23 anarchomaniac joined #perl6
03:34 alc joined #perl6
04:01 TiMBuS joined #perl6
04:28 rcfox rakudo: my @arr = ([1,0],[0,1]); say @arr.perl; my @temp = @arr[1]; @arr[1] = @arr[0]; @arr[0] = @temp; @arr.perl; say @arr.perl;
04:28 p6eval rakudo 4bd478: OUTPUT«[[1, 0], [0, 1]]␤[[[0, 1]], [1, 0]]␤»
04:29 rcfox Why's it doing this?
04:29 rcfox And how do I fix it?
04:29 sorear Why's it doing what?
04:29 sorear Oh
04:29 rcfox It's got another level of indirection on @arr[0]
04:30 sorear You need to change @temp to $temp
04:30 sorear @arr[1] is being treated as a single list item, so assigning it to @temp promoted it to a one-element list
04:30 rcfox Oh, I see.
04:31 rcfox Thanks.
04:43 dudulz joined #perl6
04:45 mantovani joined #perl6
04:45 alc joined #perl6
04:45 rcfox rakudo: my @arr = 1..5; @arr »+=» 1; say @arr
04:45 p6eval rakudo 4bd478: OUTPUT«Cannot modify readonly value␤  in '&infix:<=>' at line 1␤  in <anon> at line 204:CORE.setting␤  in 'hyper' at line 1␤  in 'hyper' at line 211:CORE.setting␤  in main program body at line 1␤»
05:12 anarchomaniac left #perl6
05:15 dalek niecza: c11c833 | sorear++ |  (4 files):
05:15 dalek niecza: Rebuild regex engine using gather/take and coroutines
05:15 dalek niecza: review: http://github.com/sorear/niecza/commit/c​11c83383f9126e115a6186429c67144b38cb09d
05:26 Mowah joined #perl6
05:41 kaare joined #perl6
05:45 drbean joined #perl6
05:49 cjk101010 joined #perl6
05:54 alester Thanks, moritz++ http://perlbuzz.com/2010/08/im-g​lad-to-hear-rakudo-is-slow.html
06:00 wtw joined #perl6
06:06 dalek niecza: 6773107 | sorear++ | Kernel.cs:
06:06 dalek niecza: Fix recursive gather/take
06:06 dalek niecza: review: http://github.com/sorear/niecza/commit/6​773107adb5060a49c7b59868c6716dcc5f4bfa3
06:06 dalek niecza: 8ea4ced | sorear++ |  (4 files):
06:06 dalek niecza: Implement <foo> and <.foo> in regexes
06:06 dalek niecza: review: http://github.com/sorear/niecza/commit/8​ea4ceda744c4ea30c22211a24254f3ff3695c5f
06:09 melte I wonder how much overall speed improvement will come from isolated changes. like it seems generating and/or assigning lists/ranges is really slow (my @a = ^10000)
06:11 alc joined #perl6
06:11 melte most of the slowness in my code is using for loops like that, 10x slower than while or loop
06:13 sorear that's not much of a suprise
06:13 sorear there's a lot of overhead in the lazy list system
06:13 * melte nods
06:20 moritz_ good morning
06:21 uniejo joined #perl6
06:24 sorear hello moritz
06:25 sorear (hmm.  given that I have source position annotations and $?ORIG already, I wonder how hard it would be to add Code.Str)
06:27 simcop2387 joined #perl6
06:40 wamba joined #perl6
06:43 Axius joined #perl6
06:45 masak joined #perl6
06:45 masak good morning, #perl6.
06:46 sorear hello masak
06:46 sorear I finally got subrules working in niecza
06:46 masak great.
06:46 masak sorear: can you backtrack into a subrule?
06:47 masak [backlog] cognominal is surprised over A.?a // "fallback" not working as Least Surprise expects. we need to do something about this.
06:49 sorear masak: not only can you, but you must!  ratcheting is NYI
06:49 masak mantovani: thanks for making us aware of this. I will submit a ticket about it, and it'll hopefully get fixed for the next release.
06:49 * masak submits rakudobug about 'perl6 --help' not working
06:52 masak what mechanism re-awakens a subrule that has already returned a Match?
06:52 d4rt joined #perl6
06:55 masak sorear: ^
07:20 Axius joined #perl6
07:29 sorear masak: a subrule looks like sub subrule($c) { gather ... lots and lots of loops ... { take $newc } }
07:29 sorear masak: re-awakening is just shifting off another cursor
07:30 masak ooh, nice.
07:32 cognominal rakudo: my @a;  say @a?[0].perl
07:32 p6eval rakudo 4bd478: OUTPUT«===SORRY!===␤Confused at line 22, near "say @a?[0]"␤»
07:33 masak cognominal: only methods.
07:33 cognominal too bad.
07:33 masak cognominal: why? .[] already DTRT.
07:33 Su-Shee joined #perl6
07:33 masak as does .{}
07:34 cognominal Can I chain it?
07:34 masak yes.
07:34 cognominal rakudo: my @a;  say @a?[0].?a
07:34 p6eval rakudo 4bd478: OUTPUT«===SORRY!===␤Confused at line 22, near "say @a?[0]"␤»
07:34 cognominal oops
07:34 cognominal rakudo: my @a;  say @a[0].?a
07:34 p6eval rakudo 4bd478: OUTPUT«␤»
07:34 cognominal ok, cool
07:35 cognominal rakudo: my @a;  say @a[0].perl
07:35 p6eval rakudo 4bd478: OUTPUT«Any␤»
07:42 d4rt joined #perl6
07:55 rcfox Use of uninitialized value in numeric context
07:55 rcfox I wish it would tell me where or what. :\
07:55 Casan joined #perl6
07:55 masak rcfox: do you have a golfed example?
07:55 lauanana joined #perl6
07:55 sorear niecza: my $x; say $x + 2
07:55 p6eval niecza 8ea4ced: OUTPUT«Unhandled exception: System.NullReferenceException: Object reference not set to an instance of an object␤  at Niecza.Kernel.UnboxDO (Niecza.DynObject o) [0x00000] in <filename unknown>:0 ␤  at Niecza.Kernel.UnboxAny (IP6 o) [0x00000] in <filename unknown>:0 ␤  at
07:55 p6eval ..SAFE.Infix_46C (Ni…
07:56 rcfox masak: Not really...
07:57 rcfox rakudo: my $x; say $x + 2
07:57 p6eval rakudo 4bd478: OUTPUT«Use of uninitialized value in numeric context␤2␤»
07:57 sorear rakudo++
07:57 rcfox Hm, it still tries to evaluate it... That's... annoying...
07:58 sorear on the other hand, maybe you would have preferred the crash with full backtrace niecza gives :p
07:58 rcfox Indeed.
07:59 rcfox How does this --trace flag work?
07:59 cono joined #perl6
08:01 sorear try perl6 --trace=4 -e '2+2'
08:01 rcfox Oh boy...
08:01 sjohnson joined #perl6
08:03 sorear Then you'll love --trace=1
08:03 rcfox :P
08:07 sorear rakudo: class Foo { method a:baz {}; method b:!cow {}; method c:sym<baz> {}; method d:foo<a b> {}; }; say Foo.^methods(:local).Str
08:07 p6eval rakudo 4bd478: OUTPUT«c:sym<baz> b:!cow d:foo<a b> a:baz␤»
08:08 sorear rakudo: class Foo { method a:baz['x','y'] {}; method b:foo< a > {}; }; say Foo.^methods(:local).Str
08:08 p6eval rakudo 4bd478: OUTPUT«a:baz['x','y'] b:foo< a >␤»
08:08 sorear :/
08:08 moritz_ sorear: btw it seems that niecza automatic rebuild now works
08:08 sorear moritz_++ !
08:09 moritz_ the order of PATH entries was different on interactive shell and cron, so the cron script would pick up a perl with some missing modules
08:10 sorear yow.
08:18 moritz_ star: my @array = ( 1 , 2 , 3 , 4 );
08:18 p6eval star 2010.07:  ( no output )
08:18 moritz_ star: my @array = ( 1 , 2 , 3 , 4 ); say "a: @array[]"
08:18 p6eval star 2010.07: OUTPUT«a: 1 2 3 4␤»
08:20 moritz_ star: my @array = ( 1 , 2 , 3 , 4 ); say "a: @array.sort()"
08:20 p6eval star 2010.07: OUTPUT«a: 1 2 3 4␤»
08:22 sorear What does method ::foo {} mean?
08:22 sorear Or is it a semantic error I should sorry on?
08:22 cono std: say "a: @(3, 2, 1).sort()"
08:22 p6eval std 31912: OUTPUT«ok 00:01 116m␤»
08:23 cono rakudo: say "a: @(3, 2, 1).sort()"
08:23 p6eval rakudo 4bd478: OUTPUT«a: 1 2 3␤»
08:23 moritz_ sorear: I have no idea :(
08:24 * sorear adds a not understood #XXX
08:25 LaVolta joined #perl6
08:25 squeeky good morning, channel.
08:25 moritz_ good morning squeeky
08:26 cono squeeky: morning
08:26 moritz_ iirc you were happy in the backlog... did you managed to fix R* packaging?
08:26 squeeky yes. I'm now waiting for it to be included in.
08:26 squeeky http://github.com/mxcl/homebrew/issues/issue/2122 btw.
08:28 moritz_ what did you need to change to make it run?
08:28 squeeky stop using rakudo's bootstrap of parrot and just use parrot as a separate dep.
08:28 moritz_ sounds sane for packaging
08:29 moritz_ btw http://www.perlmonks.org/?node_id=853975 more Perl 6 questions on perlmonks :-)
08:33 * sorear might need to rephrase a few of these error messages for the 1.0 release
08:33 sorear $M->sorry('Defining a non-our sub with a package-qualified name makes no sense');
08:33 mathw moritz_: nice, a sensible question too
08:33 mathw moritz_: and your answer is a masterpiece of clarity and elegance
08:34 moritz_ thanks
08:34 moritz_ sorear: I plan to work on unifying (and objectifying) error messages anyway
08:35 moritz_ ie a catalog of error messages, and have them wrapped in objects to make them introspectable
08:35 moritz_ and with i18n hooks etc.
08:36 rcfox Blah.
08:36 moritz_ blah?
08:36 rcfox I seem to have a choice between infinite recursion and undefined values.
08:37 sorear moritz_: unifying across all compilers?
08:37 moritz_ not good
08:39 moritz_ sorear: yes
08:39 moritz_ sorear: and in the test suite
08:39 moritz_ sorear: I want something that can easily be smart-matched against
08:40 moritz_ something like   when X::CompileTime & X::Fatal { ... }  maybe
08:41 sorear moritz_: one spec change I'd really like to see is for eval to stop catching exceptions
08:41 moritz_ sorear: me too
08:44 arnsholt joined #perl6
08:44 dakkar joined #perl6
08:46 cono rakudo: say "a: @(3 2 1).sort()"
08:46 p6eval rakudo 4bd478: OUTPUT«===SORRY!===␤Unable to parse circumfix:sym<sigil>, couldn't find final ')' at line 22␤»
08:49 rcfox Woo, I got it to work!
08:49 rcfox It's kinda dumb that you need to use temporary variables...
08:50 cognominal joined #perl6
08:51 rcfox rakudo: role n { method Num { self.(); }}; my $a = {2} does n; my $b = {3} does n; my $c = {$a*$b} does n; $a = {1+$c}; say $a();
08:51 p6eval rakudo 4bd478: OUTPUT«Method 'Num' not found for invocant of class 'Block'␤  in 'Cool::Numeric' at line 1757:CORE.setting␤  in 'Cool::Numeric' at line 1758:CORE.setting␤  in 'infix:<*>' at line 6581:CORE.setting␤  in <anon> at line 22:/tmp/7LebBuEuxI␤  in 'Num' at line 22:/tmp/7LebBuEuxI␤  in
08:51 p6eval ..'Cool::Num…
08:51 moritz_ rakudo: my %h = a => 1, b => 2; say "%h{}"
08:51 p6eval rakudo 4bd478: OUTPUT«1 2␤»
08:51 rcfox rakudo: role n { method Num { self.(); }}; my $a = {2} does n; my $b = {3} does n; my $c = {$a*$b} does n; $a = {1+$c} does n; say $a();
08:51 p6eval rakudo 4bd478: OUTPUT«maximum recursion depth exceeded␤  in 'Num' at line 22:/tmp/R4XlUYMgzl␤  in 'Num' at line 22:/tmp/R4XlUYMgzl␤  in 'Cool::Numeric' at line 1757:CORE.setting␤  in 'Cool::Numeric' at line 1758:CORE.setting␤  in 'infix:<+>' at line 6581:CORE.setting␤  in <anon> at line
08:51 p6eval ..22:/tmp/R4XlUYMg…
08:52 rcfox On one hand, it makes sense. Obviously, there's a recursive circle there.
08:52 rcfox On the other hand, why can't I tell it that I mean to use a different reference?
08:53 rcfox rakudo: my $a = {2}; say $a; $a = {$a+1}; say $a;
08:53 p6eval rakudo 4bd478: OUTPUT«_block112␤_block134␤»
08:54 rcfox See, they're different blocks.
08:54 masak joined #perl6
08:55 sorear {2} does n is an error
08:55 rcfox Why?
08:56 sorear because {2} is not a modifiable lvalue
08:56 sorear the operator you seem to want is "but"
08:56 rcfox does works though.
08:57 rcfox rakudo: role n { method Num { self.(); }}; my $a = {2} does n; say $a+1;
08:57 p6eval rakudo 4bd478: OUTPUT«3␤»
08:57 sorear rakudo doesn't implement rw-checking completely
08:57 rcfox rakudo: role n { method Num { self.(); }}; my $a = {2} but n; say $a+1;
08:57 p6eval rakudo 4bd478: OUTPUT«3␤»
08:58 drbean joined #perl6
08:59 cono rcfox: {2} <- block here?
08:59 sorear {2} does n, iiuc, applies n to all Block instances
09:00 rcfox rakudo: role n { method Num { self.(); }}; my $a = {2} does n; my $b = {3}; say $b+1;
09:00 rcfox cono: Yes.
09:00 p6eval rakudo 4bd478: OUTPUT«Method 'Num' not found for invocant of class 'Block'␤  in 'Cool::Numeric' at line 1757:CORE.setting␤  in 'Cool::Numeric' at line 1758:CORE.setting␤  in 'infix:<+>' at line 6581:CORE.setting␤  in main program body at line 22:/tmp/gndvOWs7d5␤»
09:00 Axius joined #perl6
09:00 cono not for all blocks
09:01 rcfox rakudo: role n { method Num { self.(); }}; my $a = {2}; my $b = {3} does n; say $a+1;
09:02 p6eval rakudo 4bd478: OUTPUT«Method 'Num' not found for invocant of class 'Block'␤  in 'Cool::Numeric' at line 1757:CORE.setting␤  in 'Cool::Numeric' at line 1758:CORE.setting␤  in 'infix:<+>' at line 6581:CORE.setting␤  in main program body at line 22:/tmp/DzI1ogPBLJ␤»
09:03 briang joined #perl6
09:03 sorear rakudo: role n { method Num { self.(); }}; my $a = {2}; my $b = $a does n; say $a + 1;
09:03 p6eval rakudo 4bd478: OUTPUT«3␤»
09:03 sorear rakudo: role n { method Num { self.(); }}; my $a = {2}; my $b = $a but n; say $a + 1;
09:03 p6eval rakudo 4bd478: OUTPUT«Method 'Num' not found for invocant of class 'Block'␤  in 'Cool::Numeric' at line 1757:CORE.setting␤  in 'Cool::Numeric' at line 1758:CORE.setting␤  in 'infix:<+>' at line 6581:CORE.setting␤  in main program body at line 22:/tmp/qFdxqFTI6s␤»
09:04 cono rakudo: role n { method Num { self.(); }}; my $a = {2}; my $b = $a but n; say $b + 1;
09:04 p6eval rakudo 4bd478: OUTPUT«3␤»
09:05 cono Ah, I got the "but" keyword :)
09:05 rcfox rakudo: my $a = 1 but n; say $a +1
09:05 p6eval rakudo 4bd478: OUTPUT«Could not find sub &n␤  in main program body at line 22:/tmp/7BOQ5duBWZ␤»
09:05 rcfox Whoops.
09:06 rcfox rakudo: role n { method Num { self.(); }}; my $a = 1 but n; say $a +1
09:06 p6eval rakudo 4bd478: OUTPUT«2␤»
09:06 rcfox Hm.
09:06 rcfox If nothing else, but is more convenient.
09:06 rcfox rakudo: role n { method Num { self.(); }}; my $a = 1 does n; say $a +1
09:06 p6eval rakudo 4bd478: OUTPUT«2␤»
09:06 rcfox ...
09:06 rcfox rakudo: role n { method Num { self.(); }}; my $a = 1; $a does n; say $a +1
09:06 p6eval rakudo 4bd478: OUTPUT«2␤»
09:06 rcfox What.
09:07 rcfox This is been complaining to me in my code...
09:07 moritz_ note that + used the Numeric method, not Num
09:07 rcfox Oh.
09:07 dalek book: 7875129 | moritz++ | src/basics.pod:
09:07 dalek book: [basics] be more verbose about interpolation of arrays and hashes; more examples
09:07 dalek book: review: http://github.com/perl6/book/commit/78​751291b0728d9f6da9f2c4a22838aa3df266fa
09:07 rcfox rakudo: role n { method Numeric { self.(); }}; my $a = 1; $a does n; say $a +1
09:07 p6eval rakudo 4bd478: OUTPUT«2␤»
09:07 rcfox :\
09:08 rcfox rakudo: role n { method Numeric { self.(); } method Num { self.(); }}; my $a = 1; $a does n; say $a +1
09:08 p6eval rakudo 4bd478: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 22␤»
09:08 rcfox Bah!
09:08 moritz_ though it might not work for numbers at all
09:08 moritz_ why would you coerce a number to Numeric after all?
09:08 rcfox Well, it would complain to me if I tried to give an Integer a Num() method.
09:08 sorear you're also assuming that numbers are Perl 6 objects
09:08 sorear which is not 100% true yet
09:09 sorear there's still a bit of backdoor dealing with parrot-level operators
09:09 rcfox rakudo: role n { method Num { self.(); }}; my Int $a = 1; $a does n;
09:09 sorear someone else probably knows the rules in more detail
09:09 p6eval rakudo 4bd478:  ( no output )
09:09 rcfox rakudo: role n { method Num { self.(); }}; my Int $a = 1; $a does n; say $a+1;
09:09 p6eval rakudo 4bd478: OUTPUT«2␤»
09:09 rcfox star: role n { method Num { self.(); }}; my Int $a = 1; $a does n; say $a+1;
09:09 p6eval star 2010.07: OUTPUT«2␤»
09:10 rcfox star: role n { method Num { self.(); }}; my Num $a = 1; $a does n; say $a+1;
09:10 p6eval star 2010.07: OUTPUT«Type check failed for assignment␤  in '&infix:<=>' at line 1␤  in main program body at line 22:/tmp/BxF98_6Ux6␤»
09:10 sorear std: $::::Foo
09:10 p6eval std 31912: OUTPUT«ok 00:01 112m␤»
09:10 sorear I don't think that should be legal
09:10 cono rakudo: role n { method Num { self.() - 1; }}; my Num $a = 5; $a does n; say $a+1;
09:10 p6eval rakudo 4bd478: OUTPUT«Type check failed for assignment␤  in '&infix:<=>' at line 1␤  in main program body at line 22:/tmp/8gKScd1DI3␤»
09:11 cono rakudo: role n { method Num { self.() - 1; }}; my $a = 5; $a does n; say $a+1;
09:11 p6eval rakudo 4bd478: OUTPUT«6␤»
09:11 cono rakudo: role n { method Numeric { self.() - 1; }}; my $a = 5; $a does n; say $a+1;
09:11 p6eval rakudo 4bd478: OUTPUT«6␤»
09:11 rcfox That's odd...
09:11 rcfox Oh.
09:12 rcfox Er.
09:15 rcfox Blah, formatting output from Octave for comparison in my tests is a pain.
09:15 moritz_ are you doing matrixy stuff?
09:16 rcfox Yep.
09:16 moritz_ did you see colomon's Vector module?
09:17 rcfox I looked at it, but mine thing is special. ;)
09:17 moritz_ ok
09:18 rcfox Also, he does weird stuff with fixed sizes. :x
09:19 cognominal joined #perl6
09:19 masak today's autopun from jonasbn. http://twitter.com/jonasbn/status/20780159951
09:19 rcfox Heh.
09:19 moritz_ :-)
09:20 arnsholt XD
09:22 masak cono++ # encouraging me to think about pack/unpack with http://github.com/cono/p6-pack-unpack
09:24 Sanitoeter joined #perl6
09:32 moritz_ phenny: tell jnthn could you maybe take a look at http://www.perlmonks.org/?node_id=853113 ? seems to be an MSI installier issue
09:32 phenny moritz_: I'll pass that on when jnthn is around.
09:32 masak gm
09:32 masak moritz_: how do you manage to keep track of perlmonks all the time? is there a feed?
09:33 moritz_ masak: I'm currently going through "Seekers of Perl Wisdom". Usually I update the "Newest Nodes" a few times a day
09:33 masak ok. wow.
09:36 szbalint yeah, dedication :)
09:37 M_o_C joined #perl6
09:41 cognominal joined #perl6
09:42 cono masak: I guess sub pack must have prototype: Str, List?
09:42 masak um. possible confusion of terms detected.
09:42 masak do you mean a subroutine signature?
09:43 cono masak: yeah :)
09:43 masak cono: it's all in S32/Str. you really should look there.
09:43 cono masak: okie
09:43 masak our buf8 multi pack( *@items where { @items »~~» Pair })
09:43 masak our buf8 multi pack( Str $template, *@items )
09:44 moritz_ where { [&&] @items »~~» Pair }  # no?
09:45 moritz_ otherwise it just evalutes a list of bools for truthness
09:46 rcfox moritz_: Here's what my matrix class can do, with an example of forward kinematics from my robotics course. http://gist.github.com/516995
09:46 cono Every item of array is a Pair?
09:46 moritz_ rcfox: cool
09:46 masak moritz_: oh, you're right. fixing.
09:47 rcfox It's probably going to be really slow in the long run though. :P
09:47 dolmen joined #perl6
09:47 pugssvn r31937 | masak++ | [S32/Str] fixed thinko in &pack signature
09:47 pugssvn r31937 |
09:47 pugssvn r31937 | Spotted by moritz++
09:48 dolmen \o/
09:49 moritz_ o/
10:00 Italian_Plumber joined #perl6
10:03 cono masak: don't see > and < specifiers
10:04 tadzik joined #perl6
10:04 tadzik o/
10:04 masak cono: good point. what are those?
10:04 masak tadzik! \o/
10:04 cono masak: force big or little endians
10:05 masak huh.
10:05 masak the more I learn about &pack, the more I realize we have to take this one piece at a time :)
10:05 sorear I love the way perl 5 will Str-ify array refs without warning.  Not.
10:06 moritz_ you can bless them, and emit a warning in the overloaded stringification method :-)
10:06 cono masak: iiuc grammar not apply to this kind "(ccc)@23"
10:07 masak cono: looks to me it does.
10:07 cono masak: it means to null-fill group (ccc) to 23 bytes
10:07 masak cono: it'd divide it into one <group> and one <specifier> <count>
10:08 masak cono: so it sees two <template>s.
10:08 cono ah, yeah, sorry
10:10 cono masak: (c)[s] is parse like (c) <- group [s <- specifier ] ?
10:11 masak no, the [s] would parse as <count>
10:11 masak which would contain a <specifier>.
10:12 cono masak: perl -e 'print pack("(cc)[@]", 10, 10, 10)'
10:15 oha are the spec to port the pack as it was in perl5? or are the pack going to get only something from p5?
10:16 clintongormley joined #perl6
10:17 moritz_ a 1:1 port doesn't make sense, if you ask me
10:17 moritz_ because the languages are too different
10:17 thebird joined #perl6
10:18 moritz_ speaking of output formatting... I kinda yearn for a printf with named parameters
10:18 moritz_ which would make much sense in the context of error messages, for example
10:18 masak sushi &
10:18 moritz_ different languages might need to access the information to be included in error messages in different order
10:19 sorear that's been part of ISO sprintf for a couple years
10:19 moritz_ do you know the syntax for it?
10:20 sorear perl6: printf "%2$d %1$d\n", 5, 10
10:20 p6eval rakudo 4bd478: OUTPUT«===SORRY!===␤Symbol '$d' not predeclared in <anonymous> (/tmp/J0fc7L8ZCF:22)␤»
10:20 p6eval ..pugs: OUTPUT«*** Undeclared variable: ("$d",MkPad (padToList [("$_",PELexical {pe_type = (mkType "Scalar"), pe_proto = <Scalar:0x2b09f2a6f4e9>, pe_flags = MkEntryFlags {ef_isContext = True}, pe_store = <ref:0x2b09f2a6f3b1>}),("@_",PELexical {pe_type = (mkType "Array"), pe_proto = <Array:0x2b09f…
10:20 moritz_ sorear: that's positional, not named
10:20 sorear perl6: printf "%2\$d %1\$d\n", 5, 10
10:20 p6eval rakudo 4bd478:  ( no output )
10:20 p6eval ..pugs: OUTPUT«pugs: Printf.printf: bad formatting char $␤»
10:20 sorear moritz_: the "in different order" part through me off, sorry
10:21 moritz_ though we might generalize the syntax to %varname$format
10:22 sorear in any case I wonder if there is a more quintessentially Perl way to do formats
10:22 envi^home joined #perl6
10:23 oha moritz_, as i were speaking with masak, i see that pack is a single total operation, but it could be nice to use the Buf item as a fifo, where you can push and shift things
10:23 sorear besides eval "\"$format\""
10:23 dalek niecza: 4ecd8ab | sorear++ |  (5 files):
10:23 dalek niecza: Overhaul handling of names; make &infix:<+> and leading double colons work
10:23 dalek niecza: review: http://github.com/sorear/niecza/commit/4​ecd8ab51f4ffa9ad710abf49350672ccce60df5
10:33 oha rakudo: sub foo (&code(Str)) { code("foo"); }; foo( -> Str $s { say $s; });
10:33 p6eval rakudo 4bd478: OUTPUT«Not enough positional parameters passed; got 0 but expected 1 in sub-signature of parameter &code␤  in 'foo' at line 22:/tmp/driIJrsAM5␤  in main program body at line 22:/tmp/driIJrsAM5␤»
10:34 oha rakudo: sub foo (&code(Str)) { code("foo"); }; foo(sub (Str $s) { say $s; });
10:34 p6eval rakudo 4bd478: OUTPUT«Not enough positional parameters passed; got 0 but expected 1 in sub-signature of parameter &code␤  in 'foo' at line 22:/tmp/rmYK3mLftX␤  in main program body at line 22:/tmp/rmYK3mLftX␤»
10:34 oha why?
10:36 ak_ joined #perl6
10:50 kaare_ moritz_: Your blog post has a bad <a> tag
10:52 azert0x joined #perl6
10:52 azert0x joined #perl6
10:54 lafille joined #perl6
10:57 tadzik masak: hmm, shouldn't ufo/pls/whatever install pod files too, not only pm/pm6?
10:57 oha rakudo: my %h; %h{'oo'} = 3; my $m = "foo bar" ~~ /o./; say %h{$m};
10:57 p6eval rakudo 4bd478: OUTPUT«maximum recursion depth exceeded␤  in 'Block::count' at line 5621:CORE.setting␤  in 'Block::count' at line 5625:CORE.setting␤  in 'Any::postcircumfix:<{ }>' at line 1␤  in <anon> at line 1␤  in 'Any::postcircumfix:<{ }>' at line 1␤  in <anon> at line 1␤  in
10:57 p6eval ..'Any::postcircumfix:<{ }…
10:58 M_o_C joined #perl6
10:58 oha rakudo: my %h; %h{'oo'} = 3; my $m = "foo bar" ~~ /o./; say %h{"$m"};
10:58 p6eval rakudo 4bd478: OUTPUT«3␤»
10:58 oha isn't it a bug?
10:59 meppl joined #perl6
10:59 sorear >250 tests! \o/
11:00 Italian_Plumber joined #perl6
11:00 colomon oha: it's a known issue
11:00 dalek niecza: 108e2bb | sorear++ |  (4 files):
11:00 dalek niecza: Implement optional parameters and default values
11:00 dalek niecza: review: http://github.com/sorear/niecza/commit/1​08e2bb37fe31045820c0104ed7a633e1dfd7dc1
11:00 oha i will not fill a bug, ty colomon
11:04 cognominal joined #perl6
11:04 Woody2143 joined #perl6
11:08 cspencer joined #perl6
11:11 BooK joined #perl6
11:11 jferrero joined #perl6
11:12 moritz_ kaare_: fixed, thanks
11:15 sECuRE left #perl6
11:17 * sorear can now compile around 20% of STD.pm6... pity most of that is comments
11:18 cspencer hello, all!
11:19 arnsholt sorear: What, you want to compile actual code? You're weird ;p
11:19 dalek niecza: a7c5198 | sorear++ | Niecza/Actions.pm:
11:19 dalek niecza: Fix $foo.<bar> syntax
11:19 dalek niecza: review: http://github.com/sorear/niecza/commit/a​7c5198b211bb38adc47e1db0eab2070b462ba67
11:19 cspencer i've got a quick question re: the <...> circumfix op for constructing parcels - is it possible to including characters like \n or \t in there and have them appear as the intended characters?
11:19 cspencer ie) <\n \t \r>
11:20 moritz_ cspencer: no, only witgh <<...>>
11:20 cspencer ah, thanks :)
11:20 moritz_ rakudo: say <<a\nb c\td>>.perl
11:20 p6eval rakudo 4bd478: OUTPUT«("a\\nb", "c\\td")␤»
11:20 moritz_ hum
11:20 moritz_ that did not interpolate
11:20 cspencer (what're the name of those ops anyways?  i'm trying to find them in the docs)
11:20 cspencer no, it doesn't appear it did :)
11:21 moritz_ cspencer: "angle quotes", "circumfixes"
11:21 moritz_ S02/Literals/
11:21 cspencer thanks, mortiz!
11:22 cspencer it seems like there's been a lot of change since i last paid attention about a year ago :)
11:22 moritz_ a lot also stayed the same (at least in spec land)
11:23 cspencer yes, i'm just starting to re-read through things again to get refamiliarized
11:29 abrasive left #perl6
11:33 * masak is back
11:36 cono masak: perl -e 'print pack("(cc)[@]", 10, 10, 10)'
11:36 cono masak: and Grammar already works in rakudo ?
11:36 masak cono: don't know what you want to say with the one-liner.
11:36 masak cono: yes, grammars work well in Rakudo.
11:37 cono masak: matched by gramar, but wrong
11:37 masak wrong how?
11:38 masak remember that I'm not an expert in Perl 5's pack.
11:38 cono masak: Within []-length '@' not allowed in pack at -e line 1.
11:38 masak that's more of a runtime issue than a parsing issue.
11:38 masak of course, we could disallow it at parse time, too.
11:38 masak but I'm not sure we need to bog down the spec with that.
11:39 cono masak: ok, I will learn about Grammar, and will try to implement :)
11:39 masak cono++
11:39 cono masak: thanks
11:44 briang left #perl6
11:50 pugssvn r31938 | masak++ | [S32/Str] nicer where clause for &pack
11:50 pugssvn r31938 |
11:50 pugssvn r31938 | Reads better and is more amenable to compiler optimization. Suggested by
11:50 pugssvn r31938 | TheDamian++.
11:51 takadonet morning all
11:53 rgrau joined #perl6
11:56 alc joined #perl6
11:58 clintongormley joined #perl6
12:04 szabgab masak: jnthn either of you planning to attend http://fscons.org/ ?
12:05 masak not until you mentioned it, no :)
12:05 masak jnthn is afk until tomorrow.
12:06 szabgab its in Gotenburg
12:06 szabgab and I am not sure where do you live ?
12:06 leprevost joined #perl6
12:06 szabgab besides on #perl6 I mean
12:06 masak other side of the country, but east-west is not so long a distance. :)
12:07 moritz_ :-)
12:07 moritz_ rakudo: say ?( all( "a" => 1, "b" => 2) ~~ Pair)
12:07 p6eval rakudo 4bd478: OUTPUT«0␤»
12:08 masak moritz_: what happened there?
12:08 moritz_ masak: rakudo uses smart-matching for type checks. So it checks if the LHS is a Pair - it's not. It's a Junction.
12:09 oha moritz_, so junction don't go over smart match boundaries?
12:09 masak put differently, infix:<~~> is too posh for autothreading?
12:09 moritz_ which is wrong, afaict. It should be using .does or .isa for typec checking
12:09 Axius joined #perl6
12:09 masak oh, good.
12:09 masak is this in RT?
12:09 moritz_ and properly autothread over ~~
12:09 moritz_ not sure
12:10 * masak submits rakudobug
12:10 szabgab masak: so tell me if you submit a talk proposal and if they accept it
12:10 szabgab it is afeter the dead line already
12:10 szabgab but I think they still sort of accept
12:10 masak szabgab: huh. bit busy this week with GSoC and things.
12:10 masak but I'll see what I can do.
12:12 masak szabgab++ # using the 'kameler' Swedish maining list as a communication medium
12:12 dolmen masak: pack template is a language itself
12:12 masak dolmen: yes, it is indeed.
12:12 szabgab masak: apparently I am the only one using it :)
12:12 masak dolmen: was that within some context in particular? :)
12:12 masak szabgab: more or less, yes. it's not very active.
12:14 dolmen masak: you didn't mention it in "The Prince of Parsea"? Or is my memory failng?
12:14 moritz_ speaking of which... are the slides online somewhere?
12:14 masak dolmen: I didn't, correct.
12:14 masak yes. the usual place.
12:14 masak http://feather.perl6.nl/~masak
12:15 * dolmen is maybe mixing masak's talk with jnthn's one about Signatures
12:15 moritz_ indeed
12:15 moritz_ (re slides)
12:15 masak dolmen: thing is, they're really just string literals, so in my diagram I don't count them as a sublanguage.
12:15 masak dolmen: they would count as a "poor man's sublanguage", though.
12:16 dolmen I wonder if Perl6's pack templates should not be implemented as Signature instead of Str
12:16 masak a bit the same way a set of clever subroutine names are a "poor man's DSL" :)
12:16 masak dolmen: that's an intriguing idea. sounds like a good idea for a module.
12:17 moritz_ masak++ "Embrace your inner lollipop"
12:17 masak :)
12:17 masak TimToady laughed at that one :)
12:17 dolmen :)
12:19 dolmen what is the original culture reference of "Embrace your inner..."?
12:19 Su-Shee psychology of the late 70ies/early 80ies. "embrace your inner child" stuff.
12:22 envi^home joined #perl6
12:27 rgrau_ joined #perl6
12:27 moritz_ sub mkdir-p(@a) {
12:27 moritz_ for [\~] @a.map({"$_/"}) {
12:27 moritz_ mkdir($_) unless .IO.d
12:27 moritz_ }
12:27 moritz_ }
12:28 * moritz_ loves Perl 6
12:28 frettled ooh
12:29 masak moritz_++
12:29 dolmen Su-Shee++
12:29 frettled (++)++
12:29 masak meta++
12:29 cono moritz_: *~~:d does the same as .IO.d ?
12:29 frettled ‡++
12:29 Su-Shee morse--.--. ;)
12:29 frettled Su-Shee: you win :D
12:29 moritz_ cono: you actually need .IO on the RHS of ~~ :d too
12:29 * masak bows to Su-Shee's skillz
12:30 moritz_ rakudo: say '/etc/'.IO ~~ :d
12:30 p6eval rakudo 4bd478: OUTPUT«1␤»
12:30 masak moritz_: LHS.
12:30 moritz_ erm, yes
12:30 moritz_ rakudo: say '/etc/'.IO.d
12:30 p6eval rakudo 4bd478: OUTPUT«1␤»
12:30 * moritz_ dysrexic :-)
12:30 cono RHS, LHS? (shame)
12:30 moritz_ rakudo: say '/etc/' ~~ :d
12:30 p6eval rakudo 4bd478: OUTPUT«Method 'd' not found for invocant of class 'Str'␤  in 'Enum::ACCEPTS' at line 4931:CORE.setting␤  in main program body at line 22:/tmp/s3RFbFpMO8␤»
12:30 masak cono: "left hand side", etc.
12:30 cono masak: thanks :)
12:31 masak rakudo: enum Direction <Left Right>; say Left == False
12:31 p6eval rakudo 4bd478: OUTPUT«1␤»
12:31 masak rakudo: enum Direction <Left Right>; say Right == True
12:31 p6eval rakudo 4bd478: OUTPUT«1␤»
12:32 dolmen rakudo: qp{/etc}.WHAT.say
12:32 p6eval rakudo 4bd478: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<{ }>, couldn't find final '}' at line 22␤»
12:33 * moritz_ wonders if qp(/etc} should return the same things as '/etc'.IO
12:33 dolmen rakudo: pp:q{/etc}.WHAT.say
12:33 p6eval rakudo 4bd478: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 22␤»
12:33 moritz_ qp NYI
12:34 * masak never liked qp
12:35 frettled It gives me associations to quoted-printable.
12:40 masak It gives me associations to heavy bikeshedding.
12:41 moritz_ aye
12:41 moritz_ I wonder if we can get away with simply not implementing it
12:42 moritz_ http://github.com/moritz/perl6-Module-Starter
12:42 c0nspiracy joined #perl6
12:43 masak moritz_: nice! pls add to pls.
12:43 * dolmen loves qp{}
12:44 * moritz_ loves nqp
12:44 moritz_ at least a bit
12:44 dolmen :)
12:44 szbalint what is qp btw?
12:45 moritz_ quote path
12:45 masak szbalint: path constructor.
12:45 Su-Shee p? nqp? folks, it's n-np these days! ;)
12:45 dolmen qp{} is literal for Path
12:45 masak Su-Shee: :)
12:45 dolmen like "" or q{} for Str
12:45 moritz_ that's n(1-p)
12:45 szbalint I'm like frettled on this one.
12:45 masak someone on Slashdot pointed out that P == NP iff N == 1 or P == 0.
12:46 szbalint that was easy :)
12:46 frettled masak: that someone is obviously a joker or a nitwit :)
12:46 masak frettled: hard to tell on Slashdot. :)
12:46 frettled not xor
12:46 szbalint haha, I was about to say the same thing frettled :)
12:47 baest weird, the mkdir call creates directories with permissions 000 on my machine
12:47 baest shouldn't it default to umask
12:47 masak yes.
12:47 masak there's an RT ticket about that.
12:47 moritz_ baest: fixed in latest rakudo
12:47 masak for now, one has to give the mask explicitly.
12:48 baest moritz_++, masak++ :)
12:48 tadzik joined #perl6
12:48 dolmen umask--, masak++
12:48 masak :P
12:48 moritz_ umasak?
12:48 tadzik hello again
12:49 masak tadzik: we meet again.
12:49 baest once more
12:49 frettled for the first time for the last time?
12:50 masak frettled: I am your father's brother's nephew's cousin's former roommate.
12:51 tadzik oh moritz_, I see you also have sub mkdirp on top of Your code (module-starter)
12:51 tadzik looks like a nice module to make
12:52 tadzik Something like shell-utils, mkdir -p, rm -r, cp -r etc
12:52 moritz_ btw extensions to the module-starter thing are very welcome
12:52 moritz_ it's just an initial thing
12:52 frettled masak: first, second, or third cousin?
12:53 masak frettled: zeroth.
12:53 dolmen is Perl grammar runtime extension supported in Star?
12:53 masak no.
12:54 colomon masak, moritz_: Just before I left for vacation, I was looking at the Numifying an array yields a Num, not an Int bug.  I found I have not the faintest clue how Rakudo actually numifies an array.  Any ideas?
12:54 masak except for the special case of user-defined operators.
12:54 masak colomon: Parrot-level?
12:54 moritz_ colomon: probably through the get_number vtable
12:54 colomon masak: I'm guessing Parrot-level stuff is involved, but I don't see how it works.
12:55 colomon prefix:<+> is supposed to call .Numeric now.
12:55 pugssvn r31939 | moritz++ | [S32::IO] update to new type names, remove some thinkos
12:59 oha i can't follow how exactly a socket is implemented in parrot. i got up to PIO_* but i can't find the code which does are hiding
12:59 oha any help?
12:59 tadzik isn't that a Parrot question?
12:59 oha tadzik, it is :)
12:59 tadzik :)
12:59 moritz_ oha: did you find src/pmc/socket.pmc already?
12:59 oha moritz_, yep :( nothing in
13:00 oha i've found it refers socket_api.c in parrot
13:00 moritz_ #include "../src/io/io_private.h"
13:00 oha but there it will use something like PIO_SEND and PIO_RECV which seems undefined to my grep
13:00 moritz_ I guess you found that too
13:01 moritz_ include/parrot/io_unix.h
13:01 Su-Shee mathw: haven't you been the guy with GIR and p6 bindings?
13:01 moritz_ #define PIO_SEND(interp, pmc, buf) \ Parrot_io_send_unix((interp), (pmc), (buf))
13:01 mathw Su-Shee: I've talked about them, I haven't done anything about them
13:02 moritz_ which is defined in src/io/socket_unix.c
13:02 Su-Shee mathw: I was just surfing the seed stuff. _very_ impressive.
13:02 oha moritz_++
13:02 moritz_ oha: I can very much recommend 'ack' (grep on steroids)
13:02 moritz_ which I used to find that out :-)
13:02 oha moritz_, more probably, i've just searched on parrot/src and not includes
13:03 mathw Su-Shee: yes it'd be nice if P6 can end up with something that smooth :)
13:03 mathw Su-Shee: I believe it's possible
13:04 Su-Shee mathw: they're essentially done with gnome, it's amazing. wow.
13:04 alester joined #perl6
13:06 dalek joined #perl6
13:07 mathw it's just gobject introspection and runtime binding
13:09 Su-Shee "just" - it's actually down until the socket level, included webkit and all.. :)
13:09 mathw yes
13:09 mathw well gtk webkit has GIR data :)
13:12 Su-Shee they've also bound a couple of non-gobject libs.. very impressive.
13:14 Synn joined #perl6
13:14 mathw that is a tad harder :)
13:14 Synn what's up
13:16 mathw Hi Synn
13:17 masak y0 Synn
13:17 mathw o/ masak
13:17 masak mathw \o
13:18 bluescreen joined #perl6
13:21 clintongormley joined #perl6
13:21 c0nspiracy_ joined #perl6
13:21 LaVolta joined #perl6
13:22 masak #phasers tonight?
13:22 clintongormley left #perl6
13:22 * moritz_ thinks so
13:23 Axius hello
13:23 takadonet Axius: hey
13:23 masak hello, Axius
13:24 * moritz_ wonders if s/// should desugar to .subst(..., :inplace)
13:25 moritz_ that would solve the problem of returning something other than the result of the substitution
13:26 cognominal rakudo:  grammar A { token TOP { <a> }; token a { a } };  class A::A {   method TOP($/) { say $<a>.keys }}  A.parse( 'a', :actions(A::A))
13:26 p6eval rakudo 4bd478: OUTPUT«===SORRY!===␤Confused at line 22, near "class A::A"␤»
13:27 moritz_ need ; after }
13:27 masak moritz_: if that works from a spec-consistency perspective, I'm all for it.
13:27 masak we should have a bot that says "need ; after }".
13:27 moritz_ if methods are allowed to bind their invocant rw, that looks like the best solution to me
13:27 masak we could call it semicolonbot.
13:28 moritz_ masak: it's called p6eval, and neds to be run with std:
13:28 cognominal I know that a match is both an array ans a hash and tht both containers have a keys method but I would expect it to here the keys list the named reductions
13:28 clintongormley1 joined #perl6
13:28 cognominal rakudo:  grammar A { token TOP { <a> }; token a { a } };  class A::A {   method TOP($/) { say $<a>.keys }} ;  A.parse( 'a', :actions(A::A))
13:28 p6eval rakudo 4bd478: OUTPUT«␤»
13:29 moritz_ the spec isn't clear on that point
13:31 cognominal I think it can be useful on actions for a rule that is a mere alternation list.       method alternation($/) {      make $/."{($/.keys)[0]}".ast } # if I got that right
13:31 masak fwiw, I'd also expect the subrule names from .keys
13:32 moritz_ cognominal: are you sure you don't want .caps for that?
13:33 * masak .oO( .shower-caps )
13:33 * cognominal heads to S05
13:33 moritz_ that said, I could very well live with Match.keys returning (Match.list.keys, Match.hash.keys)
13:33 moritz_ and likewise .values and .kv
13:35 cognominal Another thing that bother me with actions is there is no way to type and type check   .ast
13:35 cognominal I have just bitten by that.
13:36 moritz_ how would you want to type .ast?
13:37 moritz_ I kinda don't like the idea of a type constraint on it (more)
13:37 moritz_ the reason is that a Match object is really produces as the result of a regex match
13:37 moritz_ while the .ast is populated by an action method
13:37 moritz_ and there can be multiple sets of action methods for the same regex and thus match object
13:38 moritz_ so at the place where the match object is create, you can't know the type of the AST
13:39 moritz_ *created
13:39 * moritz_ 's words trail off in the echo chamber ...
13:40 masak :)
13:41 cognominal method a  does ASTType(Str)  {     }     #   It is kind like a return type except it is the return type of the .ast method.
13:41 cognominal ... as called in the a action.
13:42 moritz_ hm
13:42 moritz_ make() is really just syntactic sugar for setting $/.ast
13:42 moritz_ not something that's propagated by return exceptions or so
13:43 cognominal it sets $/.ast so it could check if the type is correct.
13:43 cognominal if there is a type set... (no pun intended)
13:44 moritz_ it could. And it feels oh-so-wrong
13:45 moritz_ the thing that makes it so wrong is that make() is a side effect
13:45 moritz_ if the action method simply returned the AST, and the regex engine assigned it to $/.ast under the hood, all of this would be so much simpler
13:49 moritz_ rakudo: say 'abc' ~~ .say
13:49 p6eval rakudo 4bd478: OUTPUT«abc␤1␤»
13:49 moritz_ rakudo: say 'abc' !~~ .say
13:49 p6eval rakudo 4bd478: OUTPUT«Any()␤0␤»
13:50 oha how to do integer math in p6?
13:50 moritz_ +, *, -, div, % and **
13:50 masak moritz_++ # http://perlgeek.de/blog-en/pe​rl-6/perlmonks-questions.html
13:51 oha moritz_++ i were missing div
13:51 takadonet http://www.reddit.com/r/perl/comments​/czg3t/perl_6_questions_on_perlmonks/
13:53 plobsing joined #perl6
13:53 dalek joined #perl6
13:53 ak joined #perl6
13:55 Guest34088 joined #perl6
14:00 moritz_ rakudo: given 3 { when True { say "aye" } }
14:00 p6eval rakudo 4bd478: OUTPUT«aye␤»
14:00 moritz_ std: given 3 { when True { say "aye" } }
14:01 p6eval std 31912: OUTPUT«Can't call method "Str" on unblessed reference at STD.pm line 27074.␤FAILED 00:01 113m␤»
14:01 moritz_ std: 1 ~~ True
14:02 p6eval std 31912: OUTPUT«Potential difficulties:␤  Smartmatch against True always matches; if you mean to test the topic for␤    truthiness, please use :so or *.so or ?* instead at /tmp/KRzCMvzGPf line 1:␤------> [32m1 ~~ True[33m⏏[31m<EOL>[0m␤ok 00:01 113m␤»
14:02 * moritz_ wonders why the former doesn't warn
14:02 masak looks like an stdbug.
14:03 xomas_ joined #perl6
14:07 ruoso joined #perl6
14:17 moritz_ std: 1 !~~ True
14:18 p6eval std 31912: OUTPUT«Potential difficulties:␤  Smartmatch against True always matches; if you mean to test the topic for␤    truthiness, please use :so or *.so or ?* instead at /tmp/BtjzJq3TDa line 1:␤------> [32m1 !~~ True[33m⏏[31m<EOL>[0m␤ok 00:01 113m␤»
14:18 frettled Hmm, what was the Unicode character for \o/ that someone found?
14:19 alc joined #perl6
14:20 masak .u taurus
14:20 phenny U+2649 TAURUS (♉)
14:20 masak hm, maybe not :)
14:20 tadzik star: my @ar = %foo, %bar; my %foo = one => 1; my %bar = two => 2; say @ar.perl; # bug?
14:20 squeeky .u victory hand
14:20 phenny U+270C VICTORY HAND (✌)
14:20 p6eval star 2010.07: OUTPUT«[]␤»
14:21 tadzik when I declare @ar at the end, it's ok
14:21 masak tadzik: the bug is that it doesn't parsefail.
14:21 masak std: my @ar = %foo, %bar; my %foo = one => 1; my %bar = two => 2;
14:21 p6eval std 31912: OUTPUT«[31m===[0mSORRY![31m===[0m␤Variable %foo is not predeclared at /tmp/bF0UhYT2mN line 1:␤------> [32mmy @ar = %foo[33m⏏[31m, %bar; my %foo = one => 1; my %bar = tw[0m␤Variable %bar is not predeclared at /tmp/bF0UhYT2mN line 1:␤------> [32mmy @ar = %foo, %bar[33m⏏[31m; my
14:21 p6eval ..%…
14:21 tadzik oh
14:22 tadzik by the way, how to make this @ar not flatten the hashes?
14:22 masak put it in {}s
14:22 masak or prefix with a \
14:22 masak same as in Perl 5.
14:23 cono {} will copy hash
14:23 cono $(%foo)
14:23 masak the former clones, the latter takes a reference. yes, what cono said.
14:24 cono masak: \ <- capture in p6
14:24 masak right. think of it as a reference on steroids :)
14:24 moritz_ $(%foo) or %foo.item
14:24 cono rakudo: my %h = 1,2; say (\%h).WHAT
14:24 p6eval rakudo 4bd478: OUTPUT«Capture()␤»
14:24 cono rakudo: my %h = 1,2; say ($(%h)).WHAT
14:24 p6eval rakudo 4bd478: OUTPUT«Hash()␤»
14:25 cognominal tadzik: better declaring @ar than declaing war.
14:25 tadzik will $%h work?
14:25 cono rakudo: my %h = 1,2; my @n .= push(%h.item); @n.perl.say
14:25 tadzik rakudo: my %h = 1,2; say ($%h).WHAT
14:25 p6eval rakudo 4bd478: OUTPUT«[{"1" => 2}]␤»
14:25 p6eval rakudo 4bd478: OUTPUT«===SORRY!===␤Non-declarative sigil is missing its name at line 22, near "$%h).WHAT"␤»
14:25 tadzik :(
14:25 cono I like .item :) moritz_++
14:26 molaf joined #perl6
14:26 Axius joined #perl6
14:26 tadzik no utf8 in hash keys?
14:27 tadzik star: my %h = 'łódka' => 3;
14:27 p6eval star 2010.07: OUTPUT«(timeout)»
14:27 tadzik oh you
14:27 tadzik star: my %h = 'łódka' => 3; say %h.perl
14:27 p6eval star 2010.07: OUTPUT«{"łódka" => 3}␤»
14:27 tadzik hrm
14:27 moritz_ rakudo: my %h = 'łódka' => 3; say %h.perl
14:27 p6eval rakudo 4bd478: OUTPUT«{"łódka" => 3}␤»
14:28 tadzik star: my %h = łódka => 3; say %h.perl
14:28 p6eval star 2010.07: OUTPUT«{"łódka" => 3}␤»
14:28 tadzik hrm
14:28 cono perl6 -e 'my %h = "првиет" => 1; %h.perl.say' works good
14:28 moritz_ ... but fails on the REPL?
14:28 cono as always :)
14:28 tadzik nah, just some silly bug in my script
14:29 tadzik there's like 90 lines of hashes, must be some typo
14:35 bbkr star: my %h = lodka => 1, łódka => 2; %h.perl.say
14:35 p6eval star 2010.07: OUTPUT«{"lodka" => 1, "łódka" => 2}␤»
14:35 tadzik FYI, it means 'boat' :)
14:36 TiMBuS > my %h = 'łódka' => 3; %h.perl
14:36 TiMBuS {"łódka" => 3}
14:36 TiMBuS repl works4me. might be a terminal issue (heh)
14:37 pmurias joined #perl6
14:37 pmurias ruoso: hi
14:37 ruoso hi pmurias
14:38 pmurias ruoso: would i be ok if i used 'use V6' instead of 'use v6-mildew'?
14:39 pmurias as that wouldn't require fglock to accept the patch
14:41 pmurias i have 'use v6-mildew' working runing in scripts and i'm working on making it work for modules and cleaning it up enough to commit it
14:42 astrojp joined #perl6
14:43 pmurias ruoso: we might also have a v6 hook so that once fglock releases a new version of v6.pm 'use v6-mildew' will also work
14:44 bbkr rakudo: multi sub foo (@x where {say "match"; 1}) {}; multi sub foo (@x where {say "no match"; 0}) {}; foo([1,2,3]) # why it checks first signature twice? a bug?
14:44 p6eval rakudo 4bd478: OUTPUT«match␤no match␤match␤»
14:45 ruoso pmurias, hmm...  do you have a working version of the "use v6-mildew" support?
14:45 moritz_ bbkr: once for the multi dispatch, once for binding
14:45 bbkr moritz_: thanks
14:45 moritz_ bbkr: there's nothing in the spec that forbids it, although it could be optimized
14:46 bbkr moritz_++
14:46 moritz_ side effects in type constraints are sufficiently evil to deserve the shotgun
14:46 moritz_ (except for satisfying the curiosity, of course)
14:47 pmurias ruoso: yes
14:47 ruoso pmurias, have you sent him an email with the patch>\
14:47 ruoso ?
14:47 pmurias yes
14:48 pmurias he mailed me back that he is looking into it
14:48 moritz_ colomon: what do you think of http://rt.perl.org/rt3/Tic​ket/Display.html?id=77126 ? I'm inclined to reject it, on the base that our numeric types are not subset types
14:48 ruoso pmurias, ah... ok... so that's fine, I think that's acceptable as a deliverable, just make the patched version avialble somewhere for people to try it out
14:49 ruoso pmurias, did you split the v6-alpha from plain v6?
14:49 colomon moritz_: hmmm.
14:49 ruoso pmurias, so that you don't need to install Pugs::Compiler::Rule to have v6-mildew...
14:49 colomon star: my Complex $x; $x = 1; say $x.perl
14:49 p6eval star 2010.07: OUTPUT«Type check failed for assignment␤  in '&infix:<=>' at line 1␤  in main program body at line 22:/tmp/RL_ylNR9mg␤»
14:50 colomon moritz_: that one seems like it should be easy to do.
14:50 colomon but I'm not sure "my Complex $x = 1" is reasonably doable.
14:50 moritz_ colomon: we also have (-1).sqrt and (-1 + 0i).sqrt behave differently, so we do distinguish Complex from non-complex
14:50 colomon actually, overloading infix:<=> may be pretty tricky?
14:50 colomon moritz_: oh, certainly.
14:51 moritz_ it's certainly not worth doing for this case
14:51 ruoso moritz_, I'm not sure overload is the right thing to do
14:51 moritz_ because then he'll complain that sub f(Complex $x) { } f(1) will still fail
14:51 moritz_ ruoso: I'm sure it's the wrong thing to do :-)
14:51 ruoso good...
14:52 colomon moritz_: good point, f(1) should never work like that.
14:52 moritz_ unless Complex is a coercive type, (TimToady speculated about them at YAPC)
14:52 moritz_ but I guess for now we can reject the ticket
14:52 ruoso star: my Num $a = 1 + 2i;
14:52 p6eval star 2010.07: OUTPUT«Type check failed for assignment␤  in '&infix:<=>' at line 1␤  in main program body at line 22:/tmp/cn6klu0nV7␤»
14:52 pmurias ruoso: i didn't split out v6 from v6-alpha
14:53 ruoso do we have a superset for all numbers?
14:53 moritz_ star: my Numeric $a = 1 + 2i;
14:53 p6eval star 2010.07:  ( no output )
14:53 ruoso pmurias, hmm... is it too hard?
14:53 ruoso alright..
14:53 bbkr star: multi sub foo (@x where {@x.pop; 1}) {}; my @f = 1,2,3; foo(@f); @f.perl.say # should this be disallowed? where check cannot modify param value because user doesn't control how many times it is called (as moritz said)
14:53 colomon star: my Numeric $a = 1 + 2i; say $a.WHAT
14:53 p6eval star 2010.07: OUTPUT«[1]␤»
14:53 p6eval star 2010.07: OUTPUT«Complex()␤»
14:53 pmurias ruoso: it's a matter of packaging stuff into 2 tarballs
14:53 ruoso moritz_, I might be loosing something, but "subset" is what I'd think for "coercitive type"
14:53 pmurias ruoso: there are in sepereate .pm files
14:54 moritz_ ruoso: they are not the same
14:54 moritz_ bbkr: you can't generally forbid it. You should forbid it by convention.
14:54 moritz_ because our methods aren't marked as pure or non-pure
14:54 ruoso pmurias, I think it's worth having v6.pm in a different package then v6-alpha
14:54 ruoso and v6-mildew
14:54 pmurias yes
14:55 bbkr moritz_: I was just curious if some spec part forbids it. but perl gives enough rope... just like in this case :)
14:56 ruoso pmurias, so... just make them three dists, email the patches to fglock and make the three .tar.gz available somewhere for people to test
14:56 mikehh joined #perl6
14:57 colomon star: subset ComplexNumeric of Numeric where { $^n ~~ Real || $^n ~~ Complex }; my ComplexNumeric $x = 1; say $x.perl; $x = 1i; say $x.perl
14:57 p6eval star 2010.07: OUTPUT«Null PMC access in invoke()␤  in 'ACCEPTS' at line 1␤  in '&infix:<=>' at line 1␤  in main program body at line 22:/tmp/AqD5quN4oJ␤»
14:57 Axius joined #perl6
14:57 colomon star: subset ComplexNumeric of Numeric where { ($_ ~~ Real) || ($_ ~~ Complex) }; my ComplexNumeric $x = 1; say $x.perl; $x = 1i; say $x.perl
14:57 p6eval star 2010.07: OUTPUT«Null PMC access in invoke()␤  in 'ACCEPTS' at line 1␤  in '&infix:<=>' at line 1␤  in main program body at line 22:/tmp/datuKCLFdC␤»
14:58 moritz_ colomon: please submit
14:58 colomon nyi?  or am I doing something wrong there.
14:58 moritz_ looks about right
14:59 pmurias ruoso: would use V6-mildew be a worse name then use v6-mildew?
15:00 colomon star: subset ComplexNumeric of Numeric where { ($_ ~~ Real) }; my ComplexNumeric $x = 1; say $x.perl;
15:00 p6eval star 2010.07: OUTPUT«Null PMC access in invoke()␤  in 'ACCEPTS' at line 1␤  in '&infix:<=>' at line 1␤  in main program body at line 22:/tmp/fzM3BfOkY6␤»
15:00 ruoso pmurias, yes... and it's ugly to have both V6 and v6
15:00 ruoso pmurias, I mean, it's worse because v6 is there already
15:01 pmurias ok
15:01 colomon moritz_: submitted
15:02 pmurias i'll split v6 into 2 packages, put it into the pugs repo and email fglock again
15:02 milki joined #perl6
15:02 moritz_ colomon++
15:02 wamba joined #perl6
15:05 justatheory joined #perl6
15:05 Trashlord joined #perl6
15:11 pmurias ruoso: is there anything else besides v6-mildew that needs to be done as part of GSoC?
15:12 pmurias besides releasing a version of SMOP and Mildew from the repo which supports perl5 interop?
15:13 risou joined #perl6
15:13 moritz_ speaking of p5 interop... Tim Bunce demonstrated usage of the p5 DBD::SQLite through blizkost in rakudo, live at his YAPC talk
15:15 * pmurias was at that talk
15:17 * moritz_ liked it
15:18 * masak finds http://blog.foxxtrot.net/2010/0​8/perl6-first-impressions.html
15:18 perlygatekeeper joined #perl6
15:19 cognominal joined #perl6
15:21 * moritz_ comments
15:21 masak moritz_++
15:21 tadzik oh wow, that webdesign
15:22 jferrero joined #perl6
15:25 _macdaddy joined #perl6
15:27 janosik joined #perl6
15:29 colomon ack, my comment won't go through.
15:29 moritz_ mine didn't go through when I went throught the preview
15:29 moritz_ but a direct submission worked
15:29 * moritz_ -> afk
15:33 colomon loliblogged: http://justrakudoit.wordpress.com/2​010/08/10/factorial-and-memoizing/
15:35 * [Coke] wonders how hard it would be to add memozation to rakudo subs. can store the cache as a property on the sub object...
15:36 [Coke] and you would just add a little boilerplate before and after to check and populate the cache.
15:37 pyrimidine joined #perl6
15:37 * [Coke] also wonders if "is cacheable" is a better spelling.
15:37 Axius joined #perl6
15:38 [Coke] rakudo: sub foo is cached ($arg) {say $arg}; foo(3);
15:38 p6eval rakudo 4bd478: OUTPUT«===SORRY!===␤Confused at line 22, near "sub foo is"␤»
15:38 [Coke] rakudo: sub foo ($arg) is cached {say $arg}; foo(3);
15:38 p6eval rakudo 4bd478: OUTPUT«===SORRY!===␤No applicable candidates found to dispatch to for 'trait_mod:<is>'. Available candidates are:␤:(Mu $child, Role $r)␤:(Routine $r, Any :default($default)!)␤:(Code $block, Any $arg?, Any :export($export)!)␤:(Mu $child, Mu $parent)␤:(Mu $type where ({ ... }), Any
15:38 p6eval ..:rw($rw)…
15:41 [Coke] given that the spec says you're allowed to do no caching, IWBNI if rakudo at least accepted that silently. (if that's easy to write.)
15:43 masak [Coke]: I've been thinking the same thing. I'll probably do some experiments with cached subs in Yapsi, when we have subs. :)
15:44 Holy_Cow joined #perl6
15:44 pmurias [Coke]: wouldn't implementing caching by not doing so mislead people?
15:47 colomon [Coke]: it's kind of tricky to handle all possible argument types for a cache.  (else I would have done this last month!)
15:48 colomon but if you can silently fail (or fail with a warn), it would be pretty easy to add single argument caching for Str and Numeric, at least...
15:49 colomon afk # exercising
15:51 Mowah joined #perl6
15:52 Axius joined #perl6
15:53 bbkr rakudo: say pi=4 # tricky question. why it failed _after_ say? when say param "pi=4" is evaluated it should IMO die right there and say should never happened. bug?
15:53 p6eval rakudo 4bd478: OUTPUT«3.14159265358979␤Cannot modify readonly value␤  in '&infix:<=>' at line 1␤  in main program body at line 22:/tmp/rdBTOmdtDM␤»
15:54 [Coke] pmurias: blame the spec.
15:54 [Coke] colomon: why not just cache what you can rather than failing?
15:55 [Coke] (the spec basically says it's a hint to the compiler, not a guarantee of anything.)
15:55 [Coke] bbkr: is it just a warning and not an error?
15:56 [Coke] rakudo: pi=4; say "alive"
15:56 p6eval rakudo 4bd478: OUTPUT«Cannot modify readonly value␤  in '&infix:<=>' at line 1␤  in main program body at line 22:/tmp/8AkAtWsuU3␤»
15:56 bbkr Coke: error
15:58 fod joined #perl6
15:58 pmichaud good morning, #perl6
15:59 pmichaud (say pi=4)  looks to me like it's doing exactly the right thing.
16:01 takadonet pmichaud: morning
16:03 bbkr pmichaud: why? it should die on assignment, so say param was never evaluated, and so say should not work. compare it to behavior of  'say "foo {die} bar"'
16:03 pmichaud it is dying on the assignment.
16:03 moritz_ oh hai
16:03 oha pmichaud, isn't dying as in say(pi)=4; ?
16:04 oha rakudo: say(pi=4);
16:04 pmichaud say pi=4  parses as   (say pi) = 4
16:04 p6eval rakudo 4bd478: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 22␤»
16:04 pmichaud (I think.... checking)
16:04 oha rakudo: say pi=4;
16:04 p6eval rakudo 4bd478: OUTPUT«3.14159265358979␤Cannot modify readonly value␤  in '&infix:<=>' at line 1␤  in main program body at line 22:/tmp/AFm2BNjYGL␤»
16:05 oha rakudo: (say pi)=4;
16:05 p6eval rakudo 4bd478: OUTPUT«3.14159265358979␤Cannot modify readonly value␤  in '&infix:<=>' at line 1␤  in main program body at line 22:/tmp/2qR_Aih9CS␤»
16:05 bbkr rakudo: say (pi=4)
16:05 p6eval rakudo 4bd478: OUTPUT«Cannot modify readonly value␤  in '&infix:<=>' at line 1␤  in main program body at line 22:/tmp/Ne0PDCgv2r␤»
16:05 rokoteko rakudo: my @arr = <foo bar baz>; 0..2 ==> @arr[@(*)] ==> my @t; push my @x, @t[$_] for 0..2; @x.perl.say
16:05 p6eval rakudo 4bd478: OUTPUT«too many positional arguments: 3 passed, 3 expected␤  in main program body at line 1␤»
16:05 bbkr oh, indeed!
16:05 pmichaud oh, hmmmm.
16:05 rokoteko rakudo: my @arr = <foo bar baz>; my @t; 0..2 ==> @arr[@(*)] ==> @t; # what's wrong here?
16:05 p6eval rakudo 4bd478: OUTPUT«too many positional arguments: 3 passed, 3 expected␤  in main program body at line 1␤»
16:06 pmichaud that looks really wrong to me.
16:06 bbkr isn't it a parsebug?
16:06 bbkr with precedence
16:06 oha it may be correct, to let a function be used as a RHS? mh...
16:06 rokoteko std: my @arr = <foo bar baz>; 0..2 ==> @arr[@(*)] ==> my @t;
16:06 p6eval std 31912: OUTPUT«ok 00:01 116m␤»
16:07 pmichaud looks to me like STD.pm recently changed its idea of list_assignment precedence
16:07 * moritz_ has m// as a call working, in branch match_call
16:08 moritz_ spectesting the merged-into-master version now
16:08 bbkr should i report this pi example somehow or is it expected behavior?
16:08 * bbkr is confused
16:09 pmichaud bbkr: you can report it
16:09 rokoteko anyhow. any idea why 'too many positional arguments: 3 passed, 3 expected' ? where are those expected, and why 3 more than 3?
16:09 masak bbkr++
16:11 pmichaud rokoteko: no idea
16:12 rokoteko ok. me neither. thought it might be something I just didnt get again while stumbling through the synopsis. :)
16:14 risou_ joined #perl6
16:14 oha i'm going to surrender
16:15 oha how can i write a signature which match a &code with a specific signature?
16:15 oha sub foo(&code(Int)) { ... } seems not working to me, what do i keep doing wrong?
16:16 gfldex you are missing a collon
16:16 gfldex sub foo(&code:(Int)) { ... }
16:16 masak food &
16:16 oha gfldex, tried, but rakudo complains
16:17 oha traits specified as colon pairs not yet understood at line ...
16:17 gfldex NIY
16:17 oha ohhh ok
16:17 moritz_ rakudo: sub f(&code:(Int)) { code(3) }; f -> Int $x { say $x + 3 }
16:17 gfldex :)
16:17 oha gfldex++ ty
16:17 p6eval rakudo 4bd478: OUTPUT«===SORRY!===␤traits specified as colon pairs not yet understood at line 22, near ") { code(3"␤»
16:17 moritz_ rakudo: sub f(&code(Int)) { code(3) }; f -> Int $x { say $x + 3 }
16:17 p6eval rakudo 4bd478: OUTPUT«Not enough positional parameters passed; got 0 but expected 1 in sub-signature of parameter &code␤  in 'f' at line 22:/tmp/0rN_y2CHhQ␤  in main program body at line 22:/tmp/0rN_y2CHhQ␤»
16:17 * moritz_ is sure that was implemented at some point
16:17 moritz_ probably in alpha
16:18 oha no problem, i got that was impl in rakudo, and i kept trying almost everything without success
16:22 justatheory joined #perl6
16:22 pugssvn r31940 | pmurias++ | rename files in the STD distribution, update version numbers
16:23 pugssvn r31941 | pmurias++ | remove the unused old SMOP module
16:23 pugssvn r31942 | pmurias++ | added v6::mildew and a v6 (which allows using it)
16:23 pugssvn r31942 | added required support for that to SMOP and Mildew:
16:23 pugssvn r31942 | * Mildew::Backend::C::V6
16:23 pugssvn r31942 | * SMOP::Embed
16:27 snearch joined #perl6
16:35 patrickas joined #perl6
16:36 ashleydev joined #perl6
16:39 colomon [Coke]: I didn't mean "fail" in the technical sense, I meant "fail to cache", ie just ran the function.
16:41 jferrero joined #perl6
16:43 Intensity joined #perl6
16:44 [Coke] colomon: ah. perfecto.
16:44 szabgab Anyone interested and available for a Perl 6 hackathon during or around http://www.t-dose.org/ ?
16:44 szabgab 6-7 November, Eindhoven, TheNetherlands
16:45 [Coke] yes but no.
16:45 pmichaud interested, yes.  available -- don't know.  :)
16:46 szabgab pls check it ASAP and let me know, along with a "price tag" so I can put together a budget and see if I can get someone to finance it
16:47 pmichaud will do.
16:47 pmichaud is it better to fly into amsterdam or brussels to get to eindhoven?
16:48 szabgab no idea
16:48 * pmichaud looks for direct flights to eindhoven :)
16:48 szabgab they look the same distance to me
16:49 pmichaud yes, same here.
16:49 pmichaud anyway, I'll look into it.
16:49 oha is there a way (both perl6 and rakudo) to make a function return a lazy scalar?
16:49 pmichaud I'm also trying to see if I can make it to osdc.fr -- I know a bunch of the perl 6 folks are planning to be there
16:50 pmichaud looks like amsterdam might be easiest
16:54 pmichaud flights currently $800-$900 from where I'm at, it seems.
16:54 szabgab thanks
16:55 TiMBuS oha, my $a := gather { take [+](^10000) };
16:55 TiMBuS something like that
16:55 TiMBuS ?
16:55 oha TiMBuS, i'm unsure if that could work
16:56 oha my $out = foo($in);
16:56 cotto_work joined #perl6
16:56 oha say $out; # here a code is executed to evaluate the value of $out
16:56 oha like in Contextual::Return on p5
16:57 TiMBuS is $out eval'd when you return a gather/take binding?
16:59 TiMBuS I just tried:  sub thing { gather { take [+](^10000) }; }; my $a := thing(); say 'ok'; #doesn't pause at all
16:59 oha you are right!
16:59 pmichaud I'm fairly certain that [+](^10000) isn't going to be lazy
16:59 oha TiMBuS++
17:00 oha pmichaud, gather { take ... } will
17:00 TiMBuS woot i got karma'd
17:00 pmichaud (I'm not sure what is being attempted here, though)
17:00 TiMBuS pmichaud, just the result itself needs to be lazy
17:00 Lorn joined #perl6
17:01 oha TiMBuS worked :)
17:05 rgrau joined #perl6
17:07 Trashlord joined #perl6
17:09 Axius_ joined #perl6
17:10 Trashlord joined #perl6
17:16 risou joined #perl6
17:19 oha http://nopaste.snit.ch/22673
17:20 oha the first case work as i wanted. the function is called but the say is lazy
17:20 oha but i was not able to make it work inside a map
17:21 oha what i wanted is to have all the PRE, then MID, then all the CALC
17:24 oha i've probably found a way
17:27 oha rakudo: sub lazy($v) { say "P$v"; gather { say "C$v"; take $v; }}; my @x = map { my $z := lazy($_); }, 1..3; say "MID"; say @x.join(',');
17:27 p6eval rakudo 4bd478: OUTPUT«P1␤P2␤P3␤MID␤C1␤C2␤C3␤1,2,3␤»
17:28 oha that is just wonderfull! i just don't like the useless my $z inside the map
17:30 takadonet joined #perl6
17:33 isBEKaml joined #perl6
17:49 colomon TiMBuS, oha: you're messing around with implementation details there, I think.  "gather" might well run the first few iterations and queue them up to be doled out as needed...
17:50 oha oh i see what you mean
17:50 oha but well, here lazy() is a function, in reality there will be different things in place of this call
17:52 oha method req($request) { $.conn.send($request); gather { take $conn.recv(); } }; # that's more interesting :)
17:54 oha or better:
17:55 oha method req($req) { my $c = self.findConn(); $c.send($req); gather { my $res = $c.recv(); $c.free(); take $res; } }
17:57 justatheory joined #perl6
17:57 colomon oha: but the point here is that gather might work by returning its "output" in chunks, in which case it might try to return an iterator with four or five iterations already done in it.  In Rakudo, this would likely be much more efficient than just returning one at a time.
17:58 colomon You're essentially relying on an implementation detail to make this code be lazy the way you want it to be lazy, if I understand your code correctly.
17:59 oha the actual implementation use a middle object
17:59 oha my $job = submit(...); my $res = $job.result();
17:59 oha submit will send something, and result will wait for a result
17:59 oha i was just wandering if i can make some syntactic sugar here
18:00 oha but i agree with you, it would be better something else
18:00 dalek rakudo: 22a11d0 | moritz++ |  (22 files):
18:00 dalek rakudo: Merge branch 'master' into match-call
18:00 dalek rakudo: Conflicts:
18:00 dalek rakudo:   src/core/Match.pm
18:00 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/2​2a11d0616187bdd46b49981ab584406e751341e
18:00 dalek rakudo: 77d4761 | moritz++ | src/core/Match.pm:
18:00 dalek rakudo: fix wrongly resolved merge conflict
18:00 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/7​7d47614ac6ce0c5b61d3d60f390a6b0a3df487b
18:00 dalek rakudo: 9412433 | moritz++ | src/ (3 files):
18:00 dalek rakudo: !~~ now topicalizes too
18:00 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/9​4124334809eba4e6c733ae5d8a3d708ed7741c4
18:00 dalek rakudo: 87c82c2 | moritz++ | src/ (4 files):
18:00 dalek rakudo: Merge branch 'match-call'
18:00 dalek rakudo: This turns m// into an immediate call, makes Match.ACCEPTS return self, and
18:00 dalek rakudo: sets the topic for negated smartmatch (!~~)
18:00 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/8​7c82c2c833223dd6d413cd5c92dda2cae306425
18:01 colomon moritz_++  !!!!
18:03 tedv joined #perl6
18:06 tadzik joined #perl6
18:08 hanekomu joined #perl6
18:10 colomon star: say 10000000000000000000
18:10 p6eval star 2010.07: OUTPUT«-8446744073709551616␤»
18:10 colomon star: say 10000000000000000000.0
18:10 p6eval star 2010.07: OUTPUT«1e+19␤»
18:11 colomon star: say 10000000000000000001
18:11 p6eval star 2010.07: OUTPUT«-8446744073709551615␤»
18:11 masak moritz_++
18:11 tadzik o/
18:12 colomon star: say 1000000000000000000
18:12 p6eval star 2010.07: OUTPUT«1000000000000000000␤»
18:12 colomon star: say 1000000000000000000.WHAT
18:12 p6eval star 2010.07: OUTPUT«Int()␤»
18:15 colomon star: say 100000000000000000
18:15 p6eval star 2010.07: OUTPUT«100000000000000000␤»
18:15 colomon star: say 100000000000000000 + 1
18:15 p6eval star 2010.07: OUTPUT«1e+17␤»
18:15 colomon star: say 100000000000000001
18:15 p6eval star 2010.07: OUTPUT«100000000000000001␤»
18:16 Axius_ joined #perl6
18:17 colomon star: say 100000000000000001.WHAT
18:17 p6eval star 2010.07: OUTPUT«Int()␤»
18:25 astrojp left #perl6
18:27 mantovani masak: np :P
18:28 * [Coke] wonders when http://bigthink.com/larrywall was filmed.
18:34 moritz_ #phasers in 26?
18:35 dalek rakudo: fcf4f36 | moritz++ |  (3 files):
18:35 dalek rakudo: adverbs for m//
18:35 dalek rakudo: Also update ChangeLog
18:35 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/f​cf4f368cfc62cfd85dcfc499c52880dc966cb1d
18:35 colomon aiiiii, #phasers!
18:35 tadzik [Coke]: wathing it too :)
18:37 avuserow phasers! pew pew!
18:37 moritz_ it seems that m:overlap// doesn't work properly
18:38 moritz_ or m:g// for that matter
18:40 pmichaud [Coke]: (bigthink)  I think it was done around OSCON
18:41 moritz_ pmichaud: when I call &infix:<=> from PIR, is that the list or the item assignment operator?
18:41 moritz_ I guess item, but I ain't sure
18:45 pmichaud moritz_: it's both
18:45 pmichaud the difference between item assignment and list assignment is in the parsing, not the operator.
18:45 moritz_ ok
18:45 pmichaud at least, that's how rakudo has it now.  :)
18:45 moritz_ then I don't understand why it doesn't work
18:45 moritz_ m:g// that is
18:45 moritz_ it rewrites it to
18:46 moritz_ $/ = $_.match(//, :g)
18:46 moritz_ (a --target=PAST confirms that)
18:46 pmichaud it's probably because .match is currently not handling $/ properly
18:46 pmichaud iirc, .match is currently rebinding $/, not assigning it
18:46 pmichaud so what you're left with ends up being "not assignable"
18:47 pmichaud try rewriting it to $/ := $.match(//, :g)   for now
18:47 moritz_ the same works for m:i// right now
18:47 pmichaud I suspect that would be because   m:i//  returns $/
18:47 pmichaud and so it ends up acting like a self-assignment
18:48 moritz_ oh
18:48 pmichaud whereas  $.match(//, :g)  doesn't return $/
18:48 moritz_ should I use :pasttype('bind')?
18:48 moritz_ or rather &infix:<:=>?
18:48 pmichaud no, should call &infix:<:=>
18:48 moritz_ ok
18:49 moritz_ rakudo: say 'abc' ~~ m:i/ABC/
18:49 p6eval rakudo 4bd478: OUTPUT«===SORRY!===␤Confused at line 22, near "say 'abc' "␤»
18:49 moritz_ huh
18:50 moritz_ rakudo: say 'abc' ~~ m:i/ABC/
18:50 p6eval rakudo 4bd478: OUTPUT«abc␤»
18:50 moritz_ o/
18:50 moritz_ rakudo: $_="abcdefg"; say m:i/ABC/
18:50 p6eval rakudo 4bd478: OUTPUT«abc␤»
18:51 perimosocordiae joined #perl6
18:51 moritz_ \o
18:51 perimosocordiae moritz_: who, me?
18:52 moritz_ perimosocordiae: what?
18:52 * moritz_ lacks context
18:52 perimosocordiae moritz_: the \o
18:52 moritz_ perimosocordiae: that was because m:i// now works in rakudo, not related to you :-)
18:52 moritz_ perimosocordiae: but feel free to feel greeted nontheless :-)
18:53 perimosocordiae moritz_: awww. haha, ok
18:53 moritz_ rakudo: say 'a b' ~~ m:s/a b/
18:53 p6eval rakudo 4bd478: OUTPUT«a b␤»
18:53 moritz_ and :s works too :-)
18:54 perimosocordiae what do :i and :s do?
18:54 moritz_ pmichaud: using := doesn't seem to break anything, but m:g/a/ still doesn't work :(
18:54 moritz_ :i is ignorecase
18:54 moritz_ and :s makes whitespace signficant
18:54 moritz_ see S05/Modifiers/
18:54 perimosocordiae ah, thanks
18:54 [Coke] I really would like this interview better if they /read/ the questions they were asking him. -0(
18:54 [Coke] er, =-)
18:55 pmichaud moritz_: okay.  I suspect we're going to need to get a much clearer handle on $/ altogether.
18:56 moritz_ pmichaud: I fear it, yes
18:58 moritz_ pmichaud: btw I want to introduce Cool.subst(..., :inplace), which returns what it matched
18:58 moritz_ and have s/// dispatch to it
18:59 moritz_ otherwise we run into problems with s/// returning the modified string, not the match(es)
18:59 pmichaud that feels wrongish
18:59 masak #phasers now?
19:00 moritz_ how would you propagate the match out of .subst instead?
19:00 moritz_ masak: yes
19:00 pmichaud moritz_: not sure.  It may be that ':inplace' feels like the wrong option.
19:00 pmichaud it may be that s/// should use something other than .subst
19:00 pmichaud I don't have a clean answer -- I just know that :inplace feels .... odd
19:00 pyrimidine joined #perl6
19:01 moritz_ if it does not use subst, we'll end up re-implementing .subst for s///
19:02 pmichaud well, it could be that .subst itself is implemented in terms of the other thing
19:02 pmichaud and simply has a different return value
19:02 pmichaud if you want to go with :inplace for now, I'm fine with that -- just registering that my initial reaction is "that's not quite right"
19:02 PerlJam how would  $str.subst(... :inplace) differ from $str.=substr(... :inplace) or even $str.=subst(...)  ?
19:03 moritz_ PerlJam: in return value
19:03 pmichaud PerlJam: that's why ";inplace" feels like the wrong advertb
19:03 pmichaud *adverb
19:03 pmichaud it's not really making it an inplace modification
19:03 pmichaud it's changing the return value
19:04 M_o_C joined #perl6
19:05 cono joined #perl6
19:11 moritz_ alternative might be to return both the result string and the match as a list
19:12 moritz_ but that feels awkward, if you ask me
19:12 dduncan joined #perl6
19:14 dduncan joined #perl6
19:15 dduncan left #perl6
19:26 M_o_C joined #perl6
19:28 pugssvn r31943 | moritz++ | [t/spec] a Rakudo unfudge
19:28 smash joined #perl6
19:28 smash hello everyone
19:29 tadzik o/
19:34 nimiezko joined #perl6
19:36 justatheory joined #perl6
19:36 masak hi smash
19:40 tylercurtis joined #perl6
19:48 * Hulk smash!
19:48 frettled Sorry, I just had to :)  Hi, smash!
19:49 * frettled is the resident joker, but without the poisonous ingredients.
19:51 pugssvn r31944 | moritz++ | [t/spec] rakudo unfudges
19:53 kensanata joined #perl6
19:54 masak someone on Twitter says that PHP gets it wrong and Perl 6 gets it right wrt gradual typing: http://twitter.com/kaja47/status/20818719900
19:56 moritz_ btw would anybody here will be to be grant manager for my error objects grant proposal?
19:56 * moritz_ looks at pmichaud, colomon, masak, [particle], [Coke] and a few others
19:57 masak is "grant manager" anything like "mentor"?
19:57 PerlJam masak: I think it's more like "cat herder"
19:57 pmichaud it's less "mentor" and more like "make sure progress is being made and verify that the terms of the grant are being met"
19:58 pmichaud moritz_: I'll be glad to do it.
19:58 moritz_ afaict the main purpose is to keep comunication to TPF, and answer questions wrt progress
19:58 moritz_ pmichaud: great
19:58 masak pmichaud++
19:58 colomon pmichaud++
19:58 moritz_ any other volunteers?
19:58 moritz_ wouldn't hurt to present more, justin case
19:59 masak moritz_: I'd happily grant-manage you.
19:59 moritz_ masak++
20:00 oha masak++ # pmichaud got 2 karma, i can't see why you should get only 1 in this case ;-P
20:01 masak karma doesn't grow on trees, you know. :P
20:01 oha tree--
20:02 tadzik "karma" means food in my language. Thereof, karma does grow on trees
20:06 [Coke] I can do it, if you'd like it to be less incestuous. =-)
20:08 pmichaud [Coke]: actually, I need a manager for my grant.  Would you be willing?
20:08 [Coke] Sure.
20:09 pmichaud okay, I'll let Karen know -- thanks.
20:09 [Coke] de nada.
20:09 moritz_ [Coke]++
20:12 Italian_Plumber joined #perl6
20:13 Tene karma--
20:13 Tene trees++
20:13 Italian_Plumber1 joined #perl6
20:23 masak loliblogged! http://use.perl.org/~masak/journal/40490
20:24 frettled hazmat!
20:24 pmichaud masak++  # short and very sweet
20:25 __rnddim__ joined #perl6
20:25 moritz_ lol.
20:25 frettled masak: psst, you wrote «three years ago (…) that was two years ago»
20:25 Tene How short is masak?
20:25 justatheory joined #perl6
20:25 frettled Tene: about ye tall
20:25 masak frettled: fixing.
20:26 frettled masak++ for another great motivational blog entry
20:26 cognominal masak++, I prefer to be rmentionned as cognominal. Apart a few english dictionnaries with rare words, I am alone to use that nick on the net.
20:26 masak cognominal: fixing.
20:26 cognominal I don't ask as much :)
20:27 smash masak: is RT#76978 still a problem ?
20:27 patrickas joined #perl6
20:27 masak cognominal: fixed :)
20:28 patrickas hello #perl6
20:28 masak hi patrickas!
20:28 patrickas hello masak, I have a question about RT #72914
20:29 * masak looks
20:29 masak RT seems slow right now.
20:29 frettled masak: You should add an edit note to your blog post, that within a couple of minutes of telling #perl6 that you posted, you had three bugreps to your post (including this one) :D
20:30 masak frettled: which, as we all know, represent love. I'm flattered.
20:31 masak nope, can't reach RT. sorry, smash, patrickas.
20:31 frettled masak: exactly!
20:31 patrickas masak same here :-) went throught google cache
20:31 * masak browses them through his email instead
20:32 patrickas http://webcache.googleusercontent.com/sear​ch?q=cache:fKIgMqeaJw8J:www.mail-archive.c​om/perl6-all%40perl.org/msg87614.html+http​://rt.perl.org/rt3/Ticket/Display.html%3Fi​d%3D72914&amp;cd=1&amp;hl=en&amp;ct=clnk
20:33 masak rakudo: my @a = (4...^5); say @a.perl # should be 4 3 2 1 0 1 2 3 4
20:33 p6eval rakudo fcf4f3: OUTPUT«[4, 3, 2, 1, 0, 1, 2, 3, 4]␤»
20:33 patrickas yes
20:33 masak and it is.
20:33 patrickas my understanding was that ...^ was the same as ... except it does not return the limit when it matches
20:34 masak smash: moritz_++ said it'd been fixed. I haven't tested yet.
20:34 patrickas so 4 ...^ 5 would be 4 and 4 ... ^5 would be 4 3 2 1 0 1 2 3 4
20:34 masak patrickas: that's probably right.
20:34 cognominal masak, where do you see Nil as defined in the spec?
20:34 smash masak: by my tests is fixed, think you can look into itan maybe close the ticket ?
20:34 patrickas masak: it was fixed but when I implemented ...^ (locally) it broke
20:34 masak cognominal: let me find the place for you. it's in S02.
20:35 masak hm, or S04 :)
20:35 cognominal S02:2156 apparently
20:35 masak aye.
20:36 cognominal I don't know how I missed it the first time around
20:36 masak there's some subtly deep wonkiness going on with Nil being defined.
20:36 masak I've been wanting to talk to TimToady about it.
20:36 kensanata joined #perl6
20:36 * [Coke] . o O (is that smash?)
20:37 masak for example, I'm slightly saddened that $obj.?foo // "default" no longer works.
20:37 masak smash: sure.
20:37 masak smash: as soon as RT comes back up.
20:37 smash masak: sure, thks
20:38 smash can't open RT either now :\
20:38 Mowah joined #perl6
20:38 pmichaud lots of perl servers seem to be having difficulties atm
20:38 pmichaud I couldn't reach perlfoundation.org earlier.
20:38 cognominal very often, with Perl 6, things that I innitially find wrong makes more sense once I understand the larger scheme of things. I don't know yet for that one.
20:39 pmichaud currently Nil is the same as (), so the real question is whether   ().defined is true
20:39 masak spectest run: t/spec/S03-smartmatch/any-bool.t aborts abnormally. t/spec/S05-match/capturing-contexts.rakudo t/spec/S05-metasyntax/regex.rakudo t/spec/S29-context/die.rakudo t/spec/S29-context/exit.rakudo all have failing tests.
20:40 cognominal yes I have seen that in src/builtins/Parcel.pir:22
20:40 pmichaud the any-bool.t tests need to be updated to match the spec.
20:46 pyrimidine left #perl6
20:46 * [particle] is happy to act as anyone's grant manager for hague grants
20:48 gfldex rakudo: my $s = 'abcd'; while $s ~~ /(.)/ { print $0 };
20:48 p6eval rakudo fcf4f3:
20:48 p6eval ..OUTPUT«(timeout)aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa​aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa​aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa​aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa​aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa​aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa…
20:48 gfldex rakudo: my $s = 'abcd'; while $s ~~ m:g/(.)/ { print $0 };
20:48 p6eval rakudo fcf4f3:  ( no output )
20:48 gfldex am i asking for something unreasonable?
20:49 [particle] are you expecting that regex to remove a character each time it's run?
20:49 tylercurtis rakudo: my $s = 'abcd'; for $s ~~ m:g/(.)/ { print $0 };
20:49 p6eval rakudo fcf4f3: OUTPUT«a»
20:50 tylercurtis rakudo: my $s = 'abcd'; for $s.match(/(.)/, :g) { print $0 };
20:50 p6eval rakudo fcf4f3: OUTPUT«Any()Any()Any()Any()»
20:50 oha isn't print $/[0]; ?
20:50 tylercurtis rakudo: my $s = 'abcd'; for $s ~~ m:g/(.)/ -> $/ { print $0 };
20:50 p6eval rakudo fcf4f3: OUTPUT«0»
20:50 gfldex $/[0] == $0
20:51 tylercurtis rakudo: my $s = 'abcd'; for $s.match(/(.)/, :g) -> $/ { print $0 };
20:51 p6eval rakudo fcf4f3: OUTPUT«abcd»
20:53 gfldex rakudo: my $s = 'abcd'; while $s ~~ m:g/(.)/ { print $/[0] };
20:53 p6eval rakudo fcf4f3:  ( no output )
20:53 gfldex rakudo: my $s = 'abcd'; while $s ~~ m:g/(.)/ { print $_ };
20:53 p6eval rakudo fcf4f3:  ( no output )
20:54 tylercurtis gfldex: why would while work?
20:54 gfldex it's basic perl5 thinking :)
20:55 gfldex std: my $s = 'abcd'; while $s ~~ m:g/(.)/ { print $_ };
20:55 p6eval std 31912: OUTPUT«ok 00:01 117m␤»
20:55 gfldex i'm quite sure i wont be the last one to try this
20:56 masak indeed.
20:56 masak we should add a warning for when 'while' is used in conjunction with ':g'.
20:58 gfldex would that be a rakudobug?
20:59 masak sure. feel free to submit one.
20:59 iDanny joined #perl6
20:59 tylercurtis rakudo: my $s = 'abcd'; while $s ~~ m:c/(.)/ { print $0 }
20:59 p6eval rakudo fcf4f3:
20:59 p6eval ..OUTPUT«(timeout)bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb​bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb​bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb​bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb​bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb​bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb…
21:00 tylercurtis rakudo: my $s = 'abcd'; while $s ~~ m:pc/(.)/ { print $0 }
21:00 masak t/spec/S32-str/unpack.t is all wrong. it shouldn't operate on a Str, but on a Buf.
21:00 p6eval rakudo fcf4f3: OUTPUT«===SORRY!===␤Adverb 'pc' not allowed on m at line 22, near " { print $"␤»
21:00 Mowah joined #perl6
21:00 masak I can't believe I once wrote those tests :P
21:00 tylercurtis rakudo: my $s = 'abcd'; while $s ~~ m:p/(.)/ { print $0 }
21:01 p6eval rakudo fcf4f3:
21:01 p6eval ..OUTPUT«(timeout)bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb​bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb​bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb​bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb​bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb​bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb…
21:01 masak (whoever added the '(timeout)' thingie)++
21:01 oha this is a thing which happen to me alot, i wonder if there is a way to simplify on p6. i have a field which is a Int, and some constants which are values for that field. I want to allow any Int but i want to both compile the constant name to ints, and be able to obtain the name from the Int at runtime. ideas?
21:02 masak oha: sounds a bit like enums to me.
21:02 oha masak, for the first part, yes
21:02 oha but at runtime am i able to know if there is a name for that int?
21:02 masak that's possible with enums as well.
21:03 tylercurtis oha: ~$foo; $foo.Str; $foo.perl; $foo.key; etc.
21:03 oha i'm checking S09, still can't see it
21:03 masak S12.
21:03 tylercurtis oha: http://perlcabal.org/syn/S12.html#Enumerations
21:03 masak constant %dayname := Day.enums.invert; %dayname{3} # Wed
21:03 whiteknight joined #perl6
21:03 masak TimToady++ # for that
21:04 oha ok checking there, ty
21:04 masak by the way, the other day, I realized we should probably have gone and named '.so' '.totally' instead. it has about the right Huffman coding, too :)
21:05 rcfox rakudo: my $a = 1; say $a.WHAT; my $b = 1 but 2; say $b.WHAT;
21:05 p6eval rakudo fcf4f3: OUTPUT«Int()␤()␤»
21:05 moritz_ so totally cute...
21:05 * moritz_ -> bed
21:05 tylercurtis rakudo: my $a = 1; say $a.WHAT.perl; my $b = 1 but 2; say $b.WHAT.perl;
21:05 p6eval rakudo fcf4f3: OUTPUT«Int␤␤»
21:06 masak they're recasted into anon subclasses of themselves.
21:06 masak should probably still say they're Ints, though.
21:06 rcfox rakudo: my $a = 1 but 2; say $a X[~~] 1,2;
21:07 p6eval rakudo fcf4f3: OUTPUT«10␤»
21:08 patrickas masak should I go ahead and change the test for (4...^5) to expect 4 as result or should we wait for TimToady's confirmation ?
21:08 rcfox rakudo: my $a = any(1,2,3,4); say $a ~~ 1; say $a ~~ 2;
21:09 p6eval rakudo fcf4f3: OUTPUT«any(Bool::True, Bool::False)␤any(Bool::False, Bool::True)␤»
21:09 masak patrickas: viv should be able to solve that one for us.
21:10 tylercurtis rcfox: is 1 but 2 actually valid?
21:10 rcfox tylercurtis: I don't know. I'm just fooling around, mostly.
21:10 patrickas 6->5 ? how ?
21:12 rcfox rakudo: my $a = 1 but Bool::False; say $a ~~ 1; say $a ~~ Bool; say $a ~~ Bool::False;
21:12 p6eval rakudo fcf4f3: OUTPUT«===SORRY!===␤Smartmatch against False always fails; if you mean to test the topic for truthiness, use :!so or *.not or !* instead at line 22, near " Bool::Fal"␤»
21:12 masak patrickas: viv outputs a parse tree. it would know how 4...^5 is parsed.
21:12 rcfox :\
21:12 masak patrickas: and it is very probably right.
21:12 rcfox rakudo: my $a = 1 but Bool::False; say $a ~~ 1; say $a ~~ Bool;
21:12 masak rcfox: what did you expect?
21:12 p6eval rakudo fcf4f3: OUTPUT«1␤0␤»
21:13 rcfox masak: I expected something declared to be false to be false.
21:13 patrickas ok .. how do I summon viv ? :-o
21:14 tylercurtis rcfox: matching about Bools is a bad idea.
21:14 rcfox Bool was the only predefined enum I could think of.
21:14 tylercurtis rcfox: STD warns, but iiuc, Rakudo doesn't know how to do parser warnings, so it just panics.
21:16 tylercurtis rcfox: matching against Bool::False will always fail, though.
21:16 masak rcfox: what tylercurtis said. there was a discussion (again) on p6l about this recently.
21:16 rcfox Okay, I don't know about all of the operator quirks.
21:16 Synnn joined #perl6
21:16 masak rcfox: basically, when the right-hand side of infix:<~~> is a Bool, the result of the match is that Bool.
21:16 masak that is, if it's either True or False.
21:16 masak if it's *actually* Bool, the type match works.
21:17 Synn joined #perl6
21:17 rcfox rakudo: my enum Day <Sun Mon Tue Wed Thu Fri Sat>; my Int $a = 10 but Mon; say $a ~~ Day; say $a ~~ Int;
21:17 p6eval rakudo fcf4f3: OUTPUT«===SORRY!===␤Do not yet support my scoped enums at line 22, near "; my Int $"␤»
21:17 rcfox Bah.
21:18 rcfox What does it mean by scoped enums?
21:18 rindolf joined #perl6
21:18 rindolf Hi all.
21:18 masak rcfox: 'my' makes it scoped.
21:18 masak hello, rindolf.
21:18 rindolf masak: hi, what's up?
21:18 rcfox Oh, I didn't realize I copied the my.
21:19 rcfox rakudo: enum Day <Sun Mon Tue Wed Thu Fri Sat>; my Int $a = 10 but Mon; say $a ~~ Day; say $a ~~ Int;
21:19 p6eval rakudo fcf4f3: OUTPUT«0␤1␤»
21:19 masak rindolf: finishing up my GSoC grant.
21:19 masak rindolf: what about you?
21:19 rindolf masak: I've prepared an .rpm for libenet.
21:19 rindolf I need it for building the game 0AD.
21:19 rcfox rakudo: enum Day <Sun Mon Tue Wed Thu Fri Sat>; my Int $a = 10 but Mon; say $a ~~ Day::Mon;
21:19 p6eval rakudo fcf4f3: OUTPUT«0␤»
21:20 rcfox rakudo: enum Day <Sun Mon Tue Wed Thu Fri Sat>; my Int $a = 10 but Mon; say $a ~~ Mon;
21:20 p6eval rakudo fcf4f3: OUTPUT«0␤»
21:20 rcfox Buh
21:20 rcfox Okay, I'm done flooding for now. :P
21:20 masak rindolf: every time I see your user name, my thoughts return to the Perl 5 cleanup you once initiated. http://use.perl.org/articl​e.pl?sid=02/02/13/1959233
21:21 masak rindolf: how have your thoughts on Perl 6 and Rindolf changed since then?
21:22 rindolf masak: well....
21:22 rindolf masak: I've experimented a little with Perl 6 - it has many cool ideas.
21:22 rindolf masak: and I'd like to see Perl 5 maintain backwards compatibility mostly.
21:23 rindolf masak: I appreciate the fact that the perl 5 and CPAN hackers were able to borrow many good ideas from Perl 6.
21:23 rindolf One thing I don't like is that Perl 6 is called "Perl 6". I think it should have used a different name.
21:23 masak I sense a "but" in there somewhere.
21:23 masak ah.
21:24 masak quite a few people seem to be uncomfortable with the "Perl 6" name.
21:24 masak (I'm not.)
21:24 tadzik What's the big deal, it's not replacing Perl 5, hence it's not named just "Perl"
21:25 tadzik it's not Perl 5.2
21:25 pugssvn r31945 | patrickas++ | Added spaces around ... operator
21:25 masak rindolf: what's the state of rindolf-the-implementation these days?
21:25 rindolf masak: I never started working on it.
21:25 masak oh.
21:25 rindolf masak: not sure if any of my ideas back then are any longer relevant.
21:26 rindolf masak: I discovered several of them were already doable with Perl 5.
21:26 Tene rindolf: "maintain backwards compatibility" isn't a strictly binary property.  What's your stance on, for example, adding new language keywords, that could potentially conflict with code that someone could have written sometime in the past?
21:27 [Coke] Tene: it's really not worth arguing about the name. =-)
21:27 rindolf Tene: well, maybe using the feature pragma.
21:27 Tene [Coke]: itym tadzik
21:27 tadzik [Coke]: that's why I'm not :)
21:28 frettled I'm unhappy that I have to explicitly turn on 5.10 features in Perl 5.  :(
21:28 masak rindolf: the reason I'm asking about rindolf is that as an alternative/criticism of the Perl 6 process, it's historically interesting to me.
21:28 Tene rindolf: for example, chromatic' patch to add a 'class' keyword, similar to mentioned in that UPO post, was rejected ont he grounds of backwards compatibility, iirc.
21:28 masak it was.
21:29 masak but if I were a p5p-er in that situation, I'd probably freak out too.
21:29 tadzik I'm unhappy that the fact that we have 5.12 is worth nothing, for everyone tries to be compatibile with 5.8
21:29 pugssvn r31946 | patrickas++ | Added test for 4...^5 with no spaces
21:29 tylercurtis tadzik: Frequently Foo n+1 is intended to replace Foo n.
21:30 tylercurtis e.g, versions of ECMAscript where N != 4.
21:30 PerlJam tadzik: 5.12 is not "worth nothing".  Progress happens in increments of release numbers, not necessarily in increments of time.
21:30 tadzik tylercurtis: but I'm afraid people will not easily migrate to n+1 in this case
21:30 PerlJam tadzik: at some point, 5.8 will be "too old", not because of its age, but because 5.18 is out.
21:31 * masak sleeps
21:33 frettled PerlJam: In some respects you're right, but if you still have to "use v5.10" or similar to get features more recent than 5.8, then 5.8 will remain the standard in the P5 world.
21:33 PerlJam frettled: yeah, that particular "feature" actually bothers me a bit.
21:33 frettled I'm sure there were quite a bit of broken feathers on the ground after that decision was made.  :)
21:34 [Coke] as an anecdote, I know someone in albany.pm who is still using 5.5 or 5.6
21:34 frettled colleagues of mine are writing Perl 5 code as if it was Perl 4…
21:34 PerlJam [Coke]: as long as it's not Perl 4.036    :-)
21:35 rindolf [Coke]: I think Intel Israel are still using 5.6.x.
21:36 frettled My feelings have «always» been mixed about Perl 6 having the name Perl 6, but these days, I'm feeling increasingly comfortable with that.
21:36 tylercurtis tadzik: true. People expect to be able to take their Foo n code and upgrade immediately to Foo n+1 with no effort beyond installing the new version, though. Even (relatively) minor backwards-incompatibilities (e.g. that in Python 2 to 3) bother people.
21:36 rindolf [Coke]: and szabgab told us of a company which has thousands of perl-5.6.x scripts and they are planning the upgrade to 5.8.x
21:37 frettled rindolf: I'd love to claim that I found that incredible, but that would just be dishonest of me.
21:37 PerlJam frettled: and that's the thing ... the more people see Perl 6 out there, the more they'll get used to it.
21:37 frettled Yup.
21:37 Tene I'm dealing with 5.8.4 right now and it's a horrible pain.
21:38 rindolf Tene: heh.
21:38 rindolf Tene: someone posted to SF.pm (IIRC) for help with 5.8.7 on his Linux from scratch system.
21:38 rindolf He refused to upgrade to something more recent.
21:38 rindolf I said he was beyond help.
21:44 Tene I should look into SF.pm eventually.  Moved to the bay area a couple of months ago.
21:44 molaf joined #perl6
21:45 perimosocordiae left #perl6
21:46 xinming_ joined #perl6
21:46 rindolf Tene: ah, interesting.
21:46 [Coke] (I look at it this way: I survived oracle, solaris, and java's numbering scheme.)
21:46 rindolf Tene: weren't you previously located in Utah?
21:46 Tene rindolf: Yes, that's right.
21:47 rindolf Tene: BTW, someone commented that after reading the Spark specification , he thought it was a second system effect language, and I think he was right. :-(
21:47 rindolf Tene: maybe I should aim a bit lower.
21:51 simcop2387-lap joined #perl6
21:52 simcop2387-lap what document should i look at for learning about namespaces in perl6?
21:52 simcop2387-lap nevermind i'm blind
21:53 * simcop2387-lap does this too much
21:55 rgrau joined #perl6
22:09 Packetknife joined #perl6
22:09 Packetknife joined #perl6
22:11 awwaiid joined #perl6
22:33 tylercurtis Does anyone else have problems with STD's makefile on OS X? It appears to use cp -a, but OS X's cp doesn't support -a.
22:51 tylercurtis tell pmurias The existence of both v6/v6-mildew/lib/V6/ and v6/v6-mildew/lib/v6/ in pugs svn  doesn't play nicely with non-case-sensitive filesystems (for example, HFS+). Would you mind renaming/moving one of them so that I can checkout the repo again?
22:51 tylercurtis phenny: tell pmurias The existence of both v6/v6-mildew/lib/V6/ and v6/v6-mildew/lib/v6/ in pugs svn  doesn't play nicely with non-case-sensitive filesystems (for example, HFS+). Would you mind renaming/moving one of them so that I can checkout the repo again?
22:51 phenny tylercurtis: I'll pass that on when pmurias is around.
23:02 ghyspran joined #perl6
23:05 CaptTofu joined #perl6
23:17 ingy win 46
23:24 dju_ joined #perl6
23:25 tadzik gnight
23:26 hercynium joined #perl6
23:50 tylercurtis sorear: do you know if any problems would be caused if the usages of "cp -a" in STD/viv's Makefile were replaced with "cp -R"?
23:52 Intensity joined #perl6
23:53 sorear What OS are you on?
23:53 tylercurtis OS X 10.5
23:53 sorear according to cp(1) -a is short for -dpR
23:53 sorear POSIX.1-2004 talks about -p and -R but not -d
23:53 * sorear checks if -d is essential
23:54 sorear -d: Copy symbolic links as symbolic links
23:54 sorear no symlinks in STD
23:54 sorear using -pR will work fine
23:56 sorear tylercurtis: do you have a pugs commit bit yet?
23:57 tylercurtis sorear: yes.
23:59 Psyche^ joined #perl6

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

Perl 6 | Reference Documentation | Rakudo