»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.pugscode.org/ | UTF-8 is our friend! | Rakudo Star Released!
Set by moderator on 29 July 2010.
whee aw, clang parot and rakudo is slightly slower on an arbitrary test :( 00:00
perl6 -e 'say [<] (1..1000)' 17.55s user 0.27s system 99% cpu 17.933 total 00:01
jnthn is glad colomon++ has been working on optimizing the .. operator :-) 00:02
whee (but it passes all the bundled tests :D)
jnthn Oh, that's a good thing. :-)
00:05 dduncan left
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
00:06 KenGuru joined
KenGuru whats the difference between cream-gvim and gvim? 00:07
shirtless cream will have no modal concepts when you start using it 00:08
it will feel alot like windows notepad and you'll have to use the mouse
sorear tylercurtis: egh. so no good for a mixed 5/6 project 00:09
shirtless KenGuru, if you want to try it in regular mode (plain old gvim) then here is a quick cheatsheet i made pastebin.com/ZZzd8XNr 00:10
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.
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.
shirtless wouldn't be surprised if a lot of people in here could answer a vim question, either.
tylercurtis sorear: although it fails miserably if you use =begin/=end-style POD; it doesn't recognize the =end as ending it. 00:12
00:13 KenGuru joined 00:21 cognominal joined 00:24 ashleydev joined
[Coke] offerkaye++ 00:25
kid51 [Coke] ping 00:34
colomon whee: my optimized version does [<] (1..1000) in 1.78s on my MacBook Pro. 00:37
unfortunately, it failed a bunch of tests, and I still have to sort out why.
> say +(6..8)
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).
colomon for example
tylercurtis: and that's just switching to the Int version of the fdiv op?
tylercurtis colomon: right. 00:39
00:39 matt_youell joined 00:40 infrared joined
KenGuru doh ... gvim 00:41
00:41 sECuRE joined
sECuRE i tried to use LWP::Simple from rakudo star like this: LWP::Simple.new.get('localhost:5984/foo/b616376f0add14a2...b0025f3'); 00:42
however the non-standard port seems to be a problem, i get an error message:
p.nnev.de/1492
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
easier than migrating editor settings that are in a binary registry
sECuRE can be fixed by changing line 140 of LWP/Simple.pm to $sock.open($hostname, $port.Int, :bin); 00:45
(it used $port before)
00:45 ispeak_ joined
sECuRE where can/should i report this? 00:45
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
then I'm working remotely on some strange server with my regular setup.. pretty awesome.
jnthn sECuRE: Maybe an issue in github.com/cosimo/perl6-lwp-simple/ would help
cosimo: If you're about, see ^^
sECuRE jnthn: thanks for the pointer, will do 00:47
KenGuru i have my colors saved on usb (no binary format) 00:48
shirtless you made your own theme
?
KenGuru but i don't have vim colors atm
japp
shirtless So you're a seasoned vim user, you just hate it anyway?
KenGuru its kinda like the dark theme from monodev
no i dont hate it
[Coke] kid51: yes?
shirtless oh good :)
KenGuru i'm not used to it
i use powershell all day long ;-) 00:49
and npp
shirtless I'm either using vim or the lousy eclipse editor
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)
[Coke] kid51: minimum recommended memory is 1G. 00:56
looks like you have 25% of that.
kid51 Oh :-(
Where is that minimum spelled out? 00:57
[Coke] school of hard knocks. :|
kid51 may finally be forced to buy a new laptop!
kid51 hates buying hardware ... is a confirmed late adopter
whee kid51: do it! :D 00:58
[Coke] kid51: added a note as well. someone can put a note in the README or something. 00:59
00:59 songmaster_ joined
[Coke] also: "make parrot use less memory" 00:59
also: "split up core.pm when building"
both of which are haaaaaaard.
sorear "make parrot use less memory" is very, very much in process 01:00
the object system rework will slash memory footprint in half
by my estimates
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.
your new laptop won't be PPC, so there's that.
kid51 What do you mean by ... "that"? 01:02
Is/was PPC more memory-inefficient than Intel?
[Coke] it is a fact of note.
just different.
01:02 rjbs joined
KenGuru stackoverflow ... in my brain. 01:03
to much new input
rjbs Hi, sixies. How's the R* train goin'?
kid51 turning to a new topic ...
kid51 begins reading UsingPerl6-draft.pdf ...
... Is there a plan to update this on a regular schedule?
rjbs kid51: Cool! I am looking forward to finding a pile of time to read that, myself.
kid51 rjbs: tech.groups.yahoo.com/group/perlsem...essage/993 01:04
KenGuru 2(shirtless2): you're right ... cream in easy mode is like npp
tylercurtis colomon: looks like fdiv__III doesn't work for $MOST-NEGATIVE-INT div -1 (where $MOST-NEGATIVE-INT means what it sounds like).
snarkyboojum managed to build rakudo on his 256MB slice by copying a precompiled version of core.pir across to it :)
KenGuru getting familiar 01:05
rjbs kid51: good luck! 01:07
sorear kid51: ppc has always used much less compact code than intel, it's RISC's one flaw 01:08
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
[Coke] hugme: show book? 01:09
hugme [Coke]: sorry, I don't know anything about 'book?'
[Coke] hugme: show book
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: github.com/perl6/book/
sorear kid51: though it kindof evened out because the ppc had a MMU and unused code pages could be evicted
[Coke] kid51: there's the book. you can see the update schedule so far.
sorear [Coke]: ppc vs. intel with the same sizeof(void*) shouldn't affect parrot much, since bytecode isn't machine code 01:10
colomon jnthn: ping? 01:22
jnthn colomon: oh hai 01:27
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*
colomon if I .perl it, I get ((1, 2)) instead of (1, 2)
jnthn colomon: I think I need an example of wha tyou're observing.
colomon: OK. Plesae can I see the whole thing?
(yes, that looks like a PiP to me too..) 01:29
colomon gist.github.com/501608 01:30
if $mod == 2, the output is "parcel" => ((1, 2))
(output of the say which is the next to last statement)
I can get around it by taking [0] of the Parcel, but that seems ... inelegant. 01:31
jnthn rakudo: my $parcel := pir::new__Ps('Parcel'); pir::push($parcel, 42); $parcel.perl.say 01:32
p6eval rakudo dfefdd: OUTPUT«(42, )␤»
colomon rakudo: my $parcel := pir::new__Ps('Parcel'); pir::push($parcel, 42); pir::push($parcel, 17); $parcel.perl.say
jnthn rakudo: my $parcel := pir::new__Ps('Parcel'); pir::push($parcel, 42); pir::push($parcel, 69); say :$parcel.perl
p6eval rakudo dfefdd: OUTPUT«(42, 17)␤»
rakudo dfefdd: OUTPUT«"parcel" => ((42, 69))␤»
jnthn rakudo: my $foo := (1,2,3); say :$foo.perl 01:33
01:33 drbean joined
p6eval rakudo dfefdd: OUTPUT«"foo" => ((1, 2, 3))␤» 01:33
jnthn colomon: Oh. Interesting.
colomon huh. does Parcels do funny things when you pass them as arguments?
jnthn Not really
colomon huh. 01:34
jnthn But what you're observing isn't any different from if we constructed the Parcel normally
I wonder if it's to do with the pair dumper?
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)
jnthn rakudo: my $x = 1,2,3; say :$x.perl
p6eval rakudo dfefdd: OUTPUT«"x" => 1␤»
jnthn gah!
rakudo: my @x = 1,2,3; say :@x.perl
p6eval rakudo dfefdd: OUTPUT«"x" => [1, 2, 3]␤»
jnthn colomon: I can't help but wonder if something in the Pair construction is doing it. 01:35
Since $parcel.perl seems OK but :$parcel.perl doesn't.
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.
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?
colomon will take a minute, requires a rakudo rebuild 01:38
jnthn k 01:39
isBEKaml_ (backlogging) I think we all forgot about u4x.perl6.org. :(
jnthn I'm in the procces of writing a long mail to parrot-dev ATM anyways. :-)
isBEKaml_ It needs some browser love. :(
[Coke] uhoh.
isBEKaml_ phenny: tell offerkaye, you have 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.
jnthn [Coke]: :-) 01:42
01:42 envi^home joined
jnthn [Coke]: Don't worry, it's not a rant. :-) 01:42
I have weissbier. I'm too happy to rant. 01:43
colomon just broke out the Amaretto. 01:44
jnthn :)
colomon jnthn: huh. it's a Parcel at the point of that say statement.
but inside the ConsIter it's a Seq. :\\ 01:45
jnthn colomon: Bingo.
colomon: It must be putting it in item context.
colomon: Use \\
colomon in the .new call?
jnthn Erm
oh hm. 01:46
I wonder *where* it's getting put into item context.
Oh
If it's Seq in .new then there I guess
colomon: In the signature of method new do something like \\:$value or some such
colomon: Basically, it says "don't apply any context"
colomon I'm just using default new. 01:47
jnthn Oh.
colomon I meant ConsIter.new(:value-parcel(\\$parcel)
01:47 cmadsen joined
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
jnthn colomon: OK. 01:48
colomon I can just pass an Array, and the infix:<,>(|@array, whatever) Parcel constructor trick should still work
jnthn colomon: I think it may be a slightly deep thing going on here.
colomon right?
cmadsen I'm trying to build rakudo star, and it fails:
Symbol '@named-params\\ufffd' not predeclared in MAIN_HELPER (src/gen/core.pm:6542)
jnthn Yes, but you may lose your hard-won efficiency wins, no?
cmadsen this appears to be some kind of encoding issue
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.
cmadsen but core.pm says @named-params».name».substr(1)
jnthn cmadsen: That sounds...rather odd. And yes, encoding-y.
cmadsen: What platform are you on?
cmadsen Gentoo Linux
jnthn hasn't seen this issue before... 01:50
Oh. That's...nothing so unusual. :S
cmadsen: All we do is concatenate the files together into core.pm
cmadsen  is 0xC2 in Latin-1, which is also the first byte of » in UTF-8 01:51
but that still doesn't explain how it got from » to »
jnthn cmadsen: No, I'm rather confused too.
sorear » in UTF-8 is C2 BB 01:52
» in ISO-8859-1 is C2 BB
makes perfect sense to me
cmadsen so it read MAIN.pm as Latin-1, and wrote it out as UTF-8 01:53
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
jnthn sorear: Yes, but in this case it's a Perl 5 build script.
cmadsen I just downloaded rakudo-star-2010.07
this is my first try at getting it going
jnthn We run build/gen_core_pm.pl
As something like
build/gen_core_pm.pl file1.pm file2.pm > core.pm 01:55
01:56 IllvilJa1 joined
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:57
01:58 KenGuru joined
colomon jnthn: switching to an array does not seem to kill the speed. 01:58
and it fixes the bug quite nicely.
jnthn colomon: OK, go for that then.
frooh anyone know how major of a feature temp scoping is? 01:59
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
unset PERL_UNICODE and regenerating the file worked
I'm not sure why that was necessary, tho
jnthn Oh!
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
cmadsen maybe rakudo's makefile should unset that 02:01
jnthn o/ pmichaud
cmadsen: Or maybe gen_core_pm.pl should say something more specific about the unicode handling it wants.
frooh pmichaud: hey, do you have any idea how hard it would be to add temp scoping to rakudo?
jnthn I'm not sure what the Right Answer is.
pmichaud frooh: I'm guessing not simple.
frooh that's what I figured 02:02
but I assume everything is hard, and then find out a few things are easy
so I was hoping it would be like that :-)
hm hm hm
jnthn cmadsen: If you have a spare moment, please could you drop an email to rakudobug@perl.org to report this?
cmadsen: I don't know the Correct Fix, but somebody surely will. :-)
cmadsen jnthn, np
jnthn And we can patch up a future release do not have this issue.
Thanks. 02:03
cmadsen++
pmichaud what issue?
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
jnthn pmichaud: It's in the pretty immediate backscroll.
pmichaud reads backscroll
(and on phone)
02:07 songmaster_ joined 02:08 songmaster_ joined 02:11 ispeak_ left
pugssvn r31880 | svatsan++ | [u4x] Few style changes for Webkit browsers. 02:13
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:14
frooh so in p5 we usually prefix internal subroutines with_ 02:22
do people have something like that for p6 yet?
isBEKaml_ prefix with !
private subs/methods
frooh ok, cool 02:23
*: my $x = * + 2; say $x.isa
star: my $x = * + 2; say $x.isa
p6eval star 2010.07: OUTPUT«too few positional arguments: 1 passed, 2 (or more) expected␤ in main program body at line 22:/tmp/dqeNawGnhX␤»
cmadsen jnthn: bug filed rt.perl.org/rt3/Ticket/Display.html?id=76856
frooh star: my $x = sub { }; say $x.isa
p6eval star 2010.07: OUTPUT«too few positional arguments: 1 passed, 2 (or more) expected␤ in main program body at line 22:/tmp/p6ZWkOEvQ_␤»
rjbs haha. nice "star:" command 02:25
jnthn cmadsen: Thanks!
frooh: .isa checks what it is
frooh: I think you maybe what .WHAT
rjbs star: my $x = sub {} ; $x.WHAT
p6eval star 2010.07: ( no output )
rjbs jnthn: beat me
jnthn rjbs: say
rjbs star: my $x = sub {} ; $x.WHAT.say
jnthn :-)
frooh *: my $x = * + 2; say $x.WHAT
p6eval star 2010.07: OUTPUT«Sub()␤»
frooh gah
rjbs jnthn: Beat me again! Rrrr!
frooh I keep doing *
jnthn ;-) 02:26
frooh so it's Sub?
not Code?
jnthn frooh: Sub is a subtype of Code
frooh star: my $x = sub { }; say $x.isa(Code)
p6eval star 2010.07: OUTPUT«1␤»
frooh interesting
02:26 lue joined
lue well hello o/ 02:27
frooh star: my $x = 1; say $x.WHAT
p6eval star 2010.07: OUTPUT«Int()␤»
frooh so in perl 6 everything's an object right? 02:28
I guess I need to not do blessed($foo) but instead check if it adheres to a role
jnthn frooh: It either is, or will pretend to be if you try and use it as one. :-)
frooh right 02:29
lue ooh, there's a star: bot.
frooh star: role Robot {}; class Frew { with Robot };
p6eval star 2010.07: OUTPUT«Could not find sub &with␤ in main program body at line 22:/tmp/Hvp7FlcGx6␤»
frooh star: role Robot {}; class Frew does Robot { };
p6eval star 2010.07: ( no output ) 02:30
frooh star: role Robot {}; class Frew does Robot { }; my $x = Frew.new; say $x.isa(Robot)
p6eval star 2010.07: OUTPUT«0␤»
frooh star: role Robot {}; class Frew does Robot { }; my $x = Frew.new; say $x.does(Robot)
p6eval star 2010.07: OUTPUT«1␤»
frooh nice
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
p6eval star 2010.07: OUTPUT«0␤»
[Coke] jnthn: BIER! ICH HABE BIER!
frooh star: role Robot { requires 'woohoo' }; class Frew does Robot { }; my $x = Frew.new; say $x.does(Robot)
[Coke] . o O (I forgot there was beer.)
jnthn [Coke]: ICH AUCH!
p6eval star 2010.07: OUTPUT«===SORRY!===␤Could not find sub &requires␤»
jnthn [Coke]: Forgot...beer...huh
frooh how do I require methods to be implemented in p6? 02:32
jnthn frooh: method that-i-want() { ... }
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␤»
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.
frooh that's not quite what I meant
ok
jnthn frooh: It is meant to whine at compile time too, but I didn't get to implementing that yet. :(
frooh ok, that's fine for now then
star: die 'lolwut' 02:35
p6eval star 2010.07: OUTPUT«lolwut␤ in main program body at line 22:/tmp/etfL_pxBEP␤»
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"␤»
frooh star: my $x = "frwe"; $x = do { my $y = $x; sub { $x } }; $x.perl.say;
p6eval star 2010.07: OUTPUT«{ ... }␤»
frooh star: my $x = "frwe"; $x = do { my $y = $x; sub { $x } }; $x().say; 02:37
p6eval star 2010.07: OUTPUT«_block129␤»
frooh star: my $x = "frwe"; $x = do { my $y = $x; sub { $x } }; $x.().say;
p6eval star 2010.07: OUTPUT«_block129␤»
frooh hmm
jnthn frooh: $x.() is the same as $x()
frooh right
the realais isn't working
it's probably just I'm not used to p6 semantics 02:38
or I cna't type
star: my $x = "frwe"; my $y = $x; $x = do { my $y = $x; sub { $y } }; $x().say;
p6eval star 2010.07: OUTPUT«frwe␤»
frooh there we go
perfect
jnthn :-)
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␤»
cmadsen jnthn: I figured out why it broke. See my comments at rt.perl.org/rt3/Ticket/Display.html?id=76856
jnthn cmadsen: Excellent, thanks. 02:40
frooh where's the vim highlight file again? 02:41
sorear petdance @ github
frooh wow 02:43
slow
but pretty
02:43 rjbs left
isBEKaml_ yes, instead of setting filetype, I just set syntax. works well for me. 02:44
LaVolta github.com/hinrik/vim-perl, also :)
frooh isBEKaml_: I mean using the perl6.vim is really slow at parsing 02:45
isBEKaml_ frooh: that's what I meant too.
frooh isBEKaml_: what do you mean by set syntax?
isBEKaml_ frooh: if you want something faster, don't set ft=perl6. set syn=perl6
frooh ohh 02:46
interesting
huh
now no colors at all; is that what you meant?
02:46 bjarneh joined
isBEKaml_ :set syntax=perl6 02:46
frooh yeah, went grey
isBEKaml_ or #vim: set syntax=perl6
frooh I must not be loading things in vim right 02:47
pmichaud back again
frooh star: my $y; my $z = sub { 1 }; ($y||$z).().say
p6eval star 2010.07: OUTPUT«1␤»
isBEKaml_ sorry, # vim: syntax=perl6
frooh star: say q<frwe bar biff>; 02:48
p6eval star 2010.07: OUTPUT«frwe bar biff␤»
pmichaud cmadsen: excellent bug tracking, thank you!
frooh star: my $y = sub { 1 }; ($y || die 'unset').().say; 02:49
p6eval star 2010.07: OUTPUT«1␤»
frooh star: my $y; ($y || die 'unset').().say;
p6eval star 2010.07: OUTPUT«unset␤ in main program body at line 22:/tmp/TVqNYWYoEO␤»
02:49 sahadev left
dalek kudo: 685c1e7 | (Solomon Foster)++ | src/core/Range.pm:
Try to optimize finite Int Range iteration.
02:52
kudo: 9b6189d | (Solomon Foster)++ | src/core/Range.pm:
Just go ahead and pass an Array to ConsIter -- makes the code a bit cleaner,

much.
frooh is there a p6 form of caller yet? 02:57
sorear yes 02:58
isBEKaml_ "use module qw<sub>; " doesn't seem to work. Any workarounds?
frooh sorear: what is it?
isBEKaml_ I have commented out the qw part for now.
sorear frooh: caller
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␤»
frooh It didn't work before
sorear star != p6
frooh fine fine
sorear niecza: for 1 -> $x { say caller.file }
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␤»
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␤»
frooh hmmm
sorear star: for 1 -> $x { say callframe(1).file }
frooh I'll just pretend I don't need it for now
p6eval star 2010.07: OUTPUT«Any()␤»
sorear callframe(1) looks like the rakudo way 03:01
03:01 cognominal joined
sorear star: for 1 -> $x { say callframe(0).file } 03:01
p6eval star 2010.07: OUTPUT«/tmp/1Xix3S_MtV␤»
sorear star: 1.map({say callframe(1).file})
p6eval star 2010.07: ( no output )
sorear star: 1.map({say callframe(2).file})
p6eval star 2010.07: ( no output )
sorear star: 1.map({say callframe(3).file})
p6eval star 2010.07: ( no output )
frooh star: callframe(0).perl.say
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␤»
frooh bleck 03:02
star: sub f (Code $robot, @args) { $robot.(@args).say }; f { $^a * 2 }, (1, 2, 3) 03:04
p6eval star 2010.07: OUTPUT«6␤»
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␤»
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␤»
pmichaud CALLER NYI
eternaleye Ah, okay
pmichaud (I think I will try to add a NYI message soon.)
lue wonders if macros are still NYI 03:12
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
sorear hates people sometimes 03:14
jnthn: oh please don't, that stuff was *awful*
jnthn sorear: Oh?
OK. :-)
sorear Well
It had the same problems that operator overloading does
And for the same reason
Only much worse, because adding operators rarely changes the meaning of correct code 03:15
Adding macros usually *does*
(also, work implementing niecza has changed my opinions on a number of compiler issues with ramifications on the macro problem) 03:16
03:17 jaldhar joined
frooh aww, patrick left 03:24
jnthn There goes the Netherlands...
frooh jnthn: do *you* have any idea how hard it would be to implement caller?
frooh goes to get two units of caffiene 03:25
jnthn frooh: Given that we alrady have callframe, probably not too bad. 03:26
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␤»
jnthn rakudo: say &callframe.candidates>>.signature
p6eval rakudo dfefdd: OUTPUT«Signature()<0x794d360>␤»
jnthn rakudo: say &callframe.candidates>>.signature.perl
p6eval rakudo dfefdd: OUTPUT«(:(Int $level = { ... }), )␤»
jnthn frooh: Looking at S06, probably quite easy. 03:28
Though not "I'm going to write it at 5:30am" easy. :-)
03:32 wayland76 joined
wayland76 Hi all. Quick question -- has anyone thought about whether Perl grammars are suited to natural language parsing? 03:33
lue I thought about trying my hand at macros. Then I started reading its (relatively) terse description in S06.... 03:34
03:34 PerlJam joined 03:38 dukeleto joined 03:39 pmichaud joined
frooh jnthn: sure; I was thinking maybe I could try to hack it together next time I see patrick 03:41
faking temp seems pretty easy; caller....not so much :-)
jnthn frooh: Actually caller would be much easier 03:42
frooh right
to fake?
jnthn frooh: S06 suggests it's just a curried version of callframe
I don't know what you mean by "fake"
callframe isn't really faked. :-)
frooh work around
jnthn Oh
Sorry, I thought you meant "implement" :-)
frooh I'll implement later
I want to get somethign to work first 03:43
frooh is backwards that way :-)
jnthn Well caller is easy enough
frooh javascript has twisted my brain
show me
jnthn rakudo: say callframe(0).^methods; 03:44
p6eval rakudo dfefdd: OUTPUT«mycallframefilelinekvminmaxpickflatfirstminmaxdoesrotatejoinNumericelemsendreduceallStrpostcircumfix:<[ ]>postcircumfix:<{
..}>listat_keypairsoneACCEPTSat_posanysortSeqgrepnonevaluescankeysreverseuniqisaclassifymapBUILDALLnewBoolprintsayitemWALKdefinedBUILDcloneperlWHICHCaptureCREATE…
frooh zomg omg
jnthn rakudo: say callframe(0).^methods(:local).join(',')
p6eval rakudo dfefdd: OUTPUT«my,callframe,file,line␤»
jnthn huh, callframe doesn't have a way to actually get the routine?
frooh jnthn: how do I get the package name from callframe? 03:45
that's really all I want
jnthn frooh: OK, it's not so easy as I thought. :-(
frooh hahaha
not that surprising
well, it can wait
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␤»
jnthn Ah.
Yeah, callframe needs a bit more work yet.
03:48 jql joined
frooh that's ok 03:48
but once I get caller I can port Log::Contextual
which is a nice lightweight logger
that maybe people could use
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
but if it's in pir ... not so much :-)
jnthn frooh: Should be do-able largely or entirely in Perl 6. 03:51
caller is really a curried version of callframe, or so the spec says.
frooh sure
well, if you guys point me in the right direction I am willing to give it a shot
03:54 Alias_ joined
jnthn frooh: src/core/CallFrame.pm has the implementation so far 03:55
OK, time for me to sleep :-)
04:03 MattMan joined 04:05 LaVolta joined, dushyant joined
MattMan I asked yesterday about the Match object in list context 04:06
I was having trouble getting it to work in the way I was expecting
The answer ended up being something like the following
rakudo: my ($b, $c) = @('12 34'.match(/(\\w+) \\s (\\w+))) ; say $b.perl $c.perl ; 04:07
p6eval rakudo dfefdd: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 22␤» 04:08
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␤»
MattMan Oops, try this
my ($b, $c) = @('12 34'.match(/(\\w+) \\s (\\w+)/)) ; say "$b $c" ;
My question is, why is the @() construct necessary to establish list context 04:10
Surely rakudo should know that list context is required by the fact that the LHS is a list ?
rakudo: my ($b, $c) = @('12 34'.match(/(\\w+) \\s (\\w+)/)) ; say "$b $c" ;
p6eval rakudo dfefdd: OUTPUT«12 34␤»
dushyant quit 04:11
isBEKaml_ rakudo: ('12 34'. match(/(\\w+) \\s (\\w+)/)).WHAT.say 04:14
p6eval rakudo dfefdd: OUTPUT«===SORRY!===␤Confused at line 22, near "('12 34'. "␤»
isBEKaml_ rakudo: ('12 34'. match(/(\\w+) \\s (\\w+)/))).WHAT.say
p6eval rakudo dfefdd: OUTPUT«===SORRY!===␤Confused at line 22, near "('12 34'. "␤»
04:14 achromic joined
isBEKaml_ rakudo: ('12 34'.match(/(\\w+) \\s (\\w+)/)).WHAT.say 04:15
p6eval rakudo dfefdd: OUTPUT«Match()␤»
MattMan rakudo: @('12 34'.match(/(\\w+) \\s (\\w+)/)).WHAT.say 04:17
p6eval rakudo dfefdd: OUTPUT«Seq()␤»
04:18 jql left
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:20
MattMan But S05 says the following 04:21
"When used as an array, a Match object pretends to be an array of all its positional captures."
isBEKaml_ MattMan: yes, that's what i meant by Positional. 04:22
MattMan It just doesn't seem especially DWIM-y, that's all
You've already specified that you want it to behave like a list because you've assigned it to one 04:23
The extra cast to an array seems superfluous
04:23 Juerd joined 04:33 cognominal joined, brianherman joined
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␤»
sorear wayland76: You should ask the person who created them. He's a linguist by trade. 04:36
isBEKaml_ MattMan: ^^ 04:38
04:42 [particle] joined, nadim joined 04:43 meteorjay joined
exodist am I the only one who thinks "Leeloo Dallas Multipass!" every time I see 'multi ...'? 04:44
04:44 wolverian joined, mutewit joined, moritz_ joined, rcfox joined 04:45 sjn joined, grew joined
PerlJam exodist: probably 04:47
but exodist++ anyway for the reference :)
exodist haha
frooh any of you guys know a good place to hire people to design logos? 04:51
I'm looking at elance right now
04:51 eternaleye_ joined 04:53 abrasive joined 04:54 14WAA0PR3 joined, desertm4x joined
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
but you have to enable it
PerlJam isBEKaml_: why would you want to do that?
isBEKaml_ PerlJam: Maybe write my own implementation? I know I can do that by extending the base class and rewriting it. 04:56
04:57 melte joined
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.
frooh huh...
PerlJam isBEKaml_: show the code 04:58
04:58 ashleydev joined
isBEKaml_ PerlJam: pastebin.com/8ema2rEL 04:59
Currently I'm just debugging through to grok code. :) 05:00
PerlJam I think I'm going to do with NYI on this one :) 05:02
isBEKaml_ :) 05:03
PerlJam: you mean the debugger as NYI or the feature itself - augmenting and logging?
PerlJam you really want "supersede" and it's not implemented 05:05
though I wonder if you'd have to say augment class C { supersede method M { ... } } 05:06
isBEKaml_ PerlJam: I would guess, supersede class C { method M { ... } } 05:07
PerlJam: S12:1995 05:08
PerlJam sure but I think that's ambiguous 05:09
supersede class C { ... } reads like I'm replacing the entire class
augment class C { ... } says I'm just changing the class and supersede method M { ... } reads like I'm replacing just that method 05:10
(IMHO)
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
So, IMHO, it goes against the grain when trying to completely supersede a class.
which is what S12 refers to.
S06 also contains a para about supersede. 05:12
brianherman how do you call c functions with perl?
i mean perl6
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
brianherman oh nvm docstore.mik.ua/orelly/perl/prog3/ch21_03.htm
oh cool
i got star
PerlJam brianherman: MiniDBI also makes use of this feature
brianherman why didnt they call it rakudo butterfly
oh xool 05:14
thanks jappy
i mean
jammy
wow
that sounds really offensive
sorry
T_T
please do not post to bash.org 05:15
05:15 molaf joined
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
05:22 MAK___ joined
MAK___ hi 05:23
Can rakudo run Perl5 programs?
isBEKaml_ MAK___: if you got star, you can run with a module can Zavolaj. 05:24
MAK___: erm, Rakudo Star distribution - Zavolaj is already packaged with the distribution.
MAK___ no my point is if rakudo can't run a perl 5 program directly then why should one do a 'use v6' explicitly?
because that is all it can run anyway 05:25
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
MAK___ hello world program runs without v6 05:32
so i think v6 is not compulsory
05:34 chitragupt joined
cosimo rakudo: say "WHAT".WHAT 05:42
p6eval rakudo 9b6189: OUTPUT«Str()␤»
cosimo say 21.WHAT
rakudo: say 21.WHAT
p6eval rakudo 9b6189: OUTPUT«Int()␤»
wayland76 sorear: Thanks; I guess I was hoping he'd be awake :). Maybe I'll just post it on the mailing list 05:43
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␤»
isBEKaml rakudo: ~WHAT.perl.say
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␤»
isBEKaml :)
05:44 chitragupt joined
isBEKaml rakudo: 42.WHAT.perl.say; +"42".WHAT.perl.say 05:45
p6eval rakudo 9b6189: OUTPUT«Int␤Str␤»
isBEKaml rakudo: 42.WHAT.perl.say; (+"42").WHAT.perl.say
p6eval rakudo 9b6189: OUTPUT«Int␤Num␤»
05:47 Revolve_ joined
ingy star: my @a = [5..10]; map { say } @a 05:57
p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "map { say "␤»
ingy star: my @a = [5..10]; map { .say } @a
p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "map { .say"␤»
ingy star: my @a = [5..10]; @a.map { .say }
p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "@a.map { ."␤»
ingy star: my @a = [5..10]; @a.map({ .say })
p6eval star 2010.07: ( no output )
ingy star: my @a = [5..10]; @a.map({ $_.say }) 05:58
p6eval star 2010.07: ( no output )
ingy star: my @a = [5..10]; @a.map({ say })
p6eval star 2010.07: ( no output )
ingy star: my @a = [5..10]; @a.map({ say $_ })
p6eval star 2010.07: ( no output )
ingy gives up
06:00 cognominal joined 06:05 agentzh joined
szabgab star: my @a = [5..10]; say @a.perl 06:07
p6eval star 2010.07: OUTPUT«[[5, 6, 7, 8, 9, 10]]␤»
szabgab star: my @a = [5..10]; @a.map({ say "something" }) 06:08
p6eval star 2010.07: ( no output )
szabgab star: my @a = [5..10]; for @a { say "something" }
p6eval star 2010.07: OUTPUT«something␤»
szabgab star: my @a = [5..10]; for @a { say $_ }
p6eval star 2010.07: OUTPUT«5 6 7 8 9 10␤» 06:09
szabgab star: my @a = [5..10]; for @a { say "'$_'" }
p6eval star 2010.07: OUTPUT«'5 6 7 8 9 10'␤»
TiMBuS star: my @a = [5..10]; map { .say }, @a; 06:17
p6eval star 2010.07: ( no output )
TiMBuS oh 06:18
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
TiMBuS star: my @a = [5..10]; (map { .say }, @a)[0]; 06:20
p6eval star 2010.07: OUTPUT«5 6 7 8 9 10␤»
melte o0 06:21
I don't get it
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?
TiMBuS nearly, but @a is a single element array, and the first element is an array containing 5..10
exodist ah.
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
TiMBuS star: my @a = 5..10; (map { .say }, @a)[3];
p6eval star 2010.07: OUTPUT«5␤6␤7␤8␤»
exodist I was under the impression lazy hadnt advanced that far yet, that it was all or nothing. glad to see it working. 06:26
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?
TiMBuS ==> and <== 06:28
the nicest part of perl6
exodist whats it do?
*what do they do
TiMBuS star: 1..5 ==> grep * % 2 ==> .say
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"␤»
TiMBuS aww
well it feeds a list, lazily, to anything expecting a list 06:29
star: 1..5 ==> grep {$_ % 2} ==> .say
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"␤»
TiMBuS oh its the .say
star: 1..5 ==> grep {$_ % 2} ==> say
p6eval star 2010.07: OUTPUT«135␤» 06:30
TiMBuS there we are
exodist is that a trivial example? or an intended use? seems it can be done other ways in as much or less code?
star: say grep {$_ % 2} 1..5 06:31
TiMBuS yes its just an example, not a good use
p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "say grep {"␤»
TiMBuS you need a comma
exodist star: say grep {$_ % 2}, 1..5
p6eval star 2010.07: OUTPUT«135␤»
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
instead of the "my @things = map {...}, grep {...}, split /\\s/, <>;" contraptions you often see, you can have $*IN.words ==> grep {...} ==> map {...} ==> my @things; 06:35
or the reverse using <== if you prefer being backwards :)
exodist $*IN the * means global right? what does that global hold? 06:36
06:37 gfx joined
TiMBuS well it sort of means global 06:44
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
at least thats what the spec said last time I checked
it also contains STDIN by default
exodist ah.
that makes sense
TiMBuS which might mess with my last example a bit! since it is lazy 06:47
06:48 jfried joined
melte can I use the feed operators with the reduction ops 06:54
star: 1..5 ==> [*]
p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "1..5 ==> ["␤»
TiMBuS aw that would be kinda cool 06:55
star: 1..5 ==> reduce(&infix:<*>) ==> say 06:56
p6eval star 2010.07: OUTPUT«120␤»
06:56 Su-Shee joined
Su-Shee good morning. 06:57
melte lol
is there a more normal way to make that work 06:58
TiMBuS hmmm probably not using the [*] operator 07:00
might just be a rakudo error
std: 1..5 ==> [*]
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␤»
TiMBuS blinks
looks like the parser doesn't like that. how about 1..5 ==> reduce(* * *) ==> say 07:01
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...
TiMBuS yeah it is confusing to introduce the whatever star when using multiplication 07:04
star: 1..5 ==> reduce(* + *) ==> say
p6eval star 2010.07: OUTPUT«15␤»
TiMBuS explains it better, I hope
07:05 Lasse_ joined
melte oh 07:05
exodist I must be missing something, why is it 15?
melte addition there 07:06
1 + 2 + 3 + 4 + 5 = 15 07:07
07:07 Ross joined
exodist so, what do the surrounding *'s mean? 07:07
TiMBuS 'whatever'. or better put, they're placeholders
exodist ah 07:08
TiMBuS they create their own block of code so you dont need the {}
star: my $addtwo = * + 2; say $addtwo(3); 07:09
p6eval star 2010.07: OUTPUT«5␤»
TiMBuS useful for passing code to functional.. functions 07:10
exodist clever :-) 07:11
07:11 snarkyboojum joined
melte whoa 07:11
neat
07:11 fxn joined
moritz_ moin 07:13
melte star: 1 ?? 2 :: 3 07:15
p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "1 ?? 2 :: "␤»
Su-Shee *hihi* "the tilda operator" - totally for it. "this operator is dedicated to the great actress tilda swinton.." .)
exodist star: say 1 ?? 2 :: 3; 07:16
p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "say 1 ?? 2"␤»
moritz_ exodist: !! instead of ::
melte yeah, my bad 07:17
exodist I was copying melte, but added some things to see if they were the prob
melte moritz_: I was reading dev.perl.org/perl6/doc/design/exe/E03.html
TiMBuS i'd stick with the synopses, maybe the apocalypses 07:18
melte yeah. just popped up on the google search
moritz_ the exegesis are of historical interest only 07:19
melte I want perl6doc :D 07:20
exodist star: my @stuff; push @stuff => 5; say @stuff[0];
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␤»
exodist darn, I was afraid of that 07:21
I love push @list => $thing from perl5, just seems nicer than , to me.
oh well.
moritz_ => constructs a Pair in Perl 6 07:22
it's not a "fat comma" anymore
exodist I xnow, thats what I read that made me try it.
*know. 07:23
TiMBuS coincidentally, ==> at the moment works by calling .push on any end sinks. so 5 ==> @stuff does exactly that 07:26
(for now) 07:27
moritz_ actually it's ==>> that calls .push, ==> should be assignment 07:28
Su-Shee exodist: uhm it's really embarrassing after 14 years of perl - but what does push @foo => $bar exactly give you? 07:30
07:33 spacebat joined
moritz_ Su-Shee: the same as push @foo, $bar 07:34
Su-Shee: => is just a comma in p5, except that it sometimes quotes the LHS
Su-Shee how secret hash context hidden somewhere?
exodist Su-Shee, a pretty syntax, thats all.
TiMBuS moritz_, maybe it changed since i last looked, but I think it was calling push
Su-Shee aeh no secret..
moritz_ TiMBuS: it might be doing it, but then it's wrong :-) 07:35
TiMBuS thats why i changed it to :=
sorear wayland76: I think Larry is at OSCON or something 07:36
07:37 KenGuru joined
sorear wayland76: He said he was getting on a plane a couple days ago and we haven't heard from him since 07:37
moritz_ actually touring around in Europe before YAPC::EU, iirc 07:38
sorear exodist: Would you be happy with push @list: $thing; 07:41
?
exodist sorear, lol, its not really a big deal. 07:42
but, yeah, I thnk thats better
sorear @list.push: $thing and @list.push($thing) also work
As does @list ,= $thing, but that's just weird 07:43
exodist lol, yeah
07:52 eternaleye joined, isBEKaml joined
isBEKaml moritz_: Time to show u4x.perl6.org ? :) 07:53
moritz_ isBEKaml: I wanted to rename it to doc.perl6.org first 07:55
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_ doc.perl6.org/
isBEKaml \\o/
moritz_: I see this rendering issue on my FF3.6.8. 07:57
moritz_ fixing... 07:58
pugssvn r31881 | moritz++ | [perl6.org] avoid overflow of the "community" box by joining two entries into a single one
isBEKaml moritz_++
moritz_ somebody could also add the screencasts to the community/index.html page 08:04
btw in the last two days we had 2.1k and 2.6k visitors on perl6.org, respectively 08:05
isBEKaml moritz_: I see the screencasts link on the perl6.org homepage, but not on the community page? 08:06
moritz_ right
should be added to the community page
easy karma :-)
isBEKaml :)
moritz_ you do have a pugs commit bit, right? 08:07
isBEKaml moritz_: yes.
moritz_ www.ossblog.it/post/6583/rakudo-sta...-di-perl-6 08:10
08:11 KenGuru joined
isBEKaml la prima? "only" ?? 08:12
moritz_ I think prima = first 08:13
pugssvn r31882 | svatsan++ | [perl6.org] Added screencasts entry to Community page 08:15
isBEKaml SCNR. was too tempted! :)
:D
No, I meant the italiano prima! ;) 08:16
moritz_ isBEKaml++ 08:19
08:32 isBEKaml left 08:33 eternaleye joined
dalek ecza: a60caf9 | sorear++ | Kernel.cs:
Implement the unwinder
08:34
ecza: 1e263f2 | sorear++ | Kernel.cs:
Vector unhandled CLR exceptions from the runloop into Perl 6 exceptions
ecza: ce7aca4 | sorear++ | Kernel.cs:
Generate Perl 6-level backtraces on unhandled exceptions
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
m6locks nice
08:46 avuserow joined
moritz_ www.modernperlbooks.com/mt/2010/07/...-star.html 08:51
08:54 tadzik joined
tadzik good morning #perl6 08:54
moritz_ \\o/ it's tadzik 08:55
tadzik how is the mmorpg going? 08:56
moritz_ the user numbers are rising 08:58
we've had more than 2k visitors on perl6.org on each of the last two days
my domain has had ~500 visitors per day more than usual 08:59
tadzik wee \\o/
tadzik looks at the downloads 09:00
almost 2.5k :)
09:05 isBEKaml joined
isBEKaml Hi, I got a question about make. Does make pass params to other Makefiles? 09:05
sorear try it and see
isBEKaml tadzik: (The DESTDIR issue) :) 09:06
tadzik :)
sorear shoudldn't take you more than 2 minutes to set up a test
strace -f -eexecve will tell you if the params are passed
tadzik iirc modules makefile does not have DESTDIR at all, that's the issue ;)
isBEKaml sorear: I'm not *very* familiar with makefiles.
sorear isBEKaml: if you're familiar enough to encounter the issue, you can set up a test case
09:07 Guest23195 joined 09:08 fxn joined
isBEKaml tadzik: I don't see that here. I thought the rakudo-install didn't pass DESTDIR. 09:08
sorear: I have put in a workaround for now. I'll look into it post build. :) 09:09
sorear Remember strace.
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
seems like some lines, or makefiles, are just ignoring the DESTDIR 09:10
isBEKaml tadzik: I find only 5 modules using Makefile. The rest of them simply copy over the moduels to PERL6LIB or ~/.perl6/lib? 09:11
tadzik isBEKaml: the Makefiles are generated by ufo 09:12
isBEKaml tadzik: ah.
sorear What's the Perl 6 idiom for something like my $fh = open "file" :r; LEAVE { close $fh if $fh }; do stuff; 09:14
?
09:15 avuserow joined 09:16 Qunero_ joined
moritz_ just let $fh go out of scoep 09:17
09:18 envi_home2 joined
sorear moritz_: oh dear no 09:19
that's awful.
it only works in perl5 and C++ because of the "no garbage collection, object destruction is explicit and prompt" 09:20
09:22 meppl joined
TiMBuS raii in perl6.. 09:22
09:24 Qunero_ left
moritz_ I'll be leaving shortly, taking the train to Munich, and tomorrow morning the plane to Pisa 09:24
isBEKaml moritz_: YAPC?
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
isBEKaml: yes
isBEKaml moritz_: wow, haffun! :)
moritz_ so, have fun everybody, and feel free to double the size of the test suite in my absence :-)
isBEKaml easy, copy & paste everything! :P 09:26
09:27 desertm4x_ joined
tadzik just to be sure :) 09:28
09:31 avuserow joined 09:38 snarkyboojum joined, avuserow joined 09:39 cognominal joined 09:40 plol joined 09:41 cognominal joined
spacebat anybody having trouble getting rakudo star going? 09:42
I got it built, but make rakudo-test can't find any tests 09:43
then make install fails with lots of PackFile_unpack: This Parrot cannot read bytecode files with version 8.0.
that's a parrot built from the latest SVN 09:44
09:46 aCiD2 joined, aCiD2 left, aCiD2 joined, dac_ joined
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
sorear spacebat: rakudo is written to a single version of Parrot, and too new a version is bad
aCiD2 should I use PERL6LIB or something?
spacebat at first it wouldn't build because the parrot I had was too old
sorear yeah use PERL6LIB
spacebat oh ok, will check out that version
sorear spacebat: star is supposed to be bundled with the correct version of Parrot 09:48
09:48 avuserow joined
aCiD2 great, that does indeed work. thanks 09:48
sorear it's not supposed to care about an installed parrot, ever
spacebat it definitely does
09:49 vk5fnet joined
spacebat I have parrot installed under /usr/local, and I wanted to install rakudo star there as well 09:49
so I added --prefix=/usr/local to the config arguments
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?
sorear Who is Jani? 09:51
you are building star, right? not atlanta?
spacebat I downloaded star 09:52
frettled sorear: I am jani 09:53
09:53 masak joined
masak oh hai, #perl6! 09:54
frettled masak: o/
masak I found this one yesterday before going to bed: 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. ;)
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
I'm not sure how he arrives at that. :) maybe he overestimates the current state of the art.
frettled: ah. fixing. 09:57
oh, you already fixed. frettled++ 09:58
frettled ;) 10:01
Su-Shee masak: chromatic already responded to that table.
masak Su-Shee: oh, good. 10:02
I hoped he would.
Su-Shee err article with the little "table" in it. chromatic has the real table.
frettled chromatic++ is all over the place
10:02 avuserow joined
Su-Shee masak: ur1.ca/0xrtf 10:03
pdcawley Oh, lovely, a for loop returns the list of non-null results of its body...
masak Su-Shee: thanks.
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.
frettled I'm wondering if Perl 4 vs. 5 is mentioned, *biggrin*
pdcawley (I'd expect that to return @array)
masak pdcawley: what's .each? 10:05
masak perldocs
pdcawley Evaluate the block for each member of a list, discarding results.
I dunno if it's specced, I just expected to find it :)
masak pdcawley: looks like .kv
we had an 'each' for quite a while, but it was a junction-y affair. moritz_++ killed it almost completely dead. 10:06
maybe I should say "junction-ish" in this case. :) 10:07
10:15 MattMan joined
MattMan Hi 10:16
I'm trying to use a non-default constructor in Rakudo
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 ;
My BUILD submethod has three parameters
I pass the three parameters to the new() method 10:17
But I get the message "Not enough positional parameters passed; got 1 but expected 4"
I'm a bit stumped
Any ideas ?
10:23 bjarneh joined
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:24
masak MattMan: you probably mean BUILD($!dbname,$!dbuser,$!dbpass) 10:25
MattMan: note the !s
MattMan: $foo is an "ordinary" variable, $!foo is a variable sitting on the "current object" of the method, also known as 'self'. 10:26
jnthn++ # parrot-dev email 10:28
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.
MattMan masak: I tried it but I got the same message
masak: Yeah, I was 10:30
masak hmm.
it's the BUILD method expecting 4 arguments.
MattMan masak: Although since I don't want to store dbname, dbuser and dbpass in the target (Table) object
masak (the hidden 'self' argument counts in the sum)
Rakudo--
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) ?
masak let's try to work out a minimal example that works.
frettled: no difference.
MattMan So I've tried it without parameters
Everything is fine
masak frettled: thankfully. :)
frettled is confuzzled about when it makes a difference, hee-hee :)
MattMan As soon as I get one parameter on the BUILD submethod I start getting this error
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
p6eval star 2010.07: OUTPUT«42␤»
masak MattMan: there. that works.
you need to make the parameters named, with a :
because they're sent in named. 10:33
gfldex rakudo: class A { method b(){} }; my $ref = &A.b; say $ref.WHAT;
p6eval rakudo 9b6189: OUTPUT«Could not find sub &A␤ in main program body at line 22:/tmp/9Tv5VJfF2x␤»
masak star: class A { has $.x; submethod BUILD(:$!x) {} }; say A.new(:x(42)).x
p6eval star 2010.07: OUTPUT«42␤»
masak MattMan: that works too.
frettled smacks his forehead. 10:34
D'oh! named.
masak gfldex: you're looking for .can
gfldex: don't know if it works reliably yet, though. might have to go through .^methods
snarkyboojum shouldn't MattMan's case still work though? i.e. without using named variables?
masak snarkyboojum: I have a nagging feeling it should, yes.
snarkyboojum masak: cool 10:35
masak snarkyboojum: ah, but the problem is that he doesn't define a custom .new
snarkyboojum: so the three arguments he sends in don't get passed through. so BUILD gets only 1 argument.
snarkyboojum masak: oh.. you have to define a custom new too! :)
isBEKaml masak: I thought submethods are basically for setting up the class objects. :)
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.
MattMan masak: Thanks, that got it
masak isBEKaml: submethods can be used for anything you like.
MattMan So you can't pass positional parameters to a constructor in Rakudo ?
masak isBEKaml: .new doesn't change its signature because of BUILD.
isBEKaml: it's very un-magical.
MattMan: sure you can :) 10:37
isBEKaml masak: ah, the .new came in the way. I see...
masak MattMan: acutally, the default is that you should.
isBEKaml masak: But, shouldn't it still work?
masak MattMan: (if we agree that it's .new that is the constructor here)
isBEKaml: not without a custom .new, no.
MattMan So should I be overriding .new rather than BUILD to do what I want ?
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.
gfldex: (in all ancestor classes, too) 10:39
MattMan Ah.....
Overriding .new does indeed seem to do what I want
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.
MattMan But now it seems you can
Which is good
Because it's more intuitive
10:41 bjarneh left
MattMan Actually, I spoke too soon 10:41
Su-Shee star: sub foo { say "2"; } my $bar = &foo; $bar;
p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "sub foo { "␤»
Su-Shee star: sub foo () { say "2"; } my $bar = &foo; $bar;
p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "sub foo ()"␤»
Su-Shee star: sub foo(){ say "2"; } my $bar = &foo; $bar;
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(){"␤»
star 2010.07: ( no output )
isBEKaml star: sub foo () { say "2"; }; my $bar = &foo; $bar.();
p6eval star 2010.07: OUTPUT«2␤»
MattMan It doesn't seem like I can access attributes from the overridden new
rakudo: class MyTest { has $.attr1 ; method new($other) { $.attr1 = $other ; } } my $x = MyTest.new(2) ; say $x.attr1 ;
p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Confused at line 22, near "class MyTe"␤»
Su-Shee gfldex: see isBEKaml's test.
gfldex yes, nice, that's a sub, not a method. 10:43
isBEKaml rakudo: my $foo = sub { say "hello!"; }; $foo.();
Su-Shee you want a method?
p6eval rakudo 9b6189: OUTPUT«hello!␤»
gfldex i want a reference to a method.
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'
make clean doesn't change this
make realclean takes me back to square 1 10:44
gfldex rakudo: class A { method b(){} }; my $a = &A.b;
p6eval rakudo 9b6189: OUTPUT«Could not find sub &A␤ in main program body at line 22:/tmp/BaC49TLoX3␤»
masak Su-Shee: };
gfldex rakudo: class A { method b(){} }; my $a = &(A.b);
p6eval rakudo 9b6189: ( no output )
gfldex rakudo: class A { method b(){} }; my $a = &(A.b); say $a.WHAT;
p6eval rakudo 9b6189: OUTPUT«Seq()␤»
Su-Shee masak: but I wouldn't need it in a file, would I?
gfldex :D
rakudo: class A { method b(){} }; my $a := A.b; say $a.WHAT; 10:45
masak Su-Shee: you need either the ; of an ␤
p6eval rakudo 9b6189: OUTPUT«Parcel()␤»
isBEKaml gfldex: you don't need an & before it.
masak Su-Shee: (if you plan to put anything after the '}')
gfldex rakudo: class A { method b(){ say "3"} }; my $a = A.b; say $a.WHAT;
p6eval rakudo 9b6189: OUTPUT«3␤Bool()␤»
gfldex rakudo: class A { method b(){ say "3"} }; my $a = A.b; say $a();
isBEKaml rakudo: class Foo { method b { "Foo!" }; }; my $a = Foo.b; say $a.WHAT;
p6eval rakudo 9b6189: OUTPUT«3␤invoke() not implemented in class 'Boolean'␤ in main program body at line 22:/tmp/5N_WHcf2l5␤»
rakudo 9b6189: OUTPUT«Str()␤»
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.();
p6eval rakudo 9b6189: OUTPUT«Str()␤invoke() not implemented in class 'Perl6Str'␤ in main program body at line 22:/tmp/nniGMWaZKG␤»
gfldex I do need the & to prevent that method from being invoked
isBEKaml rakudo: class Foo { method b { "Foo!" }; }; my $a = Foo.b; say $a.WHAT; say $a;
p6eval rakudo 9b6189: OUTPUT«Str()␤Foo!␤»
spacebat any ideas on how to reset the build directory for rakudo star?
gfldex But & doesn't work on methods, neither of the meta object, nor for an instance.
frettled spacebat: unpack the tarball?
masak spacebat: 'make clean'?
frettled masak: make clean didn't work 10:47
masak oh.
spacebat make clean does nothing
delete and start again
I'll :)
gfldex you can try make realclean
frettled gfldex: he did :(
gfldex for parrot too? 10:48
spacebat I was trying to install into /usr/local and use a different parrot - my bad
frettled aha, yes, that can lead to some unexpected results
But I did read a bugrep on clean earlier. Hmm.
TiMBuS i use checkinstall so that i can use aptitude to manage my parrot and rakudo installs 10:49
frettled TiMBuS: does that work with Rakudo Star, too? 10:50
TiMBuS it's pretty handy for avoiding conflicts like that
spacebat seems the idea with rakudo star is keep it in the extracted tarball's directory 10:51
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?
TiMBuS checkinstall would work if you specified an install location though 10:53
MattMan OK, I'm still confused
Sorry
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
MattMan BUILD gets called but .new doesn't seem to
spacebat ok
MattMan And the parameter does not get passed to BUILD
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:55
szabgab any spanish or portugues speaker here? 10:56
star: my @a = [5..10]; for @a { say "something" }www.perlfoundation.org/perl6/index....star_press
p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "for @a { s"␤»
szabgab sorry
TiMBuS MattMan, well for starters, new is a method, not a sub
szabgab was there any posting in those languages? 10:57
www.perlfoundation.org/perl6/index....star_press
masak Su-Shee:
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)
p6eval star 2010.07: OUTPUT«It is called tell_name␤»
masak Su-Shee: should be able to do that with .can as well, but right now... Rakudo .can't :)
10:58 avuserow joined
frettled .can't, very droll 10:58
masak will be here all week
frettled *kadang-tssshh*
hmm 10:59
No, I'll drop that pun. 11:00
MattMan TiMBus: Thanks for that
TiMBuS np
frettled How many English can dance on the head of a pun, anyway?
tadzik no idea
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'); ?
TiMBuS yes
Su-Shee it is and there's probably a ^ missing.
masak Su-Shee: oh, right.
yes, definitely .^can
MattMan TiMBus: And do I pass my named parameter to BUILD via the bless ? 11:02
masak star: say Int.^can("say").WHAT
p6eval star 2010.07: OUTPUT«Method()␤»
TiMBuS yepyep
MattMan TiMBus: I'm having difficulty understanding the relationship between new and BUILD
TiMBuS return $.bless(*, attr1 => $other); inside new
Su-Shee I have stupidly ask: this is really later the way to use methods as callbacks or am I getting something wrong?
signal_connect('clicked' ... my callback here.. ) in perl 6 within a class.. ? 11:03
colomon rakudo: say (1..6).list.elems.WHAT
p6eval rakudo 9b6189: OUTPUT«Int()␤»
colomon rakudo: say +((1..6).list).WHAT 11:04
p6eval rakudo 9b6189: OUTPUT«0␤»
colomon duh
MattMan TiMBus: Which works fine if all I want to do is set an attribute in BUILD
colomon rakudo: say (+((1..6).list)).WHAT
p6eval rakudo 9b6189: OUTPUT«Num()␤»
MattMan TiMBus: But I'm actually trying to create another object using those parameters 11:05
TiMBuS hrm?
MattMan TiMBus: And store those parameters in the object
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
TiMBus: So I want to store the connection in the Table object
TiMBus: But initialise it based on the parameters that I pass
11:06 molaf joined
tadzik github.com/timbunce/DBDI/ -- it's now DBDI, not DBI? 11:07
MattMan TiMBus: Am I trying to do something dumb ?
tadzik MattMan: use nopaste please
masak Su-Shee: I usually declare an anonymous method: 'method { ... }' 11:08
TiMBuS thats a good start
MattMan tadzik: Sorry, what's no paste ?
tadzik MattMan: nopaste.snit.ch/ put your code in here and give as the link
it'd be easier to read than the one long line with Your class 11:09
MattMan tadzik: Sure
tadzik s/as/us/
TiMBuS i see what you're doing though
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.()); ?
masak Su-Shee: hm, two terms in a row...
tadzik well, a comma is needed
masak with a comma it works.
but, hm.
tadzik but yeah, looks good
masak you can't just call the method without an invocant.
it works like this:
star: my $doublesay = method { say 2 * self }; 21.$doublesay()
TiMBuS spacebat: ya, rly
p6eval star 2010.07: OUTPUT«42␤»
tadzik oh 11:11
oh right, it's a method, not a sub
masak right.
11:11 kjeldahl joined
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
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
masak Su-Shee: is the 21.$doublesay() example above any help at all? 11:12
I believe it shows the general principle.
(anon method creation, calling an arbitrary object with the anon method) 11:13
the passing-around in between is mostly incidental to the problem.
MattMan Here it is in readable format nopaste.snit.ch/22487
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
its pretty good
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. :)
it's kind of an event model, I guess.
TiMBuS its basically a built in event system and its brilliant 11:17
masak szabgab: excellent screencast: szabgab.com/blog/2010/07/introducti...ashes.html 11:18
szabgab++
TiMBuS using 'where' clauses you can filter out specific events for your handler too
masak szabgab: getting keys back from values in a straightforward way: %hash.invert{$value} --> $key (or @keys)
11:18 whiteknight joined
TiMBuS MattMan, return $.bless(*, :$dbname,:$dbuser,:$dbpass ); seems to work 11:18
szabgab masak: right, but if you have duplicate values you are doomed :) 11:19
TiMBuS in your new()
masak szabgab: not so. :)
colomon rakudo: say (1..6).list ~~ Mu
szabgab oh, well
p6eval rakudo 9b6189: OUTPUT«1␤»
masak star: my %h = a => 1, b => 1; say %h.invert.perl
p6eval star 2010.07: OUTPUT«(1 => "a", 1 => "b")␤»
masak \\o/
oh :(
that's Wrong(TM).
MattMan TiMBus: So it does
szabgab is that? 11:20
MattMan TiMBus: Thank you very much
TiMBuS not a problem
I'm sure there's an easier way I figured out though..
isBEKaml star: my %h = a => 1, b => 1; my %new = %h.invert; say %new.perl;
MattMan TiMBus: Yes
p6eval star 2010.07: OUTPUT«{"1" => "a"}␤»
isBEKaml masak: ^^
masak submits rakudobug
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.
MattMan TiMBus: It doesn't really seem like an especially elegant way of doing it
tadzik Su-Shee: you can just signal_connect('clicked', sub { $obj.method() }), no? 11:22
11:22 avuserow joined
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
spacebat masak: is that hash invert really a bug
p6eval rakudo 9b6189: OUTPUT«A::b invoked␤»
Su-Shee tadzik: I'm not sure. it would more look like $widget.signal_connect('clicked', somethingcallbackish);
tadzik looks Gtkish :)
gfldex sticking the method call into a block will form a closure.
tadzik Su-Shee: well, that's still ok
masak spacebat: I'm having second thoughts as well.
Su-Shee tadzik: well it works in any other widget set similar. might not be called signal_connect then :)
masak spacebat: seems not. 11:24
szabgab is there a variable that holds the directory name of the current script?
masak the correct idiom is %out.push(%in.invert)
isBEKaml rakudo: my %h = a => 1, b => 1; %h.invert.perl.say; my %new = %h.invert; %new.perl.say;
p6eval rakudo 9b6189: OUTPUT«(1 => "a", 1 => "b")␤{"1" => "b"}␤»
tadzik then Widget.signal_connect() will be something like @!clicked_events.push($somethingcallbackish)
masak szabgab: something like $*CWD.
szabgab $*PROGRAM_NAME
not cwd
$*PROGRAM_NAME.dirname 11:25
masak oh.
I believe $*PROGRAM_NAME is just a Str.
szabgab so I can easily load things relative to the script 11:26
Su-Shee AAAH I'm such an idiot :)
gfldex Su-Shee: nopaste.voric.com/paste.php?f=e19cmo
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. :|
masak isBEKaml: if you assign to a hash, you get that behaviour.
isBEKaml masak: consider my last rakudo p6eval output.
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.
masak isBEKaml: I disagree. hash assignment has always thrown away keys like that.
spacebat star: my %h = a => [1,2], b=> [2,3]; my %i; %i.push(%h.invert); %i.perl.say
p6eval star 2010.07: OUTPUT«{"3" => "b", "1" => "a", "2" => ["a", "b"]}␤»
masak Perl 5 users are very used to that. that's how they override named parameter values.
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...
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..
TiMBuS which was making me think too much
11:30 pmurias joined 11:31 avuserow joined
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:31
Su-Shee: And you will have a lot better introspection with perl6 then any other signal implementation. 11:32
pmurias gldex: the & operator? 11:33
gfldex: you mean &method_name? 11:34
gfldex you can't do &SomeObject.some_method right now
rakudo will stop at the .
masak Su-Shee: no, it would be just $on_click
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())
Su-Shee: anon methods need to be passed a self by the $obj.$method() syntax.
gfldex pmurias: and i'm not sure if the & should work on methods. Couldn't find anything in S?? .
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
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); ?
masak Su-Shee: what TiMBuS said, but self.$anon_method() with the parentheses, which are required there.
Su-Shee: if you want self in $self, you need 'method ($self:)' with a colon.
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. :)
gfldex Su-Shee: do you want signals that pass parameters around? 11:41
pmurias gfldex: &SomeObject.some_method calls some_method on &SomeObject
gfldex: & is a sigil like $ not an operator
Su-Shee gfldex: that was just an example, because it's common in all widget sets.
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
masak TiMBuS: then .^can or .^methods are what you want.
gfldex pmurias: i was guessing so, but how do I store a method away for later use, without forming a closure?
Su-Shee gfldex: then I don't understand your question? 11:43
gfldex Su-Shee: do you know trolltech's Qt signal/slot implementation?
masak TiMBuS: previously this worked: &SomeClass::some_method
Su-Shee gfldex: I just wanted to pass methods as a parameter so other methods around.
"to other"
TiMBuS no longer works?
masak TiMBuS: but the object model was refined, and it was determined that methods don't have 'our' scoping.
Su-Shee gfldex: vaguely. 11:44
TiMBuS i see
masak TiMBuS: and it's the 'out' scoping that'd place the method object at that position.
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
masak TiMBuS: for an 'our' method, it works.
s/out/our/
TiMBuS that makes sense
so you have to use 'our', or method names as strings? or does ^.methods return callable method refs? 11:46
masak the latter.
TiMBuS .^methods *
tadzik jnthn: ping
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:47
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:49
gfldex pmurias: I got that. But should it be so hard to get the reference in the first place? 11:50
pmurias: even javascript does it better :)
TiMBuS using strings seems the better way.. but using strings is how php does it... :(
Su-Shee hrgh. now I'm entirely confused. 11:54
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()
p6eval star 2010.07: ( no output )
masak star: class A { method foo {} }; class B { method foo { say "OH HAI" } }; my $b-foo = B.^can("foo"); A.new.$b-foo()
p6eval star 2010.07: OUTPUT«OH HAI␤» 11:56
masak \\o/
discuss. :P
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 & :)
TiMBuS my mind!
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.
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()
p6eval star 2010.07: OUTPUT«42␤»
masak now, that's an encapsulation problem.
not sure at all how to solve that one. 11:59
masak submits a hesitant rakudobug
gfldex masak: I wasn't expection a shotgun to stop you anyway. :)
TiMBuS i would still much prefer 'my $a-foo = &A.foo', but hey you showed us something cool to make up for it
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.
gfldex In my eyes it should return 2 values, a reference to that object and a reference to that method.
masak gfldex: that calls a method on an object called &SomeObject, just like pmurias said earlier.
gfldex: you should read the spec and see for yourself :) 12:01
gfldex: notable S06 and S12.
s/ble/bly/
TiMBuS but i dont need a ref to the object, i already have a way to get one ($a = A) 12:02
or.. A
12:03 pmurias joined
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
a combination of very informed and relatively clueless. it's cute!
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. :)
pmurias gfldex: $obj.^can("foo")[0] is hard?
gfldex: my $foo = 'onclick'; $obj.$foo() should work too 12:05
gfldex: in javascript manipulating the method dictionary is more important as their OO system is quick and ugly hack
masak pmurias: I believe that might be $obj."$foo"()
pmurias s/quick/a quick/
masak: that's the form in the spec
12:05 am0c joined 12:06 KenGuru joined
pmurias but $obj.$methodobj is mentioned too 12:06
masak ok.
I seemed to recall that indirect method dereferencing from strings always required the .""() form
maybe I recall wrongly. 12:07
TiMBuS you're right
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. :)
pmurias it's not very precisely specced
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.
masak: poke larry about it?
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 -- gist.github.com/502109
phenny tadzik: I'll pass that on when jnthn is around.
gfldex didn't larry went for oscon or something?
tadzik phenny: thanks
pmurias gfldex: re ugliness, uncommonly used things don't need to be short 12:10
gfldex if you work with gui toolkits you will use that one quite often. Ask them KDE folks. :) 12:11
ofc, you can stick that method call into a block and store the reference to that block/closure. 12:12
but that kills intospection
12:13 masak joined
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
very helpful for debugging
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)
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
and that sucks because it makes it hard to unconnect a slot 12:15
pmurias you meant can't?
gfldex yes
lets say we have to functions, connect and unconnect
if i do connect({$some.foo}) and then unconnect({$some.foo}) it will fail 12:16
because the identity of the 2nd closure aint the same then the first
if i would do connect($obj, $obj::foo) and unconnect($obj, $obj::foo) i have meaningful identity 12:17
and yes, i do know that :: is not for classes
pmurias connect($obj,"foo"), unconnect($obj,"foo")?
12:17 baest joined
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
gfldex and it was slow, slow, slow
good point
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
gfldex and i think that's not the case
can you change $obj's class at runtime?
pmurias you can add/modify methods unless the class unless it's explicilty forbiden 12:20
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})
gfldex or better should a slot be a method then?
pmurias gfldex: slot? 12:22
gfldex well, for Qt a slot is indeed just a method + some data in the meta object
so you can tell the difference
but you _can_ tell the difference
and about that javascript stuff, yes, it's the same and it aint no work in javascript too 12:23
pmurias aint no work?
gfldex you have to store the first closure in a variable if you want to unconnect a signal
pmurias gfldex: the google maps api returns an event handler
so you unregister the event handler
gfldex DOM doesnt do that and it's a classic noob mistake to create a 2nd closure 12:26
12:28 rurban joined
pmurias gfldex: is the speed of UI callbacks important? 12:28
jnthn afternoon, #perl6
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 -- gist.github.com/502109
pmurias gfldex: don't they get called on events that happen very rarely (like mouse clics)
gfldex seldom and you can work with a functor too
Qt provides signal/slot stuff for network stuff and threads 12:29
jnthn tadzik: "+DESTDIR ?=" - what is that ?= there?
gfldex well, the provide singals and slots for everything :)
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:30
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" }
p6eval rakudo 9b6189: OUTPUT«1 1␤2 2␤»
jnthn $obj."$foo"() # call the method named whatever $foo stringifies to
szabgab rakudo: my @a = 1,2; for @a Z @a Z @a { say "$^a $^b $^c" }
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?
jnthn $obj.$bar() # calls $bar($ojb)
It's spec'd just fine in S12.
pmurias jnthn: and if $bar is a string?
it's an error?
jnthn pmurias: Then it's an error.
pmurias: One that we can, with enough type information, even tell you about at compile time.
colomon rakudo: my @a = 1,2; for @a Z (@a Z @a) { say "$^a $^b $^
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" }
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␤»
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.
colomon oooh, think that part is a real bug instead of a NYI
jnthn ooh.
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␤»
jnthn -> errands, back to do some hacking in a bit :-)
pmurias gfldex: functors = function objects?
gfldex pmurias: yes
colomon (take that back -- at least, it's not the bug I thought it was.) 12:35
rakudo: my @a = 1,2; (@a Z (@a Z @a)).perl
rakudo: my @a = 1,2; (@a Z (@a Z @a)).perl.say
pmurias re some magic the compiler can't warn you about stuff that happens at runtime
p6eval rakudo 9b6189: ( no output )
rakudo 9b6189: OUTPUT«(1, 1, 2, 1)␤»
colomon oh
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
p6eval rakudo 9b6189: OUTPUT«((1, 1), (2, 1))␤»
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()␤»
colomon ugh, what a mess.
szabgab: we don't have the framework in Rakudo to implement @a Z @b Z @c yet. (well, at least, not properly.) 12:40
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?
rakudo: my $x = 1|2; if $x != 1 { say 't' } else { say 'f' }
p6eval rakudo 9b6189: OUTPUT«f␤»
gfldex szabgab: check if there is a bug report already. I'm quite sure there is. 12:43
szabgab shouldn't this be t ?
gfldex is there a way explicitly remove an object from memory? 12:44
jnthn szabgab: Junctions + negated operators = bad idea, generally.
szabgab: if $x != 1 { ... } is exactly equivanet to if !($x == 1) { ... } 12:45
szabgab: (True for all negations)
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)"␤»
szabgab rakudo: my $x = 1|2; if !($x == 1) { say 't' } else { say 'f' }
p6eval rakudo 9b6189: OUTPUT«f␤»
szabgab yeah, I just had this in an example I have and it used to be 't' as I can see 12:47
anyway
jnthn More errands... :-)
bbs
tadzik jnthn: it's for DESTDIR having a default value (being '') but allow it for being set 12:48
jnthn: I'm not a Makefile guy really, but I know this thing is being used and it works :) 12:49
12:53 hudnix joined 12:54 khisanth_ joined 12:56 Mowah joined 12:57 agentzh joined
szabgab rakudo: my $str = 'ab'; if $str ~~ m/a/ { say $/ }; if $str !~~ m/z/ { say $/ } 13:05
p6eval rakudo 9b6189: OUTPUT«a␤a␤» 13:06
szabgab I wonder if that's right?
on the right
tadzik why not? 13:08
szabgab if matching fails $/ is untouched? 13:09
13:09 KenGuru joined
szabgab rakudo: my $r = "ab" ~~ m/./; say $r.WHAT 13:10
p6eval rakudo 9b6189: OUTPUT«Match()␤»
szabgab rakudo: my $r = "ab" !~~ m/./; say $r.WHAT
13:10 azert0x joined
p6eval rakudo 9b6189: OUTPUT«Bool()␤» 13:10
szabgab rakudo: my $r = "ab" !~~ m/.../; say $r.WHAT 13:11
p6eval rakudo 9b6189: OUTPUT«Bool()␤»
szabgab rakudo: my $r = "ab" ~~ m/.../; say $r.WHAT
p6eval rakudo 9b6189: OUTPUT«Match()␤»
13:14 briang joined
azert0x hi 13:18
i just learn why i have better perf when i fork a code instead of thread it
(threads in perl sucks)
Is what it will be improved in perl6 13:19
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␤»
azert0x Is what threads support will be improved in perl6 13:21
?
jnthn azert0x: Yes, we want to do a lot better in Perl 6. It'll largely depend by implementation and backend, of course. 13:22
azert0x ok. thanks jnthn. if you consider upgrading it or not. = Fork to keep the stains parallel threads or introduce real threads 13:24
*just to know if you consider...
jnthn Oh, certainly real threads are desired. :-) 13:25
azert0x jnthn: thanks to answer me :) 13:27
13:31 peters_mops joined 13:40 KenGuru joined 13:41 s1n joined 13:44 PacoLinux joined, fhew joined
fhew #connect p6eval 13:47
13:51 robinsmidsrod joined 13:53 avuserow joined 13:57 pdcawley joined
szabgab rakudo: my @a = 1,1,1,1; my @b = 1,2; say @a >>+>> @b 13:58
p6eval rakudo 9b6189: OUTPUT«2323␤»
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...
szabgab so its is not extending the last value any more, but repeating the shorter list, right? 13:59
14:00 avuserow joined
szabgab rakudo: my @a = 1,1,1,1,1; my @b = 1,2; say @a >>+>> @b 14:01
p6eval rakudo 9b6189: OUTPUT«23232␤»
jnthn rakudo: say Perl6::Grammar.parse('say 42')
p6eval rakudo 9b6189: OUTPUT«say 42␤» 14:02
jnthn rakudo: say Perl6::Grammar.parse('say 42 lol')
p6eval rakudo 9b6189: OUTPUT«Confused at line 1, near "say 42 lol"␤ in main program body at line 286␤»
14:02 ruoso joined
pdcawley jnthn: Cool! 14:08
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␤»
pdcawley Oops.
star: say Perl6::Grammar.parse 'say 5' 14:10
p6eval star 2010.07: OUTPUT«===SORRY!===␤Confused at line 22, near "say Perl6:"␤»
jnthn Need parens for method args 14:11
Or colon
pdcawley star: say Perl6::Grammar.parse('say 5')
colon?
p6eval star 2010.07: OUTPUT«say 5␤»
jnthn star: say Perl6::Grammar.parse: 'say 5';
p6eval star 2010.07: OUTPUT«say 5␤»
pdcawley Ooh...
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
jnthn Nothing so clever. 14:12
pdcawley Shame.
:)
jnthn Pure syntax.
We either after a method name parse a colon and arg list, or an arg list in parens. :-)
Or so far as my memory of the grammar is. :-)
pdcawley: Yup, it's in token methodop 14:13
pdcawley Would be be very hard to make it return -> |$a { Perl6::Grammar.parse(|$a) } ? 14:14
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
In terms of "hard to implement", not really. :-)
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
pdcawley Could always make an infix operator along the lines of the haskell '$' I suppose... 14:17
star: sub addn ($n) { -> $i { $n + $i } }; addn(10)(20) 14:18
p6eval star 2010.07: ( no output )
jnthn star: sub addn ($n) { -> $i { $n + $i } }; say addn(10)(20) 14:19
p6eval star 2010.07: OUTPUT«30␤»
pdcawley would like to be able to write something like that as addn 10 20, but it doesn't work.
jnthn (missed the say)
No, that won't work. That'd class as "two terms in a row", which is a big no-no. 14:20
pdcawley Yeah.
Need a Haskelly addn 10 $ 20
jnthn (It's one of the things the parser relies on to keep itself in check.)
pdcawley Though presumably $ isn't available as an infix operator what with it being a sigil and all. 14:21
jnthn rakudo: sub infix:<$>($a, $b) { say "hey it worked" }; 1 $ 2 # maybe 14:22
p6eval rakudo 9b6189: OUTPUT«hey it worked␤»
pdcawley Complete tangent, what sort of tools are there to introspect on stuff in the repl?
FMR!
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.
star: sub addn ($n) { -> $i { $n + $i } }; sub infix:<$>($a, $b) { $a.($b) }; say addn 10 $ 20 14:24
jnthn Well, there's the meta-model for introspecting objects/classes/roles. Subs and signatures are also introspectable.
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␤»
pdcawley Drat.
14:24 KenGuru joined
jnthn Yeah, the addn 10 will run before the operator. 14:24
I fear that's more macro-ish than just a plain ole operator.
pdcawley And we don't have macros yet.
Ho hum. 14:25
jnthn Aye. :-(
14:25 patspam joined
gfldex std: class A { multi method postfix:<()>{} }; my $a = A.new(); $a(); 14:25
p6eval std 31883: OUTPUT«ok 00:01 118m␤»
gfldex rakudo: class A { multi method postfix:<()>{} }; my $a = A.new(); $a();
p6eval rakudo 9b6189: OUTPUT«invoke() not implemented in class 'A'␤ in main program body at line 22:/tmp/L3FwO80tBz␤»
jnthn gfldex: I think you wanted method postcircumfix:<( )>($c) { } 14:26
(multi is ok too)
14:26 cibs joined
gfldex i indeed want that :) 14:27
rakudo: class A { multi method postcircumfix:<( )>($c) {} }; my $a = A.new(); $a(); 14:30
p6eval rakudo 9b6189: ( no output )
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
gfldex rakudo: class A { multi method postcircumfix:<( )>($c) {say $c.WHAT} }; my $a = A.new(); $a('ello'); 14:35
p6eval rakudo 9b6189: OUTPUT«Capture()␤» 14:36
gfldex rakudobug?
jnthn No 14:38
Correct
You get the capture containing the arguments passed.
You can get the first arg like $c[0] 14:39
gfldex How can I pass a capture on to another function so it turns into real parameters? 14:40
callwith() or somesuch?
And does that implementation means I can't really have a signature on a functor? 14:41
jnthn foo(|$c)
You can use sub-signatures to unpack the capture. 14:42
gfldex where can i find sub-singatures in S?? ? 14:43
jnthn S06
but basically
Just write a signature in parens after an argument 14:44
If the arg is a capture, then it will bind the capture against that sig.
You can use it for unpacking arrays and hashes and objects too, which all know how to coerce themselves to a capture.
gfldex i c
14:51 patspam joined 14:52 KenGuru joined 14:54 macroron joined 15:02 [1]Casan joined, whiteknight joined 15:06 Casan joined 15:11 tadzik joined 15:22 shabble joined
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:24
15:27 HarryS joined
m6locks it works with snow leopard and macports 15:30
not sure about 10.5.8, but i guess it should work too
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
I was hoping that distclean would take care of that though
m6locks oh yeah, sometimes i need to d/l the whole thing again and work it 15:32
like delete the directory and stuff
15:32 snearch joined 15:33 masonkramer joined
shabble yup, looks like nuking the whole checkout and refetching it working so far 15:36
15:36 amkrankruleuen joined 15:45 ashleydev joined 15:50 erUSUL joined 15:53 flup joined
tadzik bah, Polish heise-online: Perl 6 complete 16:03
sigh
pmichaud good morning, #perl6 16:04
tadzik hello pmichaud
shabble I'm reading the 'zomg you'll need to optimise by a million percents!!!' troll atm 16:05
pmichaud shabble: is that dkroll?
tadzik another one who needs a hug :)
pmichaud indeed.
shabble pmichaud: yep
[Coke] RT #76856 looks reasonable to me. 16:06
pmichaud I'm wondering what his agenda is.
tadzik let's maybe create a channel #perl6-haters with hugme furiously hugging anyone who joins
shabble pmichaud: new is bad! damn your pesky features! 16:07
16:08 BinGOs joined
pdcawley pings the UK Heise editor to see if he has any pull with the Polish arm. 16:09
tadzik pdcawley: I can contact them myself, that'd be faster probably, and less beaurocracy 16:10
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
tadzik: True 'nuff.
16:11 masonkramer joined
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
pdcawley should probably go read the synopses... 16:12
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.
anything else would require a macro or some new parsing consruct.
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?
pdcawley Makes a block. 16:15
with arguments given after the arrow and before the {
tadzik I see 16:16
pdcawley star: sub test { -> { return 10 }.(); 20 }; say test
p6eval star 2010.07: OUTPUT«10␤»
16:16 masonkramer_ joined 16:17 darkop joined
tadzik hmm 16:18
"Rakudo Star" is a distribution that includes (...) version 2.6.0 of the Parrot Virtual Machine
pdcawley star: sub test1(&block) { &block->(); 20 }; sub test2 { test1(-> { return 10 }); 30 }; say test2()
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"␤»
tadzik does it? IIRC it warns when Parrot is not present and offers to download it itself
pdcawley Bugger. 16:19
cmadsen tadzik, no the rakudo-star tarball includes Parrot
pdcawley star: sub test1(&block) { &block.(); 20 }; sub test2 { test1(-> {return 10}); 30 }; say test2() 16:20
p6eval star 2010.07: OUTPUT«30␤»
pdcawley Ah... I was sort of hoping that would say '10'
tadzik oh right
pdcawley Hmm... reading synopsis 4, it looks like it _should_ say 10... 16:27
16:28 erUSUL left
pdcawley 'return always returns from the lexically surrounding sub or method definition. ... Pointy blocks and bare closures are transparent to return' 16:28
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...
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.
pdcawley Ah. Right ho.
jnthn Ah, yes...
Or generally looking for exception handlers lexically.
pdcawley I won't raise a bug report then.
pmichaud RT #61126 16:31
frooh star: class Bar { for <foo bar> { &{$_} = sub { say $_ } } }; my $b = Bar.new; $b.foo;
p6eval star 2010.07: OUTPUT«Could not find sub &␤ in <anon> at line 22:/tmp/YjJQNSFkkR␤ in main program body at line 1␤»
pdcawley Where is the Rakudo RT btw?
Not leaping out at me from perl6.org 16:32
pmichaud rt.perl.org/rt3/
frooh star: class Bar { for <foo bar> { *{$_} = sub { say $_ } } }; my $b = Bar.new; $b.foo;
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␤»
pmichaud frooh: what are you wanting *{$_} to do here?
I don't grok that syntax.
(neither does Rakudo, really) 16:33
frooh pmichaud: like in p5; *($foo} would be like doing *foo
to add a method
or function or whatever
symbol table stuff
pmichaud adding a method would have to take place through the metaclass
frooh oh right...
pmichaud it's not just poking a sub into a namespace
pdcawley our &foo := sub { say $_ } doesn't work? 16:34
pmichaud that creates a subroutine named &foo, yes.
but that's not a method.
pdcawley But not a method.
16:34 kthakore joined
frooh pmichaud: so is the package var __CLASS__ in a class? 16:34
kthakore moritz_: guess what :D SDL_Manual.letter.pdf
pdcawley methods != subs in perl6. Which is good. :)
pmichaud frooh: no 16:35
kthakore pmichaud: guess what. 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?
jnthn: ^^ 16:36
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:37
kthakore pmichaud: ok 16:38
pmichaud: I don't use the pretty adobe fonts. And I give credit to the perl6 book
frooh pmichaud: I can't seem to find in S12 how to get at the metaclass
kthakore also I finally got perl6 compiled on Debian!!!!
\\o/
party party party 16:39
:D
tadzik :)
kthakore wonders if he should attempt a ubuntu package for inter 32
intel*
[Coke] 03:18 < TiMBuS> i'd stick with the synopses, maybe the apocalypses
TiMBuS: no, just the syn. apoc are also historical.
01:32 < MAK___> hello world program runs without v6 16:40
not that he's here, but the v6 isn't for rakudo, it's for perl5 and for people reading the code.
pmichaud frooh: .HOW
jnthn frooh: ClassName.^add_method('name', method ($args) { ... });
pmichaud afk, errands 16:41
frooh jnthn: so I have to use ClassName even if I am in the class?
kthakore pmichaud: be careful!
frooh jnthn: there's no shortcut?
kthakore pmichaud: watch out for ninjas!
frooh greps .HOW in s12
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.
frooh ok.
TiMBuS the perl6 books are probably better
frooh I cna use the full name for now
jnthn: why .^add instead of just .add?
tadzik meta-method, yep?
frooh is that what ^ means? .HOW ? 16:43
I thought it was for the first method that implemented that method
tadzik frooh: like ^methods, no?
the first object, you mean?
frooh I have no clue
tadzik I'm always confused with twigils
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
so I can use it where ever?
will that work?
tadzik yep
I have a symlink in ~/bin
kthakore tadzik: ok what of the lib and what not?
jnthn frooh: .^add_method does a call on the meta-class.
tadzik with just Rakudo you can make install 16:45
jnthn .add_method would do a call on the object.
kthakore it installs in the same dir
jnthn And the object doesn't have an add_method mehtod.
kthakore tadzik: is there a prefix?
tadzik and then symlink. Not sure how R* will go, I'm unable to package it still, so I'm keeping every module separate
kthakore: there's no DESTDIR, that's quite painful
rurban Can I ask about rakudo-star packaging?
tadzik Don't ask to ask, just ask :) 16:46
rurban I mean is pmichaud here? :)
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
frooh rurban: yessir
rurban Will the included rakudo always be the same as the monthly releases or some in-between?
Because I already package parrot and rakudo (short afterwards)
tadzik well, even in Star it's not the monthly release, iirc
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.
frooh is there a $ENV-like thing in rakudo yet?
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-*)
frooh: %*ENV
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?
frooh excellent
jnthn % means it's a hash
rurban Ok, so I will think something up for this 1st release (cygwin), the next will go smoother hopefully.
jnthn * means it is dynamically scoped 16:50
tadzik like 'global'?
robinsmidsrod jnthn: dynamically scoped - same definition as in perl5 docs?
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.
rurban: I hope we can next time. 16:51
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.
robinsmidsrod so %ENV, @INC and @ARGV is now %*ENV, @*INC and @*ARGV?
frooh in p6 is there a similar idiom to my %x; @x{ @foo } = ( 0 .. $#foo ) ?
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
jnthn rurban: Correct.
rurban hmm...
jnthn oh, cah 16:52
robinsmidsrod: correct
rurban: Well, Rakudo Star is a "distribution release" that bundles a bunch of stuff.
rurban: The compiler releases are just the compiler.
rurban I don't want to release both. 16:53
kthakore Woot!
tadzik: it worked!!!
robinsmidsrod jnthn: thanks!
tadzik kthakore: why not? :)
kthakore tadzik: now how to load parrot modules .... 16:54
I have a SDL.pmc here
rurban And I'm pretty sure parrot-devel is still not usable at all.
frooh star: my %foo; my @a = <a b c>; %foo{@a} = 0 .. @a.size; %foo.perl.say
jnthn frooh: Yeah, let me think a moment...
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␤»
tadzik kthakore: how about 'use SDL'?
frooh: .elems
frooh star: my %foo; my @a = <a b c>; %foo{@a} = 0 .. @a.length; %foo.perl.say
p6eval star 2010.07: OUTPUT«Method 'length' not found for invocant of class 'Array'␤ in main program body at line 22:/tmp/lLjuoLGzzv␤»
tadzik frooh: .elems :)
kthakore tadzik: that works?
crazy!
frooh star: my %foo; my @a = <a b c>; %foo{@a} = 0 .. (@a.elems - 1); %foo.perl.say
p6eval star 2010.07: OUTPUT«{"a" => 0, "b" => 1, "c" => 2}␤» 16:55
tadzik kthakore: I don't know
jnthn frooh: Is taht the output you're looking for?
frooh yessir
jnthn star: my %foo; my @a = <a b c>; %foo{@a} = ^@a;
p6eval star 2010.07: ( no output )
jnthn star: my %foo; my @a = <a b c>; %foo{@a} = ^@a; %foo.perl.say
p6eval star 2010.07: OUTPUT«{"c" => 2, "a" => 0, "b" => 1}␤»
frooh oh nice
oh yeah
^ == upto
very good 16:56
jnthn ^ means "construct a range from 0 up to this"
[Coke] TiMBuS: the code examples in the apoc are old and out of date with respect to the spec, no?
jnthn And it puts @a in numeric context.
frooh right
jnthn So it does just what you want :-)
[Coke] rurban: what is "parrot-devel"? the old install target? 16:57
(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
frooh star: for <a b c> -> $x { say $x } 16:57
p6eval star 2010.07: OUTPUT«a␤b␤c␤»
16:58 patspam1 joined
kthakore tadzik: ok chores ... then trail! 16:58
:D
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 16:59
[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
frooh is there a way I can do perl6 -Ilib or somesuch?
17:00 ruoso joined
tadzik frooh: PERL6LIB+=foo perl6 17:01
rurban And my patches are still forgotton. My perl6 patches are applied immedately in contrary
frooh ah
tadzik: ty
rurban But parrot is doomed anyway, so I don't care.
tadzik define: doomed 17:02
rurban tadzik: no 17:03
rakudo-star DESCRIPTION="Perl6 modules" okay? (short desc) 17:04
tadzik what do you mean "no"? And what do you mean DESCRIPTION?
R* is not the modules compilation
[Coke] rurban: you are the crankiest person I know in the perl community. Just FYI. =-) 17:05
jnthn rurban: It also includes docs too, and should also include module installation tools etc 17:06
rurban: It's more giving you a development environment around the compiler.
rurban tadzik: lists.parrot.org/pipermail/parrot-d...02063.html
"Perl6 modules plus docs and tools" right? 17:07
jnthn rurban: That's closer to the truth, yes. 17:08
rurban I need to come up with some kind of spec file
jnthn rurban: pmichaud++ may have a preferred phrasing.
rurban How's debian or fedora planning to do that?
tadzik rurban: so? It seems like it was back in 1.1.0 times, and I'd say Parrot is still doing fine
rurban doomed I said pre 1.0 and it still is.
It became even worse 17:09
coke: mst is for sure more cranky than me
[Coke] hugme: hug rurban
frooh jnthn: paste.scsys.co.uk/47427 <-- ideas? 17:10
[Coke] rurban: not in my personal experience, for what that's worth.
oh no, no hugmebot?
frooh rurban: mst is only cranky if you say silly things to him :-)
jnthn frooh: $name =>
frooh: Wants to be $name,
frooh oh yeah
I forgot => != , in p6 17:11
jnthn frooh: but $self.!log is your problem
What are you trying to do, call a private method for get an an attribute?
*or
frooh clal private method
jnthn just !
not .!
frooh I guess I just take out $self?
ah
great
jnthn and it's self
not $self
frooh ohh 17:12
so self!log?
or just !log?
jnthn self!log
frooh k
jnthn $self.$is_name
wants to be self.is_name ? 17:13
17:13 [Coke] left
frooh no, that's "is_$name" 17:13
jnthn ok
frooh aww 17:14
even after replacing => with , I still get the error
jnthn Then you'll want parens after the call
frooh k
jnthn __END__ # oh, I'm not sure if that's valid Perl 6. :-)
std: __END__
p6eval std 31883: OUTPUT«[31m===[0mSORRY![31m===[0m␤Undeclared name:␤ '__END__' used at line 1␤Check failed␤FAILED 00:01 114m␤»
jnthn Yeah, it'll just try for a sub call.
frooh that's not actually in there
that's just the paste
jnthn ah, ok
:-
:-)
frooh oh wait it is! 17:15
lolz
jnthn: paste.scsys.co.uk/47428
same error, same line
that's the whole thing
thoughts?
tadzik frooh: for required -- has $.foo = die "foo is required" 17:16
frooh tadzik: ah thanks
tadzik you will enjoy moritz_++'s "common Perl 6 idioms"
frooh yeah, I still have it in my feed reader
but yeah, still have syntax error 17:17
pmichaud back again 17:18
tadzik paste the error then :)
frooh tadzik: paste.scsys.co.uk/47427
I put error after __END__
but that's not actually in the code
(also note that it now says $is_name())
jnthn frooh: Ooh! 17:19
Yeah, crappy error
frooh ?
jnthn frooh: Anything at all in the form foo() is a method call
That includes method()
frooh oh
so I need a space
jnthn frooh: So method (*@_) {
Not method(*@_) {
Right.
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
pdcawley or is comma not really an operator?
frooh I love me some foo-bar methods
17:20 aCiD2 joined
jnthn pdcawley: It is really an operator. 17:20
17:21 justatheory joined
pdcawley and 'multi'-able? 17:21
frooh woo, successful compile!
jnthn pdcawley: Though for operator definitions you want to be writing a multi sub really
pdcawley Gotcha.
pmichaud &infix:<,> in Rakudo is presently pretty "core" -- overloading it is likely to cause all sorts of issues.
pdcawley Presumably semicolon isn't an operator :)
jnthn Though overriding , could be...interesting ;-)
No. :-)
pdcawley pmichaud: Wimp! 17:22
pmichaud ummmm, semicolon might become an operator.
jnthn On your own head be it. ;-)
pmichaud: oh boy, I can't wait for people to start overloading that one. ;-)
pmichaud i.e., there very well could be an &infix:<;>
jnthn Oh, true.
pmichaud jnthn: well, it would likley be invoked only in arg lists.
pdcawley jnthn: That's essentially what monads do in Haskell.
pmichaud and would build a Slicel instead of a Parcel
jnthn pmichaud: oooh...that makes...an interesting sort of sense. :-) 17:23
pdcawley: Yeah, I still need to learn Haskell. :-)
pmichaud so we can handle @a[1..5;$b;*]
and foo(1..5;$b;*)
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.
pdcawley Ah well, suck it and see, I guess :)
jnthn pmichaud: Did you read through my parrot-dev epic mail yet? :-)
pmichaud jnthn: I did. looked good. I'm not sure they'll grok it yet, though.
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
ingy jnthn: is there a url for it? 17:25
jnthn ingy: Probably...but I woudln't know where to look off hand...
ingy nod
pmichaud I can find it -- one moment
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)␤»
pmichaud lists.parrot.org/pipermail/parrot-d...04536.html
pdcawley Right, that doesn't work yet then :)
frooh aww, env is readonly?
pdcawley local %ENV{KEY} = 'whatever' doesn't work?
pmichaud Perl 6 doesn't have a 'local', afaik 17:27
frooh it's called temp from what I hear
and it's NYI
pdcawley Ah.
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
i.e., it wouldn't 'undo' the temp part
frooh pmichaud: yeah, I'm faking it for the most part that way by just manually resetting stuff 17:29
pmichaud: but is there really no way to do %*ENV<foo> = 1? I thought you guys got that working a while back
pmichaud that was working in alpha, not presently working in star
frooh ah, ok 17:30
frooh has alpha already :D
pmichaud I could re-do the cheat I had in place for %*ENV in alpha. 17:31
that wouldn't be too difficult.
frooh eh, up to you
I can use alpha for a while
I know I won't be able to port this 100% for a while
pmichaud where "this" === ...? 17:32
frooh I need caller and temp; but might as well get started to see how things are looking
Log::Contextual
pmichaud what do you need from caller?
frooh simple logging module
the package name
iirc it's not in callframe yet
we looked last night
pmichaud package wouldn't be too hard to add, though.
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
pdcawley Am I declaring my infix wrong?
pmichaud I don't think rakudo has &infix:<,> as a multi at the moment.
frooh pmichaud: if you can wait; I'd love to do it myself on the next p6 meeting
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
frooh builds alpha
17:34 h1gh left
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
pdcawley pmichaud: So, basically, override infix:<+> or something and have done? 17:35
jnthn Time to go get some noms for dinner. :-)
pmichaud pdcawley: for the current version of star, yes. :)
jnthn: I guess I should probably rewrite things in terms of Parcel.new, and switch &infix:<,> to use that.
pdcawley Would I be right in thinking that overriding << is probably a bit twitchy as well?
pmichaud which is a bit backwards from an optimization perspective, since &infix:<,> is far more common than Parcel.new 17:36
oh, I think overriding &infix:<<<> should be just fine
it's very *not* low-level.
star: multi infix:«<<»(Str $a, Str $b) { "$a << $b" }; say 'hello' << 'world';
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"␤»
pdcawley Can I override &infix:<<<=> as well? 17:37
pmichaud oh
nm
<< isn't an operator.
pdcawley Ah. Thought it was.
pmichaud pdcawley: why not just define your own operator? ;-)
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"␤»
pdcawley Yeah, that'd make sense too.
frooh hahaha
pmichaud ....huh?!?
frooh error message ate it!
pdcawley shouldn't that be multi sub infix:... ?
pmichaud star: multi infix:«←»(Str $a, Str $b) { "$a << $b" }; say 'hello' ← 'world';
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"␤»
pmichaud star: multi sub infix:«←»(Str $a, Str $b) { "$a << $b" }; say 'hello' ← 'world';
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"␤»
pdcawley That's definitely weird.
frooh pmichaud: do you need to replace << with +< maybe?
pdcawley In a _string_?
frooh you are using << and if it's not an op...?
oooh 17:39
frooh can't read
pmichaud I suspect an overeager interpolator.
star: multi sub infix:«←»(Str $a, Str $b) { "$a <- $b" }; say 'hello' ← 'world';
p6eval star 2010.07: OUTPUT«hello <- world␤»
pmichaud grrrr
pdcawley Yay! Bug!
pmichaud rakudo is thinking that the "<<" following a variable is some sort of operator.
pmichaud files bug
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\\";"␤»
pdcawley star: my $a = 3; my $b = 4; say "$a + $b"
p6eval star 2010.07: OUTPUT«3 + 4␤»
pdcawley Looks like that contextual warning's not being picky enough about it's context.
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
i.e., with "$a.xyz() something"
pdcawley Because <, or <<, or whatever, looks brackety.
pmichaud the parser has to look ahead beyond $a to see if there's a valid postfix method call or operator
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)
p6eval star 2010.07: OUTPUT«99␤»
pmichaud (it shouldn't get there at all... the whitespace should prevent it.)
pdcawley You know, I'd thought that whitespace between the function and the opening brace was illegal.
pmichaud it is.
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.
pdcawley But test (99) is legal because, presumably, parens have their usual precedence affecting mojo in that context.
17:44 eternaleye joined
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
pdcawley I don't know if you can! 17:46
aCiD2 :D
pdcawley star: multi sub infix:<==>(Str $a, Str $b) { "$a == $b" }; say '10' == 'Thing'
p6eval star 2010.07: OUTPUT«10 == Thing␤»
pdcawley w00t!
Overloadable == ftw!
aCiD2 let me just get my jaw off the floor
pdcawley About frogging time.
Presumably &infix:<||> et al. also just work. 17:47
pmichaud no
short-circuit operators have issues
aCiD2 i can infix anything I want, right? or only predefined operators?
pdcawley Oh. Yes. Of course they do.
pmichaud there's a spec design detail to be handled there
(i.e., how does an operator indicate that it needs its arguments to be thunked)
pdcawley aCiD2: Yeah. Just infix the Unicode symbols for or/and/xor or whatever.
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
just being able to overload == is good enough for now
pmichaud star: multi sub infix:<anything-you-want>($a, $b) { "any $a you $b" }; say 'way' anything-you-want 'go';
p6eval star 2010.07: OUTPUT«any way you go␤»
aCiD2 ahaaha, that opens up some crazy possibilities
are we able to do vary the precedence like Haskell? 17:49
tadzik wait for slang keyword :)
aCiD2 s/do//
pmichaud perl 6 defines traits for changing the precedence; nyi in rakudo
aCiD2 ok
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.
aCiD2 there's too much cool shit here, I am so learning enough perl 6 to be able to contribute some patches :) 17:50
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?
p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Confused at line 22, near "the more I"␤»
..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␤»
darkop ups :)
aCiD2 heh
tadzik I think you can write them using the private accessor 17:52
pdcawley Use the guillemet thingies.
darkop right now i have "has $!pcounter; method counter () { return $!pcounter }"
tadzik star: class foo {has $.bar; method baz { $!bar = 5 }}; my $a = foo.new(bar => 3); foo.baz; say foo.bar;
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␤»
tadzik hrm 17:53
frooh tadzik: did you mean to do $a.baz?
jdv79 is it just parrot that's holding back IPC in rakudo?
tadzik frooh: oh sure
star: class foo {has $.bar; method baz { $!bar = 5 }}; my $a = foo.new(bar => 3); $a.baz; say foo.bar;
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␤»
tadzik damn
pmichaud darkop: "has $.xyz" declares that $foo.xyz is readable but not writable.
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␤»
tadzik gotcha
frooh PackFile_unpack: This Parrot cannot read bytecode files with version 8.0 <-- how do I delete the old bytecode?
pdcawley aCiD2: infix:«<»($a, $b) should work.
frooh I tried make clean
aCiD2 pdcawley: I have to use the unicode characters?
pmichaud frooh: might need to remove any parrot* directory altogether
frooh k
darkop pmichaud: is it writable within a class? (i think i tried that before)
pdcawley Not sure, pmichaud or jnthn or one of the other perl6 hackers probably know though. 17:55
pmichaud darkop: yes, but as $!xyz
darkop oh, cool1
pmichaud: thanx!
pmichaud inside the class you use $!xyz, $.xyz becomes the read-only interface
pdcawley Or do the Pod rules for E<< $f-> >> apply?
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"
lue hello o/
p6eval star 2010.07: OUTPUT«0␤»
frooh likes chromatic's post comparing rakudo and perl5 + lots of modules
pmichaud frooh: yeah, dkroll is being a bit obtuse by not understanding just how much performance improvement is possible.
(I think he must have some other purpose/agenda) 17:58
tadzik I wonder how much the criticisers know about compiler design and optimizations
frooh pmichaud: wes was telling me that on reddit they were all like, "SOFTWARE NEVER GETS FASTER! ONLY MORE BLOATED!"
pdcawley pmichaud: Ah well, he's put up a dumb straw man argument, going to be relatively easy to topple it later :)
frooh it's like people have never used .. I dunno, the jvm :-)
which is markedly faster than early releases
pmichaud frooh: or even C
frooh: or Pascal 17:59
frooh right, variosu compilers indeed
pmichaud or Lisp
or Haskell
frooh as wes said, they are comparing compilers and Nero
pmichaud the odd thing is that Rakudo itself disproves the argument
17:59 dwhipp joined
frooh how so? 17:59
pmichaud look at our timings of the spectests over Rakudo's development 18:00
frooh I thought that was a function of nqp mostly
pmichaud spectest runs have remained fairly constant -- around 30 minutes
but the size of the suite has quadrupled
(actually, quintupled)
18:00 tylercurtis joined
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'?
:)
frooh heh
pmichaud pdcawley: that's usually not a regression -- it's often "progress"
Su-Shee (imagine the twitter possibilities if it has sixtupled.. :)
pmichaud i.e., the suite takes longer because we pass more tests.
pdcawley Or at least, took more than 50% longer to run than the last time...
pmichaud oh, we'd notice a 50% regression. :)
pdcawley pmichaud: Yeah, but if you're not getting faster at the same time...
spec test is getting to slow! Time to optimize the fscker! 18:02
too slow, sorry.
18:03 dwhipp joined
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␤»
dwhipp rakudo: multi f(1) { 1 }; multi f($x) { $x * f($x-1) }; say f(+$_) for (2,3).map: {$^x+1 }
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␤
.. in …
dwhipp why does the +1 fail? Int Vs Num on the multi dispatch? 18:04
pmichaud dwhipp: I'm not sure why it fails. 18:05
jnthn dwhipp: I normally define it as f(0)
Hmm, that maybe still doesn't explain it. 18:06
pmichaud rakudo: multi f(1) { 1 }; multi f($x) { 'no '}; say f(1+0);
p6eval rakudo 9b6189: OUTPUT«1␤»
pmichaud rakudo: multi f(1) { 1 }; multi f($x) { 'no '}; say f({$^x+1}(0))
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?
p6eval rakudo 9b6189: OUTPUT«1␤»
pmichaud ....why both 'for' and 'map', ooc? ;-) 18:07
dwhipp That's just how I simplified my testcase 18:08
frooh pmichaud: aww, alpha can't --gen-parrot?
dwhipp rakudo: multi f(1) { 1 }; multi f(Int $x) { $x * f($x-1) }; say f(+$_) for (2,3).map: {$^x+1 }
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␤»
dwhipp rakudo: multi f(1) { 1 }; multi f(Int $x) { $x * f($x-1) }; say f(+$_) for (2,3).map: {$^x }
p6eval rakudo 9b6189: OUTPUT«2␤6␤»
jnthn dwhipp: Oh 18:09
dwhipp: +
pmichaud frooh: it should be able to --gen-part; we've done that, like, forever.
jnthn prefix:<+> returns a Num :-(
always.
Thus the fail.
frooh oh wtf
it can't get to svn.parrot.org
jnthn That wants fixing...
darkop jnthn: now you just clarified the bug I encountered earlier today
jnthn Aha. 18:10
Yeah, I think there's even an RT about that issue.
darkop if <-> also returns a Num, that is :)
jnthn I'm not quiet sure what the spec says.
frooh wonders if he's being throttled
oh no, now it's working
whew
pdcawley wonders how to make emacs type that nice unicode arrow... 18:11
frooh star: STDERR.print('lolz!')
p6eval star 2010.07: OUTPUT«Could not find sub &STDERR␤ in main program body at line 22:/tmp/ghW1EQbkrx␤»
tadzik it's not about emacs, pdcawley
it's about your keymap
frooh pmichaud: in vim it's ^K ->
er
pdcawley: ^^
pmichaud jnthn: does multi f(1) { ... } imply that the argument has to be an Int?
pdcawley Ah, yes, the compose key. 18:12
jnthn pmichaud: Yes.
pmichaud hmmm
that's annoying.
jnthn It must.
pmichaud it's not that way in smart matching.
jnthn It's correct here.
pmichaud star: say 1e0 ~~ 1
jnthn Otherwise the candidate sorting will be wonky.
frooh how do I get to STDERR?
p6eval star 2010.07: OUTPUT«1␤»
jnthn pmichaud: Imagine otherwise if you defined multi x(1) { }; multi x(Int $x) { }
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
jnthn Right.
pmichaud okay.
I suppose multi sub f(Any where 1) { ... } #?
jnthn Yes 18:14
Or just $ where 1
Since default parameter type is Any
I think prefix:<+> still needs a fix though
I suspect for Numeric it should be identity.
rakudo: say (+5).WHAT
p6eval rakudo 9b6189: OUTPUT«Int()␤» 18:15
jnthn Oh. :/
pmichaud rakudo: say (+(5+2)).WHAT
jnthn OK, that wasn't the bug then. :-S
18:15 kjeldahl_ joined
p6eval rakudo 9b6189: OUTPUT«Num()␤» 18:15
jnthn Ah, there we are.
rakudo: say (5+2).WHAT
frooh star: Boolean.new(1).say
p6eval rakudo 9b6189: OUTPUT«Int()␤»
star 2010.07: OUTPUT«Could not find sub &Boolean␤ in main program body at line 22:/tmp/Zn6dr7yufr␤»
frooh star: Bool.new(1).say
jnthn ER...
p6eval star 2010.07: OUTPUT«0␤»
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)
(that's on rakudo-star) 18:17
frooh where is the metamodel described in the synopses?
breinbaas is DBDI going to be the 'real' DBI? (if that makes sense) 18:19
lue
.oO(I wasn't aware you could say class A is Hash . Interesting.)
18:22
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␤»
frooh star: class Foo { has $!biff = 1; method robot { my $attr = "biff"; say $!$attr } }; my $x = Foo.new; $x.robot;
p6eval star 2010.07: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 22␤»
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␤»
frooh :-/
star: class Foo { has $!biff = 1; method robot { my $attr = "biff"; say self!$attr() } }; my $x = Foo.new; $x.robot;
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␤»
tylercurtis breinbaas: I don't know, but you might want to ask mberends or timbunce when they're around.
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␤»
breinbaas tylercurtis: ok, thanks
cxreg breinbaas: I believe DBDI is meant to be a common low-level driver 18:27
not something really for end users, but MiniDBI and others could be put on top
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;
p6eval star 2010.07: OUTPUT«===SORRY!===␤Quoted method name requires parenthesized arguments at line 22, near " } }; my $"␤»
frooh hm
I want the attribute storage
star: class Foo { has $!biff = 1; method robot { my $attr = "biff"; say self!"$attr"; } }; my $x = Foo.new; $x.robot;
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.
frooh star: class Foo { has $!biff = 1; method robot { my $attr = "biff"; say !"$attr"; } }; my $x = Foo.new; $x.robot;
p6eval star 2010.07: OUTPUT«0␤»
frooh :-/
tylercurtis frooh: but self!foo calls the private method !foo on self.
frooh tylercurtis: I know 18:30
pmichaud rakudo: say "42" ~~ 42; 18:31
p6eval rakudo 9b6189: OUTPUT«1␤»
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?
frooh: I'm not aware of one. 18:33
I mean, clearly one can do $!name :-)
frooh right
gfldex maybe rakudobug question, see comments: nopaste.voric.com/paste.php?f=80fl0t
pmichaud rakudo: say "42" === 42
frooh makes method !get_$attr to do it
p6eval rakudo 9b6189: OUTPUT«0␤»
pmichaud files rakudobug 18:34
frooh star: "%s %s".sprintf("frew", "bar").say
p6eval star 2010.07: OUTPUT«frew bar␤»
pmichaud
.oO(Can't believe that masak++ missed these! Or perhaps there are bug reports already?)
diakopter who could know? ;) 18:36
pmichaud star: say "42" ~~ 42; say "42" === 42;
p6eval star 2010.07: OUTPUT«1␤0␤»
pmichaud star: say 42.ACCEPTS("42"); 18:38
p6eval star 2010.07: OUTPUT«1␤»
pmichaud star: say 42.ACCEPTS(42.0);
p6eval star 2010.07: OUTPUT«1␤»
pmichaud ......that's going to be an interesting one to resolve.
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 :)
pmichaud cancels his bug report. 18:40
frooh star: say $_ for <a b c>; 18:43
p6eval star 2010.07: OUTPUT«a␤b␤c␤»
jnthn pmichaud: I'm confused - what were you thinking was a bug? :_0
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<===>
p6eval star 2010.07: ( no output )
pmichaud but there are earlier lines that specifically handle Numeric and String
18:44 offerkaye joined
frooh star: [1..(<a b c>)].perl.say 18:44
jnthn pmichaud: Right. :-)
pmichaud (I didn't see those because I was looking for Int and Str)
p6eval star 2010.07: ( no output )
jnthn Aha. :-)
offerkaye Hi
phenny offerkaye: 01:41Z <isBEKaml_> tell offerkaye you have u4x.perl6.org that renders the pod into formatted html. Feel free to improve it! :)
frooh star: my @l = <a b c>; [1..@l].perl.say 18:45
p6eval star 2010.07: ( no output )
pmichaud star: my @l = <a b c>; [1..+@l].perl.say
frooh star: my @l = <a b c>; (1..@l).perl.say
p6eval star 2010.07: OUTPUT«[1, 2, 3]␤»
star 2010.07: OUTPUT«1..["a", "b", "c"]␤»
offerkaye phenny: nice one :)
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?
darkop aCiD2++
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
p6eval star 2010.07: OUTPUT«[1, 2]␤»
frooh offerkaye: 32 has most of that kind of stuff
pmichaud offerkaye: S32 (Containers) 18:48
frooh star: my @l = <a b c>; say @#l;
pmichaud offerkaye: svn.pugscode.org/pugs/docs/Perl6/Sp...ainers.pod
p6eval star 2010.07: OUTPUT«===SORRY!===␤Non-declarative sigil is missing its name at line 22, near "@#l;"␤»
offerkaye frooh and pmichaud - thanks! 18:49
jnthn frooh: @l.end
frooh jnthn: ty sir
pmichaud frooh: what are you trying to get to?
frooh pmichaud: I'm trying to iterate over the indices of a list, but starting in the middle 18:50
pmichaud: so like, for $x .. @list.end I guess?
pmichaud for $x ..^ +@list 18:51
frooh that goes too hight though right?
pmichaud no
my @list = <the quick brown fox jumped over the lazy dog>; .say for 3..^+@list;
star: my @list = <the quick brown fox jumped over the lazy dog>; .say for 3..^+@list;
p6eval star 2010.07: OUTPUT«3␤4␤5␤6␤7␤8␤»
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␤»
frooh ok, guess not then :-)
pmichaud +@list is the number of elements in @list
3 ..^ +@list means "3 up to the number of elements in @list"
frooh oh nice.
pmichaud the ^ means "up to" instead of "up-to-and-including"
frooh pmichaud: how about printing directly to STDERR? 18:54
pmichaud $*ERR.say # I think
star: $*ERR.say("I'm an err");
p6eval star 2010.07: OUTPUT«I'm an err␤»
pmichaud not sure if the other works
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␤»
frooh star: $*ERR.print('a', 'b', 'c');
pmichaud yeah, doesn't go the other way.
p6eval star 2010.07: OUTPUT«abc»
pmichaud but you can also do:
star: { my $*OUT = $*ERR; 'hello world'.say; }
p6eval star 2010.07: OUTPUT«hello world␤»
pmichaud which actually goes to the stderr instead of stdout
jnthn Hard to tell with evalbot ;-)
lue rakudo: say 'ß' ~~ m:i/S/ 18:56
p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Confused at line 22, near "say '\\x{df}' ~~"␤»
frooh $*ERR.say doesn't go to stderr?
pmichaud frooh: it does
frooh ok
I like that better anyway
I'd do the former if we had temp, but it's not worth it for a single line anyway
18:56 pdcawley joined
lue
.oO(curse you, improper unicode handling (?))
18:56
18:58 kjeldahl joined
aCiD2 is it possible to run a BUILD method after attributes have been initialised with defaults? 18:58
lue rakudo: say 'π' ~~ m:i/∏/ 18:59
p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Confused at line 22, near "say '\\u03c0' ~~"␤»
lue Now I feel I can blame unicode handling. 19:00
rakudo: say 'a' ~~ m:i/A/
p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Confused at line 22, near "say 'a' ~~"␤»
lue rakudo: say ('a' ~~ m:i/A/)
p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Unable to parse postcircumfix:sym<( )>, couldn't find final ')' at line 22␤»
lue O.o
[ If I've done something stupidly wrong, now is the time to speak up :) ] 19:02
diakopter std: say ('a' ~~ m:i/A/)
p6eval std 31883: OUTPUT«ok 00:01 118m␤»
pmichaud rakudo: say 'a' ~~ m/:i A/
p6eval rakudo 9b6189: OUTPUT«a␤»
pmichaud I don't think rakudo understands adverbs on m// yet. 19:03
but you can put them inside the slashes to get a similar effect
afk, lunch
sorear star-- 19:04
# creating so much traffic here I can no longer backlog
diakopter heh
19:06 cono joined
offerkaye sorear: that's a good thing I think? :) 19:06
lue
.oO(oh hey look, almost 200 people again)
19:07
offerkaye P6 Gentle Intro done at: blogs.perl.org/users/offerkaye/2010...art-2.html 19:10
Read it and weep guys
:)
Or atleast, let me know if I wrote anything wrong :) 19:11
s/P6 Gentle Intro done/P6 Gentle Intro part 2 done/ ; # do'h
jnthn offerkaye: Looks nice. :-) 19:12
pmichaud szabgab++ # hashes screencast makes me say "ooooh, nice"
jnthn offerkaye: @primes[@primes.end] can also be @primes[*-1]
tadzik star: my @primes2 = <17 19 23 29 31>; @primes2.perl.say
p6eval star 2010.07: OUTPUT«["17", "19", "23", "29", "31"]␤»
pmichaud (afk, really lunch this time)
tadzik offerkaye: not the same, see? They're strings
offerkaye star: "17" * 3.14 19:13
p6eval star 2010.07: ( no output )
offerkaye star: say "17" * 3.14
p6eval star 2010.07: OUTPUT«53.38␤»
frooh star: sub l(:@foo) { say +@foo }; l (1,2,3);
offerkaye "17'
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␤»
offerkaye "17", 17, all same same :D
szabgab pmichaud: have you learnt something new ? :)
frooh star: sub l(:@foo) { say +@foo }; l((1,2,3));
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
frooh star: sub l(:@foo) { say +@foo }; l(foo=> (1,2,3));
p6eval star 2010.07: OUTPUT«3␤»
frooh star: sub l(:@foo) { say +@foo }; l(foo=> <a b c>);
p6eval star 2010.07: OUTPUT«3␤»
tadzik star: my @a = 1, 2, 3; my @b = <1 2 3>; say @a == @b
p6eval star 2010.07: OUTPUT«1␤»
tadzik ow
…well, that's weird to me anyway
szabgab offerkaye++ # gentle intro
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>);
p6eval star 2010.07: OUTPUT«3␤»
szabgab offerkaye: when I am back from Pisa we might organize a Perl 6 evening in Hafa
frooh star: sub l(:@foo, :$sup) { say +@foo }; l (foo=> <a b c>);
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␤»
tylercurtis star: say +(1,2,3); say +<1 2 3>;
p6eval star 2010.07: OUTPUT«3␤3␤» 19:16
tylercurtis tadzik: ^^
offerkaye Gabor, that would be cool, although I'm only starting to scrape the surface of p6 :)
tadzik well, I know this one :)
star: say "5" + "2"
p6eval star 2010.07: OUTPUT«7␤»
tadzik star: say "5" == 5 19:17
p6eval star 2010.07: OUTPUT«1␤»
szabgab offerkaye: and most of the others in Haifa don't know any of it
tadzik :ASD
nevermind then
star: say "5".perl == 5.perl
p6eval star 2010.07: OUTPUT«0␤»
19:17 wamba joined
offerkaye Anyone know who phenny is, how can I contact him? I want to know how he changed u4x.perl6.org/ 19:17
tadzik offerkaye: he's a bot, passing messages
phenny: tell offerkaye something
phenny tadzik: I'll pass that on when offerkaye is around.
19:17 kjeldahl_ joined
offerkaye ah lol 19:18
phenny offerkaye: 19:17Z <tadzik> tell offerkaye something
offerkaye ok so who changed u4x.perl6.org/ ?
jnthn offerkaye: It ends to say that person's handle in the message 19:19
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_>
wb from lunch pmichaud , that was quick
:)
pmichaud no, haven't made it yet :)
(waiting on $wife)
offerkaye "offerkaye: 01:41Z <isBEKaml_> tell offerkaye you have 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
frooh pmichaud: paste.scsys.co.uk/47432 <-- passes tests, any thoughts on making it more perl6y?
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)␤»
tylercurtis frooh: given/when doesn't fall-through, does it?
pmichaud frooh: maybe turn all of $!trace, $!debug, etc. into a hash with those as keys?
szabgab rakudo: my %h{'a', 'b'}; %h{'c'} = 1; say %h.perl
p6eval rakudo 9b6189: OUTPUT«{"c" => 1}␤»
szabgab bad gabor, bad
pmichaud i.e., do they need to be attributes?
frooh pmichaud: that makes sense.
szabgab so no restriction in hash keys yet, right?
offerkaye Ah of course. So any idea who made u4x.perl6.org or who <isBEKaml_> is?
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.
szabgab rakudo: my %h<a b>
p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Confused at line 22, near "my %h<a b>"␤»
pmichaud frooh: right. we've switched object storage so that they're not just hashes.... but you can still use hashes to store data :)
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
offerkaye pmichaud: hmm okay, a bit of a confusing message there from <isBEKaml_>, who ever that is 19:24
BTW guys can anyone fix the broken link on perlcabal.org/syn/ to S26? It points to perlcabal.org/syn/S26.html currently which gives a 404 19:25
frooh pmichaud: paste.scsys.co.uk/47433 <-- much prettier
pmichaud ok, afk lunch 19:26
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)␤»
frooh man, if I only had that my ^add_methods could be oneliners 19:28
oh sweet! 19:29
frooh shims it with $?CLASS =
19:35 Trashlord joined 19:38 colomon joined, molaf joined 19:39 rbuels joined 19:43 user_2010_ joined, rurban joined
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
how about the star short descr: DESCRIPTION="Perl6 modules, more docs and tools" ?
jnthn: I have some blizkost patches for cygwin 19:45
jnthn rurban: \\o/
rurban: If you do github, feel free to send a pull request.
user_2010_ Hi
rurban just silly little things
jnthn user_2010_: hi 19:46
user_2010_ Need a perl help
jnthn rurban: Probably silly enough to fix the build... ;-)
rurban But I'm working on the rakudo-star release version. Is this tagged?
user_2010_ im trying to open a file in C folder
but the code is dying on me staing no file or directory
mantovani "user_2010" hahaha nice
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")
jnthn user_2010_: That looks like Perl 5.
user_2010_ or die "Could not open file for reading $!\\n";
tadzik user_2010_: isn't it Perl 5?
user_2010_ Yes perl 5
19:48 jaldhar joined
jnthn user_2010_: OK, Perl 6 is rather different from Perl 5, so I suggest...I think #perl-help 19:48
user_2010_: You may want to try open(INPUT, "<", "C:\\\\input.txt")
frooh I think #perl is fine in freenode. If you join irc.perl.org you'll want #perl-help
jnthn frooh: Oh, OK 19:49
So #perl can help
frooh user_2010_: or better yet, open (my $in, "<", "C:\\\\input.txt")
global filehandles--
user_2010_ ok..Thank you
frooh user_2010_: good luck :-) 19:50
tadzik user_2010_: oh, remember, you can always try Perl 6 :)
frooh :D
tadzik (I'm disappointed nobody said this :>)
frooh does module == package? 19:51
jnthn A module is a type of package that's good for sticking a bunch of subs in 19:52
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 :-)
rurban jnthn: First fix is github.com/rurban/blizkost/commit/e...ab028d8565
frooh (except of course the ones that are classes ;-)
jnthn rurban: thanks, applied 19:55
rurban fixing XS() on windows is harder... 19:56
exodist does perl6 have a working forking mechanism? is it still $pid = fork()? 19:58
jnthn exodist: Not built in at the moment, but github.com/jnthn/zavolaj/blob/maste...ix-fork.p6 shows how you can get at it with NativeCall
rurban nope. it was easy enough. just pushed 19:59
1 failure: nt/exit.t .................. Can't undef active subroutine during global destruction. 20:00
jnthn rurban++ # also applied
rurban Is this exit error known?
jnthn I think there are general issues with global distrukshun. 20:01
sorear++ would probably know how unusual that particular one is
rurban hmm, I'm working on this at the perl5 side also :) with my B::C compiler
jnthn If you have a fix, it's most welcome. :-)
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;
p6eval star 2010.07: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}' at line 22␤»
rurban Fair enough. I'll try, but not now. I'll leave to do some partying now
jnthn \\o/ 20:03
Have fun.
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:04
20:05 dalek joined
rurban hmm, blizkost needs DESTDIR support 20:06
tadzik rurban: :)
jnthn: so, looked at this patch of mine?
rurban but for the fist look it works fine 20:07
jnthn rurban: gist.github.com/502109
Is patch from tadzik++
20:07 zostay joined
rurban Great! I'll try 20:07
tadzik rurban: worksforme, I was able to package blizkost for CRUX with it 20:08
rurban yes, worked for me also. Just the tests are not running from the star Makefile 20:11
jnthn: tadzik++ patch is good
jnthn OK, great, should be applied. 20:12
tadzik: Any chance you cna send me a pull request for it?
rurban jnthn: did you test a static libperl.a also?
jnthn No
rurban Hmm. Maybe I'll try later. debian has it like this 20:13
tadzik jnthn: I can. I'll have to fork you first :) 20:14
rurban tadzik: 2 minutes
tadzik rurban: will you apply and send a pull request?
jnthn Well fork me! 20:15
tadzik That's what she said! 20:16
lue afk
20:17 hanekomu joined
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␤»
frooh star: module Lol { sub foo { _bar() }; sub _bar { say 1 } };
p6eval star 2010.07: ( no output )
frooh I guess if you want a private sub in a module you just don't export it?
tadzik jnthn: sent, if I done it right 20:20
jnthn frooh: Right 20:22
frooh: They're lexically scoped by default.
frooh cool.
tadzik jnthn: is the pull request ok? 20:23
jnthn tadzik: Looks to be.
rurban: Wanted to check something before I apply?
pmichaud back again 20:28
jnthn yayitspm 20:29
cosimo rakudo: my $y = 'foo'; my $x = ($y eq 'foo' || $y eq 'bar') ?? 1 :: 0; say $x 20:34
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
p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Confused at line 22, near "my $x = $y"␤»
20:35 alester joined
pmichaud tadzik: going to be around for a bit? I have some time to work on DESTDIR= handling. 20:36
tadzik pmichaud: sure 20:37
20:37 Ross joined
frooh I'm trying to use $obj.$foo to call the method that $foo has the name of, but I'm getting errors, ideas: paste.scsys.co.uk/47434 ? 20:39
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"()
frooh it works in the object code though 20:41
like, I can do self.$is-level()
20:42 Axord joined
frooh tylercurtis: looks like that works 20:42
(using quotes)
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␤»
frooh hmm
gfldex rakudo: class A { method b(){} }; my $a = A.new(); $a.^can('b').();
frooh hmm
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␤»
gfldex rakudo: class A { method b(){} }; my $a = A.new(); $a.^can('b').WHAT;
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;
p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Non-declarative sigil is missing its name at line 22, near "&$a.^can('"␤»
gfldex rakudo: class A { method b(){ return 'well?'} }; my $a = A.new(); say $a.^can('b');
p6eval rakudo 9b6189: ( no output )
tylercurtis gflrakudo: class A { method b() { say 'foo'; }; my $a = A.new; $a.^can('b')($a);
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␤»
tylercurtis rakudo: class A { method b() { say 'foo'; } }; my $a = A.new; $a.^can('b')($a);
p6eval rakudo 9b6189: OUTPUT«foo␤»
tylercurtis gfldex: ^^ 20:46
gfldex frooh: ^^
frooh orly...
frooh tries
ok, that works 20:49
it's a little gross, since "$foo" should probably work
or...
hmmm
frooh is getting more errors 20:50
tylercurtis frooh: I thought you said "$foo" worked?
frooh tylercurtis: yeah, it's really strange, in some situations one works and in some it doesn't
pmichaud tadzik: pmichaud.com/sandbox/rakudo-star-delta1.tar.gz # first attempt
20:53 kjeldahl joined
alester pmichaud++ 20:55
thanks for getting everything out
pmichaud alester: thanks for the perlbuzz post :)
alester posted here too perlbuzz.com/2010/07/rakudo-star-fo...lable.html
yeah, that. :-)
pmichaud was the release announcement sufficiently okay?
alester yeah, it's fine 20:56
pmichaud (I was quite happy with it when done... it seems to have hit the perfect note)
alester while you were announcing, i was in the Fed courthouse.
whee!
pmichaud alester: as a spectator, participant, or captive audience?
tylercurtis rakudo: sub foo { True; }; given False { when { foo() } { say 'foo'; } }
p6eval rakudo 9b6189: OUTPUT«foo␤»
alester well, not quite the courthouse, but dealing with legal hoohah
but stuff that could not be ignored for the sake of Perl 6. ) 20:57
and then I had to buy a Droid.
so you see
tadzik pmichaud: on it
alester now building Rakudo on my Linux box
21:01 jaldhar joined 21:06 molaf joined
tadzik pmichaud: no errors, but no results :) 21:06
pmichaud: nopaste.snit.ch/22494
offerkaye Question - is there a working implementation of a reader (a-la perldoc) for the Perl 6 Pod format?
tadzik there is grok 21:07
pmichaud wiki.github.com/rakudo/rakudo/yapce...shop-notes 21:09
tadzik: looking
offerkaye But this wasn't released with Rakudo-Star?
tadzik nope
it's on good, ol' CPAN
21:10 jaldhar joined, mantovani joined, baest joined
pmichaud tadzik: that's..... odd. Let me try it locally. 21:11
21:11 drbean joined
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:12
pmichaud offerkaye: why are you surprised there isn't a p6 one yet, ooc? 21:13
21:14 jferrero joined
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?
tadzik offerkaye: R* docs aren't written in Pod6 21:16
modules docs are
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);
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
..meta-infix␤ st…
offerkaye Nope. As I said, hopefully someone (who can code) considered this point already.
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);
p6eval rakudo 9b6189: OUTPUT«===SORRY!===␤Confused at line 22, near "sub foo($o"␤»
tadzik Well, offerkaye, how about a nice weekend project? I can, want to help me?
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)
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␤»
gfldex kekeke
tadzik (at least trying would be fu)
gfldex i haz a bug :)
pmichaud offerkaye: I'm just frequently surprised at the apparent contradictions between "release early, release often" and "releasing a tool without XYZ seems wrong"
gfldex frooh: seen that?
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
gfldex it's no wonder why references to methods dont work :) 21:18
jnthn gfldex: rakudobug@perl.org ... :-)
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.
offerkaye: as to which tool to use (more) 21:21
tadzik offerkaye: p6pod of course
imho
21:21 kjeldahl_ joined
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.
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.
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.
gfldex i prefere not to wait another 10 years
pmichaud offerkaye: whichever you choose will be (1) helpful and (2) very welcome 21:23
if there's more p6pod around, that makes it more likely that someone will find the tuits to build the tools
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
tadzik: I get similar problems as you... looking 21:24
tadzik writing a perl6doc sounds like a fun weekend projeect 21:25
offerkaye tadzik: since S26 is written in P6-Pod and since the HTML link is broken (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:29
tadzik :P 21:30
looks like it's not perfect
or the SYN is not perfect
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
:D
21:33 jfried joined
pmichaud tadzik: I see where the problem is, I'm not quite sure how to fix it. 21:33
the "cd rakudo && make install" is putting DESTDIR inside of the rakudo/ subdirectory instead of the top-level directory 21:34
tadzik hmm
so in rakudo/Makefile let's maybe put sth like DESTDIR2, which will default to $(DESTDIR)/..? 21:35
pmichaud well, you'd want ../$(DESTDIR) 21:36
and that won't work if DESTDIR= happens to be an absolute path.
tadzik hm 21:44
pmichaud ah
gnu standards say that DESTDIR should always be an absolute filename
so.... DESTDIR=xyz isn't valid
tadzik hrm
or, there is a way
pmichaud needs to be DESTDIR=$PWD/xyz
if one gives a full path, think it'll work.
tadzik you can make dir INSTALLSTUFF, then install everything there, and then install INSTALLSTUFF with DESTDIR 21:45
pmichaud that just sounds like copying the install/ subdirectory to a new location. 21:46
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:49
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
pmichaud I can imagine a lot of them. You'll have to be more specific :) 21:51
tadzik well, $PREFIX/lib/parrot/something
pmichaud in general, parrot expects everything to be installed relative to its root
tadzik hmm
yeah, I know that
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 :)
so not /usr/share/parrot/asd but /tmp/foobar/usr/share/parrot/asd
the prefix for the whole tree
difficult to express myself :)
pmichaud yeah, I'm not quite sure how to do that in the context of parrot's current build system.
part of the problem is that parrot has paths hardcoded into its binaries 21:53
tadzik well, it's not meant to work then
that's the thing
this is a temporary state
pmichaud but the only way I can get compiled rakudo and modules is if I have an actual running parrot
tadzik so the prefix will remain /usr, but it will be copied elsewhere, not expected to work there
so it can be tarballed, then unpacked to /, then work
pmichaud sure, I know that part. 21:54
I just don't see how to build a rakudo and modules without having an actual installed parrot.
(in the place that the parrot expects to run) 21:56
I suppose I could try passing -L options all over the place. 21:57
tadzik hmm
no touching the current build process 21:58
that works and is ok
now installing is a different case, rakudo will still be built and work
exodist hmm, S10-12 really do not ever cover what package Foo { ... } is good for vs using module { ... } 22:03
pmichaud the main reason for using 'module' is to unambiguously identified the code as perl 6 22:04
*identify
as opposed to 'package' which might be thought to be either p5 or p6
exodist so theoretically package and module can be used interchangably except that line 1(ish): package Foo; #is illegal 22:06
tadzik pmichaud: 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.
there are better places to maintain task lists.
22:07 tommyd joined
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 :-(
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
I defined it like this: subset Hash of Str where { $_ ~~ /[0-9a-f]{40}/; }; 22:09
and rakudo tells me: Unable to parse blockoid, couldn't find final '}' at line 3
(well, line 3 is what you're actually looking at)
pmichaud tommyd: the invalid regex is why you're getting the error
but I'm not sure that sort of subset is going to work anyway
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?
pmichaud tadzik: the problem is the building. 22:10
tommyd ah, the regex is invalid? must look into the "new" valid then apparently
pmichaud tommyd: you likely want /<.xdigit>**40/
if you really just want 0-9a-f, then it's /<[0..9a..f]>**40/
but I'm still not too sure about that subset declaration 22:11
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.
tadzik pmichaud: oh
22:12 Guest23195 left
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.
tommyd pmichaud: thanks, this brings me further
tadzik pmichaud: so first rakudo's installed into / and then the modules are built?
tommyd the rule is apparently accepted, but my "my" declaration seems to be wrong
pmichaud tadzik: rakudo is installed into wherever parrot expects it to be installed, and then the modules are built
tommyd my Hash "foobar"; spits out: In "my" declaration, typename Hash must be predeclared (or marked as declarative with :: prefix) 22:14
(I tried this with something different than "Hash", same result
tadzik oh, I see
pmichaud I guess we could try building the modules from rakudo's build directory 22:15
let me see if I can do that somehow.
tylercurtis rakudo: subset Hash of Str where /<.xdigit>**40/; my Hash $h = "foobar";
p6eval rakudo 9b6189: OUTPUT«No such attribute '$!storage'␤ in main program body at <unknown line>␤»
tylercurtis rakudo: subset HashStr of Str where /<.xdigit>**40/; my HashStr $h = "foobar";
pmichaud tylercurtis/tommyd: note that Hash is not a true class type in Rakudo right now.
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)
(and not a very good one at that)
exodist what does ::Whatever represent? (saw it in $var ~~ ::Whatever) not sure what it is checking.
pmichaud Whatever is a type
tylercurtis rakudo: subset HashStr of Str where /<.xdigit>**40/; my HashStr $h = "abcde" x 8;
p6eval rakudo 9b6189: ( no output )
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;
p6eval rakudo 9b6189: OUTPUT«abcdeabcdeabcdeabcdeabcdeabcdeabcdeabcde␤»
exodist pmichaud, thanks. Whatever seews lixe a strange name if theres already an 'Any' type, whats the difference?
pmichaud Whatever is the type of *
exodist *seems like
pmichaud Any is the generic type for non-junction objects 22:18
so, for example
tommyd rakudo: subset HashStr of Str where /<[0..9a..f]>**40/; my HashStr $f = "foo";
pmichaud my $range = 1..*;
p6eval rakudo 9b6189: OUTPUT«Type check failed for assignment␤ in '&infix:<=>' at line 1␤ in main program body at line 22:/tmp/a6gLOYKReY␤»
pmichaud that '*' there has a type of Whatever
tommyd ah nice, it works
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␤»
exodist ah-ha! thanks
pmichaud exodist: exactly
exodist: you got it in 1
exodist in 1?
pmichaud (1 try)
exodist oh, lol 22:21
pmichaud the ::'s there are actually optional
star: sub blah( $thing ) { if $thing ~~ Whatever { say 'whatever' } else { say $thing; } }; blah(*); blah(1) 22:22
p6eval star 2010.07: OUTPUT«whatever␤1␤»
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.
pmichaud sometimes the ::'s are used because the type might not have already been defined yet (e.g., when compiling the setting)
exodist perl 5, 8 years
pmichaud I just finished my 19th year of Perl programming. 22:23
(or maybe 18th -- need to double check that :)
exodist nice, 19 years ago I was 7 or 8
pmichaud anyway, it's been a long time :)
exodist yeah, ++ 22:24
tadzik 19 years ago I might have been unborn :)
pmichaud: so the only problem is the modules now?
exodist I think I am gonna put together a simple reference + glossary as I learn
pmichaud tadzik: that's the main one I see. 22:25
I think I might have an answer.
tadzik there is always a way to provide an option to install it all without modules
and supply rakudo-star-modules package
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 :)
pmichaud anyway, I think I can get it.... just a sec
trying it locally 22:30
tadzik is there something that needs to be done in Rakudo, R* or modules what I could pick for a weekend project? 22:32
22:32 ashleydev_ joined
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
my rationale - you'll be most productive with something you're interested in. and any learning is good learning
just my 2p
tadzik aCiD2: probably, but I don't feel powerful enough to fix RT bugs, at least without guidance
hence my question 22:36
aCiD2 get over that then ;)
take something and run with it. if you fix it, give us a patch
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
baby steps. (this is coming someone who's in exactly your position, this just happens to be my game plan)
tadzik :)
aCiD2 but honestly, for now I'd concentrate on becoming as familiar with source code or at least layout as possible 22:37
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
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 :)
pmichaud tadzik: I think I have something 22:39
aCiD2 saves someone else doing it; submit it!
pmichaud let me update and make a delta2 tarball for you to try
tadzik aCiD2: it's in core alredy :)
aCiD2 oh, good :)
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 :)
aCiD2 anywhoooo. too much beer now, so bed calls :)
happy hacking!
tadzik so to You pal :)
pmichaud creating tarball now 22:41
pmichaud.com/sandbox/rakudo-star-delta2.tar.gz # still uploading, should be done in 1 min 22:42
22:43 masak joined
pmichaud 30 sec 22:43
tadzik yayitsmasak! \\o/
masak ahoy, #perl6!
pmichaud masak: o/
how goes the panic list?
masak panics
pmichaud tarball finished uploading
tadzik: be sure to use a an absolute path with DESTDIR= 22:44
s/a //
tadzik pmichaud: a'right
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.
jnthn masak! \\o/
pmichaud masak: I should probably be worried. I already have my presentations ready, save for some minor updates.
afk for a bit ... walk time
masak pmichaud: Yapsi is due today/tomorrow, and I still need to finish my runtime refactor. that's vaguely worrying. :)
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.
jnthn Yeah, I mean, I thought you had ticketed every single bug in Rakudo already.
masak jnthn: if keeping my fingers crossed works, array-indexed blocks, O(1) variable access, and a first stab at static lexpads. 22:47
Yapsi development is slow but yummy. :)
if I find I have extra time(TM) tomorrow, I'll implement FIRST and LAST as per the blog post. 22:48
jnthn Nice :-)
masak someone else is welcome to try it out independently, and we'll merge before release. :)
tadzik pmichaud: closer: nopaste.snit.ch/22495 22:51
jnthn masak: I managed a little slide procrastination today. :-)
masak jnthn: woot!
jnthn I almost have a talk. :-)
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. :)
jnthn But may skip it.
:-)
masak actual coding isn't so bad, after all.
jnthn looks forward to seeing that talk.
For many reasons. :-)
masak maybe I should try something new and develop the slides here on #perl6, wiki-style? 22:53
nah. :)
jnthn Yeah!
The puns will be awesome!
As in, awful
:-)
masak au++ used to do that... maybe I should try it as well.
exodist pmichaud, when using * like DoThing(*) what terminology is used for the *? whats it called (an instance of whatever?) 22:54
22:54 _macdaddy joined
exodist oh, he,s afk. 22:54
anyone else know?
masak exodist: what-EVER!
masak rolls eyes :) 22:55
jnthn "OH HAI I will now pour out crowdsauced presentashun!"
tylercurtis masak: do I correctly remember you saying something about planning to work on POD6 related stuff? Or am I thinking of someone else?
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();
jnthn exodist: We just call it whatever.
p6eval rakudo 9b6189: OUTPUT«1␤»
gfldex bug or not bug?
masak exodist: yes, when used as a term, the '*' is called Whatever.
exodist ox.
*ok
masak tylercurtis: would you like to see my Hague grant proposal?
tadzik tylercurtis: I've just started writing something like perl6doc 22:56
masak tylercurtis: gist.github.com/500732
jnthn gfldex: Yeah, supersede is...thankfully...not yet implemented.
masak tadzik: then you should probably look at literal++'s grok tool, which is meant to be a perl6doc.
gfldex jnthn: what is supposed to happen in that case?
jnthn gfldex: The class definition would be completely replaced with the new one. 22:57
However, how that affects existing objects is a whole different matter.
tadzik masak: I'm writing in Perl6 actually, mostly to play with it :)
sorear jnthn: Check the name of the commit which added exit.t 22:58
masak tadzik: cool! what, more exactly, are you writing?
tadzik masak: well, I want it to act like perldoc, but for Perl 6 modules and Pod 6 :)
masak jnthn: it can't reasonably affect existing instances, can it?
tadzik masak: not sure what will come out of this :P
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.
sorear jnthn: I probably should revert that one, I only pushed it by accident
jnthn masak: That one is pointless
masak: Because I suspect that supersede happens at compile time.
masak jnthn: oh. :/ 23:00
gfldex jnthn: is eval compile time?
masak jnthn: and if I put it in an eval? :)
jnthn gfldex: No
gfldex: So that one has a chance of being interesting. :-)
masak: I think it probably has to affect existing instances. (more)
gfldex my bet would be a Null PMC :)
masak tadzik: you should probably have a glance at gist.github.com/500732 -- especially the last two points intersect with what you seem to be doing.
tylercurtis masak: offerkaye was interested in writing some more docs for Perl 6 and was asking about Perl 6 Pod.
masak tadzik: also probably have a look at all three projects linked from that proposal.
tadzik masak: sounds like fun 23:01
23:01 waste joined
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:01
sorear: Or mark it skipped or something. 23:02
ingy greetings
jnthn o/ ingy
ingy \\oXo/
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. :)
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
jnthn goes to read for a bit - bbl
tadzik masak: but is integrating that into Rakudo a good idea?
masak tadzik: mostly that's not me proposing, it's S26 proposing.
tadzik: I'm just making a grant proposal of things that are already spec.
tadzik oh, ok
23:05 shirtless joined
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 } }
p6eval std 31883: OUTPUT«ok 00:01 117m␤»
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
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␤»
pmichaud back again
tadzik shirtless: take a look at HTTP::Client maybe
shirtless tadzik, cool, I saw that didn't know if there were others
gonna try it out.
ingy where's TimToady during all this hooha?
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.
tadzik oh 23:07
masak tadzik: fork the repo and github and go wild!
tadzik everything on my head? /o\\
shirtless Derp never mind, There's no IMAP code for perl6 yet, is there?
ingy jnthn: read your post. seemed like good timing...
tadzik panics, learning from masak experiences
masak tadzik: just giving you ideas here :)
tadzik shirtless: I don't think there is one
shirtless Cool, new project for shirtless.
tadzik masak: I'll take a look at it
masak tadzik: also, check out use.perl.org/~masak/journal/38644
tadzik shirtless: I think the whole Net:: namespace needs some love 23:08
shirtless: my only excuse for not having fun with it yet is the lack of binary files support in Rakudo :)
sorear masak: try to make your implementation stealable by niecza, ok? :)
masak shirtless: write us a module that you yourself would love to use. that's a recipe for success.
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.
shirtless masak, I'll try. Perl is still pretty alien syntax to me.
masak sorear: I think I will have enough fun with subs and phasers for several months to come.
pmichaud tadzik: I don't understand why your "cd rakudo && make install" line seems to not do anything.
masak shirtless: you know it's always OK to ask here, right? :)
shirtless yeah this place is awesome 23:10
tadzik shirtless: yep
pmichaud: no idea
masak shirtless: it totally is! it's my favourite place on the interwebs.
pmichaud tadzik: what version of make do you have?
shirtless tadzik, oh well, guess you won't be able to use my Imap module to download trojans to your windows box then.
sorear masak: I was referring to the rakudo --doc proposal
tadzik pmichaud: GNU Make 3.81
pmichaud tadzik: very weird.
tadzik shirtless: no windows box here :(
masak sorear: oh, sure. provided I get the grant. :)
shirtless tadzik, how do you run trojans without a windows box?
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!
pmichaud tadzik: are you perhaps doing a parallel make?
tadzik pmichaud: could be 23:12
> echo $MAKEFLAGS
-j2
pmichaud aha
I bet that's part of the problem.
tadzik now with -j1…
oh, what an output 23:13
and it compiles something
this will be a big, good paste
pmichaud: nopaste.snit.ch/22496 23:15
sorear I find that a lot of "Perl 6" code isn't as easy to steal as it should be 23:19
because of completely gratuitous use of advanced features like multiple dispatch and junctions
sorear needs to overhaul the binder before either of those become feasable to implement 23:21
23:23 KenGuru joined
waste rakudo: say 1; # test 23:27
p6eval rakudo 9b6189: OUTPUT«1␤»
tadzik Null PMC access is always a bug, right?
pmichaud not *always*
but usually, yes.
waste what about segfault ? 23:28
pmichaud that's usually a bug also.
tadzik nopaste.snit.ch/22497
duh, ran twice
pmichaud yes, that's a bug. 23:30
$match[0] should probably return a failure, since there is no $match[0]
23:30 Ken-Guru joined
masak tadzik: please submit a rakudobug. 23:31
tadzik++ 23:32
tadzik will do
23:34 Italian_Plumber joined
pochi is there a way to get readline support in the repl? 23:34
pmichaud the repl has readline support. you probably need to have the libreadline[56]-dev package installed 23:35
(when building parrot)
pochi ah, ok
pmichaud parrot looks for libreadline5-dev to compile in readline support.
(package may be different on your particular OS.... libreadline5-dev is what is needed on my system)
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?){};
..}…
gfldex std: class A { method b($name, |$c){}; }; A.b('foo');
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){}; };
..A.b…
pochi pmichaud: thanks, libreadline5-dev did the trick 23:38
tadzik bug sent 23:40
waste rakudo: die; CATCH { die }; 23:41
p6eval rakudo 9b6189: ( no output )
tadzik time for me. G'night #perl6
23:43 justatheory joined
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␤»
gfldex bug?
23:44 gazza67 joined, pragma_ joined
waste rakudo: die; CATCH { say "caught!"; } 23:44
p6eval rakudo 9b6189: OUTPUT«caught!␤» 23:45
masak gfldex: please golf your code if possible :) too much noise to tell right now.
gfldex it's golfed as hard as i can
i will nopaste it with indents
masak tries it locally 23:46
waste rakudo: die; CATCH { say "caught!"; die }
gfldex gist.github.com/502758
pmichaud waste: die inside of CATCH is known to segfault
p6eval rakudo 9b6189:
..OUTPUT«caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤ca…
gfldex it doesnt like the last line
waste pmichaud: ok
masak gfldex: ah. 23:48
gfldex: no bug.
pmichaud $.ref only expects zero argumetns.
masak gfldex: you need to write that as $.ref()(|$c)
pmichaud masak++
masak gfldex: there's a mention in S12 about why.
pmichaud I suspect you could write it as $!ref(|$c)
masak gfldex: but basically, you need ()() when you call a code thing in a public accessor.
pmichaud but yes, $.ref is always a method call 23:49
(that, by default, returns the value of $!ref)
masak right, and $.ref() is *the same* method call.
gfldex: it says that it expects 1 argument because Rakudo has a confusing habit of counting the invocant as an argument. 23:50
gfldex i figured that one out already :) 23:51
masak gfldex++
gfldex P6Invocation is a funny little bugger :P
masak not really :)
waste rakudo: die; CATCH { say "caught!"; $!.handled = 1 }; 23:52
p6eval rakudo 9b6189:
..OUTPUT«caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤caught!␤ca…
masak this is why I tend not to use CATCH a lot in my programs. :P 23:53
"caught in a web of re-throws..."
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?
pmichaud or otherwise tie exceptions to a specific handling scope.
waste: Tene might recall
23:54 gbacon joined
Ken-Guru does the msi of rakudo only xcopy deploy? 23:54
masak sees a bunch of new acronyms and realizes it's about Windows :) 23:56
Ken-Guru :D
indeed
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:57
23:58 Psyche^ joined
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:58
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
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 ;-)