Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2010-11-03

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:02 dnl too close to call
00:05 tadzik what's the opposite of Str.ord?
00:06 flussence something.chr?
00:06 tadzik yes, thanks flussence
00:06 flussence educated guess, it's called that in most languages I'm aware of :)
00:07 tadzik Forgot that :)
00:09 flussence (weird, I can't find .ord in the specs...)
00:09 flussence oh, there it is.
00:09 flussence S29
00:16 sftp left #perl6
00:34 kensanata left #perl6
00:39 Chat5895 joined #perl6
00:39 wamba left #perl6
00:40 Chat5895 heyyyyy im new here
00:40 Chat5895 who wanna chat
00:41 LionMadeOfLions left #perl6
00:41 diakopter Chat5895: this is a room to discuss the programming language Perl 6
00:41 dduncan joined #perl6
00:41 dduncan left #perl6
00:41 Chat5895 ok what about it
00:43 diakopter Chat5895: is that why you joined this room? :)
00:44 Chat5895 i guess
00:48 jhuni joined #perl6
00:50 Chat5895 left #perl6
00:51 diakopter oh, Chatmosphere, how I love thee
00:51 flussence now I'm wondering if we're somehow at the top of /list ...
00:52 araujo it is just that perl6 is attractive even for non-programmers
00:54 flussence hmm, apparently that IP is some sort of proxy, I thought these /Chat\d{4}/ were all the same person...
00:59 QinGW joined #perl6
01:00 orafu left #perl6
01:02 darth_grantius joined #perl6
01:13 __david__ joined #perl6
01:22 plobsing joined #perl6
01:31 rgrau_ left #perl6
01:42 patspam1 joined #perl6
01:43 patspam left #perl6
01:58 dnl left #perl6
01:59 florz left #perl6
01:59 florz joined #perl6
02:01 molaf_ joined #perl6
02:02 dnl joined #perl6
02:04 Chat2688 joined #perl6
02:05 molaf left #perl6
02:05 Chat2688 left #perl6
02:06 dnl- joined #perl6
02:07 dnl left #perl6
02:09 whiteknight left #perl6
02:17 risou joined #perl6
02:31 takadonet1 joined #perl6
02:31 takadonet1 yo
02:35 agentzh joined #perl6
02:38 takadonet1 agentzh: yo
02:39 dnl- left #perl6
02:39 agentzh takadonet1: hiya
02:39 takadonet1 agentzh: how are you sir?
02:40 agentzh takadonet1: enjoying jemplate in our product ;)
02:40 agentzh takadonet1: and lots of nginx/lua/c hacking on its server side :)
02:41 dnl joined #perl6
02:41 perlygatekeeper left #perl6
02:41 agentzh takadonet1: looking forward to rewriting all of our DSL compilers with Perl 6.
02:41 agentzh takadonet1: currently implemented by Perl 5 + Parse::RecDescent + Moose ;)
02:41 takadonet1 agentzh: nice. Planning to rewrite bioperl6 :)
02:42 takadonet1 i mean 5 *
02:42 agentzh great :D
02:42 takadonet1 5 to 6
02:43 agentzh for now the biggest bottleneck is rakudo's performance. Waiting for more optimizations :D
02:44 takadonet1 agentzh: ya same boat so starting to port some of the most used perl 5 module on cpan to pass the time
02:44 agentzh *nod*
02:59 Chat1591 joined #perl6
03:00 Chat1591 yo
03:00 Chat1591 left #perl6
03:00 diakopter ok. you crackberry jokers are getting to me
03:01 diakopter and I can say that as someone who carries one myself
03:01 perlygatekeeper joined #perl6
03:03 __david__ left #perl6
03:03 molaf_ left #perl6
03:06 LionMadeOfLions joined #perl6
03:12 alester left #perl6
03:16 molaf_ joined #perl6
03:19 takadonet1 left #perl6
03:35 araujo left #perl6
03:41 __david__ joined #perl6
03:42 __david__ left #perl6
03:50 wooden left #perl6
04:03 bbkr left #perl6
04:11 justatheory joined #perl6
04:14 am0c^ joined #perl6
04:14 satyavvd joined #perl6
04:35 jaldhar left #perl6
04:47 colomon left #perl6
04:53 bbkr joined #perl6
04:53 colomon joined #perl6
04:58 darth_grantius left #perl6
04:58 bbkr left #perl6
04:59 dnl left #perl6
05:01 bbkr joined #perl6
05:08 \xF0 left #perl6
05:08 JimmyZ joined #perl6
05:18 jaldhar joined #perl6
05:25 justatheory left #perl6
05:50 Helios joined #perl6
06:03 ingy left #perl6
06:03 ingy joined #perl6
06:08 patspam1 left #perl6
06:08 meppl joined #perl6
06:11 sorear good * #perl6
06:18 TiMBuS left #perl6
06:18 TiMBuS joined #perl6
06:24 xabbu42 joined #perl6
06:31 colomon left #perl6
06:32 fudanchii joined #perl6
06:36 kanishka left #perl6
06:37 LionMadeOfLions left #perl6
06:44 wtw joined #perl6
06:46 cjk101010 joined #perl6
06:47 jhuni left #perl6
06:54 _kaare joined #perl6
07:09 am0c joined #perl6
07:20 REPLeffect left #perl6
07:29 JimmyZ left #perl6
07:34 REPLeffect joined #perl6
08:11 _kaare left #perl6
08:23 daxim joined #perl6
08:32 sorear dalek?
08:45 whiteknight joined #perl6
08:46 * sorear out
08:47 Mantis[] joined #perl6
08:47 wallberg joined #perl6
08:48 Mantis[] left #perl6
08:59 tadzik left #perl6
09:06 LionMadeOfLions joined #perl6
09:11 daxim are perl6 grammars powerful enough to do matching on unordered sets of characters?  I'm sure it already does a fine job on ordered sets of characters == strings
09:11 daxim hypothetic example with made-up syntax so you can see what sort of problems I want to achieve:   say 'full house' if @poker_hand =~ set_match('these{2}', 'those{3}')
09:20 moritz_ daxim: I think regexes/grammars are a poor tool for that job
09:21 daxim so I feared.  what's this which I need called, then?  it would also need to include backtracking
09:22 * moritz_ has no idea
09:39 Juerd daxim: What is "back" in an unordered set?
09:39 whiteknight left #perl6
09:40 daxim I'll illustrate with a more complex example.  backtracking is necessary when things can be combinated in several possible ways
09:44 daxim bag = <4 4 4 5 5 5 6 6 6 7 7 7>;  match: triplets{4} | triplets{1} series_of_3{3}
09:45 daxim note the second part of the conjunction has two solutions
09:48 Juerd That bag seems ordered
09:48 Juerd Why would you need all solutions? In poker only the highest hand counts
09:49 Juerd All other matches are irrelevant
09:49 daxim I need them to see which one is highest.  (it's not poker)
09:50 Juerd I guess the @poker_hand fooled me
10:00 icwiener joined #perl6
10:06 colomon joined #perl6
10:07 fudanchii left #perl6
10:07 fudanchii joined #perl6
10:07 fudanchii left #perl6
10:09 QinGW left #perl6
10:18 icwiener left #perl6
10:22 satyavvd Range.roll() not implemented yet?
10:24 moritz_ rakudo: say (1..5).roll(3)
10:24 p6eval rakudo 5f5bae: OUTPUT«315␤»
10:24 am0c left #perl6
10:24 moritz_ seems rather implemented to me
10:26 satyavvd ok will get latest rakudo...
10:28 leprevost joined #perl6
10:36 timbunce joined #perl6
10:39 kensanata joined #perl6
10:41 icwiener joined #perl6
10:55 colomon left #perl6
10:56 Bzek_ left #perl6
11:07 wamba joined #perl6
11:07 wamba left #perl6
11:07 boggytwo joined #perl6
11:07 wamba joined #perl6
11:17 nymacro joined #perl6
11:17 tadzik joined #perl6
11:18 Raynes left #perl6
11:19 Chillance joined #perl6
11:28 nymacro left #perl6
11:29 nymacro joined #perl6
11:29 Raynes joined #perl6
11:33 araujo joined #perl6
11:38 Raynes left #perl6
11:40 agentzh left #perl6
11:40 jaldhar left #perl6
11:41 jaldhar joined #perl6
11:43 constant left #perl6
11:47 Raynes joined #perl6
11:48 satyavvd left #perl6
11:48 broquaint left #perl6
12:03 takadonet hey everyone
12:07 icwiener left #perl6
12:07 icwiener joined #perl6
12:12 tadzik hey takadonet
12:13 takadonet tadzik: hey
12:19 colomon joined #perl6
12:19 takadonet colomon: morning
12:20 colomon o/
12:33 tadzik left #perl6
12:34 icwiener_ joined #perl6
12:34 Guest21983 joined #perl6
12:36 tadzik joined #perl6
12:38 icwiener left #perl6
12:41 LionMadeOfLions left #perl6
12:52 oyse joined #perl6
12:52 molaf_ left #perl6
12:52 oyse left #perl6
12:55 tadzik left #perl6
13:06 orafu joined #perl6
13:08 dnl joined #perl6
13:10 MayDaniel joined #perl6
13:14 dnl "evolution is a myth!" - sincerely, your tea party
13:14 MayDaniel left #perl6
13:14 takadonet dnl: ...
13:15 dnl they really think so
13:17 moritz_ sadly you don't have to meet certain requirements on intelligence or education to hold high political positions :(
13:19 jnthn It'd not be such a problem if more voters cared for such qualifications, though.
13:19 flussence USian politics as a whole scares the crap out of me.
13:20 constant joined #perl6
13:20 constant left #perl6
13:20 constant joined #perl6
13:21 Patterner left #perl6
13:21 moritz_ same here
13:23 tzhs joined #perl6
13:24 takadonet just love how they spend about 4 billion dollars on ads for the mid term election
13:24 jedai left #perl6
13:24 jnthn Same, but to be fair, I sorta suspect some of the US folks find European politics scary too. :-)
13:24 flussence they would've spent more, but they're still using 32-bit computers :)
13:24 jnthn lol
13:25 moritz_ :-)
13:26 moritz_ just read in my news feed a comment (translated) "America is not like Europe would like it to be"
13:26 sftp joined #perl6
13:28 tzhs left #perl6
13:28 takadonet I should not talk about how bad the states are.... Our science minister in Canada does not believe in evolution
13:30 moritz_ ouch.
13:31 moritz_ in Bavaria we had a minister for education who sent her children to a private school :-) (not quite as bad, but still amusing)
13:31 jnthn When I was a kid I used to assume that the ministers for a particular thing had some background in that area.
13:31 takadonet jnthn: sometimes
13:32 jnthn takadonet: Far less than one would hope, it seems.
13:32 takadonet jnthn: indeed
13:33 bluescreen joined #perl6
13:33 bluescreen yt?
13:33 Psyche^ joined #perl6
13:33 Psyche^ is now known as Patterner
13:33 bluescreen Patterner?
13:33 bluescreen hehe
13:33 bluescreen is now known as Guest38267
13:35 jnthn .oO( Somebody who patterns, clearly. )
13:36 moritz_ do the patterns match?
13:39 colomon well, the one in Rebma is backwards...
13:39 colomon ;)
13:42 jferrero joined #perl6
13:43 flussence ooh, I just figured out link($filehandle, 'filename') works in p5... (perldoc is a bit misleadingly worded there)
13:49 broquaint joined #perl6
13:54 mathw o/
13:55 colomon \o
13:58 rgrau_ joined #perl6
13:59 spq1 joined #perl6
14:00 tzhs joined #perl6
14:07 xabbu42 left #perl6
14:08 Util To swap two scalars in Perl 6: ($a, $b) = ($b, $a);
14:08 nymacro left #perl6
14:08 Util How best to swap two arrays?
14:09 frettled rakudo: my @a = 1, 2; my @b = 3, 4; (@a, @b) = (@b, @a); say @a.perl;
14:09 p6eval rakudo 5f5bae: OUTPUT«[3, 4, 1, 2]␤»
14:10 frettled hmm.
14:11 * frettled feels stupid.
14:12 wamba left #perl6
14:12 clkao left #perl6
14:12 exodist left #perl6
14:12 dukeleto left #perl6
14:12 nadim left #perl6
14:12 pothos left #perl6
14:12 Lorn left #perl6
14:12 jasonmay left #perl6
14:12 avuserow left #perl6
14:12 cxreg left #perl6
14:12 flatwhatson left #perl6
14:12 patch left #perl6
14:12 diakopter left #perl6
14:12 colomon rakudo: sub swap($a is rw, $b is rw) { ($a, $b) = ($b, $a); }; my @a = 1, 2; my @b = 3, 4; swap(@a, @b); say @a.perl
14:12 p6eval rakudo 5f5bae: OUTPUT«[3, 4, 1, 2]␤»
14:12 colomon :\
14:13 jnthn ...that looks wrong.
14:13 flussence that looks p5ey...
14:14 Util rakudo: my @a = <a b c>; my @b = <x y z>; my ($a, $b) = map {[@($_)]}, @a, @b; [:$a, :$b].perl.say;
14:14 p6eval rakudo 5f5bae: OUTPUT«["a" => ["a"], "b" => ["b"]]␤»
14:14 Util ???
14:15 flussence rakudo: sub swap($a is rw, $b is rw) { my $tmp := $a; $b := $a; $a := $tmp; }; my @a = 1, 2; my @b = 3, 4; swap(@a, @b); say @a.perl
14:15 p6eval rakudo 5f5bae: OUTPUT«(timeout)»
14:15 flussence :/
14:16 flussence trying to be too clever.
14:16 jedai joined #perl6
14:18 moritz_ rakudo: sub swap($a is rw, $b is rw) { say $a.perl; say $b.perl; ($a, $b) = ($b, $a);  say $a.perl; say $b.perl}; my @a = 1, 2; my @b = 3, 4; swap(@a, @b);
14:18 p6eval rakudo 5f5bae: OUTPUT«[1, 2]␤[3, 4]␤[3, 4, 1, 2]␤[]␤»
14:19 jnthn Oh
14:19 jnthn It can't really work with is rw I guess
14:19 moritz_ looks like $a := @a  doesn't really make $a a scalar
14:19 jnthn It can't with is rw
14:20 jnthn Siknce that implies is parcel
14:20 jnthn Which implies "don't apply any context"
14:20 jnthn Since if you apply context, you just lost the original value.
14:27 frettled It apperas that we're essentially stuck with using a temporary variable.
14:28 frettled rakudo: my @a=1,2; my @b=3,4; say @a.perl; say @b.perl; my @c=@a; @a=@b; @b=@c; say @a.perl; say @b.perl;
14:28 p6eval rakudo 5f5bae: OUTPUT«[1, 2]␤[3, 4]␤[3, 4]␤[1, 2]␤»
14:28 jnthn my (@a, @b) := @b, @a; # modulo the re-declaration error, that'd do it.
14:28 jnthn rakudo: my @a; my @a; say "alive"
14:28 p6eval rakudo 5f5bae: OUTPUT«===SORRY!===␤Redeclaration of symbol @a at line 22, near "; say \"ali"␤»
14:28 jnthn damn, it's an error, not a warning.
14:29 frettled Maybe we'll have to use MONKEY_GROPING.
14:32 Util Thanks, all
14:32 Util My *real* question is: How can you do `@a Z+ @b` when you don't know which array is larger?
14:32 Util I want to treat mis-matched lengths as if there were zero-filled on the right.
14:32 Util @a Z+ @b ignore extra elements.
14:32 Util @a <<+>> @b pads the short array by repeating the start of the short array.
14:33 Util ( @a, * ) repeats the last element.
14:33 colomon @a, 0 Z+ @b, 0
14:33 flussence Look at the source for :samespace :)
14:33 Util ( @a, ( 0 xx *) ) Z+ ( @b, ( 0 xx *) ) is infinite.
14:33 colomon (is that implemented yet?)
14:33 Util ( @a, ( 0 xx *) ) Z+ @b requires you to swap @a and @b when @a is longer,
14:33 Util which is why I wanted to know about swapping arrays.
14:33 Util ( @a, ( 0 xx (+@b - +@a )) ) Z+ ( @b, ( 0 xx (+@a - +@b) ) ) does work,
14:33 colomon @a, 0, * Z+ @b, 0, *
14:33 Util but I am hopefully that something shorter can be invented.
14:33 wamba joined #perl6
14:33 clkao joined #perl6
14:33 exodist joined #perl6
14:33 dukeleto joined #perl6
14:33 nadim joined #perl6
14:33 pothos joined #perl6
14:33 Lorn joined #perl6
14:33 jasonmay joined #perl6
14:33 avuserow joined #perl6
14:33 cxreg joined #perl6
14:33 flatwhatson joined #perl6
14:33 patch joined #perl6
14:33 diakopter joined #perl6
14:33 colomon also infinite.
14:33 colomon hmmm.
14:34 plobsing left #perl6
14:34 Guest38267 left #perl6
14:36 Guest38267 joined #perl6
14:36 moritz_ (@a, 0 xx * Z+ @b, 0 xx *)[^(@a max @b)]
14:37 colomon both arrays have to be finite for this to work.
14:38 colomon (I mean, in general, not just in moritz_++'s solution)
14:40 * colomon must not yield to temptation to define a new meta-op...
14:40 wallberg left #perl6
14:41 isBEKaml_ joined #perl6
14:41 moritz_ the E (for Extend) meta op
14:41 moritz_ EZ+
14:41 isBEKaml_ hi, #perl6! :)
14:42 jnthn Can't wait to use the serialized extending cross meta-operator.
14:43 isBEKaml_ Extending cross metaop? EX= ?
14:43 Util moritz's solution works if I change (@a max @b) to (+@a max +b). Since the list is lazy, it is OK to be infinite if we tell it how many elements to take.
14:43 moritz_ isBEKaml_: you forgot the Serialized (S) part
14:44 isBEKaml_ moritz_: wow, that'd make it something. ;)
14:44 jnthn ;)
14:45 colomon Util: with +@a max +@b, neither list can be lazy
14:45 colomon unless ...
14:45 colomon rakudo: my @a = 1..*; say +@a
14:45 p6eval rakudo 5f5bae: OUTPUT«-9223372036854775808␤»
14:45 colomon rakudo: my @a = 1...*; say +@a
14:46 p6eval rakudo 5f5bae: OUTPUT«(timeout)»
14:46 Util my @a and @b are not lazy. I meant that the generated (0 xx *) lists are lazy.
14:46 colomon ah, yes.
14:46 Util colomon: but I see that I misunderstood your statement: "both arrays have to be finite for this to work"
14:46 justatheory joined #perl6
14:47 isBEKaml_ rakudo: my @a = 1..*; say @a;
14:48 p6eval rakudo 5f5bae:
14:48 p6eval ..OUTPUT«(timeout)1011121314151617181920212223242​5262728293031323334353637383940414243444546474849​5051525354555657585960616263646566676869707172737​4757677787980818283848586878889909192939495969798​9910010110210310410510610710810911011111211311411​5116117118119120121122123124125126127128129130…
14:48 isBEKaml_ well, I didn't expect this (attempting to shoot myself) :D
14:49 isBEKaml_ hugme: hug rakudo
14:49 * hugme hugs rakudo
14:53 isBEKaml_ left #perl6
14:56 ggoebel left #perl6
14:57 bbkr rakudo: say Whatever ~~ *; say * ~~ Whatever; # why in first case I get "Bool::True" and in second I get "1" ?
14:57 p6eval rakudo 5f5bae: OUTPUT«Bool::True␤1␤»
15:00 mkramer left #perl6
15:00 colomon we had a similar case yesterday, something wrong in an ACCEPTS  somewhere, I suspect.
15:00 mkramer joined #perl6
15:00 moritz_ bbkr: rakudobug
15:00 moritz_ rakudo: say 1 ~~ Int
15:00 p6eval rakudo 5f5bae: OUTPUT«1␤»
15:00 moritz_ rakudo: say 1 ~~ 1
15:00 p6eval rakudo 5f5bae: OUTPUT«Bool::True␤»
15:00 moritz_ same difference
15:01 ggoebel joined #perl6
15:01 bbkr moritz_: thanks. i assume it's already reported
15:01 moritz_ http://rt.perl.org/rt3/Tic​ket/Display.html?id=78748
15:03 justatheory left #perl6
15:04 moritz_ masak++. Of course.
15:05 colomon not sure if this is the source of the problem, but it looks to me like ConcreteRole.ACCEPTS and Role.ACCEPTS are both wrong in this way.
15:05 colomon rakudo: say 1 ~~ Numeric
15:05 p6eval rakudo 5f5bae: OUTPUT«1␤»
15:05 colomon yup
15:06 bbkr rakudo: say Bool.so # how about this one? *.so should always give output as Bool value, compare to "Int.so" for example
15:06 p6eval rakudo 5f5bae: OUTPUT«Bool()␤»
15:06 LionMadeOfLions joined #perl6
15:07 moritz_ well, it is a Bool value :-)
15:07 colomon rakudo
15:07 colomon rakudo: say Int.so
15:07 p6eval rakudo 5f5bae: OUTPUT«Bool::False␤»
15:07 zby left #perl6
15:08 bbkr hmm, from my spec understanding you should get Bool::False or Bool::True values from .so operator, not Bool class
15:08 moritz_ then it should be False
15:08 zby joined #perl6
15:08 bbkr indeed. should I report?
15:08 rgrau_ left #perl6
15:09 moritz_ or fix :-)
15:09 moritz_ rakudo: say Bool.Bool
15:09 p6eval rakudo 5f5bae: OUTPUT«Bool()␤»
15:10 moritz_ augment class Bool does Abstraction { method Bool { self }
15:10 moritz_ should probably be    self ?? True !! False
15:11 patspam joined #perl6
15:12 colomon huh.
15:12 risou left #perl6
15:12 colomon does that imply that, say Real.Numeric should be { self // 0 }    ?
15:13 moritz_ hm. Maybe. Not sure
15:13 moritz_ it's something I'd like to hear TimToady's opinion on
15:13 colomon yeah.
15:14 colomon it seems to me the answer should be the same in either case.
15:16 moritz_ or maybe .so shouldn't blindly dispatch to .Bool
15:16 nymacro joined #perl6
15:17 colomon yeah, hmmm.
15:19 risou joined #perl6
15:21 jnthn I suspect part of the issue there is the circularity saw.
15:22 jnthn Bool needs ConcreteRole to exist/work.
15:22 jnthn So doesn't exist at that point.
15:22 jnthn We could make it look up Bool::True and Bool::False and fudge in some fake values until we get to the right point in the bootstrap I guess.
15:26 icwiener_ left #perl6
15:29 cjk101010 left #perl6
15:37 Bonzor432 joined #perl6
15:44 Bonzor432 left #perl6
15:47 tzhs left #perl6
15:51 wamba left #perl6
15:54 tadzik joined #perl6
15:56 tadzik ~~
15:58 leprevost left #perl6
16:00 colomon jnthn: huh
16:00 colomon could we .wrap the methods once Bool has been defined, or something like that?
16:00 jnthn no
16:01 jnthn Better to replace the thing in the namespace.
16:01 jnthn *packAGFE
16:01 jnthn *package
16:01 jnthn Then it looks up the correct thing from there on.
16:03 justatheory joined #perl6
16:04 colomon replace the method entirely, you mean?
16:05 Guest38267 left #perl6
16:05 jnthn no
16:05 jnthn replace what's installed at Bool::True
16:05 jnthn e.g. put a 1 there
16:06 jnthn then once Bool is set up, Bool::True is installed there
16:06 colomon ah.
16:06 jnthn So all call from then on find that.
16:07 sftp_ joined #perl6
16:07 sftp left #perl6
16:08 TimToady rakudo: my @a = 1,2; my @b = 3,4; (@a,@b) := (@b,@a); say ~@b
16:08 p6eval rakudo 5f5bae: OUTPUT«3 4␤»
16:09 TimToady rakudo: my @a = 1,2; my @b = 3,4; (@a,@b) := @b,@a; say ~@b
16:09 p6eval rakudo 5f5bae: OUTPUT«3 4␤»
16:09 TimToady hmm
16:09 jnthn rakudo: my @a = 1,2; my @b = 3,4; (@a,@b) := @b,@a; say ~@a
16:09 p6eval rakudo 5f5bae: OUTPUT«1 2␤»
16:09 TimToady looks like the bind has turned into a no-op somehow
16:09 jnthn wonder if parcel binding works.
16:09 jnthn yeah
16:09 jnthn that's not good.
16:09 jnthn decommute &
16:12 sftp_ left #perl6
16:13 sftp_ joined #perl6
16:13 risou left #perl6
16:13 risou_ joined #perl6
16:16 MayDaniel joined #perl6
16:19 justatheory left #perl6
16:28 icwiener joined #perl6
16:33 Guest21983 left #perl6
16:38 Ross joined #perl6
16:38 Ross left #perl6
16:38 Ross joined #perl6
16:40 Ross left #perl6
16:40 Ross joined #perl6
16:40 Ross left #perl6
16:40 Ross joined #perl6
16:55 daxim left #perl6
16:56 sftp_ left #perl6
16:58 bluescreen joined #perl6
16:58 bluescreen is now known as Guest96007
17:00 sftp joined #perl6
17:10 Trashlord left #perl6
17:11 impious joined #perl6
17:14 takadonet soo quiet.....
17:16 TimToady shh
17:16 colomon too quiet.    ;)
17:16 takadonet still working on that text::Wraps module!
17:16 colomon \o/
17:16 takadonet i figure out how the p5 modules does it and well.... it's weird
17:20 wamba joined #perl6
17:23 sftp left #perl6
17:23 sftp joined #perl6
17:26 meppl left #perl6
17:26 tadzik I had the same feeling with File::Find
17:27 timbunce left #perl6
17:29 icwiener left #perl6
17:30 Trashlord joined #perl6
17:31 icwiener joined #perl6
17:33 sftp left #perl6
17:33 sftp_ joined #perl6
17:33 timbunce joined #perl6
17:33 nymacro left #perl6
17:34 am0c^ left #perl6
17:35 plainhao joined #perl6
17:37 molaf joined #perl6
17:38 Guest96007 left #perl6
17:45 diakopter
17:45 tadzik
17:45 takadonet ?
17:46 jferrero left #perl6
17:46 diakopter freenode was confused about my nick
17:49 cdarroch joined #perl6
17:49 cdarroch left #perl6
17:49 cdarroch joined #perl6
17:53 Guest96007 joined #perl6
17:54 sftp joined #perl6
17:54 sftp_ left #perl6
17:55 PacoLinux there is no version of Song 99 Bottles of Beer in perl6 ? -> http://www.99-bottles-of-beer.net/
17:58 masak joined #perl6
17:59 masak oh hai from Austria! \o/
18:03 * masak digs into some fervent November blogging
18:05 colomon rakudo: say "5 bottles", *.pred ... 1;
18:05 p6eval rakudo 5f5bae: OUTPUT«(timeout)5 bottler5 bottleq5 bottlep5 bottleo5 bottlen5 bottlem5 bottlel5 bottlek5 bottlej5 bottlei5 bottleh5 bottleg5 bottlef5 bottlee5 bottled5 bottlec5 bottleb5 bottlea5 bottldz5 bottldy5 bottldx5 bottldw5 bottldv5 bottldu5 bottldt5 bottlds5 bottldr5 bottldq5 bottldp5
18:05 p6eval ..bottldo5 b…
18:06 Tene heh
18:06 colomon :\
18:06 masak rakudo: .say for map { $_ ~ " bottles" }, 5 ... 1
18:06 p6eval rakudo 5f5bae: OUTPUT«No candidates found to invoke for method 'map' on object of type 'Array'; available candidates have signatures:␤:(Mu : &block;; *%_)␤␤  in 'map' at line 1797:CORE.setting␤  in main program body at line 22:/tmp/h95RVOWKSj␤»
18:06 masak rakudo: .say for map { $_ ~ " bottles" }, (5 ... 1)
18:07 p6eval rakudo 5f5bae: OUTPUT«5 bottles␤4 bottles␤3 bottles␤2 bottles␤1 bottles␤»
18:07 masak rakudo: .say for map { $_ ~ " bottles" }, reverse 5..1
18:07 p6eval rakudo 5f5bae:  ( no output )
18:07 masak rakudo: .say for map { $_ ~ " bottles" }, reverse 1..5
18:07 p6eval rakudo 5f5bae: OUTPUT«5 bottles␤4 bottles␤3 bottles␤2 bottles␤1 bottles␤»
18:09 colomon rakudo: say "5 bottles", { .subst(/\d+/, { $_ - 1}); }  ... * == 1  ;
18:09 p6eval rakudo 5f5bae: OUTPUT«5 bottles4 bottles3 bottles2 bottles1 bottles␤»
18:09 colomon rakudo: say "5 bottles\n", { .subst(/\d+/, { $_ - 1}); }  ... * == 1  ;
18:09 p6eval rakudo 5f5bae: OUTPUT«5 bottles␤4 bottles␤3 bottles␤2 bottles␤1 bottles␤␤»
18:09 Tene So, who's volunteering to port Lingua::EN::Inflect?
18:10 Tene ;)
18:11 colomon it looks surprisingly complicated
18:12 Tene Surprisingly?  Are you new to English?  ;)
18:12 colomon No, just surprised at the scope of the module.  Damian++
18:14 Trashlord wait, what?
18:14 Trashlord oh, right
18:30 nadim left #perl6
18:32 TimToady PacoLinux: see http://rosettacode.org/wiki/99_Bottles_of_Beer
18:32 nadim joined #perl6
18:34 colomon TimToady++
18:35 shortcircuit TimToady: For line 3 of that example, the expression ('Take one down, pass it around' xx 99) is placed in the array. Is the expression evaluated before or after the assignment?
18:35 shortcircuit IOW, does @actions contain two members, or 100?
18:36 colomon before
18:37 timbunce left #perl6
18:37 TimToady xx is lazy but list assignment is not, unless it knows that there are an infinite number of things on the right
18:38 shortcircuit Is it possible to trick the array assignment into being lazy, even though the number of elements would be finite?
18:38 * shortcircuit is thinking about memory optimization cases.
18:38 TimToady sure, use := instead
18:38 shortcircuit Cool
18:38 moritz_ TimToady: what should Bool.Bool return? Bool or Bool::False?
18:38 moritz_ TimToady: and what about Bool.so?
18:39 shortcircuit Oh, God, I just had some awesome program loop behaviors come to mind using xx, := and function calls.
18:39 * shortcircuit sheds a tear
18:39 shortcircuit It's beautiful...
18:39 tadzik left #perl6
18:39 TimToady moritz_: do you mean Bool as a value, or anything of type Bool?
18:40 moritz_ TimToady: I mean the type object
18:40 TimToady type objects are false
18:40 moritz_ so Bool.Bool returns False?
18:40 masak blog post! http://strangelyconsistent.org/blog/n​ovember-3-2010-reform-and-improvement
18:40 TimToady I'd think so
18:40 masak makes sense to me.
18:40 TimToady certainly .so returns true or false
18:41 LionMadeOfLions left #perl6
18:41 TimToady .Bool is just type conversion, arguably, and actual testing of the truthiness is something below that
18:42 colomon likewise, should Int.Real return 0?
18:42 masak premiere &
18:42 masak left #perl6
18:42 TimToady I don't know how you convert to a role
18:42 TimToady that doesn't make sense to me
18:43 moritz_ prefix:<+> also coerces to  role (Numeric)
18:43 timbunce joined #perl6
18:43 colomon errr....   .Numeric is pretty fundamental now.
18:44 TimToady it does, but Numeric has to handle that specially
18:44 moritz_ I'd think it means "coerce to a type that implements that role"
18:44 colomon what moritz_ said.
18:44 TimToady so Int.Real can return Int, meseemeht
18:44 TimToady *th
18:45 colomon so +Int should be Int?
18:46 colomon rakudo: say +Int
18:46 p6eval rakudo 5f5bae: OUTPUT«Int()␤»
18:48 Guest96007 left #perl6
18:50 timbunce left #perl6
19:00 Guest96007 joined #perl6
19:03 molaf_ joined #perl6
19:05 molaf left #perl6
19:10 ggoebel left #perl6
19:16 ggoebel joined #perl6
19:19 justatheory joined #perl6
19:22 molaf_ left #perl6
19:24 risou_ left #perl6
19:31 wtw left #perl6
19:32 Ross left #perl6
19:34 jaldhar left #perl6
19:36 ggoebel left #perl6
19:38 Ross joined #perl6
19:41 ggoebel joined #perl6
19:46 ggoebel left #perl6
19:48 meppl joined #perl6
19:52 takadonet left #perl6
19:57 ggoebel joined #perl6
20:00 TimToady phone?
20:03 pmichaud calling now
20:03 * sjohnson calls TimToady
20:06 patspam left #perl6
20:19 jasonmay phone..? p6 superhero hotline?
20:20 diakopter weekly sixperl chat; minutes/transcript was posted once upon a time to use.perl.org
20:22 diakopter last I saw was from May
20:25 jasonmay oh cool
20:27 saaki left #perl6
20:31 MayDaniel left #perl6
20:32 dukeleto It would be nice if the perl 6 talk minutes were publicly viewable.
20:33 diakopter I'm sure it takes work to transcribe them then work to make consensus on sanitizing/clarifying them :D
20:41 skangas joined #perl6
20:46 saaki joined #perl6
21:06 LionMadeOfLions joined #perl6
21:09 Guest96007 left #perl6
21:26 ggoebel left #perl6
21:29 plainhao left #perl6
21:32 stkowski joined #perl6
21:34 wamba left #perl6
21:35 PerlJam diakopter: If one of the participants would record the conversation, transcription/condensation/clarification/etc could be out sourced
21:36 diakopter I'm sure they are recorded
21:36 diakopter chromatic historically transcribed, afaicg
21:37 whiteknight joined #perl6
21:38 justatheory left #perl6
21:38 PerlJam I'm not sure they are recorded.
21:38 diakopter oh
21:42 spq1 left #perl6
21:46 lue ohayo ツ
21:47 justatheory joined #perl6
21:52 y3llow_ joined #perl6
21:53 pothos_ joined #perl6
21:54 REPLeffect left #perl6
21:54 pothos left #perl6
21:55 ggoebel joined #perl6
21:55 y3llow left #perl6
21:55 pothos_ left #perl6
21:55 y3llow_ is now known as y3llow
21:55 pothos joined #perl6
21:56 icwiener left #perl6
22:04 ggoebel left #perl6
22:05 justatheory left #perl6
22:08 ggoebel joined #perl6
22:08 sftp left #perl6
22:09 sftp joined #perl6
22:10 REPLeffect joined #perl6
22:14 REPLeffect left #perl6
22:15 justatheory joined #perl6
22:16 REPLeffect joined #perl6
22:19 Ross left #perl6
22:21 REPLeffect left #perl6
22:34 alester joined #perl6
22:34 donaldh joined #perl6
22:37 xabbu42 joined #perl6
22:37 justatheory left #perl6
22:37 REPLeffect joined #perl6
22:37 donaldh jnthn: Hi, I'm experimenting with Zavolaj
22:38 donaldh jnthn: It's really nice, but I've reached some limits.
22:38 jnthn donaldh: Yes, it has some.
22:39 jnthn donaldh: Especially the lack of a way to handle structs. That's something that I can can be improved once the Parrot NCI GSOC work lands in master.
22:39 donaldh jnthn: I'm using it with the parrot gsoc_nci branch at the moment.
22:40 donaldh Sqlite3 makes extensive use of out params, typically opaque.
22:40 jnthn Ah, OK. There's not handling for that just yet.
22:40 donaldh So I'm trying to figure out a way of implementing the V nci parameter type
22:41 donaldh :D
22:41 * jnthn thinks for a moment how that could look
22:41 donaldh in PIR I use UnManagedStruct
22:42 donaldh And V writes a pointer into UnManagedStruct
22:43 donaldh Is there any equivalent type I can use in Rakudo?
22:43 REPLeffect left #perl6
22:43 donaldh Or a wrapper for UnManagedStruct?
22:44 jnthn Maybe a wrapper for UnManagedStruct is the way to go (more)
22:45 jnthn Maybe it wants some "placeholder" style thing like OpaquePointer
22:45 jnthn e.g. OpaquePointerOut or some such
22:45 donaldh Yes, I was thinking that way too.
22:45 REPLeffect joined #perl6
22:45 jnthn And the scalar that gets passed in gets assigned to.
22:46 jnthn Oh
22:46 donaldh Only it doesn't remain OpaquePointerOut for long. It becomes an in param to the next call.
22:46 jnthn True...
22:46 jnthn Note that OpaquePointer isn't actually used as a class ever.
22:46 donaldh I see that. Just a type.
22:46 jnthn It's only used by the NCI sig generator.
22:47 am0c joined #perl6
22:47 donaldh There is a general problem with out params that parrot never used to handle very well.
22:48 donaldh I'm not sure if it's better because I haven't looked recently.
22:48 jnthn *nod*
22:48 * donaldh admits that 'V' wasn my invention.
22:48 donaldh _was_
22:48 jnthn :-)
22:48 jnthn Yeah, I'm just pondering how to neatly map it to something in Zavolaj.
22:49 jnthn $c is just a capture, so you can get the scalar out of it and assign to it just fine.
22:50 jnthn I wonder if the way to do it is to not just call with |$c, but instead if there are out parameters (just use a "flag type" like OpaquePointer) it creates and passes in an unmangedstruct to get the pointer.
22:50 donaldh I'm staring at your method Bool that does some unmanaged magic, but not quite understanding it ;-
22:51 jnthn Reading the defined v-table method in the appropriate PMC should be revealing on that one.
22:51 jnthn I forget exactly what it does off-hand...
22:51 donaldh ah
22:51 donaldh thanks for the pointer.
22:51 * donaldh is learning fast here.
22:52 stkowski left #perl6
22:52 jnthn Wow. !update-desc-to-index is evil!
22:52 risou joined #perl6
22:53 donaldh ^^ nice symmetry to that last statement
22:53 jnthn ;-)
22:54 jnthn My feeling is that you'll need to do something in the trait_mod with $c though
22:54 jnthn e.g. re-build the argument list when there's out pointers.
22:55 jnthn And slot the unmanaged struct to populate in there.
22:55 jnthn Assigning it to the passed in scalar container.
22:55 jnthn (Maybe call !STORE directly)
22:56 jnthn Zavolaj does some evil stuff, but mostly to keep the evil out of everything else that's using it. :-)
22:56 donaldh You've just said about 5 higher order things that I barely understand right now ;0
22:56 jnthn Oops, sorry. :-)
22:56 donaldh heh
22:57 jnthn Do you understand what's going on between lines 104 and 113?
22:57 donaldh I'll go play with this and maybe come and bug you with questions.
22:57 jnthn That's the area I expect you'll need to make changes.
22:58 donaldh I don't right now [lines ...] but it's a good learning exercise for me.
22:58 jnthn I should explain at least one thing 'cus it's...bizzare. :-)
22:58 wamba joined #perl6
22:59 donaldh k
22:59 wamba left #perl6
22:59 jnthn In Rakudo when you write a sub foo, the thing that gets installed in the lexpad (or package, or whatever) isn't actually the Parrot Sub PMC.
22:59 jnthn It's a wrapper object around one.
23:00 donaldh wow, I remember that from way back.
23:00 jnthn The attribute in the wrapper containing that Parrot sub is in the $!do
23:00 jnthn pir::setattribute__vPsP($r, '$!do' ...
23:00 REPLeffect left #perl6
23:00 jnthn That is just saying "oh, we'll throw out the sub body and replace it with something that does an NCI call instead"
23:01 justatheory joined #perl6
23:01 donaldh Gotcha.
23:02 jnthn Just thought it was worth demistifying that bit. :-)
23:02 jnthn What follows is not so bad once you go through it piece by piece.
23:03 donaldh Am I right in saying that pir::descalarref__PP is just a dereferencing step?
23:03 wamba joined #perl6
23:04 jnthn Yes. Decontainerization.
23:06 justatheory left #perl6
23:06 donaldh is that roughly equivalent to .param pmc ref \n ref = deref ref
23:08 donaldh I used to do this in Rakudo: $dbHandle = q:PIR { %r = new 'UnManagedStruct' };
23:08 donaldh And: $dbHandle = q:PIR { %r = new 'UnManagedStruct' };
23:08 donaldh Ooops: my $s = Sqlite3::sqlite3_open($db, deref($dbHandle));
23:10 donaldh nopaste?
23:12 jnthn donaldh: Roughly.
23:12 jnthn donaldh: It's a specialized op
23:12 jnthn That knows about Rakudo's container types
23:12 jnthn But semantically it's a lot like deref.
23:12 donaldh Okay, thanks
23:13 justatheory joined #perl6
23:14 REPLeffect joined #perl6
23:14 donaldh Thanks jnthn++ I'll go play, but very time challenged just now so it might be a while.
23:14 alester left #perl6
23:15 jnthn donaldh: No worries. Have fun, when you get to it. :-)
23:15 jnthn donaldh: Oh, do you have a Zavolaj commit bit?
23:15 xabbu42 left #perl6
23:15 donaldh jnthn: nope
23:15 jnthn github id?
23:15 donaldh donald@sealgair.com
23:16 donaldh sorry donaldh
23:16 kensanata left #perl6
23:16 jnthn donaldh: You're added.
23:17 donaldh thanks!
23:17 jnthn donaldh: I'm happy to code-review and then merge through the fork queue if you prefer to do things that way, but if you're confident, go ahead and commit. :-)
23:17 jnthn Please do check that e.g. MiniDBI still works, though.
23:17 jnthn There's not really a test suite for Zavolaj yet. :(
23:17 ggoebel left #perl6
23:18 jnthn Though things that use it (like MiniDBI) do have one. :-)
23:18 jnthn "Test suite through proxy." ;-)
23:18 REPLeffect left #perl6
23:19 donaldh Nice :-)
23:19 justatheory left #perl6
23:19 donaldh This may all lead me to hacking on MiniDBI for Sqlite3 support.
23:20 donaldh jnthn: thanks again and goodnight.
23:20 xabbu42 joined #perl6
23:20 ggoebel joined #perl6
23:21 jnthn donaldh: Excellent
23:21 jnthn night :-)
23:22 lue rakudo: $a = "hello;world"; say $a.split(';').perl
23:22 p6eval rakudo 142d22: OUTPUT«===SORRY!===␤Symbol '$a' not predeclared in <anonymous> (/tmp/sO3fKMsLUK:22)␤»
23:22 lue rakudo: my $a = "hello;world"; say $a.split(';').perl
23:22 p6eval rakudo 142d22: OUTPUT«("hello", "world")␤»
23:23 lue rakudo: my $a = 3;say $a;
23:23 p6eval rakudo 142d22: OUTPUT«3␤»
23:23 donaldh left #perl6
23:25 sftp left #perl6
23:25 araujo http://pastie.org/1270943
23:25 araujo though it follows the smalltalk infix operators (messages) rules
23:25 araujo :P
23:28 sftp joined #perl6
23:31 REPLeffect joined #perl6
23:32 wamba left #perl6
23:32 meppl left #perl6
23:34 lue how do I access certain characters of a string again?
23:34 lue (something like $a[0])
23:39 lue rakudo: my $a = "hello"; say $a[0]
23:39 p6eval rakudo 142d22: OUTPUT«hello␤»
23:40 xabbu42 left #perl6
23:41 Util rakudo: my $s = "abcdef"; $s.substr(1,3).say; # Starting at position 1 (0-based), return 3 characters
23:41 p6eval rakudo 142d22: OUTPUT«bcd␤»
23:43 Util lue: using substr, either as a function or as a method. Method demonstrated above.
23:44 Util rakudo: my $s = "abcdef"; print substr( $s, 1,3 ); # function version
23:44 p6eval rakudo 142d22: OUTPUT«bcd»
23:45 lue How would I remove the last character of a string?
23:45 flussence .chop?
23:46 risou left #perl6
23:51 Util flussence: yes, but the chop method does not mutate its argument (unlike in Perl5); it returns the chopped string.
23:51 Util So the answer is $s = $s.chop , which can be shortened to $s .= chop;
23:51 Util rakudo: my $s = "abcdef"; $s .= chop; $s.say
23:51 p6eval rakudo 142d22: OUTPUT«abcde␤»
23:52 justatheory joined #perl6
23:53 Util The old "chop" semantics live on as "p5chop":
23:53 Util rakudo: my $s = "abcdef"; p5chop $s; $s.say
23:53 p6eval rakudo 142d22: OUTPUT«abcde␤»
23:54 Limbic_Region joined #perl6
23:55 justatheory left #perl6

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

Perl 6 | Reference Documentation | Rakudo