Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2010-07-31

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:00 whee aw, clang parot and rakudo is slightly slower on an arbitrary test :(
00:01 whee perl6 -e 'say [<] (1..1000)'  17.55s user 0.27s system 99% cpu 17.933 total
00:02 * jnthn is glad colomon++ has been working on optimizing the .. operator :-)
00:02 whee (but it passes all the bundled tests :D)
00:02 jnthn Oh, that's a good thing. :-)
00:05 dduncan left #perl6
00:06 tylercurtis sorear: the cperl-mode.el from pugssvn syntax highlights Rakudo's core.pm in non-noticeable time. Although it's less nice than vim's in that you can't tell it to do Perl 6 as easily since it modifies cperl-mode to support Perl 6 instead of just providing a separate mode.
00:06 KenGuru joined #perl6
00:07 KenGuru whats the difference between cream-gvim and gvim?
00:08 shirtless cream will have no modal concepts when you start using it
00:08 shirtless it will feel alot like windows notepad and you'll have to use the mouse
00:09 sorear tylercurtis: egh.  so no good for a mixed 5/6 project
00:10 shirtless KenGuru, if you want to try it in regular mode (plain old gvim) then here is a quick cheatsheet i made http://pastebin.com/ZZzd8XNr
00:10 shirtless If you just take the plunge you won't regret it. You shouldn't need more commands then this, since you'll have a GUI for managing files etc.
00:11 shirtless PM me with any questions you have or #vim will help as well, but if it's really noob just ask me.
00:11 tylercurtis sorear: it doesn't get rid of P5 support, just tries to detect Perl 6 files(e.g., by class/module with semicolon, use v6(I think), and probably file-type(if you use .pm6)) and highlight them as Perl 6 instead of Perl 5.
00:11 * shirtless wouldn't be surprised if a lot of people in here could answer a vim question, either.
00:12 tylercurtis sorear: although it fails miserably if you use =begin/=end-style POD; it doesn't recognize the =end as ending it.
00:13 KenGuru joined #perl6
00:21 cognominal joined #perl6
00:24 ashleydev joined #perl6
00:25 [Coke] offerkaye++
00:34 kid51 [Coke] ping
00:37 colomon whee: my optimized version does [<] (1..1000) in 1.78s on my MacBook Pro.
00:37 colomon unfortunately, it failed a bunch of tests, and I still have to sort out why.
00:37 colomon > say +(6..8)
00:38 colomon 1
00:38 tylercurtis colomon: unscientific testing using the same benchmark you were optimizing before this month's release indicates a very slight speedup(hundreds of milliseconds off the average out of about 15 or 16 second total runtime).
00:38 colomon for example
00:38 colomon tylercurtis: and that's just switching to the Int version of the fdiv op?
00:39 tylercurtis colomon: right.
00:39 matt_youell joined #perl6
00:40 infrared joined #perl6
00:41 KenGuru doh ... gvim
00:41 sECuRE joined #perl6
00:42 sECuRE i tried to use LWP::Simple from rakudo star like this: LWP::Simple.new.get('http://localhost:5984/foo/b6163​76f0add14a2feda9ad46b0025f3');
00:42 sECuRE however the non-standard port seems to be a problem, i get an error message:
00:42 sECuRE http://p.nnev.de/1492
00:44 KenGuru now i have to redefine syntax colors again ... tedious...
00:44 shirtless I dont, because I simply copy my vim directory to each new machine when I migrate
00:44 shirtless easier than migrating editor settings that are in a binary registry
00:45 sECuRE can be fixed by changing line 140 of LWP/Simple.pm to $sock.open($hostname, $port.Int, :bin);
00:45 sECuRE (it used $port before)
00:45 ispeak_ joined #perl6
00:45 sECuRE where can/should i report this?
00:46 shirtless it's really fast when I am on a server, and I can just scp over the entire config in like 2 seconds
00:46 shirtless then I'm working remotely on some strange server with my regular setup.. pretty awesome.
00:46 jnthn sECuRE: Maybe an issue in http://github.com/cosimo/perl6-lwp-simple/ would help
00:46 jnthn cosimo: If you're about, see ^^
00:47 sECuRE jnthn: thanks for the pointer, will do
00:48 KenGuru i have my colors saved on usb (no binary format)
00:48 shirtless you made your own theme
00:48 shirtless ?
00:48 KenGuru but i don't have vim colors atm
00:48 KenGuru japp
00:48 shirtless So you're a seasoned vim user, you just hate it anyway?
00:48 KenGuru its kinda like the dark theme from monodev
00:48 KenGuru no i dont hate it
00:48 [Coke] kid51: yes?
00:48 shirtless oh good :)
00:48 KenGuru i'm not used to it
00:49 KenGuru i use powershell all day long ;-)
00:49 KenGuru and npp
00:49 shirtless I'm either using vim or the lousy eclipse editor
00:50 kid51 [Coke] I posted to that RT re iBook build failure
00:50 KenGuru but i have to admit that i'm kinda spoiled (from Visual Studio and ReSharper)
00:56 [Coke] kid51: minimum recommended memory is 1G.
00:56 [Coke] looks like you have 25% of that.
00:56 kid51 Oh :-(
00:57 kid51 Where is that minimum spelled out?
00:57 [Coke] school of hard knocks. :|
00:57 * kid51 may finally be forced to buy a new laptop!
00:57 * kid51 hates buying hardware ... is a confirmed late adopter
00:58 whee kid51: do it! :D
00:59 [Coke] kid51: added a note as well. someone can put a note in the README or something.
00:59 songmaster_ joined #perl6
00:59 [Coke] also: "make parrot use less memory"
00:59 [Coke] also: "split up core.pm when building"
00:59 [Coke] both of which are haaaaaaard.
01:00 sorear "make parrot use less memory" is very, very much in process
01:00 sorear the object system rework will slash memory footprint in half
01:00 sorear by my estimates
01:01 kid51 +1; even if I do get a new laptop, I want to try to build Parrot & Rakudo on this box as long as possible
01:01 [Coke] anything rakudo can do to use less PMCs will also help.
01:01 [Coke] your new laptop won't be PPC, so there's that.
01:02 kid51 What do you mean by ... "that"?
01:02 kid51 Is/was PPC more memory-inefficient than Intel?
01:02 [Coke] it is a fact of note.
01:02 [Coke] just different.
01:02 rjbs joined #perl6
01:03 KenGuru stackoverflow ... in my brain.
01:03 KenGuru to much new input
01:03 rjbs Hi, sixies.  How's the R* train goin'?
01:03 kid51 turning to a new topic ...
01:03 * kid51 begins reading UsingPerl6-draft.pdf ...
01:03 kid51 ... Is there a plan to update this on a regular schedule?
01:03 rjbs kid51: Cool!  I am looking forward to finding a pile of time to read that, myself.
01:04 kid51 rjbs:  http://tech.groups.yahoo.com​/group/perlsemny/message/993
01:04 KenGuru 2(shirtless2): you're right ... cream in easy mode is like npp
01:04 tylercurtis colomon: looks like fdiv__III doesn't work for $MOST-NEGATIVE-INT div -1 (where $MOST-NEGATIVE-INT means what it sounds like).
01:04 * snarkyboojum managed to build rakudo on his 256MB slice by copying a precompiled version of core.pir across to it :)
01:05 KenGuru getting familiar
01:07 rjbs kid51: good luck!
01:08 sorear kid51: ppc has always used much less compact code than intel, it's RISC's one flaw
01:08 sorear kid51: back when MacOS was going though their original multiarch days, it was normal for a ppc binary to be 2-3x larger than the m68k binary
01:09 [Coke] hugme: show book?
01:09 hugme [Coke]: sorry, I don't know anything about 'book?'
01:09 [Coke] hugme: show book
01:09 hugme [Coke]: the following people have power over 'book': P⁣erlJam, T⁣imToady, [⁣particle], c⁣olomon, j⁣nthn, m⁣asak, m⁣berends, m⁣oritz_, p⁣michaud. URL: http://github.com/perl6/book/
01:09 sorear kid51: though it kindof evened out because the ppc had a MMU and unused code pages could be evicted
01:09 [Coke] kid51: there's the book. you can see the update schedule so far.
01:10 sorear [Coke]: ppc vs. intel with the same sizeof(void*) shouldn't affect parrot much, since bytecode isn't machine code
01:22 colomon jnthn: ping?
01:27 jnthn colomon: oh hai
01:28 colomon jnthn: that code you gave me yesterday for generating a Parcel seems to make a Parcel in a Parcel?
01:28 jnthn *confused look*
01:28 colomon if I .perl it, I get ((1, 2)) instead of (1, 2)
01:28 jnthn colomon: I think I need an example of wha tyou're observing.
01:28 jnthn colomon: OK. Plesae can I see the whole thing?
01:29 jnthn (yes, that looks like a PiP to me too..)
01:30 colomon http://gist.github.com/501608
01:30 colomon if $mod == 2, the output is "parcel" => ((1, 2))
01:30 colomon (output of the say which is the next to last statement)
01:31 colomon I can get around it by taking [0] of the Parcel, but that seems ... inelegant.
01:32 jnthn rakudo: my $parcel := pir::new__Ps('Parcel'); pir::push($parcel, 42); $parcel.perl.say
01:32 p6eval rakudo dfefdd: OUTPUT«(42, )␤»
01:32 colomon rakudo: my $parcel := pir::new__Ps('Parcel'); pir::push($parcel, 42); pir::push($parcel, 17); $parcel.perl.say
01:32 jnthn rakudo: my $parcel := pir::new__Ps('Parcel'); pir::push($parcel, 42); pir::push($parcel, 69); say :$parcel.perl
01:32 p6eval rakudo dfefdd: OUTPUT«(42, 17)␤»
01:32 p6eval rakudo dfefdd: OUTPUT«"parcel" => ((42, 69))␤»
01:33 jnthn rakudo: my $foo := (1,2,3); say :$foo.perl
01:33 drbean joined #perl6
01:33 p6eval rakudo dfefdd: OUTPUT«"foo" => ((1, 2, 3))␤»
01:33 jnthn colomon: Oh. Interesting.
01:33 colomon huh.  does Parcels do funny things when you pass them as arguments?
01:33 jnthn Not really
01:34 colomon huh.
01:34 jnthn But what you're observing isn't any different from if we constructed the Parcel normally
01:34 jnthn I wonder if it's to do with the pair dumper?
01:34 colomon the reason I started investigating this was that my lists were coming back ((1, 2), 3, 4, 5) instead of (1, 2, 3, 4, 5)
01:34 jnthn rakudo: my $x = 1,2,3; say :$x.perl
01:34 p6eval rakudo dfefdd: OUTPUT«"x" => 1␤»
01:34 jnthn gah!
01:34 jnthn rakudo: my @x = 1,2,3; say :@x.perl
01:34 p6eval rakudo dfefdd: OUTPUT«"x" => [1, 2, 3]␤»
01:35 jnthn colomon: I can't help but wonder if something in the Pair construction is doing it.
01:35 jnthn Since $parcel.perl seems OK but :$parcel.perl doesn't.
01:36 colomon and then I'm passing it by name to the .new method.   :\
01:36 jnthn Yeah, but passing my name shouldn't actually construct a Pair, so you may get away with it.
01:37 colomon but something's definitely going wrong at that point, too.
01:37 jnthn colomon: Can you .WHAT the thing that gets passed into the ConsIter?
01:38 colomon will take a minute, requires a rakudo rebuild
01:39 jnthn k
01:39 isBEKaml_ (backlogging) I think we all forgot about u4x.perl6.org. :(
01:39 jnthn I'm in the procces of writing a long mail to parrot-dev ATM anyways. :-)
01:39 isBEKaml_ It needs some browser love. :(
01:39 [Coke] uhoh.
01:41 isBEKaml_ phenny: tell offerkaye, you have http://u4x.perl6.org that renders the pod into formatted html. Feel free to improve it! :)
01:41 phenny isBEKaml_: I'll pass that on when offerkaye is around.
01:42 jnthn [Coke]: :-)
01:42 envi^home joined #perl6
01:42 jnthn [Coke]: Don't worry, it's not a rant. :-)
01:43 jnthn I have weissbier. I'm too happy to rant.
01:44 * colomon just broke out the Amaretto.
01:44 jnthn :)
01:44 colomon jnthn: huh.  it's a Parcel at the point of that say statement.
01:45 colomon but inside the ConsIter it's a Seq.  :\
01:45 jnthn colomon: Bingo.
01:45 jnthn colomon: It must be putting it in item context.
01:45 jnthn colomon: Use \
01:45 colomon in the .new call?
01:45 jnthn Erm
01:46 jnthn oh hm.
01:46 jnthn I wonder *where* it's getting put into item context.
01:46 jnthn Oh
01:46 jnthn If it's Seq in .new then there I guess
01:46 jnthn colomon: In the signature of method new do something like \:$value or some such
01:46 jnthn colomon: Basically, it says "don't apply any context"
01:47 colomon I'm just using default new.
01:47 jnthn Oh.
01:47 colomon I meant ConsIter.new(:value-parcel(\$parcel)
01:47 cmadsen joined #perl6
01:47 jnthn No, that won't do it.
01:47 colomon I'm actually thinking there's no real reason for it to be a parcel at that point.
01:48 orafu joined #perl6
01:48 jnthn colomon: OK.
01:48 colomon I can just pass an Array, and the infix:<,>(|@array, whatever) Parcel constructor trick should still work
01:48 jnthn colomon: I think it may be a slightly deep thing going on here.
01:48 colomon right?
01:48 cmadsen I'm trying to build rakudo star, and it fails:
01:48 cmadsen Symbol '@named-params\ufffd' not predeclared in MAIN_HELPER (src/gen/core.pm:6542)
01:48 jnthn Yes, but you may lose your hard-won efficiency wins, no?
01:48 cmadsen this appears to be some kind of encoding issue
01:49 cmadsen MAIN.pm says @named-params».name».substr(1)
01:49 colomon jnthn: that I don't know.  I tend to think not, but I could be wildly wrong.
01:49 cmadsen but core.pm says @named-params».name».substr(1)
01:49 jnthn cmadsen: That sounds...rather odd. And yes, encoding-y.
01:49 jnthn cmadsen: What platform are you on?
01:49 cmadsen Gentoo Linux
01:50 * jnthn hasn't seen this issue before...
01:50 jnthn Oh. That's...nothing so unusual. :S
01:50 jnthn cmadsen: All we do is concatenate the files together into core.pm
01:51 cmadsen  is 0xC2 in Latin-1, which is also the first byte of » in UTF-8
01:51 cmadsen but that still doesn't explain how it got from » to »
01:51 jnthn cmadsen: No, I'm rather confused too.
01:52 sorear » in UTF-8 is C2 BB
01:52 sorear » in ISO-8859-1 is C2 BB
01:52 sorear makes perfect sense to me
01:53 cmadsen so it read MAIN.pm as Latin-1, and wrote it out as UTF-8
01:54 jnthn cmadsen: That sounds plausbile. I just don't know what in your setup is causing that to happen.
01:54 sorear cmadsen: are you using rakudo atlanta?  because that's known to work stupidly with utf8 in files
01:54 jnthn sorear: Yes, but in this case it's a Perl 5 build script.
01:54 cmadsen I just downloaded rakudo-star-2010.07
01:54 cmadsen this is my first try at getting it going
01:54 jnthn We run build/gen_core_pm.pl
01:54 jnthn As something like
01:55 jnthn build/gen_core_pm.pl file1.pm file2.pm > core.pm
01:56 IllvilJa1 joined #perl6
01:57 snarkyboojum kid51: FWIW, I just managed to build rakudo star on my 256MB slice by copying a pre-compiled version of core.pir from a prebuilt star and commenting out the relevant sections of the generated Makefile which write out core.pir - surely not a recommended approach, but if you're keen - it does seem to work :)
01:58 KenGuru joined #perl6
01:58 colomon jnthn: switching to an array does not seem to kill the speed.
01:58 colomon and it fixes the bug quite nicely.
01:58 jnthn colomon: OK, go for that then.
01:59 frooh anyone know how major of a feature temp scoping is?
02:00 jnthn cmadsen: I'm not quite seeing where this could be going wrong. :-( I guess it could be to do with the re-direction, or soemthing with the way the files are being read in.
02:00 cmadsen I found it.  I had PERL_UNICODE=SAL in my env
02:00 cmadsen unset PERL_UNICODE and regenerating the file worked
02:00 cmadsen I'm not sure why that was necessary, tho
02:00 jnthn Oh!
02:01 jnthn OK, that probably will help somebody who knows what the environment variable does to fix things.
02:01 pmichaud back again
02:01 LaVolta joined #perl6
02:01 cmadsen maybe rakudo's makefile should unset that
02:01 jnthn o/ pmichaud
02:01 jnthn cmadsen: Or maybe gen_core_pm.pl should say something more specific about the unicode handling it wants.
02:01 frooh pmichaud: hey, do you have any idea how hard it would be to add temp scoping to rakudo?
02:01 jnthn I'm not sure what the Right Answer is.
02:01 pmichaud frooh: I'm guessing not simple.
02:02 frooh that's what I figured
02:02 frooh but I assume everything is hard, and then find out a few things are easy
02:02 frooh so I was hoping it would be like that :-)
02:02 frooh hm hm hm
02:02 jnthn cmadsen: If you have a spare moment, please could you drop an email to rakudobug@perl.org to report this?
02:02 jnthn cmadsen: I don't know the Correct Fix, but somebody surely will. :-)
02:02 cmadsen jnthn, np
02:02 jnthn And we can patch up a future release do not have this issue.
02:03 jnthn Thanks.
02:03 jnthn cmadsen++
02:03 pmichaud what issue?
02:03 frooh well, my simplest cpan module uses local a lot, so I was gonna port that to rakudo; maybe I'll do a bunch and then wait till that bit's done
02:03 jnthn pmichaud: It's in the pretty immediate backscroll.
02:03 * pmichaud reads backscroll
02:03 pmichaud (and on phone)
02:07 songmaster_ joined #perl6
02:08 songmaster_ joined #perl6
02:11 ispeak_ left #perl6
02:13 pugssvn r31880 | svatsan++ | [u4x] Few style changes for Webkit browsers.
02:14 isBEKaml_ Oh, crap. I committed in a few changes I made to a couple of example scripts so long ago. Didn't even know that I changed them. (Note to self: Should do svn diff before commits) :/
02:22 frooh so in p5 we usually prefix internal subroutines with_
02:22 frooh do people have something like that for p6 yet?
02:22 isBEKaml_ prefix with !
02:22 isBEKaml_ private subs/methods
02:23 frooh ok, cool
02:23 frooh *: my $x = * + 2; say $x.isa
02:23 frooh star: my $x = * + 2; say $x.isa
02:23 p6eval star 2010.07: OUTPUT«too few positional arguments: 1 passed, 2 (or more) expected␤  in main program body at line 22:/tmp/dqeNawGnhX␤»
02:23 cmadsen jnthn: bug filed http://rt.perl.org/rt3/Tic​ket/Display.html?id=76856
02:23 frooh star: my $x = sub { }; say $x.isa
02:23 p6eval star 2010.07: OUTPUT«too few positional arguments: 1 passed, 2 (or more) expected␤  in main program body at line 22:/tmp/p6ZWkOEvQ_␤»
02:25 rjbs haha.  nice "star:" command
02:25 jnthn cmadsen: Thanks!
02:25 jnthn frooh: .isa checks what it is
02:25 jnthn frooh: I think you maybe what .WHAT
02:25 rjbs star: my $x = sub {} ; $x.WHAT
02:25 p6eval star 2010.07:  ( no output )
02:25 rjbs jnthn: beat me
02:25 jnthn rjbs: say
02:25 rjbs star: my $x = sub {} ; $x.WHAT.say
02:25 jnthn :-)
02:25 frooh *: my $x = * + 2; say $x.WHAT
02:25 p6eval star 2010.07: OUTPUT«Sub()␤»
02:25 frooh gah
02:25 rjbs jnthn: Beat me again!  Rrrr!
02:25 frooh I keep doing *
02:26 jnthn ;-)
02:26 frooh so it's Sub?
02:26 frooh not Code?
02:26 jnthn frooh: Sub is a subtype of Code
02:26 frooh star: my $x = sub { }; say $x.isa(Code)
02:26 p6eval star 2010.07: OUTPUT«1␤»
02:26 frooh interesting
02:26 lue joined #perl6
02:27 lue well hello o/
02:27 frooh star: my $x = 1; say $x.WHAT
02:27 p6eval star 2010.07: OUTPUT«Int()␤»
02:28 frooh so in perl 6 everything's an object right?
02:28 frooh I guess I need to not do blessed($foo) but instead check if it adheres to a role
02:28 jnthn frooh: It either is, or will pretend to be if you try and use it as one. :-)
02:29 frooh right
02:29 lue ooh, there's a star: bot.
02:29 frooh star: role Robot {}; class Frew { with Robot };
02:29 p6eval star 2010.07: OUTPUT«Could not find sub &with␤  in main program body at line 22:/tmp/Hvp7FlcGx6␤»
02:29 frooh star: role Robot {}; class Frew does Robot {  };
02:30 p6eval star 2010.07:  ( no output )
02:30 frooh star: role Robot {}; class Frew does Robot {  }; my $x = Frew.new; say $x.isa(Robot)
02:30 p6eval star 2010.07: OUTPUT«0␤»
02:30 frooh star: role Robot {}; class Frew does Robot {  }; my $x = Frew.new; say $x.does(Robot)
02:30 p6eval star 2010.07: OUTPUT«1␤»
02:30 frooh nice
02:31 jnthn $x ~~ Robot also works, if you want to be more hand-wavey
02:31 isBEKaml_ star: role Robot {}; class Frew is Robot {  }; my $x = Frew.new; say $x.isa(Robot)  # just curious
02:31 p6eval star 2010.07: OUTPUT«0␤»
02:31 [Coke] jnthn: BIER! ICH HABE BIER!
02:31 frooh star: role Robot { requires 'woohoo' }; class Frew does Robot {  }; my $x = Frew.new; say $x.does(Robot)
02:31 [Coke] . o O (I forgot there was beer.)
02:31 jnthn [Coke]: ICH AUCH!
02:31 p6eval star 2010.07: OUTPUT«===SORRY!===␤Could not find sub &requires␤»
02:31 jnthn [Coke]: Forgot...beer...huh
02:32 frooh how do I require methods to be implemented in p6?
02:32 jnthn frooh: method that-i-want() { ... }
02:33 frooh star: role Robot {  method woot() { ... } }; class Frew does Robot {  }; my $x = Frew.new; say $x.does(Robot)
02:33 p6eval star 2010.07: OUTPUT«1␤»
02:33 jnthn frooh: I'm not sure off-hand if we implement the compile-time check, but it'll certainly give a failure at runtime if you try and call that method.
02:33 frooh that's not quite what I meant
02:33 frooh ok
02:33 jnthn frooh: It is meant to whine at compile time too, but I didn't get to implementing that yet. :(
02:33 frooh ok, that's fine for now then
02:35 frooh star: die 'lolwut'
02:35 p6eval star 2010.07: OUTPUT«lolwut␤  in main program body at line 22:/tmp/etfL_pxBEP␤»
02:36 frooh star: my $x = "frwe"; my $x = do { my $y = $x; sub { $x } }; $x.perl.say;
02:36 p6eval star 2010.07: OUTPUT«===SORRY!===␤Redeclaration of symbol $x at line 22, near " = do { my"␤»
02:36 frooh star: my $x = "frwe"; $x = do { my $y = $x; sub { $x } }; $x.perl.say;
02:36 p6eval star 2010.07: OUTPUT«{ ... }␤»
02:37 frooh star: my $x = "frwe"; $x = do { my $y = $x; sub { $x } }; $x().say;
02:37 p6eval star 2010.07: OUTPUT«_block129␤»
02:37 frooh star: my $x = "frwe"; $x = do { my $y = $x; sub { $x } }; $x.().say;
02:37 p6eval star 2010.07: OUTPUT«_block129␤»
02:37 frooh hmm
02:37 jnthn frooh: $x.() is the same as $x()
02:37 frooh right
02:37 frooh the realais isn't working
02:38 frooh it's probably just I'm not used to p6 semantics
02:38 frooh or I cna't type
02:38 frooh star: my $x = "frwe"; my $y = $x; $x = do { my $y = $x; sub { $y } }; $x().say;
02:38 p6eval star 2010.07: OUTPUT«frwe␤»
02:38 frooh there we go
02:38 frooh perfect
02:38 jnthn :-)
02:39 frooh star: say caller;
02:39 p6eval star 2010.07: OUTPUT«Could not find sub &caller␤  in main program body at line 22:/tmp/9ueLWhtz5X␤»
02:39 cmadsen jnthn: I figured out why it broke.  See my comments at http://rt.perl.org/rt3/Tic​ket/Display.html?id=76856
02:40 jnthn cmadsen: Excellent, thanks.
02:41 frooh where's the vim highlight file again?
02:41 sorear petdance @ github
02:43 frooh wow
02:43 frooh slow
02:43 frooh but pretty
02:43 rjbs left #perl6
02:44 isBEKaml_ yes, instead of setting filetype, I just set syntax. works well for me.
02:44 LaVolta http://github.com/hinrik/vim-perl, also :)
02:45 frooh isBEKaml_: I mean using the perl6.vim is really slow at parsing
02:45 isBEKaml_ frooh: that's what I meant too.
02:45 frooh isBEKaml_: what do you mean by set syntax?
02:45 isBEKaml_ frooh: if you want something faster, don't set ft=perl6. set syn=perl6
02:46 frooh ohh
02:46 frooh interesting
02:46 frooh huh
02:46 frooh now no colors at all; is that what you meant?
02:46 bjarneh joined #perl6
02:46 isBEKaml_ :set syntax=perl6
02:46 frooh yeah, went grey
02:46 isBEKaml_ or #vim: set syntax=perl6
02:47 frooh I must not be loading things in vim right
02:47 pmichaud back again
02:47 frooh star: my $y; my $z = sub { 1 }; ($y||$z).().say
02:47 p6eval star 2010.07: OUTPUT«1␤»
02:47 isBEKaml_ sorry, # vim: syntax=perl6
02:48 frooh star: say q<frwe bar biff>;
02:48 p6eval star 2010.07: OUTPUT«frwe bar biff␤»
02:48 pmichaud cmadsen:  excellent bug tracking, thank you!
02:49 frooh star: my $y = sub { 1 }; ($y || die 'unset').().say;
02:49 p6eval star 2010.07: OUTPUT«1␤»
02:49 frooh star: my $y; ($y || die 'unset').().say;
02:49 p6eval star 2010.07: OUTPUT«unset␤  in main program body at line 22:/tmp/TVqNYWYoEO␤»
02:49 sahadev left #perl6
02:52 dalek rakudo: 685c1e7 | (Solomon Foster)++ | src/core/Range.pm:
02:52 dalek rakudo: Try to optimize finite Int Range iteration.
02:52 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/6​85c1e7a42243c987d075a51811a751a706e358c
02:52 dalek rakudo: 9b6189d | (Solomon Foster)++ | src/core/Range.pm:
02:52 dalek rakudo: Just go ahead and pass an Array to ConsIter -- makes the code a bit cleaner,
02:52 dalek rakudo: fixes a bug, and doesn't seem to negatively impact the speed of things too
02:52 dalek rakudo: much.
02:52 dalek rakudo: review: http://github.com/rakudo/rakudo/commit/9​b6189d78f7a21368b2caa3688a4c71489b6af5b
02:57 frooh is there a p6 form of caller yet?
02:58 sorear yes
02:58 isBEKaml_ "use module qw<sub>; " doesn't seem to work. Any workarounds?
02:58 frooh sorear: what is it?
02:58 isBEKaml_ I have commented out the qw part for now.
02:58 sorear frooh: caller
02:59 frooh star: say caller;
02:59 p6eval star 2010.07: OUTPUT«Could not find sub &caller␤  in main program body at line 22:/tmp/MoPplBxjiP␤»
02:59 frooh It didn't work before
02:59 sorear star != p6
02:59 frooh fine fine
02:59 sorear niecza: for 1 -> $x { say caller.file }
02:59 p6eval niecza 01680b9: OUTPUT«Potential difficulties:␤  $x is declared but not used at /tmp/hFa4kOKdv7 line 1:␤------> [32mfor 1 -> [33m⏏[31m$x { say caller.file }[0m␤CORE.setting␤»
03:00 sorear star: for 1 -> $x { say callframe.caller.file }
03:00 p6eval star 2010.07: OUTPUT«Method 'caller' not found for invocant of class 'CallFrame'␤  in <anon> at line 22:/tmp/wEIR3Oh38t␤  in main program body at line 1␤»
03:00 frooh hmmm
03:00 sorear star: for 1 -> $x { say callframe(1).file }
03:00 frooh I'll just pretend I don't need it for now
03:00 p6eval star 2010.07: OUTPUT«Any()␤»
03:01 sorear callframe(1) looks like the rakudo way
03:01 cognominal joined #perl6
03:01 sorear star: for 1 -> $x { say callframe(0).file }
03:01 p6eval star 2010.07: OUTPUT«/tmp/1Xix3S_MtV␤»
03:01 sorear star: 1.map({say callframe(1).file})
03:01 p6eval star 2010.07:  ( no output )
03:01 sorear star: 1.map({say callframe(2).file})
03:01 p6eval star 2010.07:  ( no output )
03:01 sorear star: 1.map({say callframe(3).file})
03:01 p6eval star 2010.07:  ( no output )
03:01 frooh star: callframe(0).perl.say
03:01 p6eval star 2010.07: OUTPUT«Method 'perl' not found for invocant of class 'ParrotInterpreter'␤  in <anon> at line 1202:CORE.setting␤  in 'Any::join' at line 1␤  in 'Mu::attribs' at line 1203:CORE.setting␤  in 'Mu::perl' at line 1207:CORE.setting␤  in main program body at line 22:/tmp/ALb6t6819g␤»
03:02 frooh bleck
03:04 frooh star: sub f (Code $robot, @args) { $robot.(@args).say }; f { $^a * 2 }, (1, 2, 3)
03:04 p6eval star 2010.07: OUTPUT«6␤»
03:10 eternaleye rakudo: say CALLER.WHAT
03:10 p6eval rakudo dfefdd: OUTPUT«Could not find sub &CALLER␤  in main program body at line 22:/tmp/Q8qPToCzae␤»
03:11 eternaleye rakudo: say CALLER::.WHAT
03:11 p6eval rakudo dfefdd: OUTPUT«Could not find sub &CALLER␤  in main program body at line 22:/tmp/Y4Qp_z7fKR␤»
03:11 pmichaud CALLER NYI
03:11 eternaleye Ah, okay
03:11 pmichaud (I think I will try to add a NYI message soon.)
03:12 * lue wonders if macros are still NYI
03:13 jnthn pmichaud: Talking of macros, if you get chance, reviewing sorear++'s Rakudo patches to add them could be a good thing. :-)
03:13 sorear remember: if start doesn't support it, it's not in Perl 6
03:14 * sorear hates people sometimes
03:14 sorear jnthn: oh please don't, that stuff was *awful*
03:14 jnthn sorear: Oh?
03:14 jnthn OK. :-)
03:14 sorear Well
03:14 sorear It had the same problems that operator overloading does
03:14 sorear And for the same reason
03:15 sorear Only much worse, because adding operators rarely changes the meaning of correct code
03:15 sorear Adding macros usually *does*
03:16 sorear (also, work implementing niecza has changed my opinions on a number of compiler issues with ramifications on the macro problem)
03:17 jaldhar joined #perl6
03:24 frooh aww, patrick left
03:24 jnthn There goes the Netherlands...
03:24 frooh jnthn: do *you* have any idea how hard it would be to implement caller?
03:25 * frooh goes to get two units of caffiene
03:26 jnthn frooh: Given that we alrady have callframe, probably not too bad.
03:27 jnthn rakudo: say &callframe.signature
03:27 p6eval rakudo dfefdd: OUTPUT«get_attr_str() not implemented in class 'Perl6MultiSub'␤  in main program body at line 1␤»
03:27 jnthn rakudo: say &callframe.candidates>>.signature
03:27 p6eval rakudo dfefdd: OUTPUT«Signature()<0x794d360>␤»
03:27 jnthn rakudo: say &callframe.candidates>>.signature.perl
03:27 p6eval rakudo dfefdd: OUTPUT«(:(Int $level = { ... }), )␤»
03:28 jnthn frooh: Looking at S06, probably quite easy.
03:28 jnthn Though not "I'm going to write it at 5:30am" easy. :-)
03:32 wayland76 joined #perl6
03:33 wayland76 Hi all.  Quick question -- has anyone thought about whether Perl grammars are suited to natural language parsing?
03:34 lue I thought about trying my hand at macros. Then I started reading its (relatively) terse description in S06....
03:34 PerlJam joined #perl6
03:38 dukeleto joined #perl6
03:39 pmichaud joined #perl6
03:41 frooh jnthn: sure; I was thinking maybe I could try to hack it together next time I see patrick
03:41 frooh faking temp seems pretty easy; caller....not so much :-)
03:42 jnthn frooh: Actually caller would be much easier
03:42 frooh right
03:42 frooh to fake?
03:42 jnthn frooh: S06 suggests it's just a curried version of callframe
03:42 jnthn I don't know what you mean by "fake"
03:42 jnthn callframe isn't really faked. :-)
03:42 frooh work around
03:42 jnthn Oh
03:42 jnthn Sorry, I thought you meant "implement" :-)
03:42 frooh I'll implement later
03:43 frooh I want to get somethign to work first
03:43 * frooh is backwards that way :-)
03:43 jnthn Well caller is easy enough
03:43 frooh javascript has twisted my brain
03:43 frooh show me
03:44 jnthn rakudo: say callframe(0).^methods;
03:44 p6eval rakudo dfefdd: OUTPUT«mycallframefilelinekvminmaxpic​kflatfirstminmaxdoesrotatejoinNumeric​elemsendreduceallStrpostcircumfix:<[ ]>postcircumfix:<{
03:44 p6eval ..}>listat_keypairsoneACCEPTSat_posanysor​tSeqgrepnonevaluescankeysreverseuniqisacl​assifymapBUILDALLnewBoolprintsayitemWALKd​efinedBUILDcloneperlWHICHCaptureCREATE…
03:44 frooh zomg omg
03:44 jnthn rakudo: say callframe(0).^methods(:local).join(',')
03:44 p6eval rakudo dfefdd: OUTPUT«my,callframe,file,line␤»
03:44 jnthn huh, callframe doesn't have a way to actually get the routine?
03:45 frooh jnthn: how do I get the package name from callframe?
03:45 frooh that's really all I want
03:45 jnthn frooh: OK, it's not so easy as I thought. :-(
03:45 frooh hahaha
03:45 frooh not that surprising
03:45 frooh well, it can wait
03:47 jnthn rakudo: sub foo() { if 1 { say callframe(Routine).WHAT; } }; foo();
03:47 p6eval rakudo dfefdd: OUTPUT«No applicable candidates found to dispatch to for 'callframe'. Available candidates are:␤:(Int $level = { ... })␤␤  in 'foo' at line 22:/tmp/oNtFehlmig␤  in main program body at line 22:/tmp/oNtFehlmig␤»
03:47 jnthn Ah.
03:47 jnthn Yeah, callframe needs a bit more work yet.
03:48 jql joined #perl6
03:48 frooh that's ok
03:48 frooh but once I get caller I can port Log::Contextual
03:48 frooh which is a nice lightweight logger
03:48 frooh that maybe people could use
03:50 jnthn moritz_++ did the bits of callframe we have so far, so may also have some ideas on implementing it too. I will probably also have time to look at it soonish too.
03:50 frooh well, if its in p6 I'd love to try my hand at it
03:50 frooh but if it's in pir ... not so much :-)
03:51 jnthn frooh: Should be do-able largely or entirely in Perl 6.
03:51 jnthn caller is really a curried version of callframe, or so the spec says.
03:51 frooh sure
03:51 frooh well, if you guys point me in the right direction I am willing to give it a shot
03:54 Alias_ joined #perl6
03:55 jnthn frooh: src/core/CallFrame.pm has the implementation so far
03:55 jnthn OK, time for me to sleep :-)
04:03 MattMan joined #perl6
04:05 LaVolta joined #perl6
04:05 dushyant joined #perl6
04:06 MattMan I asked yesterday about the Match object in list context
04:06 MattMan I was having trouble getting it to work in the way I was expecting
04:06 MattMan The answer ended up being something like the following
04:07 MattMan rakudo: my ($b, $c) = @('12 34'.match(/(\w+) \s (\w+))) ; say $b.perl $c.perl ;
04:08 p6eval rakudo dfefdd: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 22␤»
04:09 isBEKaml_ rakudo: my ($b, $c) = @('12 34').match(/(\w+) \s (\w+)) ; say $b.perl $c.perl ;
04:09 p6eval rakudo dfefdd: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 22␤»
04:09 MattMan Oops, try this
04:09 MattMan my ($b, $c) = @('12 34'.match(/(\w+) \s (\w+)/)) ; say "$b $c" ;
04:10 MattMan My question is, why is the @() construct necessary to establish list context
04:10 MattMan Surely rakudo should know that list context is required by the fact that the LHS is a list ?
04:10 MattMan rakudo: my ($b, $c) = @('12 34'.match(/(\w+) \s (\w+)/)) ; say "$b $c" ;
04:10 p6eval rakudo dfefdd: OUTPUT«12 34␤»
04:11 dushyant quit
04:14 isBEKaml_ rakudo: ('12 34'. match(/(\w+) \s (\w+)/)).WHAT.say
04:14 p6eval rakudo dfefdd: OUTPUT«===SORRY!===␤Confused at line 22, near "('12 34'. "␤»
04:14 isBEKaml_ rakudo: ('12 34'. match(/(\w+) \s (\w+)/))).WHAT.say
04:14 p6eval rakudo dfefdd: OUTPUT«===SORRY!===␤Confused at line 22, near "('12 34'. "␤»
04:14 achromic joined #perl6
04:15 isBEKaml_ rakudo: ('12 34'.match(/(\w+) \s (\w+)/)).WHAT.say
04:15 p6eval rakudo dfefdd: OUTPUT«Match()␤»
04:17 MattMan rakudo: @('12 34'.match(/(\w+) \s (\w+)/)).WHAT.say
04:17 p6eval rakudo dfefdd: OUTPUT«Seq()␤»
04:18 jql left #perl6
04:20 isBEKaml_ MattMan: I'm a beginner here too. But my guess would be that since the match that you are doing returns a Match() object which is Positional, you'd have to specify a context to your rvalue. Also, prefixing it with @ converts it into a Seq, essentially a lazy list. Others might be able to explain better (and, correct me! :))
04:21 MattMan But S05 says the following
04:21 MattMan "When used as an array, a Match object pretends to be an array of all its positional captures."
04:22 isBEKaml_ MattMan: yes, that's what i meant by Positional.
04:22 MattMan It just doesn't seem especially DWIM-y, that's all
04:23 MattMan You've already specified that you want it to behave like a list because you've assigned it to one
04:23 MattMan The extra cast to an array seems superfluous
04:23 Juerd joined #perl6
04:33 cognominal joined #perl6
04:33 brianherman joined #perl6
04:35 isBEKaml_ rakudo: my ($a,$b) = ('12 34'.match(/(\w+) \s* (\w+)/)); say $a ~ "--" ~ $b; ("12 34" ~~ /(\w+) \s* (\w+)/); say $0 ~ "--" ~ $1;
04:35 p6eval rakudo dfefdd: OUTPUT«12 34--Any()␤12--34␤»
04:36 sorear wayland76: You should ask the person who created them.  He's a linguist by trade.
04:38 isBEKaml_ MattMan: ^^
04:42 [particle] joined #perl6
04:42 nadim joined #perl6
04:43 meteorjay joined #perl6
04:44 exodist am I the only one who thinks "Leeloo Dallas Multipass!"  every time I see 'multi ...'?
04:44 wolverian joined #perl6
04:44 mutewit joined #perl6
04:44 moritz_ joined #perl6
04:44 rcfox joined #perl6
04:45 sjn joined #perl6
04:45 grew joined #perl6
04:47 PerlJam exodist: probably
04:47 PerlJam but exodist++ anyway for the reference :)
04:47 exodist haha
04:51 frooh any of you guys know a good place to hire people to design logos?
04:51 frooh I'm looking at elance right now
04:51 eternaleye_ joined #perl6
04:53 abrasive joined #perl6
04:54 14WAA0PR3 joined #perl6
04:54 desertm4x joined #perl6
04:55 isBEKaml_ is there any way I can override an existing method in another class without extending it?
04:55 frooh isBEKaml_: I think you can use the monkeypatching stuff
04:55 frooh but you have to enable it
04:55 PerlJam isBEKaml_: why would you want to do that?
04:56 isBEKaml_ PerlJam: Maybe write my own implementation? I know I can do that by extending the base class and rewriting it.
04:57 melte joined #perl6
04:57 isBEKaml_ frooh: I'm already doing that. But I get "method already implemented in.. but may have been provided by a role"
04:57 PerlJam isBEKaml_: okay. frooh was right about monkey patching, but it's a tool of last resort.
04:57 frooh huh...
04:58 PerlJam isBEKaml_: show the code
04:58 ashleydev joined #perl6
04:59 isBEKaml_ PerlJam: http://pastebin.com/8ema2rEL
05:00 isBEKaml_ Currently I'm just debugging through to grok code. :)
05:02 PerlJam I think I'm going to do with NYI on this one  :)
05:03 isBEKaml_ :)
05:03 isBEKaml_ PerlJam: you mean the debugger as NYI or the feature itself - augmenting and logging?
05:05 PerlJam you really want "supersede" and it's not implemented
05:06 PerlJam though I wonder if you'd have to say   augment class C { supersede method M { ... } }
05:07 isBEKaml_ PerlJam: I would guess, supersede class C { method M { ... } }
05:08 isBEKaml_ PerlJam: S12:1995
05:09 PerlJam sure but I think that's ambiguous
05:09 PerlJam supersede class C { ... } reads like I'm replacing the entire class
05:10 PerlJam augment class C { ... } says I'm just changing the class and   supersede method M { ... } reads like I'm replacing just that method
05:10 PerlJam (IMHO)
05:11 isBEKaml_ also, it doesn't say how it would treat other definitions of supersede, apart from that "the compiler might refuse to do this if it has already committed to an earlier definition"
05:11 isBEKaml_ So, IMHO, it goes against the grain when trying to completely supersede a class.
05:11 isBEKaml_ which is what S12 refers to.
05:12 isBEKaml_ S06 also contains a para about supersede.
05:12 brianherman how do you call c functions with perl?
05:12 brianherman i mean perl6
05:13 brianherman is there a new way
05:13 PerlJam brianherman: If you have installed Rakudo Star, there's a modules called zavolaj that shows you how
05:13 brianherman oh nvm http://docstore.mik.ua/ore​lly/perl/prog3/ch21_03.htm
05:13 brianherman oh cool
05:13 brianherman i got star
05:13 PerlJam brianherman: MiniDBI also makes use of this feature
05:13 brianherman why didnt they call it rakudo butterfly
05:14 brianherman oh xool
05:14 brianherman thanks jappy
05:14 brianherman i mean
05:14 brianherman jammy
05:14 brianherman wow
05:14 brianherman that sounds really offensive
05:14 brianherman sorry
05:14 brianherman T_T
05:15 brianherman please do not post to bash.org
05:15 molaf joined #perl6
05:22 isBEKaml_ PerlJam: replacing augment with supersede gives me this: "Scoper declarator supersede not support on packages". I think it's ambiguous. Why not just a NYI message?
05:22 MAK___ joined #perl6
05:23 MAK___ hi
05:23 MAK___ Can rakudo run Perl5 programs?
05:24 isBEKaml_ MAK___: if you got star, you can run with a module can Zavolaj.
05:24 isBEKaml_ MAK___: erm, Rakudo Star distribution - Zavolaj is already packaged with the distribution.
05:24 MAK___ no my point is if rakudo can't run a perl 5 program directly then why should one do a 'use v6' explicitly?
05:25 MAK___ because that is all it can run anyway
05:26 isBEKaml_ MAK___: well, you don't exactly need it. It's a note to say "what follows is p6 code. So do as it says"
05:26 MAK___ hmmm
05:30 japhb joined #perl6
05:32 MAK___ hello world program runs without v6
05:32 MAK___ so i think v6 is not compulsory
05:34 chitragupt joined #perl6
05:42 cosimo rakudo: say "WHAT".WHAT
05:42 p6eval rakudo 9b6189: OUTPUT«Str()␤»
05:42 cosimo say 21.WHAT
05:42 cosimo rakudo: say 21.WHAT
05:42 p6eval rakudo 9b6189: OUTPUT«Int()␤»
05:43 wayland76 sorear: Thanks; I guess I was hoping he'd be awake :).  Maybe I'll just post it on the mailing list
05:44 isBEKaml rakudo: WHAT.WHAT.WHAT.perl.say # I'm just crazy, ignore me! :)
05:44 p6eval rakudo 9b6189: OUTPUT«Not enough positional parameters passed; got 0 but expected 1␤  in 'WHAT' at line 712:CORE.setting␤  in main program body at line 22:/tmp/p2JHTfLfo2␤»
05:44 isBEKaml rakudo: ~WHAT.perl.say
05:44 p6eval rakudo 9b6189: OUTPUT«Not enough positional parameters passed; got 0 but expected 1␤  in 'WHAT' at line 712:CORE.setting␤  in main program body at line 22:/tmp/1w9bMSjXB0␤»
05:44 isBEKaml :)
05:44 chitragupt joined #perl6
05:45 isBEKaml rakudo: 42.WHAT.perl.say; +"42".WHAT.perl.say
05:45 p6eval rakudo 9b6189: OUTPUT«Int␤Str␤»
05:45 isBEKaml rakudo: 42.WHAT.perl.say; (+"42").WHAT.perl.say
05:45 p6eval rakudo 9b6189: OUTPUT«Int␤Num␤»
05:47 Revolve_ joined #perl6
05:57 ingy star: my @a = [5..10]; map { say } @a
05:57 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "map { say "␤»
05:57 ingy star: my @a = [5..10]; map { .say } @a
05:57 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "map { .say"␤»
05:57 ingy star: my @a = [5..10]; @a.map { .say }
05:57 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "@a.map { ."␤»
05:57 ingy star: my @a = [5..10]; @a.map({ .say })
05:57 p6eval star 2010.07:  ( no output )
05:58 ingy star: my @a = [5..10]; @a.map({ $_.say })
05:58 p6eval star 2010.07:  ( no output )
05:58 ingy star: my @a = [5..10]; @a.map({ say })
05:58 p6eval star 2010.07:  ( no output )
05:58 ingy star: my @a = [5..10]; @a.map({ say $_ })
05:58 p6eval star 2010.07:  ( no output )
05:58 * ingy gives up
06:00 cognominal joined #perl6
06:05 agentzh joined #perl6
06:07 szabgab star: my @a = [5..10]; say @a.perl
06:07 p6eval star 2010.07: OUTPUT«[[5, 6, 7, 8, 9, 10]]␤»
06:08 szabgab star: my @a = [5..10]; @a.map({ say "something" })
06:08 p6eval star 2010.07:  ( no output )
06:08 szabgab star: my @a = [5..10]; for @a { say "something" }
06:08 p6eval star 2010.07: OUTPUT«something␤»
06:08 szabgab star: my @a = [5..10]; for @a { say $_ }
06:09 p6eval star 2010.07: OUTPUT«5 6 7 8 9 10␤»
06:09 szabgab star: my @a = [5..10]; for @a { say "'$_'" }
06:09 p6eval star 2010.07: OUTPUT«'5 6 7 8 9 10'␤»
06:17 TiMBuS star: my @a = [5..10]; map { .say }, @a;
06:17 p6eval star 2010.07:  ( no output )
06:18 TiMBuS oh
06:19 TiMBuS star: my @a = [5..10]; eager map { .say }, @a;
06:19 p6eval star 2010.07: OUTPUT«5 6 7 8 9 10␤»
06:19 Trashlord joined #perl6
06:20 TiMBuS star: my @a = [5..10]; (map { .say }, @a)[0];
06:20 p6eval star 2010.07: OUTPUT«5 6 7 8 9 10␤»
06:21 melte o0
06:21 melte I don't get it
06:24 TiMBuS map doesn't run unless it is asked for a value. so it won't print until you ask it for something
06:24 exodist Newb here, but perhapso say returns nothing, thus the map produces an empty array, the [0] means get first element, but it never happens forcing it te iterate the whole way?
06:24 TiMBuS nearly, but @a is a single element array, and the first element is an array containing 5..10
06:24 exodist ah.
06:25 TiMBuS if it wasn't a nested array it should print as the values are asked for
06:25 exodist I have only read some docs, I wrote tests 2 years ago, gonna dive in the first time tonight
06:25 TiMBuS star: my @a = 5..10; (map { .say }, @a)[3];
06:25 p6eval star 2010.07: OUTPUT«5␤6␤7␤8␤»
06:26 exodist I was under the impression lazy hadnt advanced that far yet, that it was all or nothing. glad to see it working.
06:27 TiMBuS some of it is still kinda.. interesting. feed operators need to create iterators to make it really owrk properly
06:27 exodist feed operators?
06:28 TiMBuS ==> and <==
06:28 TiMBuS the nicest part of perl6
06:28 exodist whats it do?
06:28 exodist *what do they do
06:28 TiMBuS star: 1..5 ==> grep * % 2 ==> .say
06:28 p6eval star 2010.07: OUTPUT«===SORRY!===␤Sorry, do not know how to handle this case of a feed operator yet. at line 22, near " .say"␤»
06:28 TiMBuS aww
06:29 TiMBuS well it feeds a list, lazily, to anything expecting a list
06:29 TiMBuS star: 1..5 ==> grep {$_ % 2} ==> .say
06:29 p6eval star 2010.07: OUTPUT«===SORRY!===␤Sorry, do not know how to handle this case of a feed operator yet. at line 22, near " .say"␤»
06:29 TiMBuS oh its the .say
06:29 TiMBuS star: 1..5 ==> grep {$_ % 2} ==> say
06:30 p6eval star 2010.07: OUTPUT«135␤»
06:30 TiMBuS there we are
06:30 exodist is that a trivial example? or an intended use? seems it can be done other ways in as much or less code?
06:31 exodist star: say grep {$_ % 2} 1..5
06:31 TiMBuS yes its just an example, not a good use
06:31 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "say grep {"␤»
06:31 TiMBuS you need a comma
06:31 exodist star: say grep {$_ % 2}, 1..5
06:31 p6eval star 2010.07: OUTPUT«135␤»
06:32 exodist lol, thats probably gonna be one of my biggest confusions
06:32 TiMBuS the idea is that you can make better looking code, with the arrows indicating direction. it also explicitly tells perl that you want a lazy feed
06:35 TiMBuS instead of the "my @things = map {...}, grep {...}, split /\s/, <>;" contraptions you often see, you can have $*IN.words ==> grep {...} ==> map {...} ==> my @things;
06:35 TiMBuS or the reverse using <== if you prefer being backwards :)
06:36 exodist $*IN  the * means global right? what does that global hold?
06:37 gfx joined #perl6
06:44 TiMBuS well it sort of means global
06:46 TiMBuS it means dynamic, followed by global. so $*IN will walk up the scope looking for a locally declared $*IN, and then it will (i think) strip the '*' and search globally for $IN, in the result of a failure
06:46 TiMBuS at least thats what the spec said last time I checked
06:46 TiMBuS it also contains STDIN by default
06:46 exodist ah.
06:46 exodist that makes sense
06:47 TiMBuS which might mess with my last example a bit! since it is lazy
06:48 jfried joined #perl6
06:54 melte can I use the feed operators with the reduction ops
06:54 melte star: 1..5 ==> [*]
06:54 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "1..5 ==> ["␤»
06:55 TiMBuS aw that would be kinda cool
06:56 TiMBuS star: 1..5 ==> reduce(&infix:<*>) ==> say
06:56 p6eval star 2010.07: OUTPUT«120␤»
06:56 Su-Shee joined #perl6
06:57 Su-Shee good morning.
06:57 melte lol
06:58 melte is there a more normal way to make that work
07:00 TiMBuS hmmm probably not using the [*] operator
07:00 TiMBuS might just be a rakudo error
07:00 TiMBuS std: 1..5 ==> [*]
07:00 p6eval std 31880: OUTPUT«[31m===[0mSORRY![31m===[0m␤Prefix requires an argument at /tmp/Q1EZqDhzx4 line 1 (EOF):␤------> [32m1..5 ==> [*][33m⏏[31m<EOL>[0m␤Parse failed␤FAILED 00:01 116m␤»
07:00 * TiMBuS blinks
07:01 TiMBuS looks like the parser doesn't like that. how about 1..5 ==> reduce(* * *) ==> say
07:02 melte why three stars
07:02 Su-Shee *sigh* and first, directly after my first coffee I ran into the idiot's comparison of p5 and p6...
07:04 TiMBuS yeah it is confusing to introduce the whatever star when using multiplication
07:04 TiMBuS star: 1..5 ==> reduce(* + *) ==> say
07:04 p6eval star 2010.07: OUTPUT«15␤»
07:04 TiMBuS explains it better, I hope
07:05 Lasse_ joined #perl6
07:05 melte oh
07:05 exodist I must be missing something, why is it 15?
07:06 melte addition there
07:07 melte 1 + 2 + 3 + 4 + 5 = 15
07:07 Ross joined #perl6
07:07 exodist so, what do the surrounding *'s mean?
07:07 TiMBuS 'whatever'. or better put, they're placeholders
07:08 exodist ah
07:08 TiMBuS they create their own block of code so you dont need the {}
07:09 TiMBuS star: my $addtwo = * + 2; say $addtwo(3);
07:09 p6eval star 2010.07: OUTPUT«5␤»
07:10 TiMBuS useful for passing code to functional.. functions
07:11 exodist clever :-)
07:11 snarkyboojum joined #perl6
07:11 melte whoa
07:11 melte neat
07:11 fxn joined #perl6
07:13 moritz_ moin
07:15 melte star: 1 ?? 2 :: 3
07:15 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "1 ?? 2 :: "␤»
07:15 Su-Shee *hihi* "the tilda operator" - totally for it. "this operator is dedicated to the great actress tilda swinton.." .)
07:16 exodist star: say 1 ?? 2 :: 3;
07:16 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "say 1 ?? 2"␤»
07:16 moritz_ exodist: !! instead of ::
07:17 melte yeah, my bad
07:17 exodist I was copying melte, but added some things to see if they were the prob
07:17 melte moritz_: I was reading http://dev.perl.org/perl6/doc/design/exe/E03.html
07:18 TiMBuS i'd stick with the synopses, maybe the apocalypses
07:18 melte yeah. just popped up on the google search
07:19 moritz_ the exegesis are of historical interest only
07:20 melte I want perl6doc :D
07:20 exodist star: my @stuff; push @stuff => 5; say @stuff[0];
07:20 p6eval star 2010.07: OUTPUT«Method '!fill' not found for invocant of class 'Pair'␤  in 'List::push' at line 2597:CORE.setting␤  in main program body at line 22:/tmp/4QNOWV8lVJ␤»
07:21 exodist darn, I was afraid of that
07:21 exodist I love push @list => $thing from perl5, just seems nicer than , to me.
07:21 exodist oh well.
07:22 moritz_ => constructs a Pair in Perl 6
07:22 moritz_ it's not a "fat comma" anymore
07:22 exodist I xnow, thats what I read that made me try it.
07:23 exodist *know.
07:26 TiMBuS coincidentally, ==> at the moment works by calling .push on any end sinks. so 5 ==> @stuff does exactly that
07:27 TiMBuS (for now)
07:28 moritz_ actually it's ==>> that calls .push, ==> should be assignment
07:30 Su-Shee exodist: uhm it's really embarrassing after 14 years of perl - but what does push @foo => $bar exactly give you?
07:33 spacebat joined #perl6
07:34 moritz_ Su-Shee: the same as push @foo, $bar
07:34 moritz_ Su-Shee: => is just a comma in p5, except that it sometimes quotes the LHS
07:34 Su-Shee how secret hash context hidden somewhere?
07:34 exodist Su-Shee, a pretty syntax, thats all.
07:34 TiMBuS moritz_, maybe it changed since i last looked, but I think it was calling push
07:34 Su-Shee aeh no secret..
07:35 moritz_ TiMBuS: it might be doing it, but then it's wrong :-)
07:35 TiMBuS thats why i changed it to :=
07:36 sorear wayland76: I think Larry is at OSCON or something
07:37 KenGuru joined #perl6
07:37 sorear wayland76: He said he was getting on a plane a couple days ago and we haven't heard from him since
07:38 moritz_ actually touring around in Europe before YAPC::EU, iirc
07:41 sorear exodist: Would you be happy with push @list: $thing;
07:41 sorear ?
07:42 exodist sorear, lol, its not really a big deal.
07:42 exodist but, yeah, I thnk thats better
07:42 sorear @list.push: $thing   and @list.push($thing) also work
07:43 sorear As does @list ,= $thing, but that's just weird
07:43 exodist lol, yeah
07:52 eternaleye joined #perl6
07:52 isBEKaml joined #perl6
07:53 isBEKaml moritz_: Time to show u4x.perl6.org ? :)
07:55 moritz_ isBEKaml: I wanted to rename it to doc.perl6.org first
07:56 isBEKaml moritz_: sure, while you're at it, you might also want to look at a little rendering issue with perl6.org. The text overflows from the Community box.
07:56 moritz_ http://doc.perl6.org/
07:56 isBEKaml \o/
07:57 isBEKaml moritz_: I see this rendering issue on my FF3.6.8.
07:58 moritz_ fixing...
07:58 pugssvn r31881 | moritz++ | [perl6.org] avoid overflow of the "community" box by joining two entries into a single one
07:58 isBEKaml moritz_++
08:04 moritz_ somebody could also add the screencasts to the community/index.html page
08:05 moritz_ btw in the last two days we had 2.1k and 2.6k visitors on perl6.org, respectively
08:06 isBEKaml moritz_: I see the screencasts link on the perl6.org homepage, but not on the community page?
08:06 moritz_ right
08:06 moritz_ should be added to the community page
08:06 moritz_ easy karma :-)
08:06 isBEKaml :)
08:07 moritz_ you do have a pugs commit bit, right?
08:07 isBEKaml moritz_: yes.
08:10 moritz_ http://www.ossblog.it/post/6583/rakudo-s​tar-la-prima-versione-usabile-di-perl-6
08:11 KenGuru joined #perl6
08:12 isBEKaml la prima? "only" ??
08:13 moritz_ I think prima = first
08:15 pugssvn r31882 | svatsan++ | [perl6.org] Added screencasts entry to Community page
08:15 isBEKaml SCNR. was too tempted! :)
08:15 isBEKaml :D
08:16 isBEKaml No, I meant the italiano prima! ;)
08:19 moritz_ isBEKaml++
08:32 isBEKaml left #perl6
08:33 eternaleye joined #perl6
08:34 dalek niecza: a60caf9 | sorear++ | Kernel.cs:
08:34 dalek niecza: Implement the unwinder
08:34 dalek niecza: review: http://github.com/sorear/niecza/commit/a​60caf99f62b80fea2c09f598189ae9b2a910f88
08:34 dalek niecza: 1e263f2 | sorear++ | Kernel.cs:
08:34 dalek niecza: Vector unhandled CLR exceptions from the runloop into Perl 6 exceptions
08:34 dalek niecza: review: http://github.com/sorear/niecza/commit/1​e263f2ba7992a7a8604fa32aa35de4c3da24df3
08:34 dalek niecza: ce7aca4 | sorear++ | Kernel.cs:
08:34 dalek niecza: Generate Perl 6-level backtraces on unhandled exceptions
08:34 dalek niecza: review: http://github.com/sorear/niecza/commit/c​e7aca41442a857321be15c298b0c604d09fccb5
08:43 sorear exception handling is starting to be vaguely sane...
08:43 * sorear tries to think of something else to do while waiting for TimToady and pmichaud
08:43 m6locks nice
08:46 avuserow joined #perl6
08:51 moritz_ http://www.modernperlbooks.com/mt/2010/07/an-acc​urate-comparison-of-perl-5-and-rakudo-star.html
08:54 tadzik joined #perl6
08:54 tadzik good morning #perl6
08:55 moritz_ \o/ it's tadzik
08:56 tadzik how is the mmorpg going?
08:58 moritz_ the user numbers are rising
08:58 moritz_ we've had more than 2k visitors on perl6.org on each of the last two days
08:59 moritz_ my domain has had ~500 visitors per day more than usual
08:59 tadzik wee \o/
09:00 * tadzik looks at the downloads
09:00 tadzik almost 2.5k :)
09:05 isBEKaml joined #perl6
09:05 isBEKaml Hi, I got a question about make. Does make pass params to other Makefiles?
09:05 sorear try it and see
09:06 isBEKaml tadzik: (The DESTDIR issue) :)
09:06 tadzik :)
09:06 sorear shoudldn't take you more than 2 minutes to set up a test
09:06 sorear strace -f -eexecve will tell you if the params are passed
09:06 tadzik iirc modules makefile does not have DESTDIR at all, that's the issue ;)
09:06 isBEKaml sorear: I'm not *very* familiar with makefiles.
09:06 sorear isBEKaml: if you're familiar enough to encounter the issue, you can set up a test case
09:07 Guest23195 joined #perl6
09:08 fxn joined #perl6
09:08 isBEKaml tadzik: I don't see that here. I thought the rakudo-install didn't pass DESTDIR.
09:09 isBEKaml sorear: I have put in a workaround for now. I'll look into it post build. :)
09:09 sorear Remember strace.
09:09 tadzik isBEKaml: nah, the issue is a bit bigger. Just before the release, with some ugly hack we were able to install it to a dir, but without modules
09:10 tadzik seems like some lines, or makefiles, are just ignoring the DESTDIR
09:11 isBEKaml tadzik: I find only 5 modules using Makefile. The rest of them simply copy over the moduels to PERL6LIB or ~/.perl6/lib?
09:12 tadzik isBEKaml: the Makefiles are generated by ufo
09:12 isBEKaml tadzik: ah.
09:14 sorear What's the Perl 6 idiom for something like my $fh = open "file" :r; LEAVE { close $fh if $fh }; do stuff;
09:14 sorear ?
09:15 avuserow joined #perl6
09:16 Qunero_ joined #perl6
09:17 moritz_ just let $fh go out of scoep
09:18 envi_home2 joined #perl6
09:19 sorear moritz_: oh dear no
09:19 sorear that's awful.
09:20 sorear it only works in perl5 and C++ because of the "no garbage collection, object destruction is explicit and prompt"
09:22 meppl joined #perl6
09:22 TiMBuS raii in perl6..
09:24 Qunero_ left #perl6
09:24 moritz_ I'll be leaving shortly, taking the train to Munich, and tomorrow morning the plane to Pisa
09:24 isBEKaml moritz_: YAPC?
09:25 moritz_ I don't know if I'll have any internet connectivty until I arrive there, and I don't know how good it'll be there
09:25 moritz_ isBEKaml: yes
09:25 isBEKaml moritz_: wow, haffun! :)
09:25 moritz_ so, have fun everybody, and feel free to double the size of the test suite in my absence :-)
09:26 isBEKaml easy, copy & paste everything! :P
09:27 desertm4x_ joined #perl6
09:28 tadzik just to be sure :)
09:31 avuserow joined #perl6
09:38 snarkyboojum joined #perl6
09:38 avuserow joined #perl6
09:39 cognominal joined #perl6
09:40 plol joined #perl6
09:41 cognominal joined #perl6
09:42 spacebat anybody having trouble getting rakudo star going?
09:43 spacebat I got it built, but make rakudo-test can't find any tests
09:43 spacebat then make install fails with lots of PackFile_unpack: This Parrot cannot read bytecode files with version 8.0.
09:44 spacebat that's a parrot built from the latest SVN
09:46 aCiD2 joined #perl6
09:46 aCiD2 left #perl6
09:46 aCiD2 joined #perl6
09:46 dac_ joined #perl6
09:47 sorear spacebat: there's a good chance that's your problem
09:47 aCiD2 hey. if I have my perl 6 in ./lib and my tests in ./t, how do I add ./lib to INC? Normally I'd use prove -l, but that doesn't seem to work with perl 6
09:47 sorear spacebat: rakudo is written to a single version of Parrot, and too new a version is bad
09:47 aCiD2 should I use PERL6LIB or something?
09:47 spacebat at first it wouldn't build because the parrot I had was too old
09:47 sorear yeah use PERL6LIB
09:47 spacebat oh ok, will check out that version
09:48 sorear spacebat: star is supposed to be bundled with the correct version of Parrot
09:48 avuserow joined #perl6
09:48 aCiD2 great, that does indeed work. thanks
09:48 sorear it's not supposed to care about an installed parrot, ever
09:48 spacebat it definitely does
09:49 vk5fnet joined #perl6
09:49 spacebat I have parrot installed under /usr/local, and I wanted to install rakudo star there as well
09:49 spacebat so I added --prefix=/usr/local to the config arguments
09:50 pugssvn r31883 | jani++ | [S26] Attempts at clarifying language
09:50 spacebat if that's where I went wrong, how do I get rakudo and its specific parrot to install to a particular location?
09:51 sorear Who is Jani?
09:51 sorear you are building star, right?  not atlanta?
09:52 spacebat I downloaded star
09:53 frettled sorear: I am jani
09:53 masak joined #perl6
09:54 masak oh hai, #perl6!
09:54 frettled masak: o/
09:55 masak I found this one yesterday before going to bed: http://david.skoll.ca/blog​/2010-07-29-perl-sss.html
09:55 frettled masak: pssst, this is 2010, not 2009 ;)  And since it felt silly fixing merely that, I almost got stuck in reading and fiddling with language and things in S26, but I managed to extract myself.  It's of course all _your_ fault, not mine, oh no.  ;)
09:56 masak someone who outlines how much faster and smaller we have to get: "If they pull this off, the Perl 6 developers will have achieved a feat unprecedented in the history of Computer Science."
09:56 masak I'm not sure how he arrives at that. :) maybe he overestimates the current state of the art.
09:57 masak frettled: ah. fixing.
09:58 masak oh, you already fixed. frettled++
10:01 frettled ;)
10:01 Su-Shee masak: chromatic already responded to that table.
10:02 masak Su-Shee: oh, good.
10:02 masak I hoped he would.
10:02 Su-Shee err article with the little "table" in it. chromatic has the real table.
10:02 frettled chromatic++ is all over the place
10:02 avuserow joined #perl6
10:03 Su-Shee masak: http://ur1.ca/0xrtf
10:03 pdcawley Oh, lovely, a for loop returns the list of non-null results of its body...
10:03 masak Su-Shee: thanks.
10:04 masak pdcawley: yes. 'for' and 'map' are basically equivalent in Perl 6. (and () is called Nil.)
10:04 pdcawley Though I note that @array.each doesn't work, which was a minor surprise.
10:04 frettled I'm wondering if Perl 4 vs. 5 is mentioned, *biggrin*
10:04 pdcawley (I'd expect that to return @array)
10:05 masak pdcawley: what's .each?
10:05 * masak perldocs
10:05 pdcawley Evaluate the block for each member of a list, discarding results.
10:05 pdcawley I dunno if it's specced, I just expected to find it :)
10:05 masak pdcawley: looks like .kv
10:06 masak we had an 'each' for quite a while, but it was a junction-y affair. moritz_++ killed it almost completely dead.
10:07 masak maybe I should say "junction-ish" in this case. :)
10:15 MattMan joined #perl6
10:16 MattMan Hi
10:16 MattMan I'm trying to use a non-default constructor in Rakudo
10:16 MattMan class Connection {   has $.dbname ;   has $.dbuser ;   has $.dbpass ; } ;  class Table {   has Connection $.conn ;    submethod BUILD($dbname,$dbuser,$dbpass) {     say "In constructor" ;     $.conn = Connection.new($dbname,$dbuser,$dbpass) ;     say :$.conn.perl ;   }  }  my $tab = Table.new("mydb","matthew","matthew") ; say $tab.conn.perl ;
10:16 MattMan My BUILD submethod has three parameters
10:17 MattMan I pass the three parameters to the new() method
10:17 MattMan But I get the message "Not enough positional parameters passed; got 1 but expected 4"
10:17 MattMan I'm a bit stumped
10:17 MattMan Any ideas ?
10:23 bjarneh joined #perl6
10:24 frettled Could you please use pastebin.com or somesuch?  I'm struggling with parsing the code IRC-wise, and my attempts at copying it into a file and running from there results in a parse error.
10:25 masak MattMan: you probably mean BUILD($!dbname,$!dbuser,$!dbpass)
10:25 masak MattMan: note the !s
10:26 masak MattMan: $foo is an "ordinary" variable, $!foo is a variable sitting on the "current object" of the method, also known as 'self'.
10:28 masak jnthn++ # parrot-dev email
10:29 MattMan masak:  Thanks for that
10:29 masak MattMan: oh, and on the relation between $!foo and $.foo: when you declare $.foo, you get a $!foo in the deal, plus a read-accessor ("getter") which can be called as $object.foo later. you're probably aware of that already.
10:29 MattMan masak:  I tried it but I got the same message
10:30 MattMan masak:  Yeah, I was
10:30 masak hmm.
10:30 masak it's the BUILD method expecting 4 arguments.
10:30 MattMan masak:  Although since I don't want to store dbname, dbuser and dbpass in the target (Table) object
10:30 masak (the hidden 'self' argument counts in the sum)
10:30 masak Rakudo--
10:31 MattMan masak:  I'm not sure why I have to treat them like attributes of Table
10:31 frettled (x,y,z) vs. (x, y, z) ?
10:31 masak let's try to work out a minimal example that works.
10:31 masak frettled: no difference.
10:31 MattMan So I've tried it without parameters
10:31 MattMan Everything is fine
10:31 masak frettled: thankfully. :)
10:31 * frettled is confuzzled about when it makes a difference, hee-hee :)
10:31 MattMan As soon as I get one parameter on the BUILD submethod I start getting this error
10:32 gfldex how do i get a reference to a method?
10:32 masak star: class A { has $.x; submethod BUILD(:$x) { $!x = $x } }; say A.new(:x(42)).x
10:32 p6eval star 2010.07: OUTPUT«42␤»
10:32 masak MattMan: there. that works.
10:32 masak you need to make the parameters named, with a :
10:33 masak because they're sent in named.
10:33 gfldex rakudo: class A { method b(){} }; my $ref = &A.b; say $ref.WHAT;
10:33 p6eval rakudo 9b6189: OUTPUT«Could not find sub &A␤  in main program body at line 22:/tmp/9Tv5VJfF2x␤»
10:33 masak star: class A { has $.x; submethod BUILD(:$!x) {} }; say A.new(:x(42)).x
10:33 p6eval star 2010.07: OUTPUT«42␤»
10:33 masak MattMan: that works too.
10:34 * frettled smacks his forehead.
10:34 frettled D'oh!  named.
10:34 masak gfldex: you're looking for .can
10:34 masak gfldex: don't know if it works reliably yet, though. might have to go through .^methods
10:34 snarkyboojum shouldn't MattMan's case still work though? i.e. without using named variables?
10:34 masak snarkyboojum: I have a nagging feeling it should, yes.
10:35 snarkyboojum masak: cool
10:35 masak snarkyboojum: ah, but the problem is that he doesn't define a custom .new
10:35 masak snarkyboojum: so the three arguments he sends in don't get passed through. so BUILD gets only 1 argument.
10:35 snarkyboojum masak: oh.. you have to define a custom new too! :)
10:35 isBEKaml masak: I thought submethods are basically for setting up the class objects. :)
10:36 masak snarkyboojum: if you want .new to have the behaviour MattMan expects, you do.
10:36 isBEKaml masak: So, .new should still look at BUILD.
10:36 MattMan masak:  Thanks, that got it
10:36 masak isBEKaml: submethods can be used for anything you like.
10:36 MattMan So you can't pass positional parameters to a constructor in Rakudo ?
10:36 masak isBEKaml: .new doesn't change its signature because of BUILD.
10:36 masak isBEKaml: it's very un-magical.
10:37 masak MattMan: sure you can :)
10:37 isBEKaml masak: ah, the .new came in the way. I see...
10:37 masak MattMan: acutally, the default is that you should.
10:37 isBEKaml masak: But, shouldn't it still work?
10:37 masak MattMan: (if we agree that it's .new that is the constructor here)
10:37 masak isBEKaml: not without a custom .new, no.
10:37 MattMan So should I be overriding .new rather than BUILD to do what I want ?
10:38 gfldex masak: if I understand S12 correctly, .can will tell me if there is a method with a given name. I don't care about the name, I need a reference to that method.
10:38 masak gfldex: .can will give you a list of all methods with that name.
10:39 masak gfldex: (in all ancestor classes, too)
10:39 MattMan Ah.....
10:39 MattMan Overriding .new does indeed seem to do what I want
10:40 MattMan I remember asking this similar question a while ago and being told that you couldn't override it
10:40 gfldex that's all nice and dandy, and i learned something new. But I don't have nor do i want that name. I just want a reference to that method, like sub foo(){}; my $ref = &foo; would give me.
10:40 MattMan But now it seems you can
10:40 MattMan Which is good
10:40 MattMan Because it's more intuitive
10:41 bjarneh left #perl6
10:41 MattMan Actually, I spoke too soon
10:41 Su-Shee star: sub foo { say "2"; } my $bar = &foo; $bar;
10:41 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "sub foo { "␤»
10:41 Su-Shee star: sub foo () { say "2"; } my $bar = &foo; $bar;
10:41 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "sub foo ()"␤»
10:41 Su-Shee star: sub foo(){ say "2"; } my $bar = &foo; $bar;
10:42 isBEKaml star: sub foo () { say "2"; }; my $bar = &foo; $bar;
10:42 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "sub foo(){"␤»
10:42 p6eval star 2010.07:  ( no output )
10:42 isBEKaml star: sub foo () { say "2"; }; my $bar = &foo; $bar.();
10:42 p6eval star 2010.07: OUTPUT«2␤»
10:42 MattMan It doesn't seem like I can access attributes from the overridden new
10:42 MattMan rakudo: class MyTest {   has $.attr1 ;   method new($other) {     $.attr1 = $other ;   } }  my $x = MyTest.new(2) ; say $x.attr1 ;
10:42 p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Confused at line 22, near "class MyTe"␤»
10:42 Su-Shee gfldex: see isBEKaml's test.
10:43 gfldex yes, nice, that's a sub, not a method.
10:43 isBEKaml rakudo: my $foo = sub { say "hello!"; }; $foo.();
10:43 Su-Shee you want a method?
10:43 p6eval rakudo 9b6189: OUTPUT«hello!␤»
10:43 gfldex i want a reference to a method.
10:43 spacebat I'm trying to build rakudo star and having no luck - perl Configure.pl --gen-parrot completes, but then make just prints 'nothing to be done for all'
10:43 spacebat make clean doesn't change this
10:44 spacebat make realclean takes me back to square 1
10:44 gfldex rakudo: class A { method b(){} }; my $a = &A.b;
10:44 p6eval rakudo 9b6189: OUTPUT«Could not find sub &A␤  in main program body at line 22:/tmp/BaC49TLoX3␤»
10:44 masak Su-Shee: };
10:44 gfldex rakudo: class A { method b(){} }; my $a = &(A.b);
10:44 p6eval rakudo 9b6189:  ( no output )
10:44 gfldex rakudo: class A { method b(){} }; my $a = &(A.b); say $a.WHAT;
10:44 p6eval rakudo 9b6189: OUTPUT«Seq()␤»
10:44 Su-Shee masak: but I wouldn't need it in a file, would I?
10:44 gfldex :D
10:45 gfldex rakudo: class A { method b(){} }; my $a := A.b; say $a.WHAT;
10:45 masak Su-Shee: you need either the ; of an ␤
10:45 p6eval rakudo 9b6189: OUTPUT«Parcel()␤»
10:45 isBEKaml gfldex: you don't need an & before it.
10:45 masak Su-Shee: (if you plan to put anything after the '}')
10:45 gfldex rakudo: class A { method b(){ say "3"} }; my $a = A.b; say $a.WHAT;
10:45 p6eval rakudo 9b6189: OUTPUT«3␤Bool()␤»
10:45 gfldex rakudo: class A { method b(){ say "3"} }; my $a = A.b; say $a();
10:45 isBEKaml rakudo: class Foo { method b { "Foo!" }; }; my $a = Foo.b; say $a.WHAT;
10:45 p6eval rakudo 9b6189: OUTPUT«3␤invoke() not implemented in class 'Boolean'␤  in main program body at line 22:/tmp/5N_WHcf2l5␤»
10:45 p6eval rakudo 9b6189: OUTPUT«Str()␤»
10:46 Su-Shee masak: I shouldn't ask something I never do wrong in an editor.. now I'm starting to think about it. ;)
10:46 isBEKaml rakudo: class Foo { method b { "Foo!" }; }; my $a = Foo.b; say $a.WHAT; say $a.();
10:46 p6eval rakudo 9b6189: OUTPUT«Str()␤invoke() not implemented in class 'Perl6Str'␤  in main program body at line 22:/tmp/nniGMWaZKG␤»
10:46 gfldex I do need the & to prevent that method from being invoked
10:46 isBEKaml rakudo: class Foo { method b { "Foo!" }; }; my $a = Foo.b; say $a.WHAT; say $a;
10:46 p6eval rakudo 9b6189: OUTPUT«Str()␤Foo!␤»
10:46 spacebat any ideas on how to reset the build directory for rakudo star?
10:46 gfldex But & doesn't work on methods, neither of the meta object, nor for an instance.
10:46 frettled spacebat: unpack the tarball?
10:46 masak spacebat: 'make clean'?
10:47 frettled masak: make clean didn't work
10:47 masak oh.
10:47 spacebat make clean does nothing
10:47 spacebat delete and start again
10:47 spacebat I'll :)
10:47 gfldex you can try make realclean
10:47 frettled gfldex: he did :(
10:48 gfldex for parrot too?
10:48 spacebat I was trying to install into /usr/local and use a different parrot - my bad
10:48 frettled aha, yes, that can lead to some unexpected results
10:48 frettled But I did read a bugrep on clean earlier.  Hmm.
10:49 TiMBuS i use checkinstall so that i can use aptitude to manage my parrot and rakudo installs
10:50 frettled TiMBuS: does that work with Rakudo Star, too?
10:50 TiMBuS it's pretty handy for avoiding conflicts like that
10:51 spacebat seems the idea with rakudo star is keep it in the extracted tarball's directory
10:52 TiMBuS I haven't tried star but it would be useful for just uninstalling older parrots/rakudos before building it.
10:52 Su-Shee masak: how would I pass a method to another method? or, how do I make an method an object so I could pass it around like a ref?
10:53 TiMBuS checkinstall would work if you specified an install location though
10:53 MattMan OK, I'm still confused
10:53 MattMan Sorry
10:54 MattMan I overrode both .new and BUILD
10:54 frettled spacebat: Well, it is supposed to work with a pre-installed Parrot meeting the version requirements, but then you must not use --gen-parrot, and maybe use --parrot_config=/path/to/parrot_config
10:54 MattMan BUILD gets called but .new doesn't seem to
10:54 spacebat ok
10:54 MattMan And the parameter does not get passed to BUILD
10:55 MattMan class MyTest {   has $.attr1 is rw ;   sub new($other) {     say "In new, other is $other" ;   }    submethod BUILD(:$other) {     say "In BUILD, other is $other" ;     $.attr1 = $other ;   }   }  my $x = MyTest.new(2) ; say $x.attr1 ;
10:56 szabgab any spanish or portugues speaker here?
10:56 szabgab star: my @a = [5..10]; for @a { say "something" }http://www.perlfoundation.org/pe​rl6/index.cgi?rakudo_star_press
10:56 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "for @a { s"␤»
10:56 szabgab sorry
10:56 TiMBuS MattMan, well for starters, new is a method, not a sub
10:57 szabgab was there any posting in those languages?
10:57 szabgab http://www.perlfoundation.org/pe​rl6/index.cgi?rakudo_star_press
10:57 masak Su-Shee:
10:57 masak star: class A { method tell_name(&method) { say "It is called &method.name()" } }; my $tell_name = A.^methods().grep("tell_name")[0]; A.tell_name($tell_name)
10:57 p6eval star 2010.07: OUTPUT«It is called tell_name␤»
10:57 masak Su-Shee: should be able to do that with .can as well, but right now... Rakudo .can't :)
10:58 avuserow joined #perl6
10:58 frettled .can't, very droll
10:58 * masak will be here all week
10:58 frettled *kadang-tssshh*
10:59 frettled hmm
11:00 frettled No, I'll drop that pun.
11:00 MattMan TiMBus:  Thanks for that
11:00 TiMBuS np
11:00 frettled How many English can dance on the head of a pun, anyway?
11:00 tadzik no idea
11:01 MattMan TiMBus:  Do I need to have a bless in the overridden .new method
11:01 Su-Shee masak: so later is my $tell_name = A.can('tell_name'); ?
11:01 TiMBuS yes
11:01 Su-Shee it is and there's probably a ^ missing.
11:01 masak Su-Shee: oh, right.
11:01 masak yes, definitely .^can
11:02 MattMan TiMBus:  And do I pass my named parameter to BUILD via the bless ?
11:02 masak star: say Int.^can("say").WHAT
11:02 p6eval star 2010.07: OUTPUT«Method()␤»
11:02 TiMBuS yepyep
11:02 MattMan TiMBus:  I'm having difficulty understanding the relationship between new and BUILD
11:02 TiMBuS return $.bless(*, attr1 => $other); inside new
11:02 Su-Shee I have stupidly ask: this is really later the way to use methods as callbacks or am I getting something wrong?
11:03 Su-Shee signal_connect('clicked' ... my callback here.. ) in perl 6 within a class.. ?
11:03 colomon rakudo: say (1..6).list.elems.WHAT
11:03 p6eval rakudo 9b6189: OUTPUT«Int()␤»
11:04 colomon rakudo: say +((1..6).list).WHAT
11:04 p6eval rakudo 9b6189: OUTPUT«0␤»
11:04 colomon duh
11:04 MattMan TiMBus:  Which works fine if all I want to do is set an attribute in BUILD
11:04 colomon rakudo: say (+((1..6).list)).WHAT
11:04 p6eval rakudo 9b6189: OUTPUT«Num()␤»
11:05 MattMan TiMBus:  But I'm actually trying to create another object using those parameters
11:05 TiMBuS hrm?
11:05 MattMan TiMBus:  And store those parameters in the object
11:06 MattMan class Connection {   has $.dbname ;   has $.dbuser ;   has $.dbpass ; } ;  class Table {   has Connection $.conn is rw ;    method new($dbname,$dbuser,$dbpass) {     say "In new" ;     return $.bless ;   }      submethod BUILD(:$dbname,:$dbuser,:$dbpass) {     say "In BUILD" ;     $.conn = Connection.new($dbname,$dbuser,$dbpass) ;     say :$.conn.perl ;    }  }  my $tab = Table.new("mydb","matthew","matthew") ; say $tab.conn.perl ;
11:06 MattMan TiMBus:  So I want to store the connection in the Table object
11:06 MattMan TiMBus:  But initialise it based on the parameters that I pass
11:06 molaf joined #perl6
11:07 tadzik http://github.com/timbunce/DBDI/ -- it's now DBDI, not DBI?
11:07 MattMan TiMBus:  Am I trying to do something dumb ?
11:07 tadzik MattMan: use nopaste please
11:08 masak Su-Shee: I usually declare an anonymous method: 'method { ... }'
11:08 TiMBuS thats a good start
11:08 MattMan tadzik:  Sorry, what's no paste ?
11:08 tadzik MattMan: http://nopaste.snit.ch/ put your code in here and give as the link
11:09 tadzik it'd be easier to read than the one long line with Your class
11:09 MattMan tadzik:  Sure
11:09 tadzik s/as/us/
11:09 TiMBuS i see what you're doing though
11:10 spacebat you see what he did there?
11:10 Su-Shee masak: $on_click = method { ... } would work? and then I'll do signal_connect('clicked' $on_click.()); ?
11:10 masak Su-Shee: hm, two terms in a row...
11:10 tadzik well, a comma is needed
11:10 masak with a comma it works.
11:10 masak but, hm.
11:10 tadzik but yeah, looks good
11:10 masak you can't just call the method without an invocant.
11:10 masak it works like this:
11:10 masak star: my $doublesay = method { say 2 * self }; 21.$doublesay()
11:10 TiMBuS spacebat: ya, rly
11:10 p6eval star 2010.07: OUTPUT«42␤»
11:11 tadzik oh
11:11 tadzik oh right, it's a method, not a sub
11:11 masak right.
11:11 kjeldahl joined #perl6
11:11 Su-Shee I wanted to pass the method. it'll get called when the event 'clicked' occurs.
11:11 MattMan TiMBus:  Based on other OO languages I'd expect to be able to do something like that
11:12 TiMBuS i remember hitting an issue similar to that a while ago MattMan
11:12 Su-Shee I'll ask the meta meta level: how does event driven programming with perl 6 classes and methods work? :)
11:12 mattgumbley joined #perl6
11:12 masak Su-Shee: is the 21.$doublesay() example above any help at all?
11:12 masak I believe it shows the general principle.
11:13 masak (anon method creation, calling an arbitrary object with the anon method)
11:13 masak the passing-around in between is mostly incidental to the problem.
11:13 MattMan Here it is in readable format http://nopaste.snit.ch/22487
11:15 TiMBuS Su-Shee, for my event model, i make a role containing method names that correspond to the event names, add it to the object being called on an event, and use $object.*"eventname";
11:15 TiMBuS its pretty good
11:16 TiMBuS MattMan, i'm looking for the solution I made. I think it was just a new/BUILD override and your solution is nearly correct
11:16 masak TiMBuS: ooh, we do that in Tardis. :)
11:16 masak it's kind of an event model, I guess.
11:17 TiMBuS its basically a built in event system and its brilliant
11:18 masak szabgab: excellent screencast: http://szabgab.com/blog/2010/07/introd​uction-to-perl6-screencast-hashes.html
11:18 masak szabgab++
11:18 TiMBuS using 'where' clauses you can filter out specific events for your handler too
11:18 masak szabgab: getting keys back from values in a straightforward way: %hash.invert{$value} --> $key (or @keys)
11:18 whiteknight joined #perl6
11:18 TiMBuS MattMan, return $.bless(*, :$dbname,:$dbuser,:$dbpass ); seems to work
11:19 szabgab masak: right, but if you have duplicate values you are doomed :)
11:19 TiMBuS in your new()
11:19 masak szabgab: not so. :)
11:19 colomon rakudo: say (1..6).list ~~ Mu
11:19 szabgab oh, well
11:19 p6eval rakudo 9b6189: OUTPUT«1␤»
11:19 masak star: my %h = a => 1, b => 1; say %h.invert.perl
11:19 p6eval star 2010.07: OUTPUT«(1 => "a", 1 => "b")␤»
11:19 masak \o/
11:19 masak oh :(
11:19 masak that's Wrong(TM).
11:19 MattMan TiMBus:  So it does
11:20 szabgab is that?
11:20 MattMan TiMBus:  Thank you very much
11:20 TiMBuS not a problem
11:20 TiMBuS I'm sure there's an easier way I figured out though..
11:20 isBEKaml star: my %h = a => 1, b => 1; my %new =  %h.invert; say %new.perl;
11:20 MattMan TiMBus:  Yes
11:20 p6eval star 2010.07: OUTPUT«{"1" => "a"}␤»
11:20 isBEKaml masak: ^^
11:20 * masak submits rakudobug
11:21 Su-Shee TiMBuS: I don't know enough about perl 6 and how to deal with methods other than calling them on an object. I will need something to handle non blocking event driven programming. python passes around methods, ruby passes around code blocks, perl 5 passes around subrefs. so I understand I would pass subrefs in perl 6.. but probably I have to read more.
11:21 masak there doesn't seem to be one for this yet.
11:21 MattMan TiMBus:  It doesn't really seem like an especially elegant way of doing it
11:22 tadzik Su-Shee: you can just signal_connect('clicked', sub { $obj.method() }), no?
11:22 avuserow joined #perl6
11:23 gfldex rakudo: class A { method b(){ say 'A::b invoked'} }; my $a = A.new(); my $b = {$a.b()}; $b();
11:23 TiMBuS Yes MattMan I noticed that overriding new() is a bit of a pain compared to other languages. it's because of the way the object system works. proto-objects and stuff
11:23 spacebat masak: is that hash invert really a bug
11:23 p6eval rakudo 9b6189: OUTPUT«A::b invoked␤»
11:23 Su-Shee tadzik: I'm not sure. it would more look like $widget.signal_connect('clicked', somethingcallbackish);
11:23 tadzik looks Gtkish :)
11:23 gfldex sticking the method call into a block will form a closure.
11:23 tadzik Su-Shee: well, that's still ok
11:23 masak spacebat: I'm having second thoughts as well.
11:23 Su-Shee tadzik: well it works in any other widget set similar. might not be called signal_connect then :)
11:24 masak spacebat: seems not.
11:24 szabgab is there a variable that holds the directory name of the current script?
11:24 masak the correct idiom is %out.push(%in.invert)
11:24 isBEKaml rakudo: my %h = a => 1, b => 1; %h.invert.perl.say; my %new = %h.invert; %new.perl.say;
11:24 p6eval rakudo 9b6189: OUTPUT«(1 => "a", 1 => "b")␤{"1" => "b"}␤»
11:24 tadzik then Widget.signal_connect() will be something like @!clicked_events.push($somethingcallbackish)
11:24 masak szabgab: something like $*CWD.
11:24 szabgab $*PROGRAM_NAME
11:24 szabgab not cwd
11:25 szabgab $*PROGRAM_NAME.dirname
11:25 masak oh.
11:25 masak I believe $*PROGRAM_NAME is just a Str.
11:26 szabgab so I can easily load things relative to the script
11:26 Su-Shee AAAH I'm such an idiot :)
11:26 gfldex Su-Shee: http://nopaste.voric.com/paste.php?f=e19cmo
11:27 gfldex Su-Shee: something like that?
11:27 isBEKaml masak: that .invert doesn't look like a bug. but the difference in behaviour between assignment and expression feels somewhat wonky. :|
11:27 masak isBEKaml: if you assign to a hash, you get that behaviour.
11:27 isBEKaml masak: consider my last rakudo p6eval output.
11:28 masak isBEKaml: if you want to keep all the values of duplicate keys, .push is what you want
11:28 isBEKaml masak: assignment is what feels consistent.
11:28 masak isBEKaml: I disagree. hash assignment has always thrown away keys like that.
11:28 spacebat star: my %h = a => [1,2], b=> [2,3]; my %i; %i.push(%h.invert); %i.perl.say
11:28 p6eval star 2010.07: OUTPUT«{"3" => "b", "1" => "a", "2" => ["a", "b"]}␤»
11:28 masak Perl 5 users are very used to that. that's how they override named parameter values.
11:29 spacebat yup, I do that every (other) week
11:29 Su-Shee ok, the python example of gtk stuff looks like this: button_object.signal_connect('clicked', self.on_click) and that would be $button_object.signal_connect('clicked', $self.on_click) I assume...
11:30 TiMBuS Su-Shee, oh for some reason I was thinking of gtk's autoconnect functions! which are dependant on the gtkbuilder file, not the code. ah geez
11:30 Su-Shee man I didn't even think about self..
11:30 TiMBuS which was making me think too much
11:30 pmurias joined #perl6
11:31 avuserow joined #perl6
11:31 gfldex Su-Shee: I don't think you will need the method names provided as strings in perl6. We will have to ask Larry if the & operator is supposed to work with methods too.
11:32 gfldex Su-Shee: And you will have a lot better introspection with perl6 then any other signal implementation.
11:33 pmurias gldex: the & operator?
11:34 pmurias gfldex: you mean &method_name?
11:34 gfldex you can't do &SomeObject.some_method right now
11:34 gfldex rakudo will stop at the .
11:34 masak Su-Shee: no, it would be just $on_click
11:35 Su-Shee masak: it assumes self anyway?
11:35 masak Su-Shee: when you want to call the method in the variable (as opposed to passing it), you do self.$on_click() (or, more generally $object.on_click())
11:35 masak Su-Shee: anon methods need to be passed a self by the $obj.$method() syntax.
11:35 gfldex pmurias: and i'm not sure if the & should work on methods. Couldn't find anything in S?? .
11:36 Su-Shee ah. I want to pass. it should be _called_ later.
11:36 masak Su-Shee: anon methods are totally orthogonal from any particular class or object.
11:36 avuserow joined #perl6
11:38 TiMBuS have the user setup button_object.signal_connect('clicked', $anon_method); then inside the signal handler use self.$anon_method when the signal is triggered. i guess
11:38 Su-Shee so it would look like: $anon = method ($self) { do_stuff; }; $button_object.signal_connect('clicked', $self.$anon); ?
11:38 masak Su-Shee: what TiMBuS said, but self.$anon_method() with the parentheses, which are required there.
11:38 masak Su-Shee: if you want self in $self, you need 'method ($self:)' with a colon.
11:39 masak but then you don't use it inside the method body, so I'm not sure you want it :)
11:39 Su-Shee I was finished typing when I saw TiMBuS' stuff. :)
11:41 gfldex Su-Shee: do you want signals that pass parameters around?
11:41 pmurias gfldex: &SomeObject.some_method calls some_method on &SomeObject
11:41 pmurias gfldex: & is a sigil like $ not an operator
11:41 Su-Shee gfldex: that was just an example, because it's common in all widget sets.
11:42 TiMBuS pmurias, but we want a reference to the method, we don't want to call it
11:42 gfldex Su-Shee: that doesn't answer my question
11:42 masak TiMBuS: then .^can or .^methods are what you want.
11:42 gfldex pmurias: i was guessing so, but how do I store a method away for later use, without forming a closure?
11:43 Su-Shee gfldex: then I don't understand your question?
11:43 gfldex Su-Shee: do you know trolltech's Qt signal/slot implementation?
11:43 masak TiMBuS: previously this worked: &SomeClass::some_method
11:43 Su-Shee gfldex: I just wanted to pass methods as a parameter so other methods around.
11:43 Su-Shee "to other"
11:43 TiMBuS no longer works?
11:43 masak TiMBuS: but the object model was refined, and it was determined that methods don't have 'our' scoping.
11:44 Su-Shee gfldex: vaguely.
11:44 TiMBuS i see
11:44 masak TiMBuS: and it's the 'out' scoping that'd place the method object at that position.
11:44 gfldex Su-Shee: you can do that right now with forming a closure but you wont be able to emit a signal with a parameter
11:44 masak TiMBuS: for an 'our' method, it works.
11:44 masak s/out/our/
11:44 TiMBuS that makes sense
11:46 TiMBuS so you have to use 'our', or method names as strings? or does ^.methods return callable method refs?
11:46 masak the latter.
11:46 TiMBuS .^methods *
11:46 tadzik jnthn: ping
11:47 gfldex well you could make the connect function a macro so you dont have to pass strings around. And use .can and .^methods to get hold of the method reference. But that's quite ugly and wont be fast.
11:49 pmurias gfldex: if you grab a method from somewhere it can be stored as a sub that takes the invocant as the first positional
11:50 gfldex pmurias: I got that. But should it be so hard to get the reference in the first place?
11:50 gfldex pmurias: even javascript does it better :)
11:50 TiMBuS using strings seems the better way.. but using strings is how php does it... :(
11:54 Su-Shee hrgh. now I'm entirely confused.
11:55 gfldex Should we try to unfuse you? :)
11:55 masak star: class A { method foo {} }; class B { method foo { say "OH HAI" } }; my $a-foo = A.^can("foo"); B.new.$a-foo()
11:55 p6eval star 2010.07:  ( no output )
11:55 masak star: class A { method foo {} }; class B { method foo { say "OH HAI" } }; my $b-foo = B.^can("foo"); A.new.$b-foo()
11:56 p6eval star 2010.07: OUTPUT«OH HAI␤»
11:56 masak \o/
11:56 masak discuss. :P
11:56 Su-Shee well I like the plain and very simple way of how I can do it in javascript. I understand how to do it with a subref. so I looked up how ruby does it, they're doing this passing a code block thingie. (and use & :)
11:56 TiMBuS my mind!
11:57 gfldex masak: That indeed works but it ain't very dwimmy.
11:57 masak gfldex: I wonder what happens if I try to extract secrets that way.
11:58 gfldex I'm not sure if dwimmy and secrets are supposed to mix. :)
11:58 masak star: class A { has $!x; method foo {} }; class B { has $!x; method foo { say $!x } }; my $b-foo = B.^can("foo"); A.new(:x(42)).$b-foo()
11:58 p6eval star 2010.07: OUTPUT«42␤»
11:58 masak now, that's an encapsulation problem.
11:59 masak not sure at all how to solve that one.
11:59 * masak submits a hesitant rakudobug
11:59 gfldex masak: I wasn't expection a shotgun to stop you anyway. :)
11:59 TiMBuS i would still much prefer 'my $a-foo = &A.foo', but hey you showed us something cool to make up for it
12:00 gfldex I would like to ask what &SomeObject.some_method should return to be drimmy?
12:00 masak TiMBuS: I know what you mean. maybe there's some nice sugar for .^can that could be added to the spec. but I'm not in a rush to suggest one.
12:00 gfldex In my eyes it should return 2 values, a reference to that object and a reference to that method.
12:00 masak gfldex: that calls a method on an object called &SomeObject, just like pmurias said earlier.
12:01 masak gfldex: you should read the spec and see for yourself :)
12:01 masak gfldex: notable S06 and S12.
12:01 masak s/ble/bly/
12:02 TiMBuS but i dont need a ref to the object, i already have a way to get one ($a = A)
12:02 TiMBuS or.. A
12:03 pmurias joined #perl6
12:03 gfldex masak: as far as i can tell S?? doesnt't say anything about returning a reference to a method. Not even from the meta object. And I think it should.
12:03 masak you guys sound a bit like p6l. :P
12:03 masak a combination of very informed and relatively clueless. it's cute!
12:04 gfldex Well I for sure do in this case. I can't really live with c++ being more dwimmy then perl6. :)
12:04 masak gfldex: ok, earlier reading S06 and S12 was just a suggestion. now I *sentence* you to it. read them carefully. :)
12:04 pmurias gfldex: $obj.^can("foo")[0] is hard?
12:05 pmurias gfldex: my $foo = 'onclick'; $obj.$foo() should work too
12:05 pmurias gfldex: in javascript manipulating the method dictionary is more important as their OO system is quick and ugly hack
12:05 masak pmurias: I believe that might be $obj."$foo"()
12:05 pmurias s/quick/a quick/
12:05 pmurias masak: that's the form in the spec
12:05 am0c joined #perl6
12:06 KenGuru joined #perl6
12:06 pmurias but $obj.$methodobj is mentioned too
12:06 masak ok.
12:06 masak I seemed to recall that indirect method dereferencing from strings always required the .""() form
12:07 masak maybe I recall wrongly.
12:07 TiMBuS you're right
12:07 gfldex masak: obj[foo]() would _be_ javascript. pmurias: and that would mean that perl6' object model is just as an ugly hack then javascript's. :)
12:07 pmurias it's not very precisely specced
12:08 masak I wish it were.
12:08 gfldex the string ain't really a problem as you can macro it away. As long as you don't do that in a loop.
12:08 gfldex masak: poke larry about it?
12:09 masak TimToady: ^^
12:09 tadzik phenny: tell jnthn I managed to make a quick and dirty fix for DESTDIR in blizkost, I was able to package blizkost for my linux distro with it, and I hope it didn't break the original install target. The patch is here -- http://gist.github.com/502109
12:09 phenny tadzik: I'll pass that on when jnthn is around.
12:09 gfldex didn't larry went for oscon or something?
12:09 tadzik phenny: thanks
12:10 pmurias gfldex: re ugliness, uncommonly used things don't need to be short
12:11 gfldex if you work with gui toolkits you will use that one quite often. Ask them KDE folks. :)
12:12 gfldex ofc, you can stick that method call into a block and store the reference to that block/closure.
12:12 gfldex but that kills intospection
12:13 masak joined #perl6
12:13 pmurias introspection?
12:13 gfldex that's why i like the Qt way of handleing signal/slots. You can tell what objects (or their signals) call what objects and what slot
12:13 gfldex very helpful for debugging
12:14 masak going offline for a few hours to focus on slidescrafting. o/
12:14 pmurias you could always introspect the closure to see what it does (it works in perl5)
12:14 gfldex as soon as you hand a closure over to the signal (what is a function that will forward it's parameters to one or many functions), the signal can tell anymore what objects it's sending to
12:15 gfldex and that sucks because it makes it hard to unconnect a slot
12:15 pmurias you meant can't?
12:15 gfldex yes
12:15 gfldex lets say we have to functions, connect and unconnect
12:16 gfldex if i do connect({$some.foo}) and then unconnect({$some.foo}) it will fail
12:16 gfldex because the identity of the 2nd closure aint the same then the first
12:17 gfldex if i would do connect($obj, $obj::foo) and unconnect($obj, $obj::foo) i have meaningful identity
12:17 gfldex and yes, i do know that :: is not for classes
12:17 pmurias connect($obj,"foo"), unconnect($obj,"foo")?
12:17 baest joined #perl6
12:18 gfldex that's how Qt used to do it before they went for templates
12:18 pmurias gfldex: a string would work better in case the object's class changes
12:18 gfldex and it was slow, slow, slow
12:18 gfldex good point
12:19 gfldex if $obj::foo would be the same then $objs_class::foo
12:19 pmurias if someone changes $obj's class you would have a very wird bug if you fetched a pointer to the bethod before that
12:19 gfldex and i think that's not the case
12:19 gfldex can you change $obj's class at runtime?
12:20 pmurias you can add/modify methods unless the class unless it's explicilty forbiden
12:21 gfldex hmm, shouldn't the compiler tell me if I (still) try to connect my signal to a method that has changed?
12:21 pmurias gfldex: re unconnecting signals the way it's done in some js frameworks is my $handle = $signal.connect({$some.foo}); $signal.unconnect({$some.foo})
12:21 gfldex or better should a slot be a method then?
12:22 pmurias gfldex: slot?
12:22 gfldex well, for Qt a slot is indeed just a method + some data in the meta object
12:22 gfldex so you can tell the difference
12:22 gfldex but you _can_ tell the difference
12:23 gfldex and about that javascript stuff, yes, it's the same and it aint no work in javascript too
12:23 pmurias aint no work?
12:23 gfldex you have to store the first closure in a variable if you want to unconnect a signal
12:23 pmurias gfldex: the google maps api returns an event handler
12:23 pmurias so you unregister the event handler
12:26 gfldex DOM doesnt do that and it's a classic noob mistake to create a 2nd closure
12:28 rurban joined #perl6
12:28 pmurias gfldex: is the speed of UI callbacks important?
12:28 jnthn afternoon, #perl6
12:28 phenny jnthn: 12:09Z <tadzik> tell jnthn I managed to make a quick and dirty fix for DESTDIR in blizkost, I was able to package blizkost for my linux distro with it, and I hope it didn't break the original install target. The patch is here -- http://gist.github.com/502109
12:28 pmurias gfldex: don't they get called on events that happen very rarely (like mouse clics)
12:28 gfldex seldom and you can work with a functor too
12:29 gfldex Qt provides signal/slot stuff for network stuff and threads
12:29 jnthn tadzik: "+DESTDIR      ?=" - what is that ?= there?
12:29 gfldex well, the provide singals and slots for everything :)
12:30 pmurias gfldex: i prefer the pass a closure and have an unregistering handle approach as it doesn't force me to have everything as a seperate class
12:31 gfldex pmurias: i prefere the compiler to slap me if I do something silly. And I somehow think that's the idea behind Perl6. :)
12:31 szabgab rakudo: my @a = 1,2; for @a Z @a { say "$^a $^b" }
12:31 p6eval rakudo 9b6189: OUTPUT«1 1␤2 2␤»
12:31 jnthn $obj."$foo"() # call the method named whatever $foo stringifies to
12:31 szabgab rakudo: my @a = 1,2; for @a Z @a Z @a { say "$^a $^b $^c" }
12:32 p6eval rakudo 9b6189: OUTPUT«No applicable candidates found to dispatch to for 'infix:<Z>'. Available candidates are:␤:()␤:(Any $lhs, Any $rhs)␤␤  in main program body at line 22:/tmp/cMEDvGFdal␤»
12:32 pmurias when do you expect the compiler to slap you?
12:32 jnthn $obj.$bar() # calls $bar($ojb)
12:32 jnthn It's spec'd just fine in S12.
12:32 pmurias jnthn: and if $bar is a string?
12:32 pmurias it's an error?
12:32 jnthn pmurias: Then it's an error.
12:32 jnthn pmurias: One that we can, with enough type information, even tell you about at compile time.
12:32 colomon rakudo: my @a = 1,2; for @a Z (@a Z @a) { say "$^a $^b $^
12:33 p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Non-variable $ must be backslashed at line 22, near "$^"␤»
12:33 colomon rakudo: my @a = 1,2; for @a Z (@a Z @a) { say "$^a $^b $^c" }
12:33 p6eval rakudo 9b6189: OUTPUT«1 1 2␤Not enough positional parameters passed; got 1 but expected 3␤  in <anon> at line 2:/tmp/1pOKYXbbVH␤  in main program body at line 1␤»
12:33 gfldex pmurias: when i try to connect a signal and a slot that are not ment to be use for that kind of stuff, because they do some magic in the background. I would like to be forced to do something explicit to get the silly stuff working. Should be possible with functors.
12:33 colomon oooh, think that part is a real bug instead of a NYI
12:33 jnthn ooh.
12:34 colomon rakudo: my @a = 1,2; for @a Z (@a Z @a) -> $a, $b, $c { say "$a $b $c" }
12:34 p6eval rakudo 9b6189: OUTPUT«1 1 2␤Not enough positional parameters passed; got 1 but expected 3␤  in <anon> at line 2:/tmp/2lWGMyI9Jz␤  in main program body at line 1␤»
12:34 * jnthn -> errands, back to do some hacking in a bit :-)
12:34 pmurias gfldex: functors = function objects?
12:34 gfldex pmurias: yes
12:35 colomon (take that back -- at least, it's not the bug I thought it was.)
12:35 colomon rakudo: my @a = 1,2; (@a Z (@a Z @a)).perl
12:35 colomon rakudo: my @a = 1,2; (@a Z (@a Z @a)).perl.say
12:35 pmurias re some magic the compiler can't warn you about stuff that happens at runtime
12:35 p6eval rakudo 9b6189:  ( no output )
12:35 p6eval rakudo 9b6189: OUTPUT«(1, 1, 2, 1)␤»
12:35 colomon oh
12:36 pmurias gfldex: if you ask for method foo as it's now, and then method foo is something different it's your mistake
12:36 colomon rakudo: my @a = 1,2; (@a Z, (@a Z, @a)).perl.say
12:36 p6eval rakudo 9b6189: OUTPUT«((1, 1), (2, 1))␤»
12:37 colomon rakudo: my @a = 1,2; for @a Z (@a Z @a) -> $a, $b?, $c? { say "$a $b $c" }
12:37 p6eval rakudo 9b6189: OUTPUT«1 1 2␤1 Mu() Mu()␤»
12:37 colomon ugh, what a mess.
12:40 colomon szabgab: we don't have the framework in Rakudo to implement @a Z @b Z @c yet.  (well, at least, not properly.)
12:42 colomon and the obvious workarounds don't work because Z flattens its arguments, so you get (1, 2) Z (1, 1, 2, 2)
12:42 szabgab so shall I file it as a bug or just leave it alone?
12:42 szabgab rakudo: my $x = 1|2; if $x != 1 { say 't' } else { say 'f' }
12:42 p6eval rakudo 9b6189: OUTPUT«f␤»
12:43 gfldex szabgab: check if there is a bug report already. I'm quite sure there is.
12:43 szabgab shouldn't this be t ?
12:44 gfldex is there a way explicitly remove an object from memory?
12:44 jnthn szabgab: Junctions + negated operators = bad idea, generally.
12:45 jnthn szabgab: if $x != 1 { ... } is exactly equivanet to if !($x == 1) { ... }
12:45 jnthn szabgab: (True for all negations)
12:46 szabgab rakudo: my $x = 1|2; if i!($x == 1) { say 't' } else { say 'f' }
12:46 p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Missing block at line 22, near "!($x == 1)"␤»
12:46 szabgab rakudo: my $x = 1|2; if !($x == 1) { say 't' } else { say 'f' }
12:46 p6eval rakudo 9b6189: OUTPUT«f␤»
12:47 szabgab yeah, I just had this in an example I have and it used to be 't'  as I can see
12:47 szabgab anyway
12:47 jnthn More errands... :-)
12:47 jnthn bbs
12:48 tadzik jnthn: it's for DESTDIR having a default value (being '') but allow it for being set
12:49 tadzik jnthn: I'm not a Makefile guy really, but I know this thing is being used and it works :)
12:53 hudnix joined #perl6
12:54 khisanth_ joined #perl6
12:56 Mowah joined #perl6
12:57 agentzh joined #perl6
13:05 szabgab rakudo: my $str = 'ab'; if $str ~~ m/a/ { say $/ }; if $str !~~ m/z/  { say $/ }
13:06 p6eval rakudo 9b6189: OUTPUT«a␤a␤»
13:06 szabgab I wonder if that's right?
13:06 szabgab on the right
13:08 tadzik why not?
13:09 szabgab if matching fails $/ is untouched?
13:09 KenGuru joined #perl6
13:10 szabgab rakudo: my $r = "ab" ~~ m/./; say $r.WHAT
13:10 p6eval rakudo 9b6189: OUTPUT«Match()␤»
13:10 szabgab rakudo: my $r = "ab" !~~ m/./; say $r.WHAT
13:10 azert0x joined #perl6
13:10 p6eval rakudo 9b6189: OUTPUT«Bool()␤»
13:11 szabgab rakudo: my $r = "ab" !~~ m/.../; say $r.WHAT
13:11 p6eval rakudo 9b6189: OUTPUT«Bool()␤»
13:11 szabgab rakudo: my $r = "ab" ~~ m/.../; say $r.WHAT
13:11 p6eval rakudo 9b6189: OUTPUT«Match()␤»
13:14 briang joined #perl6
13:18 azert0x hi
13:18 azert0x i just learn why i have better perf when i fork a code instead of thread it
13:18 azert0x (threads in perl sucks)
13:19 azert0x Is what it will be improved in perl6
13:20 szabgab rakudo: sub f($x is rw) { $x = 23; }; f(1)
13:20 p6eval rakudo 9b6189: OUTPUT«Cannot modify readonly value␤  in '&infix:<=>' at line 1␤  in 'f' at line 22:/tmp/P8WAS_CzI9␤  in main program body at line 22:/tmp/P8WAS_CzI9␤»
13:21 azert0x Is what threads support will be improved in perl6
13:21 azert0x ?
13:22 jnthn azert0x: Yes, we want to do a lot better in Perl 6. It'll largely depend by implementation and backend, of course.
13:24 azert0x ok. thanks jnthn. if you consider upgrading it or not. = Fork to keep the stains parallel threads or introduce real threads
13:24 azert0x *just to know if you consider...
13:25 jnthn Oh, certainly real threads are desired. :-)
13:27 azert0x jnthn: thanks to answer me :)
13:31 peters_mops joined #perl6
13:40 KenGuru joined #perl6
13:41 s1n joined #perl6
13:44 PacoLinux joined #perl6
13:44 fhew joined #perl6
13:47 fhew #connect p6eval
13:51 robinsmidsrod joined #perl6
13:53 avuserow joined #perl6
13:57 pdcawley joined #perl6
13:58 szabgab rakudo: my @a = 1,1,1,1; my @b = 1,2; say @a >>+>> @b
13:58 p6eval rakudo 9b6189: OUTPUT«2323␤»
13:58 pdcawley Is the perl 6 grammar accessible from within perl 6 yet? Obviously macros aren't, but I'd still be interested in mucking about with parsing perl...
13:59 szabgab so its is not extending the last value any more, but repeating the shorter list, right?
14:00 avuserow joined #perl6
14:01 szabgab rakudo: my @a = 1,1,1,1,1; my @b = 1,2; say @a >>+>> @b
14:01 p6eval rakudo 9b6189: OUTPUT«23232␤»
14:01 jnthn rakudo: say Perl6::Grammar.parse('say 42')
14:02 p6eval rakudo 9b6189: OUTPUT«say 42␤»
14:02 jnthn rakudo: say Perl6::Grammar.parse('say 42 lol')
14:02 p6eval rakudo 9b6189: OUTPUT«Confused at line 1, near "say 42 lol"␤  in main program body at line 286␤»
14:02 ruoso joined #perl6
14:08 pdcawley jnthn: Cool!
14:09 pdcawley star: say Perl6::Gramar.parse('say 42')
14:09 p6eval star 2010.07: OUTPUT«Can not find sub Perl6::Gramar␤  in main program body at line 1␤»
14:09 pdcawley Oops.
14:10 pdcawley star: say Perl6::Grammar.parse 'say 5'
14:10 p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "say Perl6:"␤»
14:11 jnthn Need parens for method args
14:11 jnthn Or colon
14:11 pdcawley star: say Perl6::Grammar.parse('say 5')
14:11 pdcawley colon?
14:11 p6eval star 2010.07: OUTPUT«say 5␤»
14:11 jnthn star: say Perl6::Grammar.parse: 'say 5';
14:11 p6eval star 2010.07: OUTPUT«say 5␤»
14:11 pdcawley Ooh...
14:11 pdcawley
14:11 pdcawley
14:12 jnthn Can look neater in some cases, but I tend to prefer the parens. :-)
14:12 pdcawley Is that : an infix operator, or does it return a bound method that is then applyed to 'say 5'?
14:12 avuserow joined #perl6
14:12 jnthn Nothing so clever.
14:12 pdcawley Shame.
14:12 pdcawley :)
14:12 jnthn Pure syntax.
14:12 jnthn We either after a method name parse a colon and arg list, or an arg list in parens. :-)
14:12 jnthn Or so far as my memory of the grammar is. :-)
14:13 jnthn pdcawley: Yup, it's in token methodop
14:14 pdcawley Would be be very hard to make it return -> |$a { Perl6::Grammar.parse(|$a) } ?
14:15 jnthn Well, yes in that it'd break a lot of existing code out there, if I understand what you're suggesting correctly anyway.
14:15 jnthn In terms of "hard to implement", not really. :-)
14:15 * pdcawley does a little more experimenting... I think I'm expecting its evaluation rules to be a little more like Haskell than they are...
14:15 xinming joined #perl6
14:17 pdcawley Could always make an infix operator along the lines of the haskell '$' I suppose...
14:18 pdcawley star:  sub addn ($n) { -> $i { $n + $i } }; addn(10)(20)
14:18 pdcawley
14:18 p6eval star 2010.07:  ( no output )
14:19 jnthn star:  sub addn ($n) { -> $i { $n + $i } }; say addn(10)(20)
14:19 p6eval star 2010.07: OUTPUT«30␤»
14:19 pdcawley would like to be able to write something like that as addn 10 20, but it doesn't work.
14:19 jnthn (missed the say)
14:20 jnthn No, that won't work. That'd class as "two terms in a row", which is a big no-no.
14:20 pdcawley Yeah.
14:20 pdcawley Need a Haskelly addn 10 $ 20
14:20 jnthn (It's one of the things the parser relies on to keep itself in check.)
14:21 pdcawley Though presumably $ isn't available as an infix operator what with it being a sigil and all.
14:22 jnthn rakudo: sub infix:<$>($a, $b) { say "hey it worked" }; 1 $ 2 # maybe
14:22 p6eval rakudo 9b6189: OUTPUT«hey it worked␤»
14:22 pdcawley Complete tangent, what sort of tools are there to introspect on stuff in the repl?
14:22 pdcawley FMR!
14:23 jnthn Well, the other side of "no two terms in a row" is that the parser also knows whether it's expecting an operator or a term. :-)
14:23 pdcawley Heh.
14:24 pdcawley star:  sub addn ($n) { -> $i { $n + $i } }; sub infix:<$>($a, $b) { $a.($b) }; say addn 10 $ 20
14:24 pdcawley
14:24 jnthn Well, there's the meta-model for introspecting objects/classes/roles. Subs and signatures are also introspectable.
14:24 p6eval star 2010.07: OUTPUT«invoke() not implemented in class 'Integer'␤  in 'infix:<$>' at line 22:/tmp/xFAW_CS1EE␤  in main program body at line 22:/tmp/xFAW_CS1EE␤»
14:24 pdcawley Drat.
14:24 KenGuru joined #perl6
14:24 jnthn Yeah, the addn 10 will run before the operator.
14:24 jnthn I fear that's more macro-ish than just a plain ole operator.
14:24 pdcawley And we don't have macros yet.
14:25 pdcawley Ho hum.
14:25 jnthn Aye. :-(
14:25 patspam joined #perl6
14:25 gfldex std: class A { multi method postfix:<()>{} }; my $a = A.new(); $a();
14:25 p6eval std 31883: OUTPUT«ok 00:01 118m␤»
14:25 gfldex rakudo: class A { multi method postfix:<()>{} }; my $a = A.new(); $a();
14:25 p6eval rakudo 9b6189: OUTPUT«invoke() not implemented in class 'A'␤  in main program body at line 22:/tmp/L3FwO80tBz␤»
14:26 jnthn gfldex: I think you wanted method postcircumfix:<( )>($c) { }
14:26 jnthn (multi is ok too)
14:26 cibs joined #perl6
14:27 gfldex i indeed want that :)
14:30 gfldex rakudo: class A { multi method postcircumfix:<( )>($c) {} }; my $a = A.new(); $a();
14:30 p6eval rakudo 9b6189:  ( no output )
14:31 gfldex rakudo: class A { multi method postcircumfix:<( )>($c) {say $c} }; my $a = A.new(); $a('ello');
14:31 p6eval rakudo 9b6189: OUTPUT«Capture()<0x80dc640>␤»
14:33 rindolf joined #perl6
14:35 gfldex rakudo: class A { multi method postcircumfix:<( )>($c) {say $c.WHAT} }; my $a = A.new(); $a('ello');
14:36 p6eval rakudo 9b6189: OUTPUT«Capture()␤»
14:36 gfldex rakudobug?
14:38 jnthn No
14:38 jnthn Correct
14:38 jnthn You get the capture containing the arguments passed.
14:39 jnthn You can get the first arg like $c[0]
14:40 gfldex How can I pass a capture on to another function so it turns into real parameters?
14:40 gfldex callwith() or somesuch?
14:41 gfldex And does that implementation means I can't really have a signature on a functor?
14:41 jnthn foo(|$c)
14:42 jnthn You can use sub-signatures to unpack the capture.
14:43 gfldex where can i find sub-singatures in S?? ?
14:43 jnthn S06
14:43 jnthn but basically
14:44 jnthn Just write a signature in parens after an argument
14:44 jnthn If the arg is a capture, then it will bind the capture against that sig.
14:44 jnthn You can use it for unpacking arrays and hashes and objects too, which all know how to coerce themselves to a capture.
14:44 gfldex i c
14:51 patspam joined #perl6
14:52 KenGuru joined #perl6
14:54 macroron joined #perl6
15:02 [1]Casan joined #perl6
15:02 whiteknight joined #perl6
15:06 Casan joined #perl6
15:11 tadzik joined #perl6
15:22 shabble joined #perl6
15:24 shabble has anyone had success building rakudo from git on osx 10.5.8? It's trying to load libicuuc.40.dylib, whereas my version is .43 (via macports)
15:27 HarryS joined #perl6
15:30 m6locks it works with snow leopard and macports
15:30 m6locks not sure about 10.5.8, but i guess it should work too
15:31 shabble I've built it successfully in the past (without libicu at all) - maybe there's something hanging around that needs to get reconfigured?
15:31 shabble I was hoping that distclean would take care of that though
15:32 m6locks oh yeah, sometimes i need to d/l the whole thing again and work it
15:32 m6locks like delete the directory and stuff
15:32 snearch joined #perl6
15:33 masonkramer joined #perl6
15:36 shabble yup, looks like nuking the whole checkout and refetching it working so far
15:36 amkrankruleuen joined #perl6
15:45 ashleydev joined #perl6
15:50 erUSUL joined #perl6
15:53 flup joined #perl6
16:03 tadzik bah, Polish heise-online: Perl 6 complete
16:03 tadzik sigh
16:04 pmichaud good morning, #perl6
16:04 tadzik hello pmichaud
16:05 shabble I'm reading the 'zomg you'll need to optimise by a million percents!!!' troll atm
16:05 pmichaud shabble: is that dkroll?
16:05 tadzik another one who needs a hug :)
16:05 pmichaud indeed.
16:05 shabble pmichaud: yep
16:06 [Coke] RT #76856 looks reasonable to me.
16:06 pmichaud I'm wondering what his agenda is.
16:06 tadzik let's maybe create a channel #perl6-haters with hugme furiously hugging anyone who joins
16:07 shabble pmichaud: new is bad! damn your pesky features!
16:08 BinGOs joined #perl6
16:09 * pdcawley pings the UK Heise editor to see if he has any pull with the Polish arm.
16:10 tadzik pdcawley: I can contact them myself, that'd be faster probably, and less beaurocracy
16:11 pdcawley Ah, yes, while I'm about it, is it possible to write (sans macros) something along the lines of 'on $pattern -> $arg { ... }', or does it have to be 'on $pattern, -> $arg {...}'?
16:11 pdcawley tadzik: True 'nuff.
16:11 masonkramer joined #perl6
16:11 pdcawley I'm guessing that the first version looks awfully like 'TERM TERM' to the parser.
16:11 tadzik also they write Parrot's included, sigh
16:12 * pdcawley should probably go read the synopses...
16:13 shabble so, err, now I've got it working, what should I do/read? :)
16:13 pmichaud pdcawley: it'd have to be the latter.
16:13 pmichaud anything else would require a macro or some new parsing consruct.
16:14 pdcawley Hrrm... one gets so used to Ruby's optional block after every method call...
16:14 tadzik what does an arrow (->) mean in here?
16:15 pdcawley Makes a block.
16:15 pdcawley with arguments given after the arrow and before the {
16:16 tadzik I see
16:16 pdcawley star: sub test { -> { return 10 }.(); 20 }; say test
16:16 p6eval star 2010.07: OUTPUT«10␤»
16:16 masonkramer_ joined #perl6
16:17 darkop joined #perl6
16:18 tadzik hmm
16:18 tadzik "Rakudo Star" is a distribution that includes (...) version 2.6.0 of the Parrot Virtual Machine
16:18 pdcawley star: sub test1(&block) { &block->(); 20 }; sub test2 { test1(-> { return 10 }); 30 }; say test2()
16:18 p6eval star 2010.07: OUTPUT«===SORRY!===␤Unsupported use of ->(), ->{} or ->[] as postfix dereferencer; in Perl 6 please use .(), .[] or .{} to deref, or whitespace to delimit a pointy block at line 22, near "); 20 }; s"␤»
16:18 tadzik does it? IIRC it warns when Parrot is not present and offers to download it itself
16:19 pdcawley Bugger.
16:19 cmadsen tadzik, no the rakudo-star tarball includes Parrot
16:20 pdcawley star: sub test1(&block) { &block.(); 20 }; sub test2 { test1(-> {return 10}); 30 }; say test2()
16:20 p6eval star 2010.07: OUTPUT«30␤»
16:20 pdcawley Ah... I was sort of hoping that would say '10'
16:20 tadzik oh right
16:27 pdcawley Hmm... reading synopsis 4, it looks like it _should_ say 10...
16:28 erUSUL left #perl6
16:28 pdcawley 'return always returns from the lexically surrounding sub or method definition. ... Pointy blocks and bare closures are transparent to return'
16:29 jnthn pdcawley: I think you're right and Rakudo is wrong here.
16:29 pdcawley Yeah, it's not like I'm trying to make a continuation through the back door...
16:30 pdcawley In fact, according to the synopsis, if I let that pointy escape, the return is illegal and I should use 'leave'.
16:30 pmichaud we know that rakudo doesn't yet support lexical return.
16:30 pdcawley Ah. Right ho.
16:30 jnthn Ah, yes...
16:30 jnthn Or generally looking for exception handlers lexically.
16:30 pdcawley I won't raise a bug report then.
16:31 pmichaud RT #61126
16:31 frooh star: class Bar { for <foo bar> { &{$_} = sub { say $_ } } }; my $b = Bar.new; $b.foo;
16:31 p6eval star 2010.07: OUTPUT«Could not find sub &␤  in <anon> at line 22:/tmp/YjJQNSFkkR␤  in main program body at line 1␤»
16:31 pdcawley Where is the Rakudo RT btw?
16:32 pdcawley Not leaping out at me from perl6.org
16:32 pmichaud https://rt.perl.org/rt3/
16:32 frooh star: class Bar { for <foo bar> { *{$_} = sub { say $_ } } }; my $b = Bar.new; $b.foo;
16:32 p6eval star 2010.07: OUTPUT«Cannot modify readonly value␤  in '&infix:<=>' at line 1␤  in <anon> at line 22:/tmp/VLzVPy4rrw␤  in main program body at line 1␤»
16:32 pmichaud frooh: what are you wanting *{$_} to do here?
16:32 pmichaud I don't grok that syntax.
16:33 pmichaud (neither does Rakudo, really)
16:33 frooh pmichaud: like in p5; *($foo} would be like doing *foo
16:33 frooh to add a method
16:33 frooh or function or whatever
16:33 frooh symbol table stuff
16:33 pmichaud adding a method would have to take place through the metaclass
16:33 frooh oh right...
16:33 pmichaud it's not just poking a sub into a namespace
16:34 pdcawley our &foo := sub { say $_ } doesn't work?
16:34 pmichaud that creates a subroutine named &foo, yes.
16:34 pmichaud but that's not a method.
16:34 pdcawley But not a method.
16:34 kthakore joined #perl6
16:34 frooh pmichaud: so is the package var __CLASS__ in a class?
16:34 kthakore moritz_: guess what :D SDL_Manual.letter.pdf
16:34 pdcawley methods != subs in perl6. Which is good. :)
16:35 pmichaud frooh: no
16:35 kthakore pmichaud: guess what. http://sdlperl.ath.cx/SDL_Manual.letter.pdf . I plundered the code. This is for a grant for TPF. Is it ok if I used the perl6 book's format?
16:36 kthakore jnthn: ^^
16:37 pmichaud kthakore: I don't have a problem with it, but I'm not the original author.  You might check with moritz_ and/or chromatic about it.
16:38 kthakore pmichaud: ok
16:38 kthakore pmichaud: I don't use the pretty adobe fonts. And I give credit to the perl6  book
16:38 frooh pmichaud: I can't seem to find in S12 how to get at the metaclass
16:38 kthakore also I finally got perl6 compiled on Debian!!!!
16:38 kthakore \o/
16:39 kthakore party party party
16:39 kthakore :D
16:39 tadzik :)
16:39 * kthakore wonders if he should attempt a ubuntu package for inter 32
16:39 kthakore intel*
16:39 [Coke] 03:18 < TiMBuS> i'd stick with the synopses, maybe the apocalypses
16:39 [Coke] TiMBuS: no, just the syn. apoc are also historical.
16:40 [Coke] 01:32 < MAK___> hello world program runs without v6
16:40 [Coke] not that he's here, but the v6 isn't for rakudo, it's for perl5 and for people reading the code.
16:40 pmichaud frooh: .HOW
16:40 jnthn frooh: ClassName.^add_method('name', method ($args) { ... });
16:41 pmichaud afk, errands
16:41 frooh jnthn: so I have to use ClassName even if I am in the class?
16:41 kthakore pmichaud: be careful!
16:41 frooh jnthn: there's no shortcut?
16:41 kthakore pmichaud: watch out for ninjas!
16:41 * frooh greps .HOW in s12
16:42 TiMBuS [Coke], well yeah the synopsis is the best, but the apocalypses are sometimes good for explaining things. code examples and all that. plus most changes to the spec are annotated in
16:42 jnthn frooh: Not an implemented one. I think in the future $?CLASS should also work.
16:42 frooh ok.
16:42 TiMBuS the perl6 books are probably better
16:42 frooh I cna use the full name for now
16:42 frooh jnthn: why .^add instead of just .add?
16:42 tadzik meta-method, yep?
16:43 frooh is that what ^ means?  .HOW ?
16:43 frooh I thought it was for the first method that implemented that method
16:43 tadzik frooh: like ^methods, no?
16:43 tadzik the first object, you mean?
16:43 frooh I have no clue
16:43 tadzik I'm always confused with twigils
16:44 frooh tadzik: I just know what jnthn said :-)
16:44 kthakore I compiled rakudo* but how do I make a symbolic link to /usr/local/bin
16:44 kthakore so I can use it where ever?
16:44 kthakore will that work?
16:44 tadzik yep
16:44 tadzik I have a symlink in ~/bin
16:44 kthakore tadzik: ok what of the lib and what not?
16:44 jnthn frooh: .^add_method does a call on the meta-class.
16:45 tadzik with just Rakudo you can make install
16:45 jnthn .add_method would do a call on the object.
16:45 kthakore it installs in the same dir
16:45 jnthn And the object doesn't have an add_method mehtod.
16:45 kthakore tadzik: is there a prefix?
16:45 tadzik and then symlink. Not sure how R* will go, I'm unable to package it still, so I'm keeping every module separate
16:45 tadzik kthakore: there's no DESTDIR, that's quite painful
16:45 rurban Can I ask about rakudo-star packaging?
16:46 tadzik Don't ask to ask, just ask :)
16:46 rurban I mean is pmichaud here? :)
16:47 tadzik you mean "is DESTDIR fixed yet"? :)
16:47 rurban Ok, question is: rakudo star is a bundle of parrot (ext), rakudo (included) and some modules
16:47 frooh rurban: yessir
16:47 rurban Will the included rakudo always be the same as the monthly releases or some in-between?
16:47 rurban Because I already package parrot and rakudo (short afterwards)
16:47 tadzik well, even in Star it's not the monthly release, iirc
16:48 rurban So if a package -star, I want just to add the included modules, not another rakudo
16:48 jnthn rurban: We'd *like* to use the monthly compiler release in the star distribution releases.
16:48 frooh is there a $ENV-like thing in rakudo yet?
16:48 jnthn rurban: However, this month it wasn't possible (the compiler release went out with a nasty bug or two that we really wanted to fix pre-*)
16:48 jnthn frooh: %*ENV
16:49 rurban Now rakudo is not en external dependency (because I newer one is included), so I have to uninstall the old rakudo and install the included
16:49 robinsmidsrod jnthn: what does the %* thing mean?
16:49 frooh excellent
16:49 jnthn % means it's a hash
16:49 rurban Ok, so I will think something up for this 1st release (cygwin), the next will go smoother hopefully.
16:50 jnthn * means it is dynamically scoped
16:50 tadzik like 'global'?
16:50 robinsmidsrod jnthn: dynamically scoped - same definition as in perl5 docs?
16:50 jnthn rurban: Yeah, I'm not sure to what degree we can commit to using the released compiler in future releases of Star at this point, but it's certainly a goal.
16:51 jnthn rurban: I hope we can next time.
16:51 jnthn robinsmidsrod: As in, it looks down the call chain until it finds something that declares a %*ENV, and if nothing in there matches it falls back to looking in the PROCCES package.
16:51 robinsmidsrod so %ENV, @INC and @ARGV is now %*ENV, @*INC and @*ARGV?
16:51 frooh in p6 is there a similar idiom to my %x; @x{ @foo } = ( 0 .. $#foo ) ?
16:51 rurban well, Ican just wait for star and ship that included rakudo. Just the numbers will get people confused. It's rakudo-star not rakudo then
16:51 jnthn rurban: Correct.
16:51 rurban hmm...
16:52 jnthn oh, cah
16:52 jnthn robinsmidsrod: correct
16:52 jnthn rurban: Well, Rakudo Star is a "distribution release" that bundles a bunch of stuff.
16:52 jnthn rurban: The compiler releases are just the compiler.
16:53 rurban I don't want to release both.
16:53 kthakore Woot!
16:53 kthakore tadzik: it worked!!!
16:53 robinsmidsrod jnthn: thanks!
16:53 tadzik kthakore: why not? :)
16:54 kthakore tadzik: now how to load parrot modules ....
16:54 kthakore I have a SDL.pmc here
16:54 rurban And I'm pretty sure parrot-devel is still not usable at all.
16:54 frooh star: my %foo; my @a = <a b c>; %foo{@a} = 0 .. @a.size; %foo.perl.say
16:54 jnthn frooh: Yeah, let me think a moment...
16:54 p6eval star 2010.07: OUTPUT«Method 'size' not found for invocant of class 'Array'␤  in main program body at line 22:/tmp/5LeM_6_EEX␤»
16:54 tadzik kthakore: how about 'use SDL'?
16:54 tadzik frooh: .elems
16:54 frooh star: my %foo; my @a = <a b c>; %foo{@a} = 0 .. @a.length; %foo.perl.say
16:54 p6eval star 2010.07: OUTPUT«Method 'length' not found for invocant of class 'Array'␤  in main program body at line 22:/tmp/lLjuoLGzzv␤»
16:54 tadzik frooh: .elems :)
16:54 kthakore tadzik: that works?
16:54 kthakore crazy!
16:54 frooh star: my %foo; my @a = <a b c>; %foo{@a} = 0 .. (@a.elems - 1); %foo.perl.say
16:55 p6eval star 2010.07: OUTPUT«{"a" => 0, "b" => 1, "c" => 2}␤»
16:55 tadzik kthakore: I don't know
16:55 jnthn frooh: Is taht the output you're looking for?
16:55 frooh yessir
16:55 jnthn star: my %foo; my @a = <a b c>; %foo{@a} = ^@a;
16:55 p6eval star 2010.07:  ( no output )
16:55 jnthn star: my %foo; my @a = <a b c>; %foo{@a} = ^@a; %foo.perl.say
16:55 p6eval star 2010.07: OUTPUT«{"c" => 2, "a" => 0, "b" => 1}␤»
16:55 frooh oh nice
16:55 frooh oh yeah
16:55 frooh ^ == upto
16:56 frooh very good
16:56 jnthn ^ means "construct a range from 0 up to this"
16:56 [Coke] TiMBuS: the code examples in the apoc are old and out of date with respect to the spec, no?
16:56 jnthn And it puts @a in numeric context.
16:56 frooh right
16:56 jnthn So it does just what you want :-)
16:57 [Coke] rurban: what is "parrot-devel"? the old install target?
16:57 [Coke] (it's just "install" now. and there is a reported bug about it not working, with the known workaround of copying libparrot.)
16:57 achromic joined #perl6
16:57 frooh star: for <a b c> -> $x { say $x }
16:57 p6eval star 2010.07: OUTPUT«a␤b␤c␤»
16:58 patspam1 joined #perl6
16:58 kthakore tadzik: ok chores ... then trail!
16:58 kthakore :D
16:59 rurban parrfot-devel is the package with which parrot-language developer shoudl be able to work without needing to install parrot-src. As it is in the real world
17:00 [Coke] gotcha.\
17:00 TiMBuS [Coke], i remember reading them about a year ago for some reason, and most examples worked when you added the changes noted in the footnotes. But yes they are old and not to be taken as official documentation
17:00 frooh is there a way I can do perl6 -Ilib or somesuch?
17:00 ruoso joined #perl6
17:01 tadzik frooh: PERL6LIB+=foo perl6
17:01 rurban And my patches are still forgotton. My perl6 patches are applied immedately in contrary
17:01 frooh ah
17:01 frooh tadzik: ty
17:01 rurban But parrot is doomed anyway, so I don't care.
17:02 tadzik define: doomed
17:03 rurban tadzik: no
17:04 rurban rakudo-star DESCRIPTION="Perl6 modules" okay? (short desc)
17:04 tadzik what do you mean "no"? And what do you mean DESCRIPTION?
17:04 tadzik R* is not the modules compilation
17:05 [Coke] rurban: you are the crankiest person I know in the perl community. Just FYI. =-)
17:06 jnthn rurban: It also includes docs too, and should also include module installation tools etc
17:06 jnthn rurban: It's more giving you a development environment around the compiler.
17:06 rurban tadzik: http://lists.parrot.org/pipermail/​parrot-dev/2009-April/002063.html
17:07 rurban "Perl6 modules plus docs and tools" right?
17:08 jnthn rurban: That's closer to the truth, yes.
17:08 rurban I need to come up with some kind of spec file
17:08 jnthn rurban: pmichaud++ may have a preferred phrasing.
17:08 rurban How's debian or fedora planning to do that?
17:08 tadzik rurban: so? It seems like it was back in 1.1.0 times, and I'd say Parrot is still doing fine
17:08 rurban doomed I said pre 1.0 and it still is.
17:09 rurban It became even worse
17:09 rurban coke: mst is for sure more cranky than me
17:09 [Coke] hugme: hug rurban
17:10 frooh jnthn: http://paste.scsys.co.uk/47427 <-- ideas?
17:10 [Coke] rurban: not in my personal experience, for what that's worth.
17:10 [Coke] oh no, no hugmebot?
17:10 frooh rurban: mst is only cranky if you say silly things to him :-)
17:10 jnthn frooh: $name =>
17:10 jnthn frooh: Wants to be $name,
17:10 frooh oh yeah
17:11 frooh I forgot => != , in p6
17:11 jnthn frooh: but $self.!log is your problem
17:11 jnthn What are you trying to do, call a private method for get an an attribute?
17:11 jnthn *or
17:11 frooh clal private method
17:11 jnthn just !
17:11 jnthn not .!
17:11 frooh I guess I just take out $self?
17:11 frooh ah
17:11 frooh great
17:11 jnthn and it's self
17:11 jnthn not $self
17:12 frooh ohh
17:12 frooh so self!log?
17:12 frooh or just !log?
17:12 jnthn self!log
17:12 frooh k
17:12 jnthn $self.$is_name
17:13 jnthn wants to be self.is_name ?
17:13 [Coke] left #perl6
17:13 frooh no, that's "is_$name"
17:13 jnthn ok
17:14 frooh aww
17:14 frooh even after replacing => with , I still get the error
17:14 jnthn Then you'll want parens after the call
17:14 frooh k
17:14 jnthn __END__ # oh, I'm not sure if that's valid Perl 6. :-)
17:14 jnthn std: __END__
17:14 p6eval std 31883: OUTPUT«[31m===[0mSORRY![31m===[0m␤Undeclared name:␤ '__END__' used at line 1␤Check failed␤FAILED 00:01 114m␤»
17:14 jnthn Yeah, it'll just try for a sub call.
17:14 frooh that's not actually in there
17:14 frooh that's just the paste
17:14 jnthn ah, ok
17:14 jnthn :-
17:14 jnthn :-)
17:15 frooh oh wait it is!
17:15 frooh lolz
17:15 frooh jnthn: http://paste.scsys.co.uk/47428
17:15 frooh same error, same line
17:15 frooh that's the whole thing
17:15 frooh thoughts?
17:16 tadzik frooh: for required -- has $.foo = die "foo is required"
17:16 frooh tadzik: ah thanks
17:16 tadzik you will enjoy moritz_++'s "common Perl 6 idioms"
17:16 frooh yeah, I still have it in my feed reader
17:17 frooh but yeah, still have syntax error
17:18 pmichaud back again
17:18 tadzik paste the error then :)
17:18 frooh tadzik: http://paste.scsys.co.uk/47427
17:18 frooh I put error after __END__
17:18 frooh but that's not actually in the code
17:18 frooh (also note that it now says $is_name())
17:19 jnthn frooh: Ooh!
17:19 jnthn Yeah, crappy error
17:19 frooh ?
17:19 jnthn frooh: Anything at all in the form foo() is a method call
17:19 jnthn That includes method()
17:19 frooh oh
17:19 frooh so I need a space
17:19 jnthn frooh: So method (*@_) {
17:19 jnthn Not method(*@_) {
17:19 jnthn Right.
17:20 pdcawley Hmm... if I have a collection and I'd like to be able to extend it by doing, say, '$collection, $new_member', could I define a 'method infix:<,>($elem) { $?CLASS.new(:members<*@!members, $elem> }' or some such?
17:20 frooh I know that the significant space will bite a lot of people, but I think it's one of the best thigns about perl 6
17:20 pdcawley or is comma not really an operator?
17:20 frooh I love me some foo-bar methods
17:20 aCiD2 joined #perl6
17:20 jnthn pdcawley: It is really an operator.
17:21 justatheory joined #perl6
17:21 pdcawley and 'multi'-able?
17:21 frooh woo, successful compile!
17:21 jnthn pdcawley: Though for operator definitions you want to be writing a multi sub really
17:21 pdcawley Gotcha.
17:21 pmichaud &infix:<,> in Rakudo is presently pretty "core" -- overloading it is likely to cause all sorts of issues.
17:21 pdcawley Presumably semicolon isn't an operator :)
17:21 jnthn Though overriding , could be...interesting ;-)
17:21 jnthn No. :-)
17:22 pdcawley pmichaud: Wimp!
17:22 pmichaud ummmm, semicolon might become an operator.
17:22 jnthn On your own head be it. ;-)
17:22 jnthn pmichaud: oh boy, I can't wait for people to start overloading that one. ;-)
17:22 pmichaud i.e., there very well could be an &infix:<;>
17:22 jnthn Oh, true.
17:22 pmichaud jnthn: well, it would likley be invoked only in arg lists.
17:22 pdcawley jnthn: That's essentially what monads do in Haskell.
17:22 pmichaud and would build a Slicel instead of a Parcel
17:23 jnthn pmichaud: oooh...that makes...an interesting sort of sense. :-)
17:23 jnthn pdcawley: Yeah, I still need to learn Haskell. :-)
17:23 pmichaud so we can handle   @a[1..5;$b;*]
17:23 pmichaud and   foo(1..5;$b;*)
17:24 pdcawley Hrm... thinking about this, the Smalltalk library I'm looking at gets to use ',' for building collections in the way it does 'cos the comma isn't really used for anything else, so it's just convenience...
17:24 jnthn Yeah, I'd seen that as being syntactic, but it makes sense.
17:24 pdcawley Ah well, suck it and see, I guess :)
17:24 jnthn pmichaud: Did you read through my parrot-dev epic mail yet? :-)
17:24 pmichaud jnthn: I did. looked good.  I'm not sure they'll grok it yet, though.
17:25 jnthn pmichaud: I'm hopeful that chromatic++ will.
17:25 frooh so I can't do temp %*ENV{foo} = 1, but it's dynamically scoped already so I don't have to?
17:25 h1gh joined #perl6
17:25 ingy jnthn: is there a url for it?
17:25 jnthn ingy: Probably...but I woudln't know where to look off hand...
17:25 ingy nod
17:25 pmichaud I can find it -- one moment
17:26 pdcawley star: class Foo { method test { say $?CLASS.perl } }; Foo.new.test
17:26 p6eval star 2010.07: OUTPUT«===SORRY!===␤Symbol '$?CLASS' not predeclared in test (/tmp/JNj0IKSKfG:22)␤»
17:26 pmichaud http://lists.parrot.org/pipermail​/parrot-dev/2010-July/004536.html
17:26 pdcawley Right, that doesn't work yet then :)
17:26 frooh aww, env is readonly?
17:26 pdcawley local %ENV{KEY} = 'whatever' doesn't work?
17:27 pmichaud Perl 6 doesn't have a 'local', afaik
17:27 frooh it's called temp from what I hear
17:27 frooh and it's NYI
17:27 pdcawley Ah.
17:28 pmichaud we might be able to create a form of 'temp' that works some of the time... but it'd fail if any exceptions got thrown
17:28 pmichaud i.e., it wouldn't 'undo' the temp part
17:29 frooh pmichaud: yeah, I'm faking it for the most part that way by just manually resetting stuff
17:29 frooh pmichaud: but is there really no way to do %*ENV<foo> = 1?  I thought you guys got that working a while back
17:29 pmichaud that was working in alpha, not presently working in star
17:30 frooh ah, ok
17:30 * frooh has alpha already :D
17:31 pmichaud I could re-do the cheat I had in place for %*ENV in alpha.
17:31 pmichaud that wouldn't be too difficult.
17:31 frooh eh, up to you
17:31 frooh I can use alpha for a while
17:31 frooh I know I won't be able to port this 100% for a while
17:32 pmichaud where "this" === ...?
17:32 frooh I need caller and temp; but might as well get started to see how things are looking
17:32 frooh Log::Contextual
17:32 pmichaud what do you need from caller?
17:32 frooh simple logging module
17:32 frooh the package name
17:32 frooh iirc it's not in callframe yet
17:32 frooh we looked last night
17:32 pmichaud package wouldn't be too hard to add, though.
17:33 pdcawley Drat. When I do multi sub infix:<,>(Some::Collection $a, $b) { Some::Collection.new($a.append($b)) } and then do '$instance_of_some_collection, 10, 20', say, I get 'No applicable candidates to dispatch to for infix:<,>'
17:33 frooh pmichaud: didn't think so
17:33 pdcawley Am I declaring my infix wrong?
17:33 pmichaud I don't think rakudo has &infix:<,> as a multi at the moment.
17:33 frooh pmichaud: if you can wait; I'd love to do it myself on the next p6 meeting
17:34 frooh pmichaud: but if you wanna do it yourself that's obv fine too
17:34 pmichaud beyond that, there's a problem that &infix:<,> is so low-level that we can't easily write it in the setting
17:34 * frooh builds alpha
17:34 h1gh left #perl6
17:34 pmichaud (so at present, &infix:<,> is probably not able to be multi'd in star)
17:34 jnthn pmichaud: Maybe we can make it a p6ms
17:35 pdcawley pmichaud: So, basically, override infix:<+> or something and have done?
17:35 jnthn Time to go get some noms for dinner. :-)
17:35 pmichaud pdcawley: for the current version of star, yes.  :)
17:35 pmichaud jnthn: I guess I should probably rewrite things in terms of Parcel.new, and switch &infix:<,> to use that.
17:35 pdcawley Would I be right in thinking that overriding << is probably a bit twitchy as well?
17:36 pmichaud which is a bit backwards from an optimization perspective, since &infix:<,> is far more common than Parcel.new
17:36 pmichaud oh, I think overriding &infix:<<<> should be just fine
17:36 pmichaud it's very *not* low-level.
17:36 pmichaud star:  multi infix:«<<»(Str $a, Str $b) { "$a << $b" };  say 'hello' << 'world';
17:36 p6eval star 2010.07: OUTPUT«===SORRY!===␤Unsupported use of << to do left shift; in Perl 6 please use +< or ~< at line 22, near "$b\" };  sa"␤»
17:37 pdcawley Can I override &infix:<<<=> as well?
17:37 pmichaud oh
17:37 pmichaud nm
17:37 pmichaud << isn't an operator.
17:37 pdcawley Ah. Thought it was.
17:37 pmichaud pdcawley: why not just define your own operator?  ;-)
17:38 pmichaud star:  multi infix:«←»(Str $a, Str $b) { "$a << $b" };  say 'hello' ← 'world';
17:38 p6eval star 2010.07: OUTPUT«===SORRY!===␤Unsupported use of << to do left shift; in Perl 6 please use +< or ~< at line 22, near "$b\" };  sa"␤»
17:38 pdcawley Yeah, that'd make sense too.
17:38 frooh hahaha
17:38 pmichaud ....huh?!?
17:38 frooh error message ate it!
17:38 pdcawley shouldn't that be multi sub infix:... ?
17:38 pmichaud star:  multi infix:«←»(Str $a, Str $b) { "$a << $b" };  say 'hello' ← 'world';
17:38 p6eval star 2010.07: OUTPUT«===SORRY!===␤Unsupported use of << to do left shift; in Perl 6 please use +< or ~< at line 22, near "$b\" };  sa"␤»
17:38 pmichaud star:  multi sub infix:«←»(Str $a, Str $b) { "$a << $b" };  say 'hello' ← 'world';
17:38 p6eval star 2010.07: OUTPUT«===SORRY!===␤Unsupported use of << to do left shift; in Perl 6 please use +< or ~< at line 22, near "$b\" };  sa"␤»
17:38 pdcawley That's definitely weird.
17:38 frooh pmichaud: do you need to replace << with +< maybe?
17:38 pdcawley In a _string_?
17:38 frooh you are using << and if it's not an op...?
17:39 frooh oooh
17:39 * frooh can't read
17:39 pmichaud I suspect an overeager interpolator.
17:39 pmichaud star:  multi sub infix:«←»(Str $a, Str $b) { "$a <- $b" };  say 'hello' ← 'world';
17:39 p6eval star 2010.07: OUTPUT«hello <- world␤»
17:39 pmichaud grrrr
17:39 pdcawley Yay! Bug!
17:39 pmichaud rakudo is thinking that the "<<" following a variable is some sort of operator.
17:39 * pmichaud files bug
17:40 pmichaud star:  my $a = 3;  my $b = 4;   say "$a << $b";
17:40 p6eval star 2010.07: OUTPUT«===SORRY!===␤Unsupported use of << to do left shift; in Perl 6 please use +< or ~< at line 22, near "$b\";"␤»
17:40 pdcawley star: my $a = 3; my $b = 4; say "$a + $b"
17:40 p6eval star 2010.07: OUTPUT«3 + 4␤»
17:40 pdcawley Looks like that contextual warning's not being picky enough about it's context.
17:41 melte same with >>
17:41 pmichaud it has to do with the part of the parser that is looking to see if there's any postcircumfix operator on the variable
17:41 pmichaud i.e.,   with   "$a.xyz() something"
17:41 pdcawley Because <, or <<, or whatever, looks brackety.
17:41 pmichaud the parser has to look ahead beyond $a to see if there's a valid postfix method call or operator
17:42 pmichaud and apparently rakudo is getting into the part of the parse that is trying to warn against a p5-ism
17:42 pdcawley star: sub test($arg) { say $arg }; test (99)
17:42 p6eval star 2010.07: OUTPUT«99␤»
17:42 pmichaud (it shouldn't get there at all... the whitespace should prevent it.)
17:42 pdcawley You know, I'd thought that whitespace between the function and the opening brace was illegal.
17:42 pmichaud it is.
17:43 aCiD2 Coming back to operator overloading that was mentioned earlier - is that possible atm? In my SQL generation stuff I'd much rather have where($table.column('foo') == 5) than where($table.column('foo'), '=', 5)
17:43 pmichaud that "look ahead for postfix methods"  part of interpolation causes no end of trouble.  I continue to prefer the curly braces if you want to do that.
17:43 pdcawley But test (99) is legal because, presumably, parens have their usual precedence affecting mojo in that context.
17:44 eternaleye joined #perl6
17:45 pdcawley aCiD2: Presumably if $table.column('foo') is returning an object of the appropriate type (ColumnSpec, say), then you'd just write multi sub infix:<==>(SqlType $a, SqlType $b) {...} and have it return a SqlTerm or whatever.
17:45 aCiD2 pdcawley: that's hella cool :) I didn't know you could declare that infix stuff
17:46 pdcawley I don't know if you can!
17:46 aCiD2 :D
17:46 pdcawley star: multi sub infix:<==>(Str $a, Str $b) { "$a == $b" }; say '10' == 'Thing'
17:46 p6eval star 2010.07: OUTPUT«10 == Thing␤»
17:46 pdcawley w00t!
17:46 pdcawley Overloadable == ftw!
17:46 aCiD2 let me just get my jaw off the floor
17:46 pdcawley About frogging time.
17:47 pdcawley Presumably &infix:<||> et al. also just work.
17:47 pmichaud no
17:47 pmichaud short-circuit operators have issues
17:47 aCiD2 i can infix anything I want, right? or only predefined operators?
17:47 pdcawley Oh. Yes. Of course they do.
17:47 pmichaud there's a spec design detail to be handled there
17:47 pmichaud (i.e., how does an operator indicate that it needs its arguments to be thunked)
17:47 pdcawley aCiD2: Yeah. Just infix the Unicode symbols for or/and/xor or whatever.
17:48 pdcawley Yeah, || is a special form, needs to be defined as a macro. But you don't have macros...
17:48 aCiD2 Well, I was probably not going to go as far as overloading for adding boolean operators
17:48 aCiD2 just being able to overload == is good enough for now
17:48 pmichaud star:  multi sub infix:<anything-you-want>($a, $b) { "any $a you $b" };   say  'way' anything-you-want 'go';
17:48 p6eval star 2010.07: OUTPUT«any way you go␤»
17:48 aCiD2 ahaaha, that opens up some crazy possibilities
17:49 aCiD2 are we able to do vary the precedence like Haskell?
17:49 tadzik wait for slang keyword :)
17:49 aCiD2 s/do//
17:49 pmichaud perl 6 defines traits for changing the precedence;  nyi in rakudo
17:49 aCiD2 ok
17:49 pdcawley pmichaud: Presumably a friendly mechanism is proto infix:<anything-you-want>($a, $b) { fail "Dunno how to handle those types" }, and then sub infix:<anything-you-want>(Type $a, OtherType $b) {...} just add to the multi-bundle.
17:50 aCiD2 there's too much cool shit here, I am so learning enough perl 6 to be able to contribute some patches :)
17:51 aCiD2 hrm, how do I write an infix for >? infix:<>> ?
17:51 darkop perl6: the more I read about it, the more I like it. I am wondering: is there a way to declare attributes as writeble inside the class, but only readable outside it?
17:51 p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Confused at line 22, near "the more I"␤»
17:51 p6eval ..pugs: OUTPUT«*** ␤    Unexpected " I"␤    expecting ".", "\187", ">>", "=", "^", operator name, qualified identifier, variable name, "...", "--", "++", "i", array subscript, hash subscript or code subscript␤    at /tmp/T_kcCX0wMO line 1, column 46␤»
17:51 darkop ups :)
17:51 aCiD2 heh
17:52 tadzik I think you can write them using the private accessor
17:52 pdcawley Use the guillemet thingies.
17:52 darkop right now i have "has $!pcounter; method counter () { return $!pcounter }"
17:52 tadzik star: class foo {has $.bar; method baz { $!bar = 5 }}; my $a = foo.new(bar => 3); foo.baz; say foo.bar;
17:52 p6eval star 2010.07: OUTPUT«Type objects are abstract and have no attributes, but you tried to access $!bar␤  in 'foo::baz' at line 22:/tmp/jLQfCEiBT1␤  in main program body at line 22:/tmp/jLQfCEiBT1␤»
17:53 tadzik hrm
17:53 frooh tadzik: did you mean to do $a.baz?
17:53 jdv79 is it just parrot that's holding back IPC in rakudo?
17:53 tadzik frooh: oh sure
17:53 tadzik star: class foo {has $.bar; method baz { $!bar = 5 }}; my $a = foo.new(bar => 3); $a.baz; say foo.bar;
17:53 p6eval star 2010.07: OUTPUT«Type objects are abstract and have no attributes, but you tried to access $!bar␤  in main program body at line 22:/tmp/dImYqyJD5I␤»
17:53 tadzik damn
17:53 pmichaud darkop: "has $.xyz"   declares that  $foo.xyz  is readable but not writable.
17:54 tadzik star: class foo {has $.bar; method baz { $!bar = 5 }}; my $a = foo.new(bar => 3); $a.baz; say $a.bar;
17:54 p6eval star 2010.07: OUTPUT«5␤»
17:54 tadzik gotcha
17:54 frooh PackFile_unpack: This Parrot cannot read bytecode files with version 8.0 <-- how do I delete the old bytecode?
17:54 pdcawley aCiD2: infix:«<»($a, $b) should work.
17:54 frooh I tried make clean
17:54 aCiD2 pdcawley: I have to use the unicode characters?
17:54 pmichaud frooh: might need to remove any parrot* directory altogether
17:54 frooh k
17:54 darkop pmichaud: is it writable within a class? (i think i tried that before)
17:55 pdcawley Not sure, pmichaud or jnthn or one of the other perl6 hackers probably know though.
17:55 pmichaud darkop: yes, but as $!xyz
17:55 darkop oh, cool1
17:55 darkop pmichaud: thanx!
17:55 pmichaud inside the class you use $!xyz, $.xyz becomes the read-only interface
17:55 pdcawley Or do the Pod rules for E<< $f-> >> apply?
17:57 pmichaud if your operator contains < or >, you probably want to use  « and »
17:57 pdcawley star: multi sub infix:<< > >>(Str $a, Str $b) { "$a > $b" }; say "foo" > "bar"
17:57 lue hello o/
17:57 p6eval star 2010.07: OUTPUT«0␤»
17:57 * frooh likes chromatic's post comparing rakudo and perl5 + lots of modules
17:57 pmichaud frooh: yeah, dkroll is being a bit obtuse by not understanding just how much performance improvement is possible.
17:58 pmichaud (I think he must have some other purpose/agenda)
17:58 tadzik I wonder how much the criticisers know about compiler design and optimizations
17:58 frooh pmichaud: wes was telling me that on reddit they were all like, "SOFTWARE NEVER GETS FASTER!  ONLY MORE BLOATED!"
17:58 pdcawley pmichaud: Ah well, he's put up a dumb straw man argument, going to be relatively easy to topple it later :)
17:58 frooh it's like people have never used .. I dunno, the jvm :-)
17:58 frooh which is markedly faster than early releases
17:58 pmichaud frooh: or even C
17:59 pmichaud frooh: or Pascal
17:59 frooh right, variosu compilers indeed
17:59 pmichaud or Lisp
17:59 pmichaud or Haskell
17:59 frooh as wes said, they are comparing compilers and Nero
17:59 pmichaud the odd thing is that Rakudo itself disproves the argument
17:59 dwhipp joined #perl6
17:59 frooh how so?
18:00 pmichaud look at our timings of the spectests over Rakudo's development
18:00 frooh I thought that was a function of nqp mostly
18:00 pmichaud spectest runs have remained fairly constant -- around 30 minutes
18:00 pmichaud but the size of the suite has quadrupled
18:00 pmichaud (actually, quintupled)
18:00 tylercurtis joined #perl6
18:01 pmichaud and I'm pretty sure the latter 20K tests were testing more complex features than the first 5K  :)
18:01 pdcawley Have you got a regression in there for 'suite took longer to run than last time on this machine'?
18:01 pdcawley :)
18:01 frooh heh
18:01 pmichaud pdcawley: that's usually not a regression -- it's often "progress"
18:01 Su-Shee (imagine the twitter possibilities if it has sixtupled.. :)
18:01 pmichaud i.e., the suite takes longer because we pass more tests.
18:01 pdcawley Or at least, took more than 50% longer to run than the last time...
18:01 pmichaud oh, we'd notice a 50% regression.  :)
18:01 pdcawley pmichaud: Yeah, but if you're not getting faster at the same time...
18:02 pdcawley spec test is getting to slow! Time to optimize the fscker!
18:02 pdcawley too slow, sorry.
18:03 dwhipp joined #perl6
18:03 dwhipp rakudo: multi f(1) { 1 }; multi f($x) { $x * f($x-1) }; say f(+$_) for (2,3).map: {$^x }
18:03 p6eval rakudo 9b6189: OUTPUT«2␤6␤»
18:03 dwhipp rakudo: multi f(1) { 1 }; multi f($x) { $x * f($x-1) }; say f(+$_) for (2,3).map: {$^x+1 }
18:03 p6eval rakudo 9b6189: OUTPUT«maximum recursion depth exceeded␤  in 'Int::Num' at line 3462:CORE.setting␤  in 'Int::Num' at line 3464:CORE.setting␤  in 'Int::Bridge' at line 3457:CORE.setting␤  in 'infix:<->' at line 3408:CORE.setting␤  in 'f' at line 22:/tmp/D_GY1WdqXT␤  in 'f' at line 22:/tmp/D_GY1WdqXT␤
18:03 p6eval .. in …
18:04 dwhipp why does the +1 fail? Int Vs Num on the multi dispatch?
18:05 pmichaud dwhipp: I'm not sure why it fails.
18:05 jnthn dwhipp: I normally define it as f(0)
18:06 jnthn Hmm, that maybe still doesn't explain it.
18:06 pmichaud rakudo:  multi f(1) { 1 };  multi f($x) { 'no '};  say f(1+0);
18:06 p6eval rakudo 9b6189: OUTPUT«1␤»
18:06 pmichaud rakudo:  multi f(1) { 1 };  multi f($x) { 'no '};  say f({$^x+1}(0))
18:06 * pdcawley gives his terminal a hard stare. Bugger. I have to do some locale magic to get the unicode operators working properly don't I?
18:06 p6eval rakudo 9b6189: OUTPUT«1␤»
18:07 pmichaud ....why  both 'for' and 'map', ooc?  ;-)
18:08 dwhipp That's just how I simplified my testcase
18:08 frooh pmichaud: aww, alpha can't --gen-parrot?
18:08 dwhipp rakudo: multi f(1) { 1 }; multi f(Int $x) { $x * f($x-1) }; say f(+$_) for (2,3).map: {$^x+1 }
18:08 p6eval rakudo 9b6189: OUTPUT«No applicable candidates found to dispatch to for 'f'. Available candidates are:␤:(Int  where (1))␤:(Int $x)␤␤  in main program body at line 22:/tmp/7wmfGMVFOg␤»
18:08 dwhipp rakudo: multi f(1) { 1 }; multi f(Int $x) { $x * f($x-1) }; say f(+$_) for (2,3).map: {$^x }
18:08 p6eval rakudo 9b6189: OUTPUT«2␤6␤»
18:09 jnthn dwhipp: Oh
18:09 jnthn dwhipp: +
18:09 pmichaud frooh: it should be able to --gen-part; we've done that, like, forever.
18:09 jnthn prefix:<+> returns a Num :-(
18:09 jnthn always.
18:09 jnthn Thus the fail.
18:09 frooh oh wtf
18:09 frooh it can't get to svn.parrot.org
18:09 jnthn That wants fixing...
18:09 darkop jnthn: now you just clarified the bug I encountered earlier today
18:10 jnthn Aha.
18:10 jnthn Yeah, I think there's even an RT about that issue.
18:10 darkop if <-> also returns a Num, that is :)
18:10 jnthn I'm not quiet sure what the spec says.
18:10 * frooh wonders if he's being throttled
18:10 frooh oh no, now it's working
18:10 frooh whew
18:11 * pdcawley wonders how to make emacs type that nice unicode arrow...
18:11 frooh star: STDERR.print('lolz!')
18:11 p6eval star 2010.07: OUTPUT«Could not find sub &STDERR␤  in main program body at line 22:/tmp/ghW1EQbkrx␤»
18:11 tadzik it's not about emacs, pdcawley
18:11 tadzik it's about your keymap
18:11 frooh pmichaud: in vim it's ^K ->
18:11 frooh er
18:11 frooh pdcawley: ^^
18:11 pmichaud jnthn: does   multi f(1) { ... }     imply that the argument has to be an Int?
18:12 pdcawley Ah, yes, the compose key.
18:12 jnthn pmichaud: Yes.
18:12 pmichaud hmmm
18:12 pmichaud that's annoying.
18:12 jnthn It must.
18:12 pmichaud it's not that way in smart matching.
18:12 jnthn It's correct here.
18:12 pmichaud star:   say 1e0 ~~ 1
18:12 jnthn Otherwise the candidate sorting will be wonky.
18:12 frooh how do I get to STDERR?
18:12 p6eval star 2010.07: OUTPUT«1␤»
18:12 jnthn pmichaud: Imagine otherwise if you defined multi x(1) { }; multi x(Int $x) { }
18:13 jnthn The second one would always win when passed 1.
18:13 pmichaud so, in other words:    multi sub f(1) { ... };   f(1/1)  # will never match
18:13 jnthn Right.
18:13 pmichaud okay.
18:13 pmichaud I suppose multi sub f(Any where 1) { ... }    #?
18:14 jnthn Yes
18:14 jnthn Or just $ where 1
18:14 jnthn Since default parameter type is Any
18:14 jnthn I think prefix:<+> still needs a fix though
18:14 jnthn I suspect for Numeric it should be identity.
18:14 jnthn rakudo: say (+5).WHAT
18:15 p6eval rakudo 9b6189: OUTPUT«Int()␤»
18:15 jnthn Oh. :/
18:15 pmichaud rakudo:  say (+(5+2)).WHAT
18:15 jnthn OK, that wasn't the bug then. :-S
18:15 kjeldahl_ joined #perl6
18:15 p6eval rakudo 9b6189: OUTPUT«Num()␤»
18:15 jnthn Ah, there we are.
18:15 jnthn rakudo: say (5+2).WHAT
18:15 frooh star: Boolean.new(1).say
18:15 p6eval rakudo 9b6189: OUTPUT«Int()␤»
18:15 p6eval star 2010.07: OUTPUT«Could not find sub &Boolean␤  in main program body at line 22:/tmp/Zn6dr7yufr␤»
18:15 frooh star: Bool.new(1).say
18:15 jnthn ER...
18:15 p6eval star 2010.07: OUTPUT«0␤»
18:16 frooh heh
18:16 breinbaas hi. How does DBDI compare against MiniDBI?     (I've tried MiniDBI (against pg), and it works. But it's very slow)
18:17 breinbaas (that's on rakudo-star)
18:17 frooh where is the metamodel described in the synopses?
18:19 breinbaas is DBDI going to be the 'real' DBI? (if that makes sense)
18:22 lue .oO(I wasn't aware you could say  class A is Hash  . Interesting.)
18:24 frooh star: class Foo { has $!biff = 1; method robot { say $!biff } }; my $x = Foo.new; $x.robot;
18:24 p6eval star 2010.07: OUTPUT«1␤»
18:24 frooh star: class Foo { has $!biff = 1; method robot { my $attr = "biff"; say $!$attr } }; my $x = Foo.new; $x.robot;
18:24 p6eval star 2010.07: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 22␤»
18:25 frooh star: class Foo { has $!biff = 1; method robot { my $attr = "biff"; say $!$attr() } }; my $x = Foo.new; $x.robot;
18:25 p6eval star 2010.07: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 22␤»
18:25 frooh :-/
18:25 frooh star: class Foo { has $!biff = 1; method robot { my $attr = "biff"; say self!$attr() } }; my $x = Foo.new; $x.robot;
18:25 p6eval star 2010.07: OUTPUT«Could not find sub !!dispatch_variable␤  in 'Foo::robot' at line 22:/tmp/_t9zFgLMYg␤  in main program body at line 22:/tmp/_t9zFgLMYg␤»
18:25 tylercurtis breinbaas: I don't know, but you might want to ask mberends or timbunce when they're around.
18:26 tylercurtis star: class Foo { has $!biff = 1; method robot { my $attr = "biff"; say self!"$attr"() } }; my $x = Foo.new; $x.robot; # frooh, different error.
18:26 p6eval star 2010.07: OUTPUT«Method '!biff' not found for invocant of class 'Foo'␤  in 'Foo::robot' at line 22:/tmp/JFLTknJnOI␤  in main program body at line 22:/tmp/JFLTknJnOI␤»
18:26 breinbaas tylercurtis: ok, thanks
18:27 cxreg breinbaas: I believe DBDI is meant to be a common low-level driver
18:27 cxreg not something really for end users, but MiniDBI and others could be put on top
18:28 tylercurtis frooh: $!biff is directly accessing the actual attribute storage, iiuc. It's not a private method.
18:28 frooh star: class Foo { has $!biff = 1; method robot { my $attr = "biff"; say self!"$attr" } }; my $x = Foo.new; $x.robot;
18:28 p6eval star 2010.07: OUTPUT«===SORRY!===␤Quoted method name requires parenthesized arguments at line 22, near " } }; my $"␤»
18:28 frooh hm
18:28 frooh I want the attribute storage
18:28 frooh star: class Foo { has $!biff = 1; method robot { my $attr = "biff"; say self!"$attr"; } }; my $x = Foo.new; $x.robot;
18:29 p6eval star 2010.07: OUTPUT«===SORRY!===␤Quoted method name requires parenthesized arguments at line 22, near "; } }; my "␤»
18:29 cxreg breinbaas: it's not likely that DBDI will be significantly faster though, most of MiniDBD::Pg's work is done in C code, and the slow parts are Rakudo and Parrot.  The Perl 6 part of the code is very thin.
18:29 frooh star: class Foo { has $!biff = 1; method robot { my $attr = "biff"; say !"$attr"; } }; my $x = Foo.new; $x.robot;
18:29 p6eval star 2010.07: OUTPUT«0␤»
18:29 frooh :-/
18:29 tylercurtis frooh: but self!foo calls the private method !foo on self.
18:30 frooh tylercurtis: I know
18:31 pmichaud rakudo:  say "42" ~~ 42;
18:31 p6eval rakudo 9b6189: OUTPUT«1␤»
18:32 frooh pmichaud: is there a way to access an attribute by name?
18:32 pmichaud frooh: I presume you mean in a hash-like manner?
18:33 pmichaud frooh: I'm not aware of one.
18:33 pmichaud I mean,  clearly one can do  $!name   :-)
18:33 frooh right
18:33 gfldex maybe rakudobug question, see comments: http://nopaste.voric.com/paste.php?f=80fl0t
18:33 pmichaud rakudo:  say "42" === 42
18:33 * frooh makes method !get_$attr to do it
18:33 p6eval rakudo 9b6189: OUTPUT«0␤»
18:34 * pmichaud files rakudobug
18:34 frooh star: "%s %s".sprintf("frew", "bar").say
18:34 p6eval star 2010.07: OUTPUT«frew bar␤»
18:34 pmichaud .oO(Can't believe that masak++ missed these!  Or perhaps there are bug reports already?)
18:36 diakopter who could know? ;)
18:36 pmichaud star:  say "42" ~~ 42;   say "42" === 42;
18:36 p6eval star 2010.07: OUTPUT«1␤0␤»
18:38 pmichaud star:  say 42.ACCEPTS("42");
18:38 p6eval star 2010.07: OUTPUT«1␤»
18:38 pmichaud star:  say 42.ACCEPTS(42.0);
18:38 p6eval star 2010.07: OUTPUT«1␤»
18:38 pmichaud ......that's going to be an interesting one to resolve.
18:39 pmichaud oh, wait, no it's not.
18:39 darkop there's one thing positive in slowness of rakudo - no one will write malware in it for some time :)
18:40 * pmichaud cancels his bug report.
18:43 frooh star: say $_ for <a b c>;
18:43 p6eval star 2010.07: OUTPUT«a␤b␤c␤»
18:43 jnthn pmichaud: I'm confused - what were you thinking was a bug? :_0
18:44 frooh star: say [1..(<a b c>)].perl
18:44 pmichaud jnthn: I was reading the last line of the smart match table which says that any two scalars smartmatch with   C<===>
18:44 p6eval star 2010.07:  ( no output )
18:44 pmichaud but there are earlier lines that specifically handle Numeric and String
18:44 offerkaye joined #perl6
18:44 frooh star: [1..(<a b c>)].perl.say
18:44 jnthn pmichaud: Right. :-)
18:44 pmichaud (I didn't see those because I was looking for Int and Str)
18:44 p6eval star 2010.07:  ( no output )
18:44 jnthn Aha. :-)
18:44 offerkaye Hi
18:44 phenny offerkaye: 01:41Z <isBEKaml_> tell offerkaye you have http://u4x.perl6.org that renders the pod into formatted html. Feel free to improve it! :)
18:45 frooh star: my @l = <a b c>; [1..@l].perl.say
18:45 p6eval star 2010.07:  ( no output )
18:45 pmichaud star:  my @l = <a b c>;  [1..+@l].perl.say
18:45 frooh star: my @l = <a b c>; (1..@l).perl.say
18:45 p6eval star 2010.07: OUTPUT«[1, 2, 3]␤»
18:45 p6eval star 2010.07: OUTPUT«1..["a", "b", "c"]␤»
18:45 offerkaye phenny: nice one :)
18:46 aCiD2 ~$person.select(*).where(($person.column('name') LIKE 'steve') AND ($person.column('id') == 6)). Now that is cool!
18:46 offerkaye I'll look into it. Do you have an email address I can use to contact you if I have questions?
18:46 darkop aCiD2++
18:47 offerkaye General question - does anyone know, which Synopsys lists array/list methods (or functions)?
18:47 frooh star: my @l = <a b c>; [1..(+@l-1)].perl.say
18:47 p6eval star 2010.07: OUTPUT«[1, 2]␤»
18:47 frooh offerkaye: 32 has most of that kind of stuff
18:48 pmichaud offerkaye: S32 (Containers)
18:48 frooh star: my @l = <a b c>; say @#l;
18:48 pmichaud offerkaye: http://svn.pugscode.org/pugs/docs/Perl6/​Spec/S32-setting-library/Containers.pod
18:48 p6eval star 2010.07: OUTPUT«===SORRY!===␤Non-declarative sigil is missing its name at line 22, near "@#l;"␤»
18:49 offerkaye frooh and pmichaud  - thanks!
18:49 jnthn frooh: @l.end
18:49 frooh jnthn: ty sir
18:49 pmichaud frooh: what are you trying to get to?
18:50 frooh pmichaud: I'm trying to iterate over the indices of a list, but starting in the middle
18:50 frooh pmichaud: so like, for $x .. @list.end I guess?
18:51 pmichaud for $x ..^ +@list
18:51 frooh that goes too hight though right?
18:51 pmichaud no
18:51 pmichaud my @list = <the quick brown fox jumped over the lazy dog>;   .say for 3..^+@list;
18:51 pmichaud star: my @list = <the quick brown fox jumped over the lazy dog>;   .say for 3..^+@list;
18:51 p6eval star 2010.07: OUTPUT«3␤4␤5␤6␤7␤8␤»
18:52 pmichaud star: my @list = <the quick brown fox jumped over the lazy dog>;   .say for 3..^+@list;  say @list[8];
18:52 p6eval star 2010.07: OUTPUT«3␤4␤5␤6␤7␤8␤dog␤»
18:52 frooh ok, guess not then :-)
18:52 pmichaud +@list is the number of elements in @list
18:52 pmichaud 3 ..^ +@list  means "3 up to the number of elements in @list"
18:52 frooh oh nice.
18:52 pmichaud the ^ means "up to" instead of "up-to-and-including"
18:54 frooh pmichaud: how about printing directly to STDERR?
18:54 pmichaud $*ERR.say  # I think
18:54 pmichaud star:  $*ERR.say("I'm an err");
18:54 p6eval star 2010.07: OUTPUT«I'm an err␤»
18:54 pmichaud not sure if the other works
18:55 pmichaud star:  'hello world'.say($*ERR)
18:55 p6eval star 2010.07: OUTPUT«Too many positional parameters passed; got 2 but expected 1␤  in 'Mu::say' at line 1220:CORE.setting␤  in main program body at line 22:/tmp/OB6XbtcrBw␤»
18:55 frooh star: $*ERR.print('a', 'b', 'c');
18:55 pmichaud yeah, doesn't go the other way.
18:55 p6eval star 2010.07: OUTPUT«abc»
18:55 pmichaud but you can also do:
18:55 pmichaud star:  { my $*OUT = $*ERR;  'hello world'.say;  }
18:55 p6eval star 2010.07: OUTPUT«hello world␤»
18:55 pmichaud which actually goes to the stderr instead of stdout
18:55 jnthn Hard to tell with evalbot ;-)
18:56 lue rakudo: say 'ß' ~~ m:i/S/
18:56 p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Confused at line 22, near "say '\x{df}' ~~"␤»
18:56 frooh $*ERR.say doesn't go to stderr?
18:56 pmichaud frooh: it does
18:56 frooh ok
18:56 frooh I like that better anyway
18:56 frooh I'd do the former if we had temp, but it's not worth it for a single line anyway
18:56 pdcawley joined #perl6
18:56 lue .oO(curse you, improper unicode handling (?))
18:58 kjeldahl joined #perl6
18:58 aCiD2 is it possible to run a BUILD method after attributes have been initialised with defaults?
18:59 lue rakudo: say 'π' ~~ m:i/∏/
18:59 p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Confused at line 22, near "say '\u03c0' ~~"␤»
19:00 lue Now I feel I can blame unicode handling.
19:00 lue rakudo: say 'a' ~~ m:i/A/
19:00 p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Confused at line 22, near "say 'a' ~~"␤»
19:00 lue rakudo: say ('a' ~~ m:i/A/)
19:00 p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 22␤»
19:00 lue O.o
19:02 lue [ If I've done something stupidly wrong, now is the time to speak up :) ]
19:02 diakopter std: say ('a' ~~ m:i/A/)
19:02 p6eval std 31883: OUTPUT«ok 00:01 118m␤»
19:02 pmichaud rakudo:  say 'a' ~~ m/:i A/
19:02 p6eval rakudo 9b6189: OUTPUT«a␤»
19:03 pmichaud I don't think rakudo understands adverbs on m// yet.
19:03 pmichaud but you can put them inside the slashes to get a similar effect
19:03 pmichaud afk, lunch
19:04 sorear star--
19:04 sorear # creating so much traffic here I can no longer backlog
19:04 diakopter heh
19:06 cono joined #perl6
19:06 offerkaye sorear: that's a good thing I think? :)
19:07 lue .oO(oh hey look, almost 200 people again)
19:10 offerkaye P6 Gentle Intro done at: http://blogs.perl.org/users/offerkaye​/2010/07/p6-gentle-intro-part-2.html
19:10 offerkaye Read it and weep guys
19:10 offerkaye :)
19:11 offerkaye Or atleast, let me know if I wrote anything wrong :)
19:11 offerkaye s/P6 Gentle Intro done/P6 Gentle Intro part 2 done/ ; # do'h
19:12 jnthn offerkaye: Looks nice. :-)
19:12 pmichaud szabgab++   # hashes screencast makes me say "ooooh, nice"
19:12 jnthn offerkaye: @primes[@primes.end] can also be @primes[*-1]
19:12 tadzik star: my @primes2 = <17 19 23 29 31>; @primes2.perl.say
19:12 p6eval star 2010.07: OUTPUT«["17", "19", "23", "29", "31"]␤»
19:12 pmichaud (afk, really lunch this time)
19:12 tadzik offerkaye: not the same, see? They're strings
19:13 offerkaye star: "17" * 3.14
19:13 p6eval star 2010.07:  ( no output )
19:13 offerkaye star: say "17" * 3.14
19:13 p6eval star 2010.07: OUTPUT«53.38␤»
19:13 frooh star: sub l(:@foo) { say +@foo }; l (1,2,3);
19:13 offerkaye "17'
19:13 p6eval star 2010.07: OUTPUT«Too many positional parameters passed; got 1 but expected 0␤  in 'l' at line 22:/tmp/pRDyVpsa_z␤  in main program body at line 22:/tmp/pRDyVpsa_z␤»
19:13 offerkaye "17", 17, all same same :D
19:13 szabgab pmichaud: have you learnt something new ? :)
19:13 frooh star: sub l(:@foo) { say +@foo }; l((1,2,3));
19:14 p6eval star 2010.07: OUTPUT«Too many positional parameters passed; got 1 but expected 0␤  in 'l' at line 22:/tmp/Pa4h3Q7NSD␤  in main program body at line 22:/tmp/Pa4h3Q7NSD␤»
19:14 offerkaye Gabor, he's AFK for lunch
19:14 frooh star: sub l(:@foo) { say +@foo }; l(foo=> (1,2,3));
19:14 p6eval star 2010.07: OUTPUT«3␤»
19:14 frooh star: sub l(:@foo) { say +@foo }; l(foo=> <a b c>);
19:14 p6eval star 2010.07: OUTPUT«3␤»
19:14 tadzik star: my @a = 1, 2, 3; my @b = <1 2 3>; say @a == @b
19:14 p6eval star 2010.07: OUTPUT«1␤»
19:14 tadzik ow
19:14 tadzik …well, that's weird to me anyway
19:14 szabgab offerkaye++ # gentle intro
19:15 tadzik here's a list of strings, and nums on the other side. Why equal?
19:15 frooh star: sub l(:@foo, :$sup) { say +@foo }; l(foo=> <a b c>);
19:15 p6eval star 2010.07: OUTPUT«3␤»
19:15 szabgab offerkaye: when I am back from Pisa we might organize a Perl 6 evening in Hafa
19:15 frooh star: sub l(:@foo, :$sup) { say +@foo }; l (foo=> <a b c>);
19:15 p6eval star 2010.07: OUTPUT«Too many positional parameters passed; got 1 but expected 0␤  in 'l' at line 22:/tmp/_dQGocuQ_E␤  in main program body at line 22:/tmp/_dQGocuQ_E␤»
19:15 tylercurtis star: say +(1,2,3); say +<1 2 3>;
19:16 p6eval star 2010.07: OUTPUT«3␤3␤»
19:16 tylercurtis tadzik: ^^
19:16 offerkaye Gabor, that would be cool, although I'm only starting to scrape the surface of p6 :)
19:16 tadzik well, I know this one :)
19:16 tadzik star: say "5" + "2"
19:16 p6eval star 2010.07: OUTPUT«7␤»
19:17 tadzik star: say "5" == 5
19:17 p6eval star 2010.07: OUTPUT«1␤»
19:17 szabgab offerkaye: and most of the others in Haifa don't know any of it
19:17 tadzik :ASD
19:17 tadzik nevermind then
19:17 tadzik star: say "5".perl == 5.perl
19:17 p6eval star 2010.07: OUTPUT«0␤»
19:17 wamba joined #perl6
19:17 offerkaye Anyone know who phenny is, how can I contact him? I want to know how he changed http://u4x.perl6.org/
19:17 tadzik offerkaye: he's a bot, passing messages
19:17 tadzik phenny: tell offerkaye something
19:17 phenny tadzik: I'll pass that on when offerkaye is around.
19:17 kjeldahl_ joined #perl6
19:18 offerkaye ah lol
19:18 phenny offerkaye: 19:17Z <tadzik> tell offerkaye something
19:18 offerkaye ok so who changed http://u4x.perl6.org/ ?
19:19 jnthn offerkaye: It ends to say that person's handle in the message
19:20 pmichaud offerkaye: svn blame doesn't show that anyone changed  u4x.perl6.org
19:20 offerkaye Well the user name in the beginning was <isBEKaml_>
19:20 offerkaye wb from lunch pmichaud , that was quick
19:20 offerkaye :)
19:20 pmichaud no, haven't made it yet :)
19:20 pmichaud (waiting on $wife)
19:21 offerkaye "offerkaye: 01:41Z <isBEKaml_> tell offerkaye you have http://u4x.perl6.org that renders the pod into formatted html. Feel free to improve it! :)"
19:21 pmichaud I think he was pointing you to another location for u4x, not that it changed
19:21 frooh pmichaud: http://paste.scsys.co.uk/47432 <-- passes tests, any thoughts on making it more perl6y?
19:22 szabgab rakudo: my %h{'a', 'b'}; $h{'c'} = 1; say %h.perl
19:22 p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Symbol '$h' not predeclared in <anonymous> (/tmp/xKX5LYhIlY:22)␤»
19:22 tylercurtis frooh: given/when doesn't fall-through, does it?
19:22 pmichaud frooh: maybe turn all of $!trace, $!debug, etc. into a hash with those as keys?
19:22 szabgab rakudo: my %h{'a', 'b'}; %h{'c'} = 1; say %h.perl
19:22 p6eval rakudo 9b6189: OUTPUT«{"c" => 1}␤»
19:22 szabgab bad gabor, bad
19:22 pmichaud i.e., do they need to be attributes?
19:22 frooh pmichaud: that makes sense.
19:22 szabgab so no restriction in hash keys yet, right?
19:22 offerkaye Ah of course. So any idea who made  http://u4x.perl6.org  or who <isBEKaml_> is?
19:23 frooh pmichaud: of course in p5 it *was* a hash, but that's because the storage is a hashref :-)
19:23 pmichaud u4x.perl.org has been around for a while, I think.
19:23 szabgab rakudo: my %h<a b>
19:23 p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Confused at line 22, near "my %h<a b>"␤»
19:23 pmichaud frooh: right.  we've switched object storage so that they're not just hashes.... but you can still use hashes to store data :)
19:23 frooh pmichaud: I'll make this a hashref, but I *do* think you guys need to make some way to access attributes with a string
19:24 offerkaye pmichaud: hmm okay, a bit of a confusing message there from <isBEKaml_>, who ever that is
19:25 offerkaye BTW guys can anyone fix the broken link on http://perlcabal.org/syn/ to S26? It points to http://perlcabal.org/syn/S26.html currently which gives a 404
19:25 frooh pmichaud: http://paste.scsys.co.uk/47433 <-- much prettier
19:26 pmichaud ok, afk lunch
19:27 frooh star: class Foo { method bummer { say $?CLASS } }; Foo.new.bummer
19:27 p6eval star 2010.07: OUTPUT«===SORRY!===␤Symbol '$?CLASS' not predeclared in bummer (/tmp/T6EhOs9e7g:22)␤»
19:28 frooh man, if I only had that my ^add_methods could be oneliners
19:29 frooh oh sweet!
19:29 * frooh shims it with $?CLASS =
19:35 Trashlord joined #perl6
19:38 colomon joined #perl6
19:38 molaf joined #perl6
19:39 rbuels joined #perl6
19:43 user_2010_ joined #perl6
19:43 rurban joined #perl6
19:44 rurban pmichaud: I added a rakudobug for make install. cp lib/*.pm and lib/*.pir but there is no lib dir. docs/announce dir is also ignored with make install
19:44 rurban how about the star short descr: DESCRIPTION="Perl6 modules, more docs and tools" ?
19:45 rurban jnthn: I have some blizkost patches for cygwin
19:45 jnthn rurban: \o/
19:45 jnthn rurban: If you do github, feel free to send a pull request.
19:45 user_2010_ Hi
19:45 rurban just silly little things
19:46 jnthn user_2010_: hi
19:46 user_2010_ Need a perl help
19:46 jnthn rurban: Probably silly enough to fix the build... ;-)
19:46 rurban But I'm working on the rakudo-star release version. Is this tagged?
19:46 user_2010_ im trying to open a file in C folder
19:46 user_2010_ but the code is dying on me staing no file or directory
19:46 mantovani "user_2010" hahaha nice
19:47 rurban src/pmc/bkmarshal.c:299: error: external linkage required for symbol blizkost_callable_trampoline because of dllexport attribute
19:47 user_2010_ open(INPUT, "C:\\input.txt")
19:47 jnthn user_2010_: That looks like Perl 5.
19:47 user_2010_ or die "Could not open file for reading $!\n";
19:47 tadzik user_2010_: isn't it Perl 5?
19:47 user_2010_ Yes perl 5
19:48 jaldhar joined #perl6
19:48 jnthn user_2010_: OK, Perl 6 is rather different from Perl 5, so I suggest...I think #perl-help
19:48 jnthn user_2010_: You may want to try open(INPUT, "<", "C:\\input.txt")
19:48 frooh I think #perl is fine in freenode.  If you join irc.perl.org you'll want #perl-help
19:49 jnthn frooh: Oh, OK
19:49 jnthn So #perl can help
19:49 frooh user_2010_: or better yet, open (my $in, "<", "C:\\input.txt")
19:49 frooh global filehandles--
19:49 user_2010_ ok..Thank you
19:50 frooh user_2010_: good luck :-)
19:50 tadzik user_2010_: oh, remember, you can always try Perl 6 :)
19:50 frooh :D
19:50 tadzik (I'm disappointed nobody said this :>)
19:51 frooh does module == package?
19:52 jnthn A module is a type of package that's good for sticking a bunch of subs in
19:53 jnthn A class is a type of package with a bunch of class-y semantics thanks to its meta-object.
19:53 frooh ok, so a module is what I think of as a package then :-)
19:53 rurban jnthn: First fix is http://github.com/rurban/blizkost/commit/​e7aac6c73e92454c2f7119e0b4696aab028d8565
19:53 frooh (except of course the ones that are classes ;-)
19:55 jnthn rurban: thanks, applied
19:56 rurban fixing XS() on windows is harder...
19:58 exodist does perl6 have a working forking mechanism? is it still $pid = fork()?
19:58 jnthn exodist: Not built in at the moment, but http://github.com/jnthn/zavolaj/b​lob/master/examples/unix-fork.p6 shows how you can get at it with NativeCall
19:59 rurban nope. it was easy enough. just pushed
20:00 rurban 1 failure: nt/exit.t .................. Can't undef active subroutine during global destruction.
20:00 jnthn rurban++ # also applied
20:00 rurban Is this exit error known?
20:01 jnthn I think there are general issues with global distrukshun.
20:01 jnthn sorear++ would probably know how unusual that particular one is
20:01 rurban hmm, I'm working on this at the perl5 side also :) with my B::C compiler
20:01 jnthn If you have a fix, it's most welcome. :-)
20:02 jnthn But my guess is it's non-trivial. :-)
20:02 eternaleye star: class Foo { has $!biff = 1; method robot { my $attr = "biff"; say $!"$attr" } }; my $x = Foo.new; $x.robot;
20:02 p6eval star 2010.07: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 22␤»
20:02 rurban Fair enough. I'll try, but not now. I'll leave to do some partying now
20:03 jnthn \o/
20:03 jnthn Have fun.
20:04 rurban the rakudo-star package is also ready, but I'll do the testing and maybe patches tomorrow. rakudo star make test will need some love
20:05 dalek joined #perl6
20:06 rurban hmm, blizkost needs DESTDIR support
20:06 tadzik rurban: :)
20:06 tadzik jnthn: so, looked at this patch of mine?
20:07 rurban but for the fist look it works fine
20:07 jnthn rurban: http://gist.github.com/502109
20:07 jnthn Is patch from tadzik++
20:07 zostay joined #perl6
20:07 rurban Great! I'll try
20:08 tadzik rurban: worksforme, I was able to package blizkost for CRUX with it
20:11 rurban yes, worked for me also. Just the tests are not running from the star Makefile
20:11 rurban jnthn: tadzik++ patch is good
20:12 jnthn OK, great, should be applied.
20:12 jnthn tadzik: Any chance you cna send me a pull request for it?
20:12 rurban jnthn: did you test a static libperl.a also?
20:12 jnthn No
20:13 rurban Hmm. Maybe I'll try later. debian has it like this
20:14 tadzik jnthn: I can. I'll have to fork you first :)
20:14 rurban tadzik: 2 minutes
20:14 tadzik rurban: will you apply and send a pull request?
20:15 jnthn Well fork me!
20:16 tadzik That's what she said!
20:16 lue afk
20:17 hanekomu joined #perl6
20:19 frooh star: module Lol { sub foo { !bar() }; sub !bar { say 1 } };
20:19 p6eval star 2010.07: OUTPUT«Could not find sub &bar␤  in main program body at line 22:/tmp/vvlwHQrniO␤»
20:19 frooh star: module Lol { sub foo { _bar() }; sub _bar { say 1 } };
20:19 p6eval star 2010.07:  ( no output )
20:19 frooh I guess if you want a private sub in a module you just don't export it?
20:20 tadzik jnthn: sent, if I done it right
20:22 jnthn frooh: Right
20:22 jnthn frooh: They're lexically scoped by default.
20:22 frooh cool.
20:23 tadzik jnthn: is the pull request ok?
20:23 jnthn tadzik: Looks to be.
20:23 jnthn rurban: Wanted to check something before I apply?
20:28 pmichaud back again
20:29 jnthn yayitspm
20:34 cosimo rakudo: my $y = 'foo'; my $x = ($y eq 'foo' || $y eq 'bar') ?? 1 :: 0; say $x
20:35 p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Confused at line 22, near "my $x = ($"␤»
20:35 cosimo rakudo: my $y = 'foo'; my $x = $y eq 'foo' || $y eq 'bar' ?? 1 :: 0; say $x
20:35 p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Confused at line 22, near "my $x = $y"␤»
20:35 alester joined #perl6
20:36 pmichaud tadzik: going to be around for a bit?  I have some time to work on DESTDIR= handling.
20:37 tadzik pmichaud: sure
20:37 Ross joined #perl6
20:39 frooh I'm trying to use $obj.$foo to call the method that $foo has the name of, but I'm getting errors, ideas: http://paste.scsys.co.uk/47434 ?
20:40 tadzik frooh: maybe You just can't use a variable as a method name. Or NYI. What do specs say?
20:40 tylercurtis frooh: I think that's $obj."$foo"()
20:41 frooh it works in the object code though
20:41 frooh like, I can do self.$is-level()
20:42 Axord joined #perl6
20:42 frooh tylercurtis: looks like that works
20:42 frooh (using quotes)
20:43 gfldex rakudo: class A { method b(){} }; my $a = A.new(); $a.^can('b')();
20:43 p6eval rakudo 9b6189: OUTPUT«Not enough positional parameters passed; got 0 but expected 1␤  in 'A::b' at line 22:/tmp/s3kmX90NPL␤  in main program body at line 22:/tmp/s3kmX90NPL␤»
20:43 frooh hmm
20:43 gfldex rakudo: class A { method b(){} }; my $a = A.new(); $a.^can('b').();
20:43 frooh hmm
20:43 p6eval rakudo 9b6189: OUTPUT«Not enough positional parameters passed; got 0 but expected 1␤  in 'A::b' at line 22:/tmp/cSmzENIDnL␤  in main program body at line 22:/tmp/cSmzENIDnL␤»
20:43 gfldex rakudo: class A { method b(){} }; my $a = A.new(); $a.^can('b').WHAT;
20:44 p6eval rakudo 9b6189: OUTPUT«Method 'WHAT' not found for invocant of class 'P6Invocation'␤  in main program body at line 22:/tmp/k3kubFtLah␤»
20:44 gfldex rakudo: class A { method b(){} }; my $a = A.new(); say &$a.^can('b').WHAT;
20:44 p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Non-declarative sigil is missing its name at line 22, near "&$a.^can('"␤»
20:44 gfldex rakudo: class A { method b(){ return 'well?'} }; my $a = A.new(); say $a.^can('b');
20:44 p6eval rakudo 9b6189:  ( no output )
20:44 tylercurtis gflrakudo: class A { method b() { say 'foo'; }; my $a = A.new; $a.^can('b')($a);
20:45 tylercurtis rakudo: class A { method b() { say 'foo'; }; my $a = A.new; $a.^can('b')($a);
20:45 p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 22␤»
20:45 tylercurtis rakudo: class A { method b() { say 'foo'; } }; my $a = A.new; $a.^can('b')($a);
20:45 p6eval rakudo 9b6189: OUTPUT«foo␤»
20:46 tylercurtis gfldex: ^^
20:46 gfldex frooh: ^^
20:46 frooh orly...
20:46 * frooh tries
20:49 frooh ok, that works
20:49 frooh it's a little gross, since "$foo" should probably work
20:49 frooh or...
20:49 frooh hmmm
20:50 * frooh is getting more errors
20:50 tylercurtis frooh: I thought you said "$foo" worked?
20:50 frooh tylercurtis: yeah, it's really strange, in some situations one works and in some it doesn't
20:50 pmichaud tadzik: http://pmichaud.com/sandbox​/rakudo-star-delta1.tar.gz  # first attempt
20:53 kjeldahl joined #perl6
20:55 alester pmichaud++
20:55 alester thanks for getting everything out
20:55 pmichaud alester: thanks for the perlbuzz post :)
20:55 alester posted here too http://perlbuzz.com/2010/07/rakudo-star-for-e​arly-adopters-of-perl-6-is-now-available.html
20:55 alester yeah, that. :-)
20:55 pmichaud was the release announcement sufficiently okay?
20:56 alester yeah, it's fine
20:56 pmichaud (I was quite happy with it when done... it seems to have hit the perfect note)
20:56 alester while you were announcing, i was in the Fed courthouse.
20:56 alester whee!
20:56 pmichaud alester: as a spectator, participant, or captive audience?
20:56 tylercurtis rakudo: sub foo { True; }; given False { when { foo() } { say 'foo'; } }
20:56 p6eval rakudo 9b6189: OUTPUT«foo␤»
20:56 alester well, not quite the courthouse, but dealing with legal hoohah
20:57 alester but stuff that could not be ignored for the sake of Perl 6. )
20:57 alester and then I had to buy a Droid.
20:57 alester so you see
20:57 tadzik pmichaud: on it
20:57 alester now building Rakudo on my Linux box
21:01 jaldhar joined #perl6
21:06 molaf joined #perl6
21:06 tadzik pmichaud: no errors, but no results :)
21:06 tadzik pmichaud: http://nopaste.snit.ch/22494
21:06 offerkaye Question - is there a working implementation of a reader (a-la perldoc) for the Perl 6 Pod format?
21:07 tadzik there is grok
21:09 pmichaud http://wiki.github.com/rakudo/ra​kudo/yapceu-2010-workshop-notes
21:09 pmichaud tadzik: looking
21:09 offerkaye But this wasn't released with Rakudo-Star?
21:09 tadzik nope
21:09 tadzik it's on good, ol' CPAN
21:10 jaldhar joined #perl6
21:10 mantovani joined #perl6
21:10 baest joined #perl6
21:11 pmichaud tadzik: that's..... odd.  Let me try it locally.
21:11 drbean joined #perl6
21:12 offerkaye tadzik: thanks, I'm installing it now. It's nice to have a working P5 version, I'm surprised there isn't a P6 one yet. Hopefully it's on someone's TODO list :)
21:13 pmichaud offerkaye: why are you surprised there isn't a p6 one yet, ooc?
21:14 jferrero joined #perl6
21:15 offerkaye I don't know. Releasing a tool that comes with documentation in a format that it itself cannot read seems... wrong somehow?
21:15 pmichaud offerkaye: so, we should've held the release?
21:16 tadzik offerkaye: R* docs aren't written in Pod6
21:16 tadzik modules docs are
21:16 gfldex std: use v6;  class A {      method b(){ say 'butterfly'; }; };  my $a = A.new(); my $method_ref = $a.^can('b'); $method_ref($a);  sub foo($o, $m){  $m($o); }  foo($a, $method_ref);
21:16 p6eval std 31883: OUTPUT«[31m===[0mSORRY![31m===[0m␤Strange text after block (missing comma, semicolon, comment marker?) at /tmp/RQ95i7gwO1 line 1:␤------> [32mod_ref($a);  sub foo($o, $m){  $m($o); }[33m⏏[31m  foo($a, $method_ref);[0m␤    expecting any of:␤      bracketed infix␤  infix or
21:16 p6eval ..meta-infix␤      st…
21:16 offerkaye Nope. As I said, hopefully someone (who can code) considered this point already.
21:16 gfldex rakudo: use v6;  class A {      method b(){ say 'butterfly'; }; };  my $a = A.new(); my $method_ref = $a.^can('b'); $method_ref($a);  sub foo($o, $m){  $m($o); }  foo($a, $method_ref);
21:16 p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Confused at line 22, near "sub foo($o"␤»
21:16 tadzik Well, offerkaye, how about a nice weekend project? I can, want to help me?
21:17 gfldex rakudo: use v6;  class A {      method b(){ say 'butterfly'; }; };  my $a = A.new(); my $method_ref = $a.^can('b'); $method_ref($a);  sub foo($o, $m){  $m($o); };  foo($a, $method_ref);
21:17 tadzik (I hope I can)
21:17 p6eval rakudo 9b6189: OUTPUT«butterfly␤Null PMC access in invoke()␤  in 'foo' at line 1:/tmp/G7kAH2rSQ2␤  in 'foo' at line 22:/tmp/G7kAH2rSQ2␤  in main program body at line 22:/tmp/G7kAH2rSQ2␤»
21:17 gfldex kekeke
21:17 tadzik (at least trying would be fu)
21:17 gfldex i haz a bug :)
21:17 pmichaud offerkaye: I'm just frequently surprised at the apparent contradictions between "release early, release often" and "releasing a tool without XYZ seems wrong"
21:17 gfldex frooh: seen that?
21:18 tadzik I'm actually happy more effort was put into Rakudo itself than into the enviroment
21:18 jnthn gfldex: Eww.
21:18 cAMI`ff joined #perl6
21:18 gfldex it's no wonder why references to methods dont work :)
21:18 jnthn gfldex: rakudobug@perl.org ... :-)
21:20 offerkaye pmichaud: no offense meant. I do support "release early, release often". But if I do want to move ahead in starting to write user docs, should I do it in P5-POD or P6-Pod?
21:20 pmichaud offerkaye: no offense taken -- I really was just curious for the reasons behind the statement.  I do understand them.
21:21 pmichaud offerkaye: as to which tool to use (more)
21:21 tadzik offerkaye: p6pod of course
21:21 tadzik imho
21:21 kjeldahl_ joined #perl6
21:21 pmichaud that depends on what your goal is.  If you want rich, high-quality user docs in a short period of time, then you probably want to do it in p5 pod and hope that someday we can convert (which we should be able to do)
21:21 offerkaye Also "releasing a tool without XYZ seems wrong" depends on the tool and on the person thinking the thought. For me, documentation support is probably pretty high up on the list.
21:21 pmichaud if you want to help build the tool that you're surprised we don't have yet, then working on it in p6pod would seem to be the way to go.
21:22 pmichaud offerkaye: (tool/person)   sure, and every person has a different idea of what's high-on-the-list.  :)
21:22 offerkaye pmichaud: I probably cannot help with the tool. But I can help with the docs themselves.
21:22 gfldex i prefere not to wait another 10 years
21:23 pmichaud offerkaye: whichever you choose will be (1) helpful and (2) very welcome
21:23 pmichaud if there's more p6pod around, that makes it more likely that someone will find the tuits to build the tools
21:23 pmichaud I'd like to spend a lot of time working on p6pod tools, but so far my tuit supply is limited and (I think) there are a few other areas that need my attention slightly more still
21:24 pmichaud tadzik: I get similar problems as you... looking
21:25 tadzik writing a perl6doc sounds like a fun weekend projeect
21:29 offerkaye tadzik: since S26 is written in P6-Pod and since the HTML link is broken (http://perlcabal.org/syn/S26.html), I downloaded the .pod file and tried to use grok to translate it to xhtml. No luck, got fatal error :(
21:30 tadzik :P
21:30 tadzik looks like it's not perfect
21:30 tadzik or the SYN is not perfect
21:31 offerkaye S26 is the Pod (documentation) synopyss, written by Damian Conway. If it's not in perfect Pod itself I will eat my hat!
21:31 offerkaye :D
21:33 jfried joined #perl6
21:33 pmichaud tadzik: I see where the problem is, I'm not quite sure how to fix it.
21:34 pmichaud the "cd rakudo && make install"  is putting DESTDIR inside of the rakudo/ subdirectory instead of the top-level directory
21:34 tadzik hmm
21:35 tadzik so in rakudo/Makefile let's maybe put sth like DESTDIR2, which will default to $(DESTDIR)/..?
21:36 pmichaud well, you'd want  ../$(DESTDIR)
21:36 pmichaud and that won't work if DESTDIR=  happens to be an absolute path.
21:44 tadzik hm
21:44 pmichaud ah
21:44 pmichaud gnu standards say that DESTDIR should always be an absolute filename
21:44 pmichaud so.... DESTDIR=xyz  isn't valid
21:44 tadzik hrm
21:44 tadzik or, there is a way
21:44 pmichaud needs to be  DESTDIR=$PWD/xyz
21:44 pmichaud if one gives a full path,  think it'll work.
21:45 tadzik you can make dir INSTALLSTUFF, then install everything there, and then install INSTALLSTUFF with DESTDIR
21:46 pmichaud that just sounds like copying the install/ subdirectory to a new location.
21:49 pmichaud perhaps a bigger/better question is:   what directory structure do you need for creating the package?  and what all will be in it it?
21:50 pmichaud i.e., are you creating a package that has rakudo+parrot+modules, or rakudo+modules (with parrot packaged separately), or ... ?
21:50 tadzik well, imagine an existing R* directory tree
21:51 pmichaud I can imagine a lot of them.  You'll have to be more specific :)
21:51 tadzik well, $PREFIX/lib/parrot/something
21:51 pmichaud in general, parrot expects everything to be installed relative to its root
21:51 tadzik hmm
21:51 tadzik yeah, I know that
21:52 exodist hmm, reading the docs I am a bit confused on packages/classes/modules. I understand the difference between modules and classes, and that both are a type of package. But what exactly is a package that is not a class or module? package foo {...}   what is it goo for, why would I do that instead of module Foo {...}?
21:52 tadzik but the thing is to be able to change the first / in path to whatever you want :)
21:52 tadzik so not /usr/share/parrot/asd but /tmp/foobar/usr/share/parrot/asd
21:52 tadzik the prefix for the whole tree
21:52 tadzik difficult to express myself :)
21:52 pmichaud yeah, I'm not quite sure how to do that in the context of parrot's current build system.
21:53 pmichaud part of the problem is that parrot has paths hardcoded into its binaries
21:53 tadzik well, it's not meant to work then
21:53 tadzik that's the thing
21:53 tadzik this is a temporary state
21:53 pmichaud but the only way I can get compiled rakudo and modules is if I have an actual running parrot
21:53 tadzik so the prefix will remain /usr, but it will be copied elsewhere, not expected to work there
21:53 tadzik so it can be tarballed, then unpacked to /, then work
21:54 pmichaud sure, I know that part.
21:54 pmichaud I just don't see how to build a rakudo and modules without having an actual installed parrot.
21:56 pmichaud (in the place that the parrot expects to run)
21:57 pmichaud I suppose I could try passing -L options all over the place.
21:57 tadzik hmm
21:58 tadzik no touching the current build process
21:58 tadzik that works and is ok
21:58 tadzik now installing is a different case, rakudo will still be built and work
22:03 exodist hmm, S10-12 really do not ever cover what package Foo { ... } is good for vs using module { ... }
22:04 pmichaud the main reason for using 'module' is to unambiguously identified the code as perl 6
22:04 pmichaud *identify
22:04 pmichaud as opposed to 'package' which might be thought to be either p5 or p6
22:06 exodist so theoretically package and module can be used interchangably except that  line 1(ish): package Foo;  #is illegal
22:07 tadzik pmichaud: http://wiki.github.com/rakudo/rakudo/tasks that's a bit outdated, isn't it?
22:07 pmichaud tadzik: yes, outdated.  we can likely delete that page altogether.
22:07 pmichaud there are better places to maintain task lists.
22:07 tommyd joined #perl6
22:08 tadzik pmichaud: how is Makefile going?
22:08 pmichaud tadzik: no farther yet.  Parrot gives me  PARROT_INCLUDE and PARROT_LIBRARY but no PARROT_LANGUAGES  :-(
22:08 tommyd evening all! I'm trying to find my way through all the niceties of Perl 6 with the Rakudo release and I am a bit stuck on my first experiment - a custom type
22:09 tommyd I defined it like this: subset Hash of Str where { $_ ~~ /[0-9a-f]{40}/; };
22:09 tommyd and rakudo tells me: Unable to parse blockoid, couldn't find final '}' at line 3
22:09 tommyd (well, line 3 is what you're actually looking at)
22:09 pmichaud tommyd: the invalid regex is why you're getting the error
22:09 pmichaud but I'm not sure that sort of subset is going to work anyway
22:09 tadzik pmichaud: I don't get it. The problem is not the building, and almost not the installing. It's about prepending DESTDIR to every cp in makefile, isn't it?
22:10 pmichaud tadzik: the problem is the building.
22:10 tommyd ah, the regex is invalid? must look into the "new" valid then apparently
22:10 pmichaud tommyd: you likely want   /<.xdigit>**40/
22:10 pmichaud if you really just want 0-9a-f, then it's    /<[0..9a..f]>**40/
22:11 pmichaud but I'm still not too sure about that subset declaration
22:12 pmichaud tadzik: I can't build the .pir versions of the various modules without having a working, installed rakudo to build them with.
22:12 tylercurtis tommyd: There's a Hash class, already, so defining a subset with that name might not work/be desirable, as well.
22:12 tadzik pmichaud: oh
22:12 Guest23195 left #perl6
22:13 tylercurtis tommyd: a Hash role rather.
22:13 pmichaud tadzik: a working rakudo is sufficient, but if we're not running from the rakudo build directory itself, then it has to be installed.
22:13 tommyd pmichaud: thanks, this brings me further
22:13 tadzik pmichaud: so first rakudo's installed into / and then the modules are built?
22:13 tommyd the rule is apparently accepted, but my "my" declaration seems to be wrong
22:13 pmichaud tadzik: rakudo is installed into wherever parrot expects it to be installed, and then the modules are built
22:14 tommyd my Hash "foobar"; spits out: In "my" declaration, typename Hash must be predeclared (or marked as declarative with :: prefix)
22:14 tommyd (I tried this with something different than "Hash", same result
22:14 tadzik oh, I see
22:15 pmichaud I guess we could try building the modules from rakudo's build directory
22:15 pmichaud let me see if I can do that somehow.
22:15 tylercurtis rakudo: subset Hash of Str where /<.xdigit>**40/; my Hash $h = "foobar";
22:15 p6eval rakudo 9b6189: OUTPUT«No such attribute '$!storage'␤  in main program body at <unknown line>␤»
22:15 tylercurtis rakudo: subset HashStr of Str where /<.xdigit>**40/; my HashStr $h = "foobar";
22:15 pmichaud tylercurtis/tommyd:  note that Hash is not a true class type in Rakudo right now.
22:16 p6eval rakudo 9b6189: OUTPUT«Type check failed for assignment␤  in '&infix:<=>' at line 1␤  in main program body at line 22:/tmp/CsY8de6r_w␤»
22:16 pmichaud (it's a role)
22:16 pmichaud (and not a very good one at that)
22:16 exodist what does ::Whatever represent? (saw it in $var ~~ ::Whatever)  not sure what it is checking.
22:16 pmichaud Whatever is a type
22:16 tylercurtis rakudo: subset HashStr of Str where /<.xdigit>**40/; my HashStr $h = "abcde" x 8;
22:16 p6eval rakudo 9b6189:  ( no output )
22:17 pmichaud ::Whatever (as a term) is also a type -- the '::' are simply making it extra-clear that it's a type.
22:17 tylercurtis rakudo: subset HashStr of Str where /<.xdigit>**40/; my HashStr $h = "abcde" x 8; say $h;
22:17 p6eval rakudo 9b6189: OUTPUT«abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcde␤»
22:17 exodist pmichaud, thanks. Whatever seews lixe a strange name if theres already an 'Any' type, whats the difference?
22:17 pmichaud Whatever is the type of *
22:17 exodist *seems like
22:18 pmichaud Any is the generic type for non-junction objects
22:18 pmichaud so, for example
22:18 tommyd rakudo: subset HashStr of Str where /<[0..9a..f]>**40/; my HashStr $f = "foo";
22:18 pmichaud my $range = 1..*;
22:18 p6eval rakudo 9b6189: OUTPUT«Type check failed for assignment␤  in '&infix:<=>' at line 1␤  in main program body at line 22:/tmp/a6gLOYKReY␤»
22:18 pmichaud that '*' there has a type of Whatever
22:18 tommyd ah nice, it works
22:20 exodist star: sub blah( $thing ) { if $thing ~~ ::Whatever { say "they gave *" } else { say "They gave $thing" }}; blah(*); blah(1);
22:20 p6eval star 2010.07: OUTPUT«they gave *␤They gave 1␤»
22:20 exodist ah-ha!  thanks
22:20 pmichaud exodist: exactly
22:20 pmichaud exodist: you got it in 1
22:20 exodist in 1?
22:20 pmichaud (1 try)
22:21 exodist oh, lol
22:21 pmichaud the ::'s there are actually optional
22:22 pmichaud star:  sub blah( $thing ) {  if $thing ~~ Whatever { say 'whatever' } else { say $thing; } }; blah(*); blah(1)
22:22 p6eval star 2010.07: OUTPUT«whatever␤1␤»
22:22 exodist I fell in love with perl 5 8 years ago about a year into learning programming, it has been my love since, I am happy with what I see in perl6 though and am glad it has the same kind of thinking.
22:22 pmichaud sometimes the ::'s are used because the type might not have already been defined yet (e.g., when compiling the setting)
22:22 exodist perl 5, 8 years
22:23 pmichaud I just finished my 19th year of Perl programming.
22:23 pmichaud (or maybe 18th -- need to double check that :)
22:23 exodist nice, 19 years ago I was 7 or 8
22:23 pmichaud anyway, it's been a long time :)
22:24 exodist yeah, ++
22:24 tadzik 19 years ago I might have been unborn :)
22:24 tadzik pmichaud: so the only problem is the modules now?
22:24 exodist I think I am gonna put together a simple reference + glossary as I learn
22:25 pmichaud tadzik: that's the main one I see.
22:25 pmichaud I think I might have an answer.
22:25 tadzik there is always a way to provide an option to install it all without modules
22:25 tadzik and supply rakudo-star-modules package
22:26 pmichaud sure, thus my question earlier about how you thought the packages should be split :)
22:26 tadzik oh? I think I missed that one :)
22:26 pmichaud anyway, I think I can get it.... just a sec
22:30 pmichaud trying it locally
22:32 tadzik is there something that needs to be done in Rakudo, R* or modules what I could pick for a weekend project?
22:32 ashleydev_ joined #perl6
22:35 aCiD2 tadzik: Your time would probably be best spent finding taht out for yourself. For example, browse the bugs queue and choose something that sounds interesting
22:35 aCiD2 my rationale - you'll be most productive with something you're interested in. and any learning is good learning
22:35 aCiD2 just my 2p
22:35 tadzik aCiD2: probably, but I don't feel powerful enough to fix RT bugs, at least without guidance
22:36 tadzik hence my question
22:36 aCiD2 get over that then ;)
22:36 aCiD2 take something and run with it. if you fix it, give us a patch
22:36 aCiD2 if it's shit, it's better than nothing. and if it's THAT shit, you'll probably get feedback on how to make it less shit
22:36 aCiD2 baby steps. (this is coming someone who's in exactly your position, this just happens to be my game plan)
22:36 tadzik :)
22:37 aCiD2 but honestly, for now I'd concentrate on becoming as familiar with source code or at least layout as possible
22:37 aCiD2 I don't see myself making any useful contributions for at least a few weeks - I'm happy enough just getting my head around things
22:38 aCiD2 that said, if anyone does have ideas for tadzik, suggest away :)
22:38 tadzik aCiD2: well, I have one patch behind me, but that was quite an easy thing, nothing hard with writing a class and a couple of one-line methods :)
22:39 pmichaud tadzik: I think I have something
22:39 aCiD2 saves someone else doing it; submit it!
22:39 pmichaud let me update and make a delta2 tarball for you to try
22:39 tadzik aCiD2: it's in core alredy :)
22:39 aCiD2 oh, good :)
22:40 * aCiD2 spends too much time with people who patch stuff for themselves but decide its "not good enough" to submit
22:40 tadzik despite the fact pmichaud wasn't really happy about this :)
22:40 aCiD2 anywhoooo. too much beer now, so bed calls :)
22:40 aCiD2 happy hacking!
22:40 tadzik so to You pal :)
22:41 pmichaud creating tarball now
22:42 pmichaud http://pmichaud.com/sandbox​/rakudo-star-delta2.tar.gz   # still uploading, should be done in 1 min
22:43 masak joined #perl6
22:43 pmichaud 30 sec
22:43 tadzik yayitsmasak! \o/
22:43 masak ahoy, #perl6!
22:43 pmichaud masak: o/
22:43 pmichaud how goes the panic list?
22:43 * masak panics
22:43 pmichaud tarball finished uploading
22:44 pmichaud tadzik: be sure to use a an absolute path with DESTDIR=
22:44 pmichaud s/a //
22:44 tadzik pmichaud: a'right
22:44 masak pmichaud: I feel fairly confident about my presentations, despite the fact that I haven't made one actual slide for either yet. I've made plenty of preparations, though.
22:44 jnthn masak! \o/
22:44 pmichaud masak: I should probably be worried.  I already have my presentations ready, save for some minor updates.
22:44 pmichaud afk for a bit ... walk time
22:44 masak pmichaud: Yapsi is due today/tomorrow, and I still need to finish my runtime refactor. that's vaguely worrying. :)
22:46 jnthn masak: What's going into Yapsi for this month? :-)
22:46 masak I saw in the backlog that someone(TM) hinted that I had missed an obvious rakudobug. haven't finished backlogging yet, so I don't know which one it might be -- but of course I'm baffled at this. need to backlog more.
22:46 jnthn Yeah, I mean, I thought you had ticketed every single bug in Rakudo already.
22:47 masak jnthn: if keeping my fingers crossed works, array-indexed blocks, O(1) variable access, and a first stab at static lexpads.
22:47 masak Yapsi development is slow but yummy. :)
22:48 masak if I find I have extra time(TM) tomorrow, I'll implement FIRST and LAST as per the blog post.
22:48 jnthn Nice :-)
22:48 masak someone else is welcome to try it out independently, and we'll merge before release. :)
22:51 tadzik pmichaud: closer: http://nopaste.snit.ch/22495
22:51 jnthn masak: I managed a little slide procrastination today. :-)
22:51 masak jnthn: woot!
22:51 jnthn I almost have a talk. :-)
22:52 jnthn Blocking on ideas on one part.
22:52 masak jnthn: the closest I got was actual coding on GGE, the subject of my Prince-of-Parsea talk. :)
22:52 jnthn But may skip it.
22:52 jnthn :-)
22:52 masak actual coding isn't so bad, after all.
22:52 * jnthn looks forward to seeing that talk.
22:52 jnthn For many reasons. :-)
22:53 masak maybe I should try something new and develop the slides here on #perl6, wiki-style?
22:53 masak nah. :)
22:53 jnthn Yeah!
22:53 jnthn The puns will be awesome!
22:53 jnthn As in, awful
22:53 jnthn :-)
22:53 masak au++ used to do that... maybe I should try it as well.
22:54 exodist pmichaud, when using * like DoThing(*)  what terminology is used for the *?  whats it called (an instance of whatever?)
22:54 _macdaddy joined #perl6
22:54 exodist oh, he,s afk.
22:54 exodist anyone else know?
22:54 masak exodist: what-EVER!
22:55 * masak rolls eyes :)
22:55 jnthn "OH HAI I will now pour out crowdsauced presentashun!"
22:55 tylercurtis masak: do I correctly remember you saying something about planning to work on POD6 related stuff? Or am I thinking of someone else?
22:55 gfldex rakudo: class A { method b(){ say "1"; }; };    my $a = A.new();        my $ref = {$a.b};       eval 'supersede class A { method b(){ say "2"}; }';     $ref();
22:55 jnthn exodist: We just call it whatever.
22:55 p6eval rakudo 9b6189: OUTPUT«1␤»
22:55 gfldex bug or not bug?
22:55 masak exodist: yes, when used as a term, the '*' is called Whatever.
22:55 exodist ox.
22:55 exodist *ok
22:55 masak tylercurtis: would you like to see my Hague grant proposal?
22:56 tadzik tylercurtis: I've just started writing something like perl6doc
22:56 masak tylercurtis: http://gist.github.com/500732
22:56 jnthn gfldex: Yeah, supersede is...thankfully...not yet implemented.
22:56 masak tadzik: then you should probably look at literal++'s grok tool, which is meant to be a perl6doc.
22:56 gfldex jnthn: what is supposed to happen in that case?
22:57 jnthn gfldex: The class definition would be completely replaced with the new one.
22:57 jnthn However, how that affects existing objects is a whole different matter.
22:57 tadzik masak: I'm writing in Perl6 actually, mostly to play with it :)
22:58 sorear jnthn: Check the name of the commit which added exit.t
22:58 masak tadzik: cool! what, more exactly, are you writing?
22:58 tadzik masak: well, I want it to act like perldoc, but for Perl 6 modules and Pod 6 :)
22:58 masak jnthn: it can't reasonably affect existing instances, can it?
22:58 tadzik masak: not sure what will come out of this :P
22:59 jnthn sorear: Aha.
22:59 masak jnthn: for example, I'd expect class A {}; my $a = A.new; supersede class A {}; say $a ~~ A; to print False.
22:59 sorear jnthn: I probably should revert that one, I only pushed it by accident
22:59 jnthn masak: That one is pointless
22:59 jnthn masak: Because I suspect that supersede happens at compile time.
23:00 masak jnthn: oh. :/
23:00 gfldex jnthn: is eval compile time?
23:00 masak jnthn: and if I put it in an eval? :)
23:00 jnthn gfldex: No
23:00 jnthn gfldex: So that one has a chance of being interesting. :-)
23:00 jnthn masak: I think it probably has to affect existing instances. (more)
23:00 gfldex my bet would be a Null PMC :)
23:00 masak tadzik: you should probably have a glance at http://gist.github.com/500732 -- especially the last two points intersect with what you seem to be doing.
23:00 tylercurtis masak: offerkaye was interested in writing some more docs for Perl 6 and was asking about Perl 6 Pod.
23:00 masak tadzik: also probably have a look at all three projects linked from that proposal.
23:01 tadzik masak: sounds like fun
23:01 waste joined #perl6
23:01 jnthn The type object is also an instance and if we don't update what that points to as well then we're into all kinds of fun.
23:02 jnthn sorear: Or mark it skipped or something.
23:02 ingy greetings
23:02 jnthn o/ ingy
23:02 ingy \oXo/
23:02 masak tadzik: aye, I expect it to be! \o/ I have a feeling the path you've laid out for yourself will be fun, too. likely our paths will intersect, but that's OK in this community. :)
23:03 masak sorear: thanks for your replies on my p6l thread today. they helped.
23:03 tadzik masak: I was thinking about the parser which could use multiple, let's say, output engines, like --oe=text, --oe=xhtml, which is like what you are proposing, but for Rakudo itself
23:03 * jnthn goes to read for a bit - bbl
23:03 tadzik masak: but is integrating that into Rakudo a good idea?
23:03 masak tadzik: mostly that's not me proposing, it's S26 proposing.
23:03 masak tadzik: I'm just making a grant proposal of things that are already spec.
23:03 tadzik oh, ok
23:05 shirtless joined #perl6
23:05 shirtless What's the best code to do an HTTP POST with that will work with rakudo perl6?
23:05 masak std: class A { has $!foo }; class B { method x { say $!A::foo } }
23:05 p6eval std 31883: OUTPUT«ok 00:01 117m␤»
23:06 tadzik masak: looks like Pod::Parser in p6-examples is doing much of work alredy
23:06 masak rakudo: class A { has $!foo }; class B { method x { say $!A::foo } }; B.new.x
23:06 p6eval rakudo 9b6189: OUTPUT«No such attribute '$foo'␤  in 'B::x' at line 22:/tmp/_d_WtYAO3f␤  in main program body at line 22:/tmp/_d_WtYAO3f␤»
23:06 pmichaud back again
23:06 tadzik shirtless: take a look at HTTP::Client maybe
23:06 shirtless tadzik, cool, I saw that didn't know if there were others
23:06 shirtless gonna try it out.
23:06 ingy where's TimToady during all this hooha?
23:06 masak tadzik: yes, you could probably start from that -- you'd need to first update it to Rakudo ng, because it's almost two years old by now.
23:07 tadzik oh
23:07 masak tadzik: fork the repo and github and go wild!
23:07 tadzik everything on my head? /o\
23:07 shirtless Derp never mind, There's no IMAP code for perl6 yet, is there?
23:07 ingy jnthn: read your post. seemed like good timing...
23:07 * tadzik panics, learning from masak experiences
23:07 masak tadzik: just giving you ideas here :)
23:07 tadzik shirtless: I don't think there is one
23:07 shirtless Cool, new project for shirtless.
23:07 tadzik masak: I'll take a look at it
23:07 masak tadzik: also, check out http://use.perl.org/~masak/journal/38644
23:08 tadzik shirtless: I think the whole Net:: namespace needs some love
23:08 tadzik shirtless: my only excuse for not having fun with it yet is the lack of binary files support in Rakudo :)
23:08 sorear masak: try to make your implementation stealable by niecza, ok? :)
23:08 masak shirtless: write us a module that you yourself would love to use. that's a recipe for success.
23:09 shirtless tadzik, what are the implications of that? I can't save a binary?
23:09 masak sorear: not nearly at OO yet :) but sure.
23:09 shirtless masak, I'll try. Perl is still pretty alien syntax to me.
23:09 masak sorear: I think I will have enough fun with subs and phasers for several months to come.
23:09 pmichaud tadzik: I don't understand why your "cd rakudo && make install" line seems to not do anything.
23:09 masak shirtless: you know it's always OK to ask here, right? :)
23:10 shirtless yeah this place is awesome
23:10 tadzik shirtless: yep
23:10 tadzik pmichaud: no idea
23:10 masak shirtless: it totally is! it's my favourite place on the interwebs.
23:10 pmichaud tadzik: what version of make do you have?
23:10 shirtless tadzik, oh well, guess you won't be able to use my Imap module to download trojans to your windows box then.
23:10 sorear masak: I was referring to the rakudo --doc proposal
23:10 tadzik pmichaud: GNU Make 3.81
23:10 pmichaud tadzik: very weird.
23:10 tadzik shirtless: no windows box here :(
23:10 masak sorear: oh, sure. provided I get the grant. :)
23:10 shirtless tadzik, how do you run trojans without a windows box?
23:11 masak sorear: almost all of it will be in Perl 6 code, and thus easily stealable. :)
23:11 tadzik shirtless: oh, I have a great trojan emulator for linux. Works perfectly!
23:11 pmichaud tadzik: are you perhaps doing a parallel make?
23:12 tadzik pmichaud: could be
23:12 tadzik > echo $MAKEFLAGS
23:12 tadzik -j2
23:12 pmichaud aha
23:12 pmichaud I bet that's part of the problem.
23:12 tadzik now with -j1…
23:13 tadzik oh, what an output
23:13 tadzik and it compiles something
23:13 tadzik this will be a big, good paste
23:15 tadzik pmichaud: http://nopaste.snit.ch/22496
23:19 sorear I find that a lot of "Perl 6" code isn't as easy to steal as it should be
23:19 sorear because of completely gratuitous use of advanced features like multiple dispatch and junctions
23:21 * sorear needs to overhaul the binder before either of those become feasable to implement
23:23 KenGuru joined #perl6
23:27 waste rakudo: say 1; # test
23:27 p6eval rakudo 9b6189: OUTPUT«1␤»
23:27 tadzik Null PMC access is always a bug, right?
23:27 pmichaud not *always*
23:27 pmichaud but usually, yes.
23:28 waste what about segfault ?
23:28 pmichaud that's usually a bug also.
23:28 tadzik http://nopaste.snit.ch/22497
23:28 tadzik duh, ran twice
23:30 pmichaud yes, that's a bug.
23:30 pmichaud $match[0] should probably return a failure, since there is no $match[0]
23:30 Ken-Guru joined #perl6
23:31 masak tadzik: please submit a rakudobug.
23:32 masak tadzik++
23:32 tadzik will do
23:34 Italian_Plumber joined #perl6
23:34 pochi is there a way to get readline support in the repl?
23:35 pmichaud the repl has readline support.  you probably need to have the libreadline[56]-dev package installed
23:35 pmichaud (when building parrot)
23:35 pochi ah, ok
23:35 pmichaud parrot looks for libreadline5-dev to compile in readline support.
23:35 pmichaud (package may be different on your particular OS.... libreadline5-dev is what is needed on my system)
23:36 gfldex std: class A { method b($name, |$c?){}; }; A.b('foo');
23:36 p6eval std 31883: OUTPUT«[31m===[0mSORRY![31m===[0m␤Unable to parse signature at /tmp/Lf2ytpsH8N line 1:␤------> [32mclass A { method b[33m⏏[31m($name, |$c?){}; }; A.b('foo');[0m␤Couldn't find final ')'; gave up at /tmp/Lf2ytpsH8N line 1:␤------> [32mclass A { method b($name, |$c[33m⏏[31m?){};
23:36 p6eval ..}…
23:36 gfldex std: class A { method b($name, |$c){}; }; A.b('foo');
23:36 p6eval std 31883: OUTPUT«Potential difficulties:␤  $name is declared but not used at /tmp/tuZ_sQqso3 line 1:␤------> [32mclass A { method b([33m⏏[31m$name, |$c){}; }; A.b('foo');[0m␤  $c is declared but not used at /tmp/tuZ_sQqso3 line 1:␤------> [32mclass A { method b($name, |[33m⏏[31m$c){}; };
23:36 p6eval ..A.b…
23:38 pochi pmichaud: thanks, libreadline5-dev did the trick
23:40 tadzik bug sent
23:41 waste rakudo: die; CATCH { die };
23:41 p6eval rakudo 9b6189:  ( no output )
23:41 tadzik time for me. G'night #perl6
23:43 justatheory joined #perl6
23:43 gfldex rakudo: class B {       has $.ref is rw;        method m(|$c){ $.ref(|$c)}; };  multi sub sub1(){};     multi sub sub1($a){say $a;};    my $b = B.new();        $b.ref = &sub1; $b.m(); $b.m('butterfly');
23:43 p6eval rakudo 9b6189: OUTPUT«too many positional arguments: 2 passed, 1 expected␤  in 'B::m' at line 22:/tmp/dSKHiZZ7fQ␤  in main program body at line 22:/tmp/dSKHiZZ7fQ␤»
23:43 gfldex bug?
23:44 gazza67 joined #perl6
23:44 pragma_ joined #perl6
23:44 waste rakudo: die; CATCH { say "caught!"; }
23:45 p6eval rakudo 9b6189: OUTPUT«caught!␤»
23:45 masak gfldex: please golf your code if possible :) too much noise to tell right now.
23:45 gfldex it's golfed as hard as i can
23:45 gfldex i will nopaste it with indents
23:46 * masak tries it locally
23:46 waste rakudo: die; CATCH { say "caught!"; die }
23:46 gfldex http://gist.github.com/502758
23:46 pmichaud waste: die inside of CATCH is known to segfault
23:46 p6eval rakudo 9b6189:
23:46 p6eval ..OUTPUT«caught!␤caught!␤caught!␤caught!␤caught!␤​caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤c​aught!␤caught!␤caught!␤caught!␤caught!␤caught!␤ca​ught!␤caught!␤caught!␤caught!␤caught!␤caught!␤cau​ght!␤caught!␤caught!␤caught!␤caught!␤caught!␤caug​ht!␤caught!␤caught!␤caught!␤caught!␤caught!␤ca…
23:46 gfldex it doesnt like the last line
23:46 waste pmichaud: ok
23:48 masak gfldex: ah.
23:48 masak gfldex: no bug.
23:48 pmichaud $.ref  only expects zero argumetns.
23:48 masak gfldex: you need to write that as $.ref()(|$c)
23:48 pmichaud masak++
23:48 masak gfldex: there's a mention in S12 about why.
23:48 pmichaud I suspect you could write it as  $!ref(|$c)
23:48 masak gfldex: but basically, you need ()() when you call a code thing in a public accessor.
23:49 pmichaud but yes,  $.ref is always a method call
23:49 pmichaud (that, by default, returns the value of $!ref)
23:49 masak right, and $.ref() is *the same* method call.
23:50 masak gfldex: it says that it expects 1 argument because Rakudo has a confusing habit of counting the invocant as an argument.
23:51 gfldex i figured that one out already :)
23:51 masak gfldex++
23:51 gfldex P6Invocation is a funny little bugger :P
23:51 masak not really :)
23:52 waste rakudo: die; CATCH { say "caught!"; $!.handled = 1 };
23:52 p6eval rakudo 9b6189:
23:52 p6eval ..OUTPUT«caught!␤caught!␤caught!␤caught!␤caught!␤​caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤c​aught!␤caught!␤caught!␤caught!␤caught!␤caught!␤ca​ught!␤caught!␤caught!␤caught!␤caught!␤caught!␤cau​ght!␤caught!␤caught!␤caught!␤caught!␤caught!␤caug​ht!␤caught!␤caught!␤caught!␤caught!␤caught!␤ca…
23:53 masak this is why I tend not to use CATCH a lot in my programs. :P
23:53 masak "caught in a web of re-throws..."
23:54 pmichaud someday I'm going to have to really investigate Parrot's exception handling system to see how I can selectively disable handlers for certain exceptions.  :-|
23:54 waste just curious; the latest release anouncement mentioned resumable exceptions; what's the syntax for that?
23:54 pmichaud or otherwise tie exceptions to a specific handling scope.
23:54 pmichaud waste: Tene might recall
23:54 gbacon joined #perl6
23:54 Ken-Guru does the msi of rakudo only xcopy deploy?
23:56 * masak sees a bunch of new acronyms and realizes it's about Windows :)
23:56 Ken-Guru :D
23:56 Ken-Guru indeed
23:57 jnthn Ken-Guru: It extracts stuff into the C:\Rakudo folder, and sets up a file association and some start menu entries. That's all.
23:58 Psyche^ joined #perl6
23:58 exodist Is there a page/site/doc that lists like a glossary of terms, list of operators, list of functions, modules, etc, like perldoc does for perl5?
23:59 jnthn sorear: Multiple dispatch is not really an advanced feature. It's pretty much foundational in Perl 6.
23:59 sorear waste: the specced syntax is $!.resume; in a handler
23:59 Ken-Guru 2(jnthn2): i got no start menu entry. haven't found an uninstaller, so copied it over to my usb and deleted the original ;-)

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

Perl 6 | Reference Documentation | Rakudo