Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2010-10-09

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:03 sorear Should role Foo { } be considered a subtype of Mu?
00:16 sorear I guess it has to bee
00:16 sorear otherwise it's impossible to pass Foo into a function like &infix:<~~> or &infix:<but>
00:17 sorear which leaves the question - are roles Mu, or Any?
00:17 sorear if Foo ~~ Any, then, is it also the case that ClassWhichDoesFoo ~~ Any?  Subtyping ought to be transitive
00:18 sorear Does *that* mean that class Bar is Mu does Foo is illegal?
00:18 sorear TimToady: jnthn: ping
00:22 dukeleto sorear: sounds like some interesting edge cases
00:22 * dukeleto gets popcorn
00:30 jaldhar joined #perl6
00:44 saaki left #perl6
00:49 saaki joined #perl6
00:50 masak rakudo: role Foo {}; say Foo ~~ Mu; say Foo ~~ Any
00:51 dalek sprixel: e438505 | diakopter++ | sprixel/ (5 files):
00:51 dalek sprixel: added a TAILCALL_NOT_TRAMPOLINE preprocessor option. it seems 1.5x as slow
00:51 dalek sprixel: as the trampoline in my microbenchmarking, on .NET/x86 anyway.
00:51 dalek sprixel: I'll try it on Mono on Windows and Linux sometime.
00:51 dalek sprixel: review: http://github.com/diakopter/sprixel/commit/e438505882b76df375762b446ea75966dfe3226f
00:51 p6eval rakudo 668719: OUTPUT«(timeout)»
00:51 masak locally, that says '1\n1\n'
00:53 diakopter the poor p6eval vps is bogged with something.  looking.
00:54 diakopter oh. swapping horribly due to rebuilding parrot.
00:54 diakopter that is getting out of hand.
00:55 diakopter actually no, gen/perl6.pbc is compiling gen/core.pm
00:55 diakopter and using 90% of the system ram
00:55 diakopter 6 hours of cpu?
00:56 diakopter oh, minutes. :)
00:58 diakopter rakudo: role Foo {}; say Foo ~~ Mu; say Foo ~~ Any
00:58 p6eval rakudo 668719: OUTPUT«1␤1␤»
00:59 QinGW joined #perl6
01:03 QinGW1 joined #perl6
01:04 QinGW left #perl6
01:06 masak diakopter++
01:07 Holy_Cow joined #perl6
01:08 diakopter I didn't do anything; I just waited for rakudo to be done rebuilding
01:10 masak ah.
01:12 mavrc left #perl6
01:19 jaldhar left #perl6
01:40 plobsing joined #perl6
01:41 sjohnson "perl6:  ready to rock and/or roll"
01:41 simcop2387 left #perl6
01:42 LaVolta joined #perl6
01:42 simcop2387 joined #perl6
01:47 meppl joined #perl6
01:50 redicaps joined #perl6
01:54 justatheory joined #perl6
02:00 sjohnson perl!
02:00 colomon 6!
02:00 sjohnson heh
02:01 sjohnson ++perl5; !
02:01 simcop2387 left #perl6
02:02 simcop2387 joined #perl6
02:05 cdarroch left #perl6
02:06 satyavvd joined #perl6
02:18 mikehh left #perl6
02:45 masak sjohnson: "Perl 6: ready to rock, paper or scissors."
02:45 satyavvd left #perl6
02:45 Chillance left #perl6
02:47 araujo joined #perl6
02:51 jasonmay left #perl6
02:52 jasonmay joined #perl6
02:53 plobsing rakudo:  "rock", "paper" or "scissors"
02:53 p6eval rakudo 668719:  ( no output )
02:53 plobsing rakudo:  say "rock", "paper" or "scissors"
02:53 p6eval rakudo 668719: OUTPUT«rockpaper␤»
02:57 pythonian4000afk is now known as pythonian4000
03:01 jaldhar joined #perl6
03:07 pythonian4000 is now known as pythonian4000afk
03:09 orafu left #perl6
03:11 orafu joined #perl6
03:12 risou joined #perl6
03:19 plobsing left #perl6
03:23 synth joined #perl6
03:24 synth left #perl6
03:29 masak ok, then. time to go to Paris.
03:29 masak left #perl6
03:31 risou left #perl6
03:32 risou joined #perl6
03:35 leprevost joined #perl6
03:37 meppel joined #perl6
03:40 nymacro joined #perl6
03:41 meppl left #perl6
03:56 jasonmay left #perl6
03:58 jasonmay joined #perl6
04:24 mfollett joined #perl6
04:31 meppel left #perl6
04:34 Holy_Cow left #perl6
04:48 mfollett left #perl6
04:49 agentzh joined #perl6
05:02 pythonian4000afk is now known as pythonian4000
05:22 satyavvd joined #perl6
05:27 redicaps left #perl6
05:31 pythonian4000 is now known as pythonian4000afk
05:52 s_mosher left #perl6
06:00 satyavvd_ joined #perl6
06:01 satyavvd left #perl6
06:01 satyavvd_ is now known as satyavvd
06:06 [particle] left #perl6
06:11 justatheory left #perl6
06:16 Bucciarati left #perl6
06:33 envi left #perl6
06:37 envi joined #perl6
06:37 satyavvd left #perl6
06:40 dalek niecza/master: a3cf7c1 | sorear++ | / (4 files):
06:40 dalek niecza/master: Implement type objects for roles
06:40 dalek niecza/master: review: http://github.com/sorear/niecza/commit/a3cf7c1f13af7273aef532496517dd35fbe11c2b
06:40 dalek niecza/master: 4d2eb8a | sorear++ | / (6 files):
06:40 dalek niecza/master: Implement compilation of parametric roles
06:40 dalek niecza/master: review: http://github.com/sorear/niecza/commit/4d2eb8adefc7659ba2600b66b907d1fe43f1642f
06:44 nymacro left #perl6
06:46 nymacro joined #perl6
06:54 envi left #perl6
06:57 [particle] joined #perl6
06:57 envi joined #perl6
07:04 Ross joined #perl6
07:04 Ross left #perl6
07:04 Ross joined #perl6
07:17 molaf joined #perl6
07:23 _kaare joined #perl6
07:24 araujo left #perl6
07:34 envi left #perl6
07:43 envi joined #perl6
07:45 envi left #perl6
08:06 meppl joined #perl6
08:08 Mowah joined #perl6
08:30 risou left #perl6
08:34 risou joined #perl6
08:39 mavrc joined #perl6
08:42 _kaare left #perl6
08:52 nadim on p5 someone said to not use this <<<<  say~~grep{$_<0}@array >>>> which may be. some one cares to tell me why?
08:53 moritz_ what does ~~ as a prefix do?
08:53 moritz_ nadim: but the best chances are to ask the one who told you
08:54 nadim in p5 it two unary ~ to force scalar context
08:55 moritz_ you can use $(...) for that in Perl 6
08:55 sorear Why are you writing code that ugly?
08:55 moritz_ nadim: there's also the scalar() in p5
08:56 nadim I know it all started because I wanted to write >>> say scalar grep {$_ < 0} @array ; <<< shorter. please ddon't ask why, there is no reason.
09:00 Ross left #perl6
09:01 risou left #perl6
09:01 masak joined #perl6
09:02 masak oh hai from OSDC.fr! \o/
09:02 risou joined #perl6
09:02 nadim you're everywhere K.
09:02 icwiener joined #perl6
09:06 jnthn_fr joined #perl6
09:06 risou left #perl6
09:06 jnthn_fr o/ #perl6
09:15 masak rakudo: my @i = <rock paper scissors>; my %n = %(@i.kv).invert; sub w($a, $b) { (%n{$a} - %n{$b}) % 3 }; my ($p1, $p2) = @i.roll(2); .say for $p1, $p2; say $_ ?? "Player $_ wins" !! "A tie" given w($p1, $p2)
09:15 p6eval rakudo 668719: OUTPUT«paper␤scissors␤Player 2 wins␤»
09:16 cogno joined #perl6
09:20 masak rakudo: my @i = <⽯ ⎘ ✄>; my %n = %(@i.kv).invert; sub w($a, $b) { (%n{$a} - %n{$b}) % 3 }; my ($p1, $p2) = @i.roll(2); .say for $p1, $p2; say $_ ?? "Player $_ wins" !! "A tie" given w($p1, $p2)
09:20 p6eval rakudo 668719: OUTPUT«✄␤✄␤A tie␤»
09:22 jnthn_fr That rocks on paper, but srsly, cut it out. :P
09:22 masak :P
09:22 * masak cuts out of IRC
09:23 masak left #perl6
09:25 sorear hello jnthn_fr
09:25 sorear jnthn_fr: niecza's metamodel is not so unlike 6model as I once thought
09:26 sorear the mistake I made was to think of DynMetaObject as a bizarre HOW
09:26 sorear it's not, it's much closer to STable
09:26 sorear the one thing I'm really missing is reification of representations as objects
09:26 jnthn_fr left #perl6
09:27 sorear blah
09:31 cogno left #perl6
09:37 cogno joined #perl6
09:45 cogno_ joined #perl6
09:49 envi joined #perl6
09:49 cogno left #perl6
09:49 cogno joined #perl6
09:49 cogno_ left #perl6
09:53 masak joined #perl6
09:54 saaki left #perl6
09:57 saaki joined #perl6
09:57 Mowah left #perl6
09:58 Mowah joined #perl6
09:59 cogno left #perl6
10:02 amkrankruleuen joined #perl6
10:02 QinGW1 left #perl6
10:05 M_o_C joined #perl6
10:08 cogno joined #perl6
10:12 masak rakudo: class A { has $.x }; say A.new(:x<a b c>).x.WHAT
10:12 p6eval rakudo 668719: OUTPUT«Seq()␤»
10:14 M_o_C left #perl6
10:14 Holy_Cow joined #perl6
10:19 cognominal left #perl6
10:19 cogno left #perl6
10:20 * moritz_ wonders why item context turns a Parcel into a Seq
10:24 sorear because S02 says so.
10:24 sorear TimToady and pmichaud are adamant S02 is right but I haven't grokked their explanations yet
10:25 * moritz_ hopes that it becomes clearer when pmichaud updates the specs with the new list/iterator API
10:25 LaVolta left #perl6
10:25 masak "specs" in plural makes it sound like there's more than one spec... :/
10:26 masak it's enough of a bother with the one we have.
10:27 moritz_ we have the written S\d\d documents, the test suite and #perl6 collective knowledge
10:27 wamba joined #perl6
10:27 masak I'm pretty sure you only meant the first of those, though.
10:27 moritz_ right
10:27 masak which I'd call "one spec" but "several synopses".
10:28 masak sorry about being so picky.
10:28 masak I'm still a bit un-fine with the repo being called "specs" as in "eyeglasses".
10:29 masak not that there aren't more important matters to attend to, but still. renaming it would make one small thing more right.
10:43 masak jnthn++ says "specs -- how you look at Perl 6" :)
10:44 masak lunch &
10:44 masak left #perl6
10:48 MayDaniel joined #perl6
10:52 cogno joined #perl6
10:55 timbunce joined #perl6
10:55 oyse joined #perl6
11:02 cogno left #perl6
11:12 zulon joined #perl6
11:16 cosimo any examples of sockets usage in parrot or perl6?
11:16 moritz_ cosimo: http://github.com/mberends/http-server-simple
11:17 cosimo perl6 lwp::simple is working fine for me, while i have really big problems talking to a memcached server
11:17 cosimo as in, i can't get all the bytes the server is sending me, or get just some lines, ...
11:17 cosimo moritz_: thanks, i'll take a look
11:20 oyse Is the perl6 executable built with debugging symbols by default or do I have to provide som options when running make?
11:20 moritz_ oyse: you probably need to change that in parrot's configure step
11:21 moritz_ hm, looks like by default is with debugging symbols
11:22 oyse moritz_: ok. thanks
11:25 redicaps joined #perl6
11:27 Italian_Plumber joined #perl6
11:28 sftp left #perl6
11:28 sftp joined #perl6
11:29 redicaps left #perl6
11:32 Italian_Plumber left #perl6
11:34 Holy_Cow left #perl6
11:40 _kaare joined #perl6
11:43 Holy_Cow joined #perl6
11:47 molaf_ joined #perl6
11:49 lucas_ joined #perl6
11:49 molaf left #perl6
11:52 lucas_ hello developers
11:53 lucas_ I'm just beginning my learning path, so I have some doubts...
11:53 lucas_ STD.pm(6) is written in Perl 6, right?
11:53 lucas_ was it written in Perl 5 at any point in time before?
11:55 Holy_Cow left #perl6
12:05 masak joined #perl6
12:06 masak lucas_: no, STD.pm6 is written in Perl 6 from the start. there's a tool that knows how to translate (the STD-specific subset of) Perl 6 into Perl 5 so that it can run, though.
12:10 agentzh left #perl6
12:10 lucas_ masak: hello
12:10 lucas_ what's is the name of this tool?
12:10 lucas_ I run into this file...
12:10 masak lucas_: viv.
12:11 lucas_ std/std_hilite/STD_syntax_highlight
12:11 lucas_ and it was written in p5
12:11 masak lucas_: its name means "vi -> v", i.e. Roman numerals for "6 -> 5".
12:11 lucas_ but it required STD...
12:11 moritz_ lucas_: you can install the compiled-to-p5 version of STD via CPAN
12:11 lucas_ oh, cool, I wouldn't think that about viv name
12:11 masak lucas_: yes, the std_hilite thing is mostly used by Padre, I think. Padre is written in Perl 5.
12:11 moritz_ cpanm STD # and wait a bit
12:14 lucas_ the lesson I learned now it that there is this p5-compiled version of STD. I didn't know about that. thanks
12:17 masak well, viv compiles the Perl 6 source code in STD.pm6 to Perl 5.
12:17 masak for the purpouse of them running it.
12:25 Trashlord left #perl6
12:39 lucas_ I'm trying to run std/std_hilite/STD_syntax_highlight
12:39 lucas_ it dies because CursorBase.pm can't find setting CORE and asks if I runned make
12:39 lucas_ running make in std source tree dies because of missing package VAST::Assignment_operator
12:39 lucas_ even after installing Mildew dist from CPAN
12:39 lucas_ sub load_lex in CursorBase.pm is trying to load some yaml file syml/CORE.syml
12:39 lucas_ what are those syml files? I've never heard of these before. stands for "syntax" yaml?
12:39 lucas_ where are they installed?
12:41 masak left #perl6
12:48 Italian_Plumber joined #perl6
12:53 risou joined #perl6
12:54 orafu left #perl6
13:00 x3nU i'm trying to use MiniDBI
13:00 x3nU and that's what i get
13:00 x3nU The native library 'libmysqlclient' required for 'mysql_affected_rows' could not                                                                              be located
13:00 x3nU of course i have libmysqlclient
13:10 thepler left #perl6
13:14 araujo joined #perl6
13:19 Patterner left #perl6
13:22 Italian_Plumber left #perl6
13:26 orafu joined #perl6
13:29 spinclad left #perl6
13:29 spinclad joined #perl6
13:31 Psyche^ joined #perl6
13:31 Psyche^ is now known as Patterner
13:33 moritz_ x3nU: do you also have the header files?
13:34 Trashlord joined #perl6
13:38 masonkramer joined #perl6
13:38 x3nU moritz_: yes
13:49 risou left #perl6
13:55 colomon loliblogged: http://justrakudoit.wordpress.com/2010/10/09/longest-palindrome/
13:56 satyavvd joined #perl6
13:56 avuserow left #perl6
13:58 avuserow joined #perl6
14:17 justatheory joined #perl6
14:19 jferrero joined #perl6
14:23 timbunce left #perl6
14:25 rjbs (16, 8, 4 ... 0)
14:25 rjbs So, this gets all Zeno on me and gets to very very small numbers.  Fine, I can dig it.
14:25 rjbs Is there a way to say, "treat everything as integers"?
14:26 moritz_ rakudo: .say for 'abcdedbb'.match(:g, /(\w+)\w?<?{$0.flip}>/)
14:26 p6eval rakudo 668719: OUTPUT«abcdedbb␤»
14:27 moritz_ rakudo: say ~(64, 32, *div* ... 0)
14:27 Juerd So that matched what, bb?
14:27 p6eval rakudo 668719: OUTPUT«64 32 2 16 0␤»
14:27 oyse left #perl6
14:27 * rjbs wanted to do it without supplying a closure.
14:27 moritz_ Juerd: it matched the whole string, because the <?{...}> seemed to have been ignored
14:27 rjbs (Just for exploration, not because it's important.)
14:28 moritz_ rjbs: then I don't know how to do it
14:28 rjbs Ok, thanks!
14:28 moritz_ hm, <?{ is a assertion
14:28 moritz_ rakudo: .say for 'abcdedbb'.match(:g, /(\w+)\w?<{$0.flip}>/)
14:28 p6eval rakudo 668719: OUTPUT«ded␤bb␤»
14:29 moritz_ colomon: that's a simpler solution... just look for the match with the highest length
14:30 colomon moritz_: isn't that grotesquely inefficient?
14:31 moritz_ colomon: it probably is
14:31 moritz_ colomon: but it's in the regex engine, which is a bit faster than regular Perl 6 code
14:34 colomon I mean, with a thousand character string, there will be 1,000,000 possible matches to test, no?
14:34 nperez left #perl6
14:35 colomon I was figuring a regex solution would look like /(\w)(\w)(\w)$3$2$1/
14:35 moritz_ correct
14:35 moritz_ that's only for length 6
14:36 MayDaniel left #perl6
14:36 moritz_ but it'd be probably more efficient to to look for length 2 and 3 palindromes, and then go to the left and right for there on
14:38 nperez joined #perl6
14:39 colomon moritz_: right, but you can pretty easily generate the equivalent matches for longer lengths, and as soon as you hit one that does match (if you're counting up in length) you know your last match was the correct answer.
14:41 lucas_ left #perl6
14:42 moritz_ colomon: http://nopaste.snit.ch/24122 is my current approach
14:42 moritz_ still a bit buggy, it seems
14:42 mberends joined #perl6
14:43 moritz_ but takes only 2.3s on the example string from the challenge
14:43 colomon ooooooooo
14:43 colomon zippy
14:44 colomon that only gets the length 3 palindromes, right?
14:44 colomon well, and length 2
14:44 moritz_ length 2 and 3, and then the inner while-loop should expand them
14:44 moritz_ going to left and right simultaneously as long as left and right are the same
14:45 colomon ah, I see.  nice.
14:45 moritz_ but there's a bug
14:45 moritz_ at walks over the end
14:46 moritz_ that's a bad description
14:46 cls_bsd left #perl6
14:46 cls_bsd joined #perl6
14:46 moritz_ it produces 'allh', which is not a palindrome at all
14:47 mberends x3nU: in a debian-ish system, the module required for MiniDBI is libmysqlclient-dev.  It's a bit like using libicu-dev when building Parrot.
14:47 araujo left #perl6
14:49 x3nU i'm using CentOS
14:49 x3nU and i have mysql-dev
14:49 x3nU devel*
14:49 x3nU /usr/include/mysql.h
14:49 x3nU is present
14:49 x3nU /usr/include/mysql/mysql.h *
14:50 xinming_ joined #perl6
14:50 justatheory left #perl6
14:50 mberends x3nU: no other ideas right now, but I'll try installing on CentOS next week. Thanks for pointing this out :)
14:51 xinming left #perl6
14:53 x3nU hope it will eventually work for me :)
14:59 colomon moritz_: think you need "my $right = .to;"
14:59 colomon and then kill the $right--; at the end.
14:59 colomon that said, it's generating correct results for me, but not THE correct result, which is weird.
15:01 colomon never mind, the correct result is indeed in there.
15:01 colomon and this version is screamingly fast.  moritz_++
15:03 MayDaniel joined #perl6
15:05 Holy_Cow joined #perl6
15:06 zulon left #perl6
15:10 cirne100 joined #perl6
15:11 colomon moritz_: now you need to blog your solution.  :)
15:14 mberends left #perl6
15:17 Axius joined #perl6
15:20 satyavvd left #perl6
15:29 moritz_ colomon: I will
15:30 colomon I've updated my post pointing out your brilliance.  ;)
15:43 Chillance joined #perl6
15:46 moritz_ lolnowibloggedtoo: http://perlgeek.de/blog-en/perl-6/longest-palindrome-regex.html
15:46 nymacro left #perl6
15:46 satyavvd joined #perl6
15:48 justatheory joined #perl6
15:51 Holy_Cow left #perl6
15:51 Italian_Plumber joined #perl6
15:51 moritz_ anyone got a not-so-slow prime tester in perl 6 at hand?
15:54 envi left #perl6
15:55 moritz_ rakudo: foo($x)
15:55 p6eval rakudo 668719: OUTPUT«===SORRY!===␤too few positional arguments: 2 passed, 3 (or more) expected␤»
15:55 moritz_ now that's really LTA
15:55 moritz_ rakudo: sub foo($) { }; foo($x)
15:55 p6eval rakudo 668719: OUTPUT«===SORRY!===␤too few positional arguments: 2 passed, 3 (or more) expected␤»
15:57 risou joined #perl6
15:59 MayDaniel left #perl6
16:00 moritz_ rakudo: say (1, 2, 2).uniq
16:00 p6eval rakudo 668719: OUTPUT«12␤»
16:02 Axius_ joined #perl6
16:02 awwaiid joined #perl6
16:03 Holy_Cow joined #perl6
16:06 Axius left #perl6
16:07 amkrankruleuen left #perl6
16:13 hercynium left #perl6
16:15 justatheory left #perl6
16:21 cirne100 left #perl6
16:21 Axius joined #perl6
16:24 Axius_ left #perl6
16:26 x3nU win 30
16:26 x3nU oops
16:26 x3nU in 30
16:28 TimToady rakudo: ~(64,32,16 ...^ Rat)
16:29 TimToady that ought work
16:29 p6eval rakudo 668719: OUTPUT«(timeout)»
16:29 TimToady but it doesn't
16:29 TimToady rakudo: ~(64,32,16 ...^ Num)
16:29 p6eval rakudo 668719: OUTPUT«(timeout)»
16:29 TimToady that's not it...
16:29 moritz_ rakudo: say ~(64,32,16 ... *)[^10]>>.WHAT
16:29 p6eval rakudo 668719: OUTPUT«Int() Int() Int() Rat() Rat() Rat() Rat() Rat() Rat() Rat()␤»
16:30 TimToady is is not really doing a smartmatch?
16:31 colomon moritz_: I used the old 2, 3, *+2 ... * > $possible-prime.sqrt method, which was plenty fast for the second challenge.
16:31 risou_ joined #perl6
16:31 TimToady rakudo: say ~(64,32,16 ...^ 0..^1)
16:31 p6eval rakudo 668719: OUTPUT«Method 'shift' not found for invocant of class 'Range'␤  in 'infix:<...^>' at line 838:CORE.setting␤  in main program body at line 22:/tmp/UGYc0ZNN_f␤»
16:31 satyavvd left #perl6
16:31 TimToady rakudo: say ~(64,32,16 ...^ (0..^1))
16:32 p6eval rakudo 668719: OUTPUT«Method 'shift' not found for invocant of class 'Range'␤  in 'infix:<...^>' at line 838:CORE.setting␤  in main program body at line 22:/tmp/7LgcdWL3o9␤»
16:32 TimToady rakudo: say ~(64,32,16 ...^ ^1.item)
16:32 p6eval rakudo 668719: OUTPUT«Method 'shift' not found for invocant of class 'Range'␤  in 'infix:<...^>' at line 838:CORE.setting␤  in main program body at line 22:/tmp/WWDCUhFtqJ␤»
16:32 moritz_ colomon: I've done the same now; fast enough indeed
16:32 TimToady rakudo: say ~(64,32,16 ...^ (^1).item)
16:32 p6eval rakudo 668719: OUTPUT«Method 'shift' not found for invocant of class 'Range'␤  in 'infix:<...^>' at line 838:CORE.setting␤  in main program body at line 22:/tmp/SFdSJozP11␤»
16:32 risou left #perl6
16:32 moritz_ colomon: but I don't have a good idea on how to approach the third
16:33 TimToady rakudo: my $r = (^1); say ~(64,32,16 ...^ $r)
16:33 p6eval rakudo 668719: OUTPUT«Method 'shift' not found for invocant of class 'Range'␤  in 'infix:<...^>' at line 838:CORE.setting␤  in main program body at line 22:/tmp/3UG0Zw9Glp␤»
16:33 colomon no approach at all, or just no fast approach?
16:33 TimToady yes, that's because I want you to treat the Range as a scalar!!!
16:34 TimToady maybe Any.shift should be an identity
16:34 moritz_ colomon: there's always brute forcing, but that's ugly, and too slow in Perl 6
16:35 moritz_ (2**22 would be fine in C, for example)
16:35 moritz_ iterations, that is
16:35 colomon moritz_: okay, yes, I have verify experimentally that brute force is too slow in Rakudo.  :)
16:35 colomon *verified
16:35 TimToady rakudo: say ~(64,32,16 ... 1);  # course, this works fine too
16:35 p6eval rakudo 668719: OUTPUT«64 32 16 8 4 2 1␤»
16:38 zby left #perl6
16:38 moritz_ rakudo: .say for [X~] (0, 1) xx 3
16:38 p6eval rakudo 668719:  ( no output )
16:38 colomon TimToady: Range does Positional, so it will try to match it to the @rhs version of sequence op
16:38 moritz_ rakudo: .say for [X~] [0, 1] xx 3
16:38 p6eval rakudo 668719: OUTPUT«000 001 010 011 100 101 110 111␤»
16:38 moritz_ \o/
16:38 colomon I don't know why the rate one doesn't work.
16:39 colomon s/rate/Rat/
16:39 moritz_ the series code uses $limit.defined in a lot of places
16:40 colomon moritz_++
16:44 colomon hmmm.  wonder if 16, 8, 4 ...^ Rat is a known bug?
16:48 TimToady well, the $r should have shielded the Positionalness in any case
16:49 Holy_Cow left #perl6
16:50 TimToady lunch &
16:51 MayDaniel joined #perl6
16:52 Italian_Plumber left #perl6
16:52 Axius_ joined #perl6
16:53 Axius left #perl6
16:55 awwaiid left #perl6
16:56 mavrc left #perl6
16:57 Axius joined #perl6
16:57 Axius_ left #perl6
16:59 mavrc joined #perl6
17:02 draxil left #perl6
17:05 Holy_Cow joined #perl6
17:16 incucullo joined #perl6
17:22 HarryS is now known as K-Lined
17:23 K-Lined is now known as HarryS
17:25 Holy_Cow left #perl6
17:27 Axius left #perl6
17:29 Axius joined #perl6
17:32 colomon moritz_: think I have a workable solution for the third problem (currently executing)
17:32 risou joined #perl6
17:33 moritz_ colomon: what approach do you take?
17:33 colomon recursion
17:33 moritz_ I considered that too
17:33 colomon my first full run just ended, but I don't know if the result is correct yet or not.
17:33 moritz_ probably a good idea
17:34 colomon it's a lot faster because it is easy to knock out dead ends
17:34 risou_ left #perl6
17:34 moritz_ right, that was the reason not to brute force it with a [X~] [0, 1] xx 21  bitmaks
17:34 Trashlord left #perl6
17:35 Trashlord joined #perl6
17:37 meppl left #perl6
17:37 Axius left #perl6
17:38 Axius joined #perl6
17:39 colomon moritz_: my answer was indeed right.
17:40 colomon btw, [X~] [0, 1] xx 21  never occurred to me.  I just counted from 1 to 2**22.   ;)
17:41 moritz_ is 2236 correct?
17:41 moritz_ nope
17:41 colomon nope
17:41 colomon that's much too high
17:43 * moritz_ sees that he counted lots of  cases like 78 + 0 == 78
17:43 Axius_ joined #perl6
17:44 Holy_Cow joined #perl6
17:44 Italian_Plumber joined #perl6
17:44 Axius left #perl6
17:47 sftp left #perl6
17:47 moritz_ when I remove those I get 200, but that's still wrong :(
17:50 moritz_ much better now...
17:52 awwaiid joined #perl6
17:54 colomon I think you must have another instance of the same sort of error.  ;)
17:54 moritz_ I've got the right solution now :-)
17:55 moritz_ and I have a complete list of fulfilled equations along the way
17:57 colomon oooo, nice, I didn't try to make a list of equations.
17:58 moritz_ very helpful for debugging :-)
17:58 moritz_ http://nopaste.snit.ch/24126 if you're interested in the code
17:59 colomon http://justrakudoit.wordpress.com/2010/10/09/summing-subsets/
17:59 colomon how fast is yours?
17:59 * moritz_ checks
18:00 moritz_ 23s
18:00 moritz_ probably faster if I skip debugging output, and passing along the already selected values as an array
18:00 sorear Good * #perl6!
18:01 colomon \o
18:01 moritz_ o/
18:01 MayDaniel left #perl6
18:01 colomon moritz_: interesting, yours seems to be a bit faster than mine.  (at a guess, I've not run it locally to get a real comparison.)
18:03 moritz_ colomon: I put in some prior knowledge. Like that the last two numbers can never appear on the LHS of a sum
18:03 moritz_ 16s without the debugging code
18:03 moritz_ but probabaly more important, I don't look for a specific target
18:04 moritz_ but rather at each subsum I look if the sum appears in the array
18:07 moritz_ rakudo: say 40.16 / 15.95 # time ratio on my machine
18:07 p6eval rakudo 668719: OUTPUT«2.51786833855799␤»
18:09 Italian_Plumber left #perl6
18:10 icwiener left #perl6
18:13 plobsing joined #perl6
18:23 kjeldahl joined #perl6
18:28 Chillance left #perl6
18:46 kjeldahl left #perl6
18:50 plobsing_ joined #perl6
18:53 plobsing left #perl6
18:53 sftp joined #perl6
19:06 Trashlord left #perl6
19:06 incucullo left #perl6
19:06 M_o_C joined #perl6
19:11 Axius joined #perl6
19:17 Axius_ left #perl6
19:17 Axius left #perl6
19:22 M_o_C left #perl6
19:33 risou left #perl6
19:34 risou joined #perl6
19:38 risou left #perl6
19:39 levengli joined #perl6
19:52 levengli left #perl6
19:53 _kaare left #perl6
19:54 meppl joined #perl6
19:54 sorear seen tylercurtis
19:54 aloha tylercurtis was last seen in #perl6 1 days 6 hours ago joining the channel.
20:33 Holy_Cow left #perl6
20:35 Holy_Cow joined #perl6
20:35 Schwern joined #perl6
20:40 dalek roast: d8e4ca9 | moritz++ | S02-builtin_data_types/array.t:
20:40 dalek roast: [array.t] unfudge test for RT #63350, also add a similar one for $()
20:40 dalek roast:
20:40 dalek roast: Also covers RT #78284, which seems to be mostly a duplicate of 63350
20:40 dalek roast: review: http://github.com/perl6/roast/commit/d8e4ca96b03fdea174d34dc3f4102de23c7ed177
21:02 awwaiid left #perl6
21:14 Holy_Cow left #perl6
21:22 MayDaniel joined #perl6
21:23 synth joined #perl6
21:38 pythonian4000afk is now known as pythonian4000
22:07 Schwern left #perl6
22:17 MayDaniel left #perl6
22:25 Holy_Cow joined #perl6
22:58 wamba left #perl6
23:01 Mowah left #perl6
23:46 mavrc left #perl6
23:50 meppl left #perl6
23:53 justatheory joined #perl6

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

Perl 6 | Reference Documentation | Rakudo