pugscode.org/ | nopaste: sial.org/pbot/perl6 | pugs: [~] <m oo se> (or rakudo:, kp6:, smop: etc.) || We do Haskell, too | > reverse . show $ foldl1 (*) [1..4] | irclog: irc.pugscode.org/
Set by TimToady on 25 January 2008.
pmichaud Tene++ 00:02
Eevee considers flooding www.perlfoundation.org/perl6/index....and_jargon with perl 6 language constructs and links to associated synopses 00:09
lambdabot Title: Glossary of Perl 6 Terms and Jargon / Perl 6, tinyurl.com/ytvdje
pmichaud Eevee++
Eevee I will take that as approval 00:10
00:24 [particle1 joined 00:27 [particle1 left
Eevee are the globals still going to have single-symbol names? 00:30
well, whoops. apparently I found a magical "close exactly the tab I don't want closed" keystroke, and of course socialtext uses a ridiculous javascript editor instead of a page with a textarea.. 00:39
00:42 valkyrie-- left 00:44 Alias_ joined, pbuetow left 00:48 BinGOs left 00:49 vixey left, BinGOs joined 00:53 aindilis joined 01:03 wknight8111 left 01:04 ispy_ joined
ispy_ I <3 Perl6 01:05
01:08 vertog joined 01:16 ispy_ left 01:25 Ched left, Ched joined 01:32 ispy_ joined 01:59 [particle2 joined, [particle2 left 02:02 [particle2 joined 02:15 [particle] left, eternaleye left 02:19 Auzon left 02:21 justatheory left 02:34 eternaleye joined 03:10 Diablo-D3 joined
Diablo-D3 heh, oh wow, this channel does exist 03:11
is there any way to future proof code against perl6?
Eevee well let's see 03:21
never use the dot operator
never use the arrow operator
Diablo-D3 dont use packages either
(which wipes out cpan)
Eevee don't use for 03:22
don't use three-arg for
Diablo-D3 can parrot speak perl5?
because perl6 isn't an issue if perl5 ends up being dragged along for the ride 03:23
03:23 alester left
Eevee there have been a few attempts at getting perl 5 running on parrot, yes; not sure where they are or what their status is 03:25
Diablo-D3 Im asking because atm I'm writing code
Eevee I think the goal is to distribute a binary that can run either
Diablo-D3 I expect this code to continue working 10 years from now
migration seems to be nearly impossible if I don't also drag a bunch of cpan modules with me 03:27
Eevee there is a huge body of existing perl 5 code; it's not like perl 5 is going to vanish the day perl 6 is released
Diablo-D3 no, but if it stops being released, then eventually it stops being able to be compiled on a modern system 03:28
thus, Im screwed
Eevee and even if it did someone would maintain it anyway, (open source)++
for all intents and purposes consider perl 6 to be a new language 03:29
perl 5 will probably live alongside it for a while, and I would be surprised if it weren't actively developed for another ten years
Diablo-D3 well, if they make parrot speak perl5 as well as the real perl5 does
then its a total non-issue
Eevee yes 03:30
only problem there is that nothing has ever spoken perl except perl
Diablo-D3 yes, and perl isnt very good at speaking perl sometimes, too 03:31
Eevee touche
Diablo-D3 I'm rather interested in parrot though
it seems to be effectively gathering all the smart bytecode vm coders out there 03:32
which means no matter what syntax you actually end up using for your code, you still get to leverage their knowledge and work
03:32 ispy_ left
Eevee yeah, I really hope it takes off in OSS land as much as .NET has for microsofties 03:33
Diablo-D3 heh, I was thinking more like java
.net seems to be stillborn imo
well, C# anyways 03:34
.net is more than just c#
Eevee eh, I do see a lot of mention of .NET 03:35
not so much in end-user apps, but enough people seem to be using it for big enterprisey things or as ASP.NET
Java's mindshare looks to be gradually slipping
but this is all anecdotal really
03:46 cmarcelo left 03:51 alester joined 04:03 vertog left 04:29 meppl joined 04:35 Psyche^ joined 04:39 kane__ joined, Alias__ joined 04:40 Alias_ left 04:48 Patterner left, Psyche^ is now known as Patterner 04:58 stalerx joined
dduncan out of curiosity, how is Rakudo now as far as completeness of the Perl 6 spec go ... eg, how much of the Pugs test suite run, versus what Pugs runs? 05:10
Eevee x% vs y% 05:12
(not sure, and that depends how correct *and* complete the test suite is..)
dduncan how much of the test suite does each run and pass? 05:14
note the smoke server seems to be down
05:21 dduncan left 06:10 alester left 06:13 masak joined 06:53 smtms left 06:58 meppl left 07:01 smtms joined 07:07 peepsalot left 07:15 pbuetow joined 07:23 peepsalot joined 07:39 chris2 joined 07:49 elmex joined 07:55 chris2 left 07:58 masak left 08:07 smtms left
syle is perl6 gonna be close to speed of c, or am i better off just writing things in c? 08:20
Diablo-D3 syle: fuck c, write it in assembly 08:21
syle will it have an eventloop based on something like eventlib and power of pthreads etc?
well current project i am coding is about 7 thousand lines of perl5, took me about 6 months, i traded devel time for speed, but not entirely linked alot of c libraries in, but fuck the time it takes to generate files in perl is fucking depressing 08:23
Diablo-D3 wait, are you implying perl5 is slow?
syle yes
Diablo-D3 wait, before or after the part where perl5 lets you run C?
syle shit man i;m doing basic file processing and can only do about 1200 files per min
i have linked in c libraries everywhere 08:24
08:27 stalerx left
syle sure gimme 2 years of rent and food and i;ll write the fucker in assembly, devel time is somewhat important unfortunately 08:29
moritz_ syle: did you profile your application? 08:30
syle no
moritz_ Perl 6 is designed to be optimizable, but how much of that will happen is up the implementors
syle: well, do it
syle is perl6 compilable or just bytecode again? 08:31
moritz_ Perl 6 is a *language*
syle is perl6 compilable or just bytecode again? 08:32
moritz_ again, it's a *language*
that can be implemented in different ways
as an interpreter or as a compiler
08:32 pbuetow left
moritz_ as a compiler to byte code or to native code 08:32
syle what is going to be the social norm? 08:33
moritz_ or to lisp
that's too early to predict, but many expect it to be parrot
syle so pugs is a joke you think?
moritz_ no, a prototype
syle will it use more advanced event loops ie: epoll on linux , kqueue on fbsd? 08:35
heard about an internat eventloop
internal
was thinking eventlib would be a great start
moritz_ how portable is that?
parrot has the goal to run on all platform that perl5 does 08:36
syle it works really great, it defaults to best types on almost every OS, epoll on linux, kqueue fbsd, poll solaris etc etc
moritz_ (including windows and VMS)
08:37 masak joined
syle omg people still use VMS 08:37
syle pulls out his commodore 64 08:38
yes eventlib even supports those
windows is abit different 08:39
i been hearing perl6 will be threaded really efficiently
i am looking forward to sharing shit with other threads finally 08:40
moritz_ why would you want to share shit?
syle but am abit curious how thats being implemented , mutex locks etc
why, give ya a good example... 08:41
araujo please take it to priv
syle smtpd server, email comes in, has some blocking operations, love to pass email message off to a thread instead of using a pipe
well i been studying alot of IPC's, and i found pipes in perl5 to support the least latency 08:43
played with domain sockets, tcp sockets, files, pipes , share memory implementations , while shared memory will always be the fastest, not always feasible in alot of apps 08:44
someone sends you a 10 meg pictures, woot shared memory goes out the door 08:45
whats currently best way to deal with this situation? dish the shit to disk and let some other process pick it up 08:47
what you think , memory will one day replace harddrives entirely? 08:50
masak syle: you talk a lot
syle well cause you talk next to shit
today i am drunk again though, i can only work on big code bases so long before resorting to the wine 08:51
its quite interesting, after about 1/2 a liter you can still program well, at about the 3/4 mark you pretty much have to give up and chat irc bullshit 08:53
well its 4am i figure nothing interesting going on anyways, i wouldn;t interrupt the daytime people 08:54
masak how US-centric of you 09:01
09:02 cls_bsd left
syle oww fuk no, i;m no lame american, i;m a nice pot smoking, liquor drinking friendly canadian 09:04
masak congratulations
syle i been having a personal crisis lately, girls convicing me to be a lawyer instead of programming cause they actualyl might understand wtf i am talking about time to time 09:08
i been doing this shit over 10 years now, and live alone in a house, cause i program from home, i;ve actually contacted the law faculty locally here and toldme to write the LSAT before dec 30th for acceptance 09:10
i don;t think this is anything new, the new guy on the senate in the US was one of the top assembly programmers idk 09:11
syle doesn;t know why he is saying this shit, very drunk
masak yes 09:12
syle comes to realization you cannot work from home and be an efficient husband/father 09:13
syle looks for psychologic counselling from someone. 09:14
09:22 REPLeffect left 09:23 REPLeffect joined 09:27 Diablo-D3 left
Alias__ syle: Pretty much 09:27
How old?
It's tricky to convince young kids that you are "away" when you are in the house
Or so I imagine anyways 09:29
syle 32 09:33
09:34 Alias__ left, Alias__ joined 09:52 cognominal__ left 10:03 ruoso joined 11:03 syle left 11:36 bsb left 12:13 kyrbe joined 12:15 kyrbe left 12:19 agentz1 left 12:34 agentzh joined
kolibrie @tell dduncan another term to consider is integration (re normalization, canonization) 12:46
lambdabot Consider it noted.
diakopter chuckles at drunk ircing 12:51
13:11 eternaleye left 13:14 cmarcelo joined, eternaleye joined 13:16 vixey joined 13:28 rdice joined 13:34 eternaleye left 13:39 TJCRI joined 13:57 cognominal_ joined, sscaffidi joined, cognominal_ left 13:58 cognominal_ joined 13:59 cognominal_ left, cognominal_ joined, alester joined 14:07 mj41 left 14:14 IllvilJa left 14:15 cjfields joined 14:46 fridim_ joined
pugs_svnbot r20431 | clkao++ | grrr hate 14:51
14:54 IllvilJa joined 14:55 pbuetow joined 14:57 pbuetow_ joined, pbuetow_ left
[particle2 msg syle i encourage you to look at the parrot design documents: www.parrotcode.org/docs/pdd/ 14:59
lambdabot Title: Parrot Documentation :: Parrot Design Documents - parrotcode
14:59 [particle2 is now known as [particle]
[particle] msg syle you'll find good information about the event and concurrency subsystems on the vm running under rakudo perl (perl 6 on parrot) 15:00
15:04 Alias__ left
moritz_ [particle]: it's @tell here in #perl6 ;) 15:13
[particle] ah, right! thanks. 15:14
can i msg a bot with @tell, or does it have to be in chan?
kolibrie [particle]: I think you can msg lambdabot directly 15:17
moritz_ I'm quite sure you can 15:18
lambdabot delivers across channel boundaries
lambdabot++
[particle] kolibrie++ moritz_++ #done 15:19
15:22 pmurias joined, masak left 15:23 justatheory joined, justatheory left
allbery_b you can, just remember that the @ (or ?) prefix is still required on commands (unlike other bots) 15:24
that seems to catch a lot of people by surprise 15:25
Juerd I'm used to ! in some other channels 15:57
Maybe it's time for a standard bot protocol :)
moritz_ and while you are it, standardize the character encoding for IRC 15:58
Eevee moritz_: utf8. there that was easy!
[particle] no! ucs-2! 15:59
Eevee Juerd: imo bot commands should just be targeted at the bot, so nobody has to worry about guessing the sigil or whether another bot in the same channel is using it etc
moritz_ Eevee: I know too many people who use iso-8859-{1,15} :(
[particle] latin-1 is the only-1! 16:00
moritz_ Eevee: that's bad huffman coding
Eevee moritz_: me too. but probably only because that's the default in mirc (I assume?) and nobody knows or cares to change it 16:01
moritz_ we should have a bot that kicks everybody who's not sending valid utf8 ;)
Juerd Eevee: But then you have to know which bot handles the command 16:02
Eevee Juerd: true, but if all the bots have different sigils anyway.. 16:05
16:06 justatheory joined 16:20 fridim_ left 16:21 simcop2387 left, kane__ left 16:23 meppl joined 16:26 pmurias left 16:27 pmurias joined 16:34 iblechbot left 16:39 stevan_ left, stevan_ joined, kane_ joined 16:44 cjfields left 16:45 gbacon left 16:50 rindolf joined 16:53 kane__ joined 17:05 kane_ left, Ched left 17:07 Ched- joined 17:08 kane_ joined 17:16 kane__ left 17:18 mj41 joined 17:23 mj41 left 17:25 mj41 joined, kane__ joined 17:30 eternaleye joined 17:31 eternaleye left 17:32 eternaleye joined 17:33 kane_ left, gbacon joined 17:37 kane_ joined 17:46 kane__ left 17:56 kane__ joined 18:02 meppl left 18:05 meppl joined 18:10 kane_ left 18:26 iblechbot joined 18:37 Ched- left 18:40 Ched- joined 18:44 smtms joined 18:48 justatheory left 19:03 rdice left, sscaffidi left 19:06 aindilis left 19:09 justatheory joined 19:27 sscaffidi joined 19:30 apple-gunkies joined 19:37 japhb left 20:04 japhb joined 20:13 pbuetow left
rindolf Hi all. 20:19
vixey hey rindolf
rindolf Hi vixey
vixey: so are you a l33t Perl 6 Hax0r now? 20:20
vixey hehe not really, just looking around :)
rindolf vixey: OK.
The IRC seems kinda quiet now.
20:20 fullermd_ joined 20:22 fullermd left, fullermd_ is now known as fullermd 20:25 Caelum left 20:27 Caelum joined 20:29 ting_ joined 20:30 agentz1 joined, syle joined 20:36 ruoso left 20:40 simcop2387 joined
Eevee hm 20:41
if `for @array -> $i { say $i }` works, would `sub f { say $^a }; for @array &f` work?
20:42 ting_ left, ting_ joined
wolverian I don't think you can use ^ variables in subs 20:43
only in bare blocks
and it should be "for @array, &f", probably 20:44
20:46 agentzh left 20:47 ting___ left
Tene wolverian: you can't use placeholders in subs? I don't recall that from the spec. 20:48
wolverian hm. apparently I misremembered. 20:52
sorry. :) 20:53
20:55 rindolf left, araujo left
Eevee wolverian: well, there's no comma before a pointy block on a for. I am just conjecturing wildly though; I've never seen this actually done, spec or otherwise 20:55
perl6: my @foo = [1,2,3]; for @foo -> $i { print $i } 20:56
[particle] you can't use placeholders in subs with param lists
exp_evalbot kp6: OUTPUT[1 2 3]
..pugs: OUTPUT[1 2 3]
..rakudo: OUTPUT[123]
Eevee perl6: my @foo = [1,2,3]; sub bar { print $^a }; for @foo &bar
exp_evalbot kp6: OUTPUT[no method 'APPLY' in Class 'Undef'␤ at compiled/perl5-kp6-mp6/lib/KindaPerl6/Runtime/Perl5/MOP.pm line 345␤ KindaPerl6::Runtime::Perl5::MOP::__ANON__('HASH(0x824c37c)', 'APPLY', 'HASH(0x8e5ce00)') called at compiled/perl5-kp6-mp6/lib/KindaPerl6/Runtime/Perl5/MOP.pm line 169␤
..main::DISPATCH('HASH(0x824c37c)', 'APPLY', 'HASH(0x8e5ce00)') ca...
..pugs: OUTPUT[*** ␤ Unexpected end of input␤ expecting ":", "{", identifier, operator or block construct␤ at /tmp/gYzVezgMdZ line 2, column 1␤]
..rakudo: OUTPUT[too few arguments passed (0) - 1 params expected␤current instr.: 'bar' pc 99 (EVAL_11:35)␤called from Sub '_block11' pc 70 (EVAL_11:27)␤called from Sub 'parrot;PCT::HLLCompiler;eval' pc 785 (src/PCT/HLLCompiler.pir:458)␤called from Sub 'parrot;PCT::HLLCompiler;evalfiles' pc 1067
..(src/PCT/HLLCompiler.pir:587)␤called from Sub 'parrot;PCT::H...
Eevee perl6: my @foo = [1,2,3]; my $bar = sub { print $^a }; for @foo $bar 20:57
exp_evalbot kp6: OUTPUT[no method 'APPLY' in Class 'Undef'␤ at compiled/perl5-kp6-mp6/lib/KindaPerl6/Runtime/Perl5/MOP.pm line 345␤ KindaPerl6::Runtime::Perl5::MOP::__ANON__('HASH(0x824c4ec)', 'APPLY', 'HASH(0x8e53cf4)') called at compiled/perl5-kp6-mp6/lib/KindaPerl6/Runtime/Perl5/MOP.pm line 169␤
..main::DISPATCH('HASH(0x824c4ec)', 'APPLY', 'HASH(0x8e53cf4)') ca...
..pugs: OUTPUT[*** ␤ Unexpected "$bar"␤ expecting operator or block construct␤ at /tmp/Sev1RJ3fWF line 1, column 58␤]
..rakudo: OUTPUT[Statement not terminated properly at line 1, near "$bar"␤current instr.: 'parrot;PGE::Util;die' pc 120 (runtime/parrot/library/PGE/Util.pir:82)␤called from Sub 'parrot;Perl6::Grammar;statementlist' pc 17940 (src/gen_grammar.pir:2661)␤called from Sub
..'parrot;Perl6::Grammar;statement_block' pc 15006 (src/gen_grammar.pir:1611)␤called from Su...
Eevee rakudo: my @foo = [1,2,3]; my $bar = sub { print $^a }; for @foo, $bar;
exp_evalbot OUTPUT[Could not invoke non-existent sub for␤current instr.: '_block11' pc 84 (EVAL_11:35)␤called from Sub 'parrot;PCT::HLLCompiler;eval' pc 785 (src/PCT/HLLCompiler.pir:458)␤called from Sub 'parrot;PCT::HLLCompiler;evalfiles' pc 1067 (src/PCT/HLLCompiler.pir:587)␤called from Sub
..'parrot;PCT::HLLCompiler;command_line' pc 1246 (src/PCT/HLLCompile...
[particle] rakudo: my @foo = [1,2,3]; my $bar = sub { print $^a }; $bar($_) for @foo; 20:58
exp_evalbot OUTPUT[123]
Eevee evalbot should probably just go "that didn't work" on parse errors
[particle] i think it's nice to tell you how it didn't work 20:59
wolverian Eevee, I think the lack of a comma is a property of the -> operator, not the for
Tene Again I'm seeing the "@foo = [...]" problem.
That's the same as @foo := [ [...] ]; 21:00
Eevee yeah but the backtrace is a little.. unnecessary
Tene Putting a list in @foo[0]
21:00 peeps[work] joined
Eevee rakudo: my @foo = [1,2,3]; say @foo[0]; 21:00
exp_evalbot OUTPUT[1␤]
Tene Eevee: rakudo doesn't handle lists properly yet. 21:01
Eevee pugs: my @foo = [1,2,3]; say @foo[0];
exp_evalbot OUTPUT[1 2 3␤]
Eevee ah.
21:01 peepsalot left
Eevee what exactly is [] constructing then? if everything's an object now I'd assume everything's a reference, and thus from a user point of view references don't exist 21:03
Tene Hm...
rakudo: for @foo, { say $^a }
exp_evalbot OUTPUT[A signature must not be defined on a sub that uses placeholder vars. at line 1, near " }"␤current instr.: 'parrot;PGE::Util;die' pc 120 (runtime/parrot/library/PGE/Util.pir:82)␤called from Sub 'parrot;Perl6;Grammar;Actions;_block2302' pc 109941 (src/gen_actions.pir:4313)␤called from Sub
..'parrot;Perl6;Grammar;Actions;_block2297' pc 109370 ...
Tene That's not quite right.
[particle] rakudo: for @foo { say $^a } 21:04
exp_evalbot OUTPUT[A signature must not be defined on a sub that uses placeholder vars. at line 1, near " }"␤current instr.: 'parrot;PGE::Util;die' pc 120 (runtime/parrot/library/PGE/Util.pir:82)␤called from Sub 'parrot;Perl6;Grammar;Actions;_block2302' pc 109941 (src/gen_actions.pir:4313)␤called from Sub
..'parrot;Perl6;Grammar;Actions;_block2297' pc 109370 ...
[particle] er, wait
Tene I'm curious why it things a signature is defined on that block.
thinks.
Eevee pugs: for @foo { say $^a }
exp_evalbot OUTPUT[*** ␤ Unexpected " {"␤ expecting "::"␤ Variable "@foo" requires predeclaration or explicit package name␤ at /tmp/8rbJnBXDew line 1, column 9␤]
[particle] rakudo: for @foo -> $^a { say $^a }
exp_evalbot OUTPUT[Statement not terminated properly at line 1, near "-> $^a { s"␤current instr.: 'parrot;PGE::Util;die' pc 120 (runtime/parrot/library/PGE/Util.pir:82)␤called from Sub 'parrot;Perl6::Grammar;statementlist' pc 17940 (src/gen_grammar.pir:2661)␤called from Sub
..'parrot;Perl6::Grammar;statement_block' pc 15006 (src/gen_grammar.pir:1611)␤called f...
[particle] (checking pblock) 21:05
Tene for @foo -> $a { say $a }
rakudo: my @foo = 1, 2, 3; for @foo -> $a { say $a }
exp_evalbot OUTPUT[get_iter() not implemented in class 'Integer'␤current instr.: '_block11' pc 67 (EVAL_12:29)␤called from Sub 'parrot;PCT::HLLCompiler;eval' pc 785 (src/PCT/HLLCompiler.pir:458)␤called from Sub 'parrot;PCT::HLLCompiler;evalfiles' pc 1067 (src/PCT/HLLCompiler.pir:587)␤called from Sub
..'parrot;PCT::HLLCompiler;command_line' pc 1246 (src/PCT/HL...
Eevee wait what
why is it trying to iterate over an integer 21:06
[particle] problems with list context
Tene I'm checking...
Eevee rakudo: my @foo = 4, 5, 6; say @foo[0], "\t", @foo;
exp_evalbot OUTPUT[get_pmc_keyed() not implemented in class 'Integer'␤current instr.: '_block11' pc 67 (EVAL_10:29)␤called from Sub 'parrot;PCT::HLLCompiler;eval' pc 785 (src/PCT/HLLCompiler.pir:458)␤called from Sub 'parrot;PCT::HLLCompiler;evalfiles' pc 1067 (src/PCT/HLLCompiler.pir:587)␤called from Sub
..'parrot;PCT::HLLCompiler;command_line' pc 1246 (src/P...
Eevee rakudo: my @foo = 4, 5, 6; say @foo;
exp_evalbot OUTPUT[4␤]
[particle] rakudo: my @foo = [1, 2, 3]; for @foo -> $a { say $a }
exp_evalbot OUTPUT[1␤2␤3␤]
[particle] rakudo: my @foo = [1, 2, 3]; for @foo { say $^a } 21:07
exp_evalbot OUTPUT[A signature must not be defined on a sub that uses placeholder vars. at line 1, near " }"␤current instr.: 'parrot;PGE::Util;die' pc 120 (runtime/parrot/library/PGE/Util.pir:82)␤called from Sub 'parrot;Perl6;Grammar;Actions;_block2302' pc 109941 (src/gen_actions.pir:4313)␤called from Sub
..'parrot;Perl6;Grammar;Actions;_block2297' pc 109370 ...
Tene rakudo: my $f = [1, 2, 3]; for $f -> $a { say $a }
exp_evalbot OUTPUT[1␤2␤3␤]
[particle] yep, see, it's treating @foo just like $f
wolverian Eevee, [1,2,3] === Array.new(1,2,3). the type of (1,2,3) depends on its context.
Eevee wolverian: I would kinda expect `@foo = Array.new(whatever)` to work like in javascript 21:08
pmichaud rakudo doesn't understand lists yet 21:09
if you want to create an array, it's pretty much either
my @f = (4, 5, 6);
or
my @f = <4 5 6>
Tene Eevee: Yes, most people do expect that, but that's not what the spec says.
The spec says that the rhs of assigning to a list is in list context.
wolverian the @foo is already an array 21:10
that's what the @ means
Eevee wolverian: my Foo $foo = Foo.new() -- the $foo is already a Foo
pmichaud with for @foo { say $^a } I suspect that rakudo may be hard-coding a -> $_ onto the block
Tene Ahh, look at method pblock. 21:11
It does exactly that.
Is that a special case?
wolverian Eevee, no, the value of $foo can be a Foo
pmichaud it was put in to get the 01-sanity tests passing. The code isn't correct as written. 21:12
wolverian Eevee, $foo itself is Scalar
Tene pmichaud: do you know what the correct solution is?
pmichaud I'd have to go back and look at the code -- I put that in last December 21:13
and haven't looked at it since :-)
Tene I'll look at it tonight.
pmichaud the part I'm not entirely clear on is when a block gets promoted to a -> $_ block
and I think that might've changed in the past five months, anyway. 21:14
Eevee mm. I can see the rationale but I can also see a lot of people tripping over it
Tene Eevee: My big objection is that I see a lot of people actually making that same mistake.
I see a lot of people saying: @foo = [ ... ]
Eevee I can, in fact, literally see a lot of people tripping over it :P
wolverian well. complain to larry. :)
Eevee I don't know what a good alternative is though 21:15
wolverian right.
Tene It seems kind of like the "sigils are weird" complaints. Sure it makes sense, but real people actually have a hard time remembering it before they learn it well.
wolverian removing list flattening altogether is one.
and with it, contexts.
(context would be just return type polymorphism, though maybe it already is) 21:16
21:16 cmarcelo left
wolverian I doubt that'll fly though. :) 21:16
Eevee main problem being, what if I go my @foo = [1,2], [3,4] -- should it really be an entire dimension different from my @foo = [1,2]
maybe emit a warning when assigning a bare scalar to an array var
Tene in 'for @foo, { ... }', the {} is parsed as a pblock.
pmichaud tene: yes, but do all pblocks default to a -> $_ signature? 21:17
it's not a question of parsing as much as semantics
Tene pmichaud: in rakudo they do unless there's a different signature already. 21:18
21:18 peepsalot joined
pmichaud tene: I'm pretty sure rakudo is wrong there -- again, all I did was implement something to get 01-sanity to pass. I wasn't aiming for correctness. 21:18
Tene nods.
So the question is what the specs say about whether $f = { ... } accepts any args. 21:19
pmichaud A bare closure without placeholder arguments that uses $_ (either explicitly or implicitly) is treated as though $_ were a formal parameter:
$func = { .print if $_ }; # Same as: $func = -> $_ { .print if $_ };
Tene If @_ or %_ are used in the block, they get added to the signature.
pmichaud (from S04)
Tene pmichaud: what about just: $func = { .print };
That uses $_ implicitly.
pmichaud 21:13 <pmichaud> the part I'm not entirely clear on is when a block gets promoted to a -> $_ block 21:20
:-)
Tene does that count?
Heh.
pmichaud more in S04:
However, use of $_ with a conditional statement's block is not considered sufficiently explicit to turn a 0-ary block into a 1-ary function, so both these methods use the same invocant:
if .haste { .waste }
(Contrast with a non-conditional statement such as:
for .haste { .waste }
where each call to the block would bind a new invocant for the .waste method, each of which is likely different from the original invocant to the .haste method.) 21:21
[particle] urk
sounds fun to implement.
Tene So it should be 'for' itself that adds $_ if it's not already there?
[particle] yes, for, and not if
Tene Okay. I can do that. 21:22
[particle] for takes a pblock
pmichaud the for statement should check the block for a signature, and add $_ if it doesn't already have one.
[particle] i don't think if does
pmichaud if takes a pblock also
if testa() -> $a { say $a }
(pct doesn't support that yet -- that's another item I have to figure out how to do.)
Eevee oh cool 21:23
equivalent to perl 5 `if (my $a = testa()) { print "$a\n" }`?
pmichaud mostly, yes.
(I don't know the scope of the 'my' in the p5 case) 21:24
[particle] it's internal to the if, in modern perls
Eevee it used to be the containing block, but at some point if()s got their own scope
yeah
pmichaud I never write code like that. :-)
for precisely that reason. :-)
[particle] (assignment in conditional)--
Eevee I see it on occasion
pmichaud but yes, the p6 syntax is much more obvious and consistent.
Tene Okay, lunchtime.
Eevee yeah, I like that
Tene Then maybe hacking, or maybe work. 21:25
pmichaud @Larry++
lambdabot Unknown command, try @list
Eevee haha
what else was I going to say/ask about for..
pmichaud oh, I think I know how to solve the if testa() -> $a { ... } problem in pct 21:26
cool.
way too many solutions. way too little time. 21:27
Eevee whoops, I thought of three things
is there an @array.kv or similar? so I can go for @array.kv -> $i, $elem { ... } 21:28
21:28 TJCRI left
[particle] eevee: yes 21:28
Eevee hooray 21:29
#2: `my @array = foo(); for @array { ... }; if (not @array) { ... }` seems to happen often enough to be irritating, yet no language has `for foo() { ... } else { ... }` 21:31
or 'empty' instead of 'else', or.. something
21:34 araujo joined
pmichaud python has an 'else' clause, I think. 21:34
21:34 REPLeffect left, lisppaste3 left
[particle] yes, they do 21:34
21:34 mib_1864dswq joined 21:35 REPLeffect joined
Eevee really? 21:35
so it does. didn't know that 21:36
clearly we also need one
oh, wait, no
python's is different
"When the items are exhausted (which is immediately when the sequence is empty), the suite in the else clause, if present, is executed, and the loop terminates."
pmichaud right, just checking that.
Eevee so it's for running code after the for is done, but not if it was broken out of 21:37
which I doubt perl needs, when it has block labels 21:38
mib_1864dswq pmichaud: where is the best place to ask a rakudo implementation question?
[particle] this chan works fine
pmichaud mib: either here or #parrot
[particle] #parrot is on irc.perl.org fyi
pmichaud or on [email@hidden.address] for mailing list questions 21:39
mib_1864dswq I was playing with rakudo and I found that .kv didn't work yet: Method 'kv' not found for invocant of class 'Hash'
pmichaud correct, we haven't implemented .kv yet.
there's a patch for it, but it needs a bit of work.
mib_1864dswq So I decided to dive into the code and see if I could implement it
But, it seems that nothing I do to Hash.pir has any effect 21:40
pmichaud I'm not agreeable with the current Hash implementation in rakudo.
so it doesn't surprise me if it doesn't work :-)
mib_1864dswq Is languages/perl6/src/classes/Hash.pir the right place to look?
21:41 apple-gunkies left
mib_1864dswq Or should I just not bother... 21:41
Eevee I should really give the rakudo source a perusal
pmichaud I'd have to check on Hash.pir
the implementation for Rakudo's Hash was changed earlier in the year (by someone other than me) and I haven't had a chance to figure it out other than to note that I think it's "wrong" (for some value of "wrong") 21:42
Eevee how.. approachable is rakudo?
pmichaud easier than one might think
[particle] it's not C, for one :)
pmichaud but it's also frustrating at times
mib_1864dswq Ok. In the file (Hash.pir) it seems that the class is Perl6Hash 21:43
pmichaud some parts that seem like they ought to be easy aren't.
(Perl6Hash) that's the part I don't like. It got cargo-culted from the Str/Perl6Str implementation when it shouldn't have been.
pmurias [particle]: i would say pir is preferable to C
mib_1864dswq Trying .values doesn't work either, thought that is implemented in the Hash.pir file 21:44
pmichaud right, there's a class mapping problem there.
mib_1864dswq That is what I figured was going on 21:45
Thanks for the info - &supper
pmichaud I think what I'm saying is that what you're trying to do _should_ be easy, and you're probably doing it the right way, but rakudo is fundamentally flawed in its current implementation of Hash
so that it's not working.
I should probably see about fixing that. But it may involve updating the protoobject mess as well. 21:46
[particle] luckily, the fundamentals are still pretty accessible
pmichaud yes, and getting easier all the time.
the latest compiler tools update simplifies a bunch of stuff.
21:48 lisppaste3 joined 21:54 iblechbot left 21:58 elmex left
Eevee perl6: my @foo := [1,2,3]; say @foo; 22:06
exp_evalbot kp6: OUTPUT[1 2 3␤]
..pugs: OUTPUT[1 2 3␤]
..rakudo: OUTPUT[123␤]
22:06 sscaffidi_ joined 22:07 sscaffidi left
moritz_ perl6: my @foo = [1, 2, 3]; say |@foo; 22:10
exp_evalbot kp6: OUTPUT[1 2 3␤]
..pugs: OUTPUT[123␤]
..rakudo: OUTPUT[␤get_bool() not implemented in class 'Junction'␤current instr.: 'parrot;PCT::HLLCompiler;command_line' pc 1290 (src/PCT/HLLCompiler.pir:688)␤called from Sub 'parrot;Perl6::Compiler;main' pc 9647 (perl6.pir:187)␤]
moritz_ rakudo tries to parse that as a *Junction*? 22:11
Eevee er. what's unary prefix pipe do?
moritz_ pugs: sub foo($a, $b){ say "$a|$b" }; my @c=<a b>; foo(@c) 22:12
exp_evalbot OUTPUT[*** No compatible multi variant found: "&foo"␤ at /tmp/FumAOE9mOZ line 1, column 46 - line 2, column 1␤]
moritz_ pugs: sub foo($a, $b){ say "$a|$b" }; my @c=<a b>; foo(|@c) 22:13
exp_evalbot OUTPUT[a|b␤]
moritz_ Eevee: that's the difference: it flattens an array into a capture (which is used for sub calls)
in Perl 6 my_sub(@array) actually looks for a multi which expects an array 22:14
Eevee aha, thought that was *. maybe it used to be, or maybe too much python 22:16
22:19 peeps[work] left, Limbic_Region joined
moritz_ * is the thing that you put into the signature IIRC 22:21
pugs: sub foo(*@args){say @args}; foo(2, 3)
exp_evalbot OUTPUT[23␤]
moritz_ pugs: sub foo(@args){say @args}; foo(2, 3)
exp_evalbot OUTPUT[*** No compatible multi variant found: "&foo"␤ at /tmp/huZVYh6NNy line 1, column 28 - line 2, column 1␤]
moritz_ pugs: sub foo(|@args){say @args}; foo(2, 3)
exp_evalbot OUTPUT[*** No compatible multi variant found: "&foo"␤ at /tmp/COiDGWru0H line 1, column 29 - line 2, column 1␤]
moritz_ aye, what I said 22:22
Eevee pugs: sub foo (|@args){say @args}; my @bar = (1,2); foo(||@bar);
exp_evalbot OUTPUT[*** ␤ Unexpected "||@"␤ expecting ":", identifier or ")"␤ at /tmp/Bs9DkQYq7A line 1, column 51␤]
moritz_ off to bed now, good localtime() everybody
Eevee night
pugs: sub foo (|@args){say @args}; my @bar = (1,2); foo(|(|@bar));
exp_evalbot OUTPUT[*** No compatible multi variant found: "&foo"␤ at /tmp/U1G1W7VI7o line 1, column 47-60␤]
Eevee huh. wonder what it expects |@args in the signature to be then
meppl good night 22:34
Eevee unsure about the inconsistency; reads spec 22:36
22:38 meppl left 22:39 eternaleye left
mib_1864dswq I played around with Hash.pir a bit more and if I change the namespace to 'Hash', rather than 'Perl6Hash' things seem to work. 23:40
Adding kv to Hash.pir after that was trivial 23:45
23:54 pmurias left