»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg p6eval perl6: ... | irclog: irc.perl6.org/ | UTF-8 is our friend!
Set by sorear on 4 February 2011.
00:02 lichtkind left 00:09 PacoAir left, drbean left 00:10 drbean joined 00:20 fgomez left, fgomez joined 00:23 fgomez left, fgomez joined, fgomez left, fgomez joined
jnthn pmichaud: Lemme know if you get chance to time latest and see if it helped for you too. 00:26
'night, #perl6
00:31 erkan left 00:32 erkan joined, erkan left, erkan joined 00:44 icwiener joined
felher jnthn++ 01:02
jnthn: sleep well :)
01:09 drbean left 01:12 drbean joined 01:37 daemon_ is now known as daemon 01:42 cognominal_ left 01:43 cognominal joined 02:05 Chillance left 02:09 drbean left 02:11 drbean joined, xinming left 02:12 _jaldhar joined, Guest38800 left 02:16 _jaldhar left 02:19 _jaldhar joined 02:30 xinming joined 02:36 araujo left 02:39 drbean left 02:42 drbean joined 02:49 _jaldhar is now known as jaldhar 03:06 Guest9285 joined
Guest9285 hi 03:06
03:06 Guest9285 left
moritz hello Guest78369 03:07
03:20 JimmyZ_ joined
dalek c: 794a5aa | moritz++ | / (2 files):
switch pod extration to Pod::To::SectionFilter
03:21
03:30 crab2313 left 03:41 icwiener left
pmichaud phenny: tell jnthn I get about 6% improvement in the parse phase for CORE.setting 04:14
phenny pmichaud: I'll pass that on when jnthn is around.
04:19 tokuhiro_ joined
pmichaud phenny: tell jnthn I wasn't able to work on while loop exception handler... it's still on my "to-do" list for the weekend if you don't get to it first :) 04:25
phenny pmichaud: I'll pass that on when jnthn is around.
04:44 araujo joined, araujo left, araujo joined
sjohnson hello 04:53
:3 04:56
05:05 thelazydeveloper left
sorear hello, sjohnson. how are you? 05:08
sjohnson sorear: pretty good. was wondering how perl6 is doing lately 05:09
i had a dream I tried Rakudo out
(probably why I was compelled to visit again) 05:10
sjohnson googles Rakudo
oh yeah, that reminds me, I also had a dream about Niecza too :)
well, they happened at the same time. 05:12
05:15 JimmyZ_ left 05:21 birdwindupbird joined 05:26 crab2313 joined 05:31 fgomez left, fgomez joined 05:35 fgomez left 05:36 fgomez joined
sjohnson i am happy they are still actively produced 05:45
06:21 GlitchMr joined 06:24 tokuhiro_ left 06:27 JimmyZ_ joined, erkan left
GlitchMr What is "=begin pod" 06:38
What does it do aside of annoying GitHub
06:39 brrt joined
moritz GlitchMr: see S26 06:41
diakopter moritz: good morning 06:46
06:52 fgomez left 06:55 Caldrin joined 06:57 Entonian joined
Caldrin Hi! The Perl6 book at github.com/perl6/book/downloads says "{%hash}" is interpolated as "key1\tvalue1\nkey2\tvalue2\n..." I tried and got "key1\tvalue1 key2\tvalue2". 06:59
Is that an error in the docu or does the doc describe the desired behaviour and the implementation is wrong?
07:00 cosimo joined
diakopter which implementation are you using 07:00
07:00 Entonian left
Caldrin rakudo-2012.05 07:02
My child is awake, I need to care for her. I'll come back to talk about the hashes in like 10 hours. See you later. 07:06
07:07 edwin joined, edwin is now known as Guest29823 07:11 NamelessTee joined
Guest29823 rakudo: 'abc' ~~ /<[^z]>+/ 07:15
p6eval rakudo 0fde4a: ( no output )
Guest29823 how do I do that properly?
[^z] doesn't work for anything but z
GlitchMr nr: print 'a' => 'b', 'c' => 'd'
p6eval rakudo 0fde4a, niecza v18-6-ge52d6c3: OUTPUT«a bc d»
sorear Guest29823: information/reminder: you need to explicity use 'say' if you want p6eval to return anything 07:16
Guest29823: <-[z]>
std: /<[^z]>/
p6eval std f179a1b: OUTPUT«ok 00:00 42m␤»
Guest29823 sorear: thanks
sorear std: /[^z]/
GlitchMr nr: print('a' => 'b', 'c' => 'd')
p6eval std f179a1b: OUTPUT«Potential difficulties:␤ [^z] appears to be an old-school character class; please use <-[z]> if you mean a character class at /tmp/oVgnCzal0t line 1:␤------> /[^z]⏏/␤ok 00:00 41m␤»
rakudo 0fde4a, niecza v18-6-ge52d6c3: OUTPUT«a bc d»
sorear phenny: tell TimToady perhaps <[^z]> should warn too, for people with some knowledge of p6regex changes 07:17
phenny sorear: I'll pass that on when TimToady is around.
GlitchMr But [^z] is perfectly fine...
... ok... it's pointless
std: /[a-z]/ 07:18
p6eval std f179a1b: OUTPUT«===SORRY!===␤Invalid regex metacharacter (must be quoted to match literally) at /tmp/8eMgN2Qczb line 1:␤------> /[a-⏏z]/␤Potential difficulties:␤ [a-z] appears to be an old-school character class; please use <[a..z]> if you mean …
GlitchMr std: /[a-z]+/
p6eval std f179a1b: OUTPUT«===SORRY!===␤Invalid regex metacharacter (must be quoted to match literally) at /tmp/Hhi2vOxz_N line 1:␤------> /[a-⏏z]+/␤Potential difficulties:␤ [a-z] appears to be an old-school character class; please use <[a..z]> if you mean…
GlitchMr std: /[a]+/
p6eval std f179a1b: OUTPUT«Potential difficulties:␤ [a] appears to be an old-school character class; please use <[a]> if you␤ mean a character class, or quote it like 'a' to match␤ string as a unit at /tmp/zFYLzKeqGH line 1:␤------> /[a]⏏+/␤ok 00:00 41m␤»
GlitchMr ... ok
Is it just me, or it's not in github.com/perl6/std/blob/master/STD.pm6 07:19
sorear GlitchMr: check CursorBase.pmc
07:22 fgomez joined 07:36 fgomez left 07:38 fgomez joined, fgomez left 07:39 fgomez joined
GlitchMr How to detect Perl 6, the short way: 07:40
my @perl = 1, 2;
my $perl = (5, 6)[@perl - 1]
(I guess that you could make something better than this, but whatever)
ok... 07:41
my $perl = (5, 6)["\n" ~~ /./];
... no 07:42
It doesn't work...
diakopter eval: my $perl = (5, 6)["\n" ~~ /./];
buubot_backup diakopter: 5
GlitchMr perl6: my $perl = (5, 6)[+("\n" ~~ /./)]; print $perl;
p6eval pugs: OUTPUT«Error eval perl5: "if (!$INC{'Pugs/Runtime/Match/HsBridge.pm'}) {␤ unshift @INC, '/home/p6eval/.cabal/share/Pugs-6.2.13.20120203/blib6/pugs/perl5/lib';␤ eval q[require 'Pugs/Runtime/Match/HsBridge.pm'] or die $@;␤}␤'Pugs::Runtime::Match::HsBridge'␤"␤*** Can't locate P…
..rakudo 0fde4a, niecza v18-6-ge52d6c3: OUTPUT«5»
GlitchMr eval: my $perl = (5, 6)[+("\n" ~~ /./)]; print $perl;
buubot_backup GlitchMr: 51
GlitchMr :)
diakopter heh
GlitchMr That 1 is result from print, it doesn't count
moritz r: print eval '1 == True' 07:44
p6eval rakudo 0fde4a: OUTPUT«True»
moritz r: if ( eval '1 == True' ) { print 'Perl 6' } else { print 'Perl 5' }
p6eval rakudo 0fde4a: OUTPUT«Perl 6»
moritz eval: if ( eval '1 == True' ) { print 'Perl 6' } else { print 'Perl 5' } 07:45
buubot_backup moritz: Perl 51
GlitchMr :)
moritz eval: if ( 1 == True ) { print 'Perl 6' } else { print 'Perl 5' }
buubot_backup moritz: Perl 51
diakopter eval: if ( 1 == True ) { print 'Perl 6' } else { 'Perl 5' }
buubot_backup diakopter: Perl 5
moritz won't work under strict though 07:46
GlitchMr True is bareword equal to 0
Right?
(or rather, 'True', but that with eq) 07:47
moritz right 07:48
diakopter eval: use strict; 'Perl 5'
buubot_backup diakopter: Perl 5
diakopter eval: use strict; True; 07:49
buubot_backup diakopter: ERROR: Bareword "True" not allowed while "strict subs" in use at (eval 20) line 1.
moritz eval: 10 * 0.1 == 1
buubot_backup moritz: 1
diakopter eval: say 3
buubot_backup diakopter: ERROR: syntax error at (eval 20) line 1, near "say 3"
GlitchMr I prefer (5, 6)[+("\n" ~~ /./)] way 07:50
(but seriously, checking version is something that you rarely want to do)
... actually 07:51
eval: (5, 6)[+'0e0']
buubot_backup GlitchMr: 5
GlitchMr perl6: print (5, 6)[+'0e0']
p6eval rakudo 0fde4a, niecza v18-6-ge52d6c3, pugs: OUTPUT«5»
GlitchMr ...
... right
perl6: print (5, 6)[!!+'0e0'] 07:52
p6eval rakudo 0fde4a, niecza v18-6-ge52d6c3, pugs: OUTPUT«5»
GlitchMr perl6: print (6, 5)[!!+'0e0']
p6eval rakudo 0fde4a, niecza v18-6-ge52d6c3, pugs: OUTPUT«6»
sorear nr: say $*PERL<version>
p6eval rakudo 0fde4a, niecza v18-6-ge52d6c3: OUTPUT«Any()␤»
GlitchMr eval: (6, 5)[!!+'0e0']
buubot_backup GlitchMr: 5
GlitchMr :)
sorear nr: say $*PERL
p6eval rakudo 0fde4a: OUTPUT«("name" => "rakudo", "compiler" => {"name" => "rakudo", "ver" => "2012.05-221-g0fde4a1", "release-number" => "", "build-date" => "2012-06-09T01:12:11Z", "codename" => ""}).hash␤»
..niecza v18-6-ge52d6c3: OUTPUT«Any()␤»
sorear nr: say $?PERL
p6eval niecza v18-6-ge52d6c3: OUTPUT«{"build-time" => 1339095605.0433719e0, "name" => "niecza", "version" => "v18-6-ge52d6c3"}␤»
..rakudo 0fde4a: OUTPUT«===SORRY!===␤Variable $?PERL is not declared␤at /tmp/IxNbtaucfk:1␤»
GlitchMr (6, 5)[!!+'0e0'] looks simple enough... 07:53
sorear I ought to fix that
'0 but true' works too
moritz r: say (5, 6)[+":2<1>"]
p6eval rakudo 0fde4a: OUTPUT«6␤»
moritz eval: (5, 6)[+":2<1>"]
buubot_backup moritz: 5
GlitchMr sorear, unless I've missed something, '0 but true' is not numeric for Perl 6 07:54
nr: print +'0 but true'
p6eval niecza v18-6-ge52d6c3: OUTPUT«Unhandled exception: Cannot parse number: 0 but true␤ at /home/p6eval/niecza/lib/CORE.setting line 1402 (die @ 5) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3480 (ANON @ 11) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3482 (NumSyntax.str2num @ 5) …
..rakudo 0fde4a: OUTPUT«Cannot convert string to number: trailing characters after number in '0⏏ but true' (indicated by ⏏)␤ in method Str at src/gen/CORE.setting:9423␤ in method print at src/gen/CORE.setting:7094␤ in sub print at src/gen/CORE.setting:6965␤ in block <anon> at /tmp/8d_…
sorear GlitchMr: oops. right.
07:54 pupoque joined
GlitchMr It was Perl 5 hack 07:55
You can use 0 but True in Perl 6...
This code uses fact that "+" prefix in Perl 5 does... nothing 07:57
08:02 sergot joined
sergot hi o/ :) 08:02
08:03 espadrine joined
dalek kudo/require-arglist: 715efa4 | moritz++ | src/Perl6/Actions.pm:
compile-time evaluate argument lists to "require"; check for redeclarations
08:05
08:20 kaare_ joined 08:21 Guest29823 left 08:22 fgomez left 08:24 fgomez joined 08:29 cosimo left
dalek kudo/require-arglist: 2e974ac | moritz++ | src/Perl6/Actions.pm:
oops, $<EXPR> is an RPA
08:37
08:50 pupoque left 08:54 cosimo joined 08:55 cosimo left 09:14 espadrine left, espadrine joined 09:20 espadrine left, espadrine joined 09:21 tokuhiro_ joined
tadzik good morning #perl6 09:23
GlitchMr hi 09:24
09:28 fgomez left 09:36 brrt left 09:38 snearch joined
moritz \o tadzik 10:11
r: say "a\nb\nc\nd\n".lines(2).perl 10:12
p6eval rakudo 0fde4a: OUTPUT«("a", "b").list␤»
10:12 grondilu joined
grondilu Why can't we put a type constraint on a 'our'-scoped variable? 10:13
r: package { our Int $n } 10:14
p6eval rakudo 0fde4a: OUTPUT«===SORRY!===␤Cannot put a type constraint on an 'our'-scoped variable at line 2, near "}"␤»
moritz do { our Str $a }; do { our Int $a } # which type does our $a have?
grondilu I see. But if the packages are named there is no problem, is it? 10:15
moritz I don't understand 10:16
10:16 kboga left
grondilu Nevermind. 10:16
10:16 grondilu left
dalek ecs: 34fddf7 | moritz++ | S32-setting-library/Str.pod:
[S32::Str] substr is not rw anymore, but substr-rw is
10:20
10:23 wooden left
dalek c: 06dccaf | moritz++ | lib/Str.pod:
Str.lines, words, flip, sprintf

mostly copied from the specs
10:24
Caldrin eval: print "{a => 1, b => 2}" 10:28
buubot_backup Caldrin: {a => 1, b => 2}1
Caldrin r: print "{(a => 1, b => 2)}" 10:29
p6eval rakudo 0fde4a: OUTPUT«a 1 b 2»
moritz r: print "{}" 10:30
p6eval rakudo 0fde4a: ( no output )
moritz so "{}" eq '{}' is also a nice 5-vs-6 test
Caldrin++
10:32 whiteknight joined 10:33 whiteknight is now known as Guest47534, crab2313 left
Caldrin r: print "{{a => 1, b => 2}}" 10:36
p6eval rakudo 0fde4a: OUTPUT«a 1 b 2»
moritz where is hash stringification specced? 10:39
10:39 PacoAir joined
moritz I haven't found it in S32::Container 10:39
and a quick grep through S02 doesn't reveal anything either 10:40
r: say Hash ~~ Iterable 10:42
p6eval rakudo 0fde4a: OUTPUT«True␤»
moritz nr: say substr('foo') 10:48
p6eval rakudo 0fde4a: OUTPUT«===SORRY!===␤CHECK FAILED:␤Calling 'substr' will never work with argument types (str) (line 1)␤ Expected: :(Cool $s, $pos, $chars?)␤»
..niecza v18-6-ge52d6c3: OUTPUT«Unhandled exception: No value for parameter '$start' in 'substr'␤ at /home/p6eval/niecza/lib/CORE.setting line 0 (substr @ 1) ␤ at /tmp/3pjqrImRsZ line 1 (mainline @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3917 (ANON @ 3) ␤ at /home/p6eval/nie…
dalek c: f9a1cbe | moritz++ | lib/Str.pod:
add substr signatures
10:51
moritz low-hanging fruit: add the description for substr 10:53
11:10 JimmyZ joined 11:12 JimmyZ_ left 11:17 thelazydeveloper joined
jnthn Well, that was quite some long sleep... :) 11:27
phenny jnthn: 04:14Z <pmichaud> tell jnthn I get about 6% improvement in the parse phase for CORE.setting
jnthn: 04:25Z <pmichaud> tell jnthn I wasn't able to work on while loop exception handler... it's still on my "to-do" list for the weekend if you don't get to it first :)
diakopter jnthn: o hai
jnthn phenny: tell pmichaud well, I eliminated the while loop in !alt now so that is less urgent
phenny jnthn: I'll pass that on when pmichaud is around.
diakopter welcome to the land of the awake
jnthn phenny: tell pmichaud I shove the marks straight onto the bstack in an op now, which saves another GC allocation and a bunch of screwing around. :) 11:29
phenny jnthn: I'll pass that on when pmichaud is around.
11:31 crab2313 joined 11:34 snearch left 11:39 crab2313 left
tadzik emmentaler: 54 modules ok, 47 not ok (101 total), Testing took 21 minutes and 33 seconds 11:42
GlitchMr: I'm afraid Acme::Addslashes doesn't build 11:43
moritz: MiniDBI tests failed for me 11:44
GlitchMr Possibly, I haven't tested. 11:50
I couldn't get Rakudo to work...
It worked for me on Niecza through 11:51
moritz tadzik: DBIish is the new kid in town 11:52
GlitchMr r: module Acme::Addslashes { sub addslashes is export (Str $string) { $string.subst(/ (.) /, { "$0\c[COMBINING LONG SOLIDUS OVERLAY]" }, :g); }; }; print addslashes '3000';
p6eval rakudo 0fde4a: OUTPUT«===SORRY!===␤Missing block␤at /tmp/SN7ndqEkPS:1␤»
moritz tadzik: though I should fix the tests, yes
GlitchMr n: module Acme::Addslashes { sub addslashes is export (Str $string) { $string.subst(/ (.) /, { "$0\c[COMBINING LONG SOLIDUS OVERLAY]" }, :g); }; }; print addslashes '3000';
p6eval niecza v18-6-ge52d6c3: OUTPUT«===SORRY!===␤␤Undeclared routine:␤ 'addslashes' used at line 1␤␤Unhandled exception: Check failed␤␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 1401 (die @ 5) ␤ at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 37) ␤ at…
GlitchMr n: module Acme::Addslashes { sub addslashes is export (Str $string) { $string.subst(/ (.) /, { "$0\c[COMBINING LONG SOLIDUS OVERLAY]" }, :g); }; }; use Acme::Addslashes; print addslashes '3000'; 11:53
p6eval niecza v18-6-ge52d6c3: OUTPUT«Unhandled exception: Unable to locate module Acme::Addslashes in @path␤ at /home/p6eval/niecza/boot/lib/CORE.setting line 1401 (die @ 5) ␤ at /home/p6eval/niecza/src/NieczaPathSearch.pm6 line 23 (NieczaPathSearch.load_module @ 17) ␤ at /home/p6eval/niecz…
moritz tadzik: wait, MiniDBI needs mysql credentials to run the tests; I won't change that 11:58
tadzik oh, I see 12:01
I've mistaken those two
moritz oh, I've lost mysql during my upgrade to debian testing 12:03
jnthn phenny: de en "require arglist"? 12:09
phenny jnthn: "require arglist" (de to en, translate.google.com)
jnthn Dang... :)
moritz++ anyways
moritz phenny: en de "malice"? 12:10
phenny moritz: "Bosheit" (en to de, translate.google.com)
moritz hm
phenny: de en "arglist"?
phenny moritz: "malice" (de to en, translate.google.com)
moritz ENOROUNDTRIP
jnthn: stupid question, how do I declare a variablein the actions
?
I've tried to understand make_variable_from_parts, but I have trouble figuring out what's actually going on 12:11
jnthn moritz: declare_variable(...)
moritz oh.
jnthn r: use fatal; say $*FATAL 12:12
p6eval rakudo 0fde4a: OUTPUT«True␤»
jnthn r: say $*FATAL
p6eval rakudo 0fde4a: OUTPUT«False␤»
jnthn Yeah
The use that sets up $*FATAL works, and isn't tied in to anything much
shopping & 12:18
12:21 tokuhiro_ left 12:23 spider-mario joined
dalek kudo/require-arglist: 40e87e0 | moritz++ | src/Perl6/Actions.pm:
stub in symbols from the require arglist
12:29
12:30 araujo left 12:31 araujo joined 12:34 araujo left 12:37 cognominal_ joined, cognominal left 12:49 araujo joined 12:53 cognominal_ left 12:55 crab2313 joined, cognominal joined 13:00 espadrine left 13:08 Psyche^ joined
moritz r: sub f($sym) { CALLER::{$sym} := 'foo' }; my $x; f('$x'); say $x 13:11
p6eval rakudo 0fde4a: OUTPUT«foo␤» 13:12
13:12 Patterner left, Psyche^ is now known as Patterner
moritz r: our class A { }; say OUR::<A> 13:14
p6eval rakudo 0fde4a: OUTPUT«A()␤»
13:14 Guest47534 left
araujo hello 13:20
13:21 wooden joined, wooden left, wooden joined
moritz hello araujo 13:25
13:28 MayDaniel joined
araujo hi moritz o/ 13:29
jnthn back 13:37
Beer and food supplies now replenished. :) 13:38
moritz jnthn: I'm tryint to patch in importing from require'd modules 13:39
jnthn: and I get "Could not locate compile-time value for symbol PseudoStash"
jnthn: I suspect that the reason is that I added an import helper in the setting that binds to CALLER::{$sym} 13:40
and the setting doesn't like that
jnthn: any idea how to fix it?
oh, maybe I should put it after PseudoStash :-)
and now I get infinite recursion (with Str, Stringy and infix:<~>) 13:44
:/
jnthn How are you trying to do the import?
I need to see the match, really.
moritz wait a sec, I'll push the patch
13:45 sftp_ left
dalek kudo/require-arglist: 3862754 | moritz++ | src/ (4 files):
try to import from required modules
13:45
moritz this blows up during setting compilation
jnthn Hmmm 13:49
Does it come before or after PseudoStash?
moritz (the patch is wrong in that it tries to import 'our' symbols, and not exported symbols; but I don't see how fixing that could make it not blow up)
after
jnthn Well, it should not even be invoked during setting compilation.
13:50 sftp joined
moritz it doesn't blow up with the PseudoStash thing anymore 13:50
15:44 < moritz> and now I get infinite recursion (with Str, Stringy and infix:<~>)
jnthn That tends to mean "tried to report an error and failed to"
jnthn builds it 13:51
moritz hm, I can try to compile with --ll--exception
jnthn wonders if this is the first use of pseudo-packages in the setting 13:52
moritz why do some things (like binding to an attribute) don't work in the setting? 13:53
but you're right, World.throw appears in the backtrace 13:54
called from variable_declarator
jnthn Binding to attributes works fine in the setting *in general*.
moritz so, symbol redeclaration
jnthn The problem is with attributes added early in the stuff done in BOOTSTRAP 13:55
moritz oh
jnthn oh 14:00
my @missing;
my $package := ::OUR{$package-name}.WHO;
my @missing;
...two @missing
moritz oops
jnthn missed that completely when reading the code on GitHub.
.oO( @missing something... )
moritz double-missed
is there a way to not make the exceptions go wrong like that? 14:02
jnthn I'm just trying to see if I can figure out why/where it goes wrong here 14:04
pmichaud good morning, #perl6 14:06
phenny pmichaud: 11:27Z <jnthn> tell pmichaud well, I eliminated the while loop in !alt now so that is less urgent
pmichaud: 11:29Z <jnthn> tell pmichaud I shove the marks straight onto the bstack in an op now, which saves another GC allocation and a bunch of screwing around. :)
pmichaud jnthn: yes, I saw the op -- I agree that's the way to go :)
dalek kudo/require-arglist: 05b24b5 | moritz++ | src/core/operators.pm:
fix setting compilation. jnthn++
jnthn phew :)
moritz: It's not immediately obvious to me what's going on there.
pmichaud I think I'll try the bstack clone here, just to see if I get anything fromit 14:07
*from it
moritz jnthn: (pure speculation) might it be that stringification of some types isn't working yet, for example get_string vtables not yet set up? 14:08
jnthn moritz: It looks something like that. 14:11
moritz r: use Test; say ::OUR<Test>;
p6eval rakudo 0fde4a: OUTPUT«Any()␤»
moritz oh. 14:12
r: use Test; say Test
p6eval rakudo 0fde4a: OUTPUT«Test()␤»
jnthn The import is purely lexical.
r: use Test; say ::MY<Test>;
p6eval rakudo 0fde4a: OUTPUT«No such method 'postcircumfix:<{ }>' for invocant of type 'Perl6::Metamodel::ModuleHOW'␤ in block <anon> at /tmp/XXx5UnSuta:1␤␤»
moritz r: require Test; say OUR<Test>;
p6eval rakudo 0fde4a: OUTPUT«Any()␤»
jnthn r: use Test; say MY::<Test>;
p6eval rakudo 0fde4a: OUTPUT«Any()␤»
moritz no global merging?
jnthn Oh...for require? 14:13
Hmm...we probably *should*, but whether it does or not is another matter.
moritz it seems it does not
though we could stub symbol 'A' on 'require A <...>' 14:14
jnthn Stub? 14:15
Hm
moritz declare
jnthn Yeah, I'm not sure if that makes sense. 14:16
Doing the global merge does though.
moritz considering that you can also do require $filename <&foo $bar>; it probably doesn't make too much sense to declare something 14:17
jnthn Good point.
spacebat_ hey, trying to build a fresh clone of rakudo on debian testing, it fails linking libparrot with (.text+0x20): undefined reference to `main' 14:18
I can find plenty of references to the error in general, the general advice is that the makefile has a bug 14:20
but I can't find any reference to parrot in these google results
moritz spacebat_: did you do --gen-parrot in rakudo?
spacebat_: or are you building parrot HEAD?
spacebat_ in the rakudo dir perl Configure.pl --gen-parrot 14:21
moritz I've upgraded to debian testing today, and it built rakudo and parrot just fiine
tadzik I'm on debian testing, works fine
spacebat_ I've built rakudo in the past and never encountered this 14:22
14:22 JimmyZ left
moritz generic advice in such situations is to wipe out old parrot installations 14:22
and in parrot's dir, type git clean -xdf
spacebat_ ok I'll try that
moritz (removes all files not under version control)
and in rakudo, rm -rf install/ 14:23
and make clean
and then try again
oh, but now with --gen-parrot=master I get the same error :(
though the first error is /usr/bin/ld: /usr/lib/debug/usr/lib/x86_64-linux-gnu/Scrt1.o(.debug_info): relocation 0 has invalid symbol index 11
spacebat_ it is from that object file that the error I see is thrown 14:24
moritz tadzik, spacebat_: do you have libc6-dbg:amd64 installed, and if yes, in which version? 14:27
spacebat_ I don't, but libc:amd64 is 2.13-32 14:28
14:30 JimmyZ joined
tadzik moritz: 2.13-32 14:30
(installed)
14:32 birdwind1pbird joined
spacebat_ I just installed libc-dbg and trying to build again 14:33
14:34 pmurias joined
spacebat_ found someone else mentioning it gist.github.com/2842279 14:34
moritz phenny: ask timotimo if he ever found a fix for gist.github.com/2842279 14:38
phenny moritz: I'll pass that on when timotimo is around.
spacebat_ he had that problem on 31 may, and subsequently seems to have been using rakudo, so my guess is he found a workaround at least 14:42
moritz: you mentioned that you can reproduce it with --gen-parrot=master 14:45
perhaps I'm doing that implicitly
moritz spacebat_: I've retried with older version of parrot too. Same failure 14:46
spacebat_: I guess my libc wasn't upgraded when I last built rakudo + parrot successfully 14:47
spacebat_ ah, well I'm glad its not just me being a clutz
15:01 cognominal left 15:02 cognominal joined
araujo anybody knows if there exist a good reference for built-in methods in perl6? 15:06
pmichaud perlcabal.org/syn/S32/ is the closest I know of 15:07
moritz github.com/perl6/doc/ # I'm working on it
and contributions are very welcome
15:07 wooden left
araujo thanks pmichaud moritz ! 15:09
moritz, \o/
crab2313 great 15:10
pmichaud jnthn: I just rebuilt CORE.settings from latest -- it's now showing about a 8% improvement from before your changes yesterday. jnthn++ 15:18
my system yesterday might've had something going on in background
jnthn pmichaud: Well, noise happens too :)
pmichaud: Anyway, getting a matching result in that region is good. 15:19
It means we're almost back to where things stood before altnfa landed.
pmichaud yes, within a percentage point or two
I'm about to try my RIA patch and see if that helps or hurts
moritz lately I've got a lot of parse errors without line numbers 15:22
I suspect they come from failed goals (ie ~ syntax)
that is very annoying
15:23 MayDaniel left
jnthn That...doesn't report line number? 15:23
moritz r: { my $a = 3 my $x = 5 }
p6eval rakudo 0fde4a: OUTPUT«===SORRY!===␤Unable to parse blockoid, couldn't find final '}'␤»
moritz no line number. 15:24
pmichaud RIA patch seems to make less than 0.1% difference in CORE.setting compile speed
jnthn hm, it doesn't.
pmichaud: Doesn't surprise me entirely. I don't think we ever shift off one, which is where the big savings were.
pmichaud oh, I was comparing the cost of new "ResizableIntegerArray" versus clone $P0, RIA 15:25
jnthn Oh
Oh, sorry, I thought you meant something else. I see now.
pmichaud apparently we don't create enough of them to make a huge difference
jnthn Hmm.
We create one every time in !cursor_start
15:26 grondilu joined
grondilu failed to compile nqp. Trying again. 15:26
jnthn moritz: Trying a patch for that. 15:28
JimmyZ Online Perl6 Compiler & Debugging Tool: ideone.com/TRKto 15:29
JimmyZ wonders who wrote it 15:30
15:30 birdwind1pbird left
grondilu JimmyZ: cool. Definitely something that should be on perl6.org imho 15:32
tadzik wow
grondilu ahhh. Failed again!
tadzik there's some Perl 6 person at ideone
grondilu called from Sub 'MAIN' pc 10508 (src/stage0/NQP-s0.pir:3382) (src\stage2\gen\NQP.pm:2936)
called from Sub '_block1000' pc 201 (src/stage0/NQP-s0.pir:106) (src\stage2\gen\NQP.pm:1)
make: *** [src/stage1/NQPCORE.setting.pbc] Erreur 1
Command failed (status 512): make 15:33
araujo moritz, very cool the doc project ....
grondilu Command failed (status 512): /usr/bin/perl Configure.pl --with-parrot=/usr/local/src/rakudo/install/bin/parrot --make-install
tadzik nice how they can afford something that eats 80 MBs :)
araujo moritz, just checked the Any.pod , .. it seems 'all' and 'none' entries are duplicated there?
benabik ideone.com/GV799
15:33 brrt joined
jnthn "Perl 6 (rakudo-2010.08)" - hmm. :) 15:33
tadzik ideone.com/howYJ
yeah :)
we think alike 15:34
grondilu Any help about fail above, please?
moritz grondilu: you need to show (nopaste) the error, not just the tail of the backtrace
dalek p: ea9ceea | jnthn++ | src/HLL/Grammar.pm:
Override FAILGOAL in HLL::Grammar and get it to delegate to panic, so we get a line number.
c: deb2cd9 | moritz++ | lib/Any.pod:
fix duplicate heading, araujo++
araujo :D 15:35
hehe
jnthn moritz: ea9ceea should help
pmichaud: Do you know how :dba is meant to work?
moritz jnthn: thanks
jnthn I thought it set a $*DBA contextual
But now I can't find any evidence of that...
(In STD that is)
grondilu s0.barwen.ch/~grondilu/nqp-compile-error 15:36
15:37 pmurias left
moritz grondilu: do you have local modifications in nqp? 15:37
pmichaud jnthn: looking 15:38
grondilu moritz: I don't think so.
I never touched nqp's code.
However, I recently removed old versions of parrot to make some room on my disk. Maybe it's related. 15:39
grondilu has quite a small disk storage 15:40
pmichaud grondilu: are there any old versions of parrot remaining on the system? 15:41
jnthn "invoke() not implemented in class 't'" 15:42
...class "t"? Sounds...very weird.
grondilu pmichaud: I'm not sure but I think not.
moritz indeed
which is why I asked about local modifications 15:43
grondilu also, I recently update all my perl packages on CPAN. I hope this has nothing to do with it.
I also notice there are a LOT of warnings about implicit conversion from void* to mp_digit* 15:44
pmichaud jnthn: I _think_ (but I'm not positive) that :dba('foo') sets $/{'dba'} := 'foo' in the resulting match object
jnthn pmichaud: Hmm. 15:45
pmichaud: Which leads me to wonder how on earth it ends up in the FAILGOAL error.
pmichaud I think that's a separate path
jnthn Oh.
pmichaud but clearly FAILGOAL could look at $/<dba> to get it.
jnthn Oh, that's true... 15:46
pmichaud i.e., FAILGOAL does something similar to $/<dba> // $rulename
or, if it's not actually in the match hash, it could be $/.dba that provides it
that might actually be nicer/cleaner
i.e., it could be an attribute instead of an entry in the hash 15:47
jnthn I can imagine it going into the match hash just fine too
Well, but then we bloat up Cursor with a $!dba slot for every cursor.
pmichaud well, using $/.dba would be nice in that $/.dba could return the rule name if :dba wasn't set
jnthn True 15:48
pmichaud also, $/<dba> is kind of "not-nice" in that it's not necessarily a full-fledged match object.
jnthn Yeah, you'd have to shove the thing on the cstack or something
pmichaud although we could make it one... but that gets kind of icky too
moritz shouldn't :dba be a property of the regex?
grondilu damned it I'm gonna have to leave in 10 minutes. I'm trying to remove everything and reclone. 15:49
pmichaud I'm find with dba setting a property of the regex, too. .nqpattr strikes again :-/
jnthn moritz: Well, but it can be set multiple times within one regex too.
I agree there's a sense in which it's "static" though. 15:50
pmichaud if :dba appears multiple times in a regex, that probably argues for it going on the cstack somehow
pmichaud looks for an example
jnthn Well, or updating a $!dba in the cursor.
moritz well, I'd think it should be lexically scoped
15:51 Chillance joined
pmichaud updating dba in the cursor might have backtracking issues, though 15:51
jnthn pmichaud: ah...good point.
pmichaud it could go on the cstack but *not* be treated like a capture.
i.e., it goes onto the cstack, but caphash doesn't treat it like a capture. Instead, $/.dba knows how to find the latest :dba entry on the cstack, and (perhaps) returns the regex name if one isn't found
jnthn If we can make the caphash treatement of it cheap, that sounds feasible. 15:52
pmichaud oh, caphash should be really cheap
looking
jnthn caphash is a hot path in profiles today.
pmichaud well, I mean not-much-more-expensive than what we have now :) 15:53
jnthn ah, OK :)
pmichaud keep in mind that there's always a "hot path" :)
jnthn
.oO( Parsing CORE.setting will always be like walking on burning coals... )
pmichaud moritz: (lexically scoped) -- yes, that make some sense also. In that sense it acts like the other modifiers. 15:54
that makes it seem more like a separate slot on the cursor object 15:56
er, wait
jnthn Modulo backtracking issues
pmichaud well, backtracking is handled already by the lexical scoping
if lexical, then it's something that is set at match object creation instead of being part of the cursor 15:57
15:57 grondilu left
pmichaud that's not too bad, if it's just a slot in the match object 15:58
jnthn token statement in STD is a place with multiple uses of :dba, fwiw.
pmichaud also prevents having to munge with the cstack, and helps to reflect that it's really more static than dynamic
jnthn: (token statement) -- thanks, that's a huge help. 15:59
16:01 grondilu joined
pmichaud oh, I should leave in about 15 16:01
jnthn pmichaud: OK. I wasn't gonna do :dba "right now", just was in failgoal and remembered it and thought it'd be nice to have in the near future. :) 16:03
pmichaud :dba is something I might like to hack on :)
jnthn That also works very well for me. :)
pmichaud I think I might spend a bit of time with the profiler, though 16:04
jnthn *nod*
pmichaud I still want to improve map performance a bit more, and there's still some eagerness creeping into the process somewhere that needs to be fleshed out
grondilu totally underestimate the time it takes to clone and compile rakudo :( 16:05
s/underestimate/&ed/
pmichaud cloning parrot takes a really long time :-/
jnthn: I tried special-casing the path where $block.count == 1 (to avoid maniuplating the args array and doing block(args :flat) ) but it didn't seem to make a noticeable difference 16:06
jnthn pmichaud: Interesting...
pmichaud: Where did you put the special case?
pmichaud right before block(args :flat) 16:07
jnthn Was the conditional for it in the loop, or outside of it?
Ah, okm.
16:07 JimmyZ left
pmichaud conditional in the loop 16:07
jnthn Yeah
May be that the cost of that noms the advantage.
pmichaud well, the alternative is two separate Q:PIR sections; that doesn't seem worth it. 16:08
jnthn Pulling it out is messy to deal with though I guess.
Right.
pmichaud I'm guessing args :flat must not be that expensive
manipulating the args array isn't that expensive either -- it's basically just a push 16:09
jnthn Can imagine it not being too bad.
Yeah
Do we re-make the args array each time around the loop?
pmichaud no
args = 0
jnthn OK, then you already have that optimization :)
pmichaud basically it's args = 0
and then shiftpush args, items, argc 16:10
jnthn *nod*
And the shift is nice and cheap now we have QRPA :)
pmichaud the shift from items is common, so not expensive (with QRPA)
so I'm guessing that args = shift items is about the same cost as shiftpush args, items, 1 16:11
jnthn Yes.
Particularly as the push won't have to allocate
(After the intial push, anyway)
pmichaud anyway, I may do profiling over the next couple of days, unless there's a high-priority issue that needs my attention now that .munch is being addressed 16:12
oh, I still need to spread qrpa through out more of the places that we currently use rpa
jnthn Yeah, performance work is welcome. :dba is nice for errors.
grondilu the 'receiving objects' part keeps halting for no apparent reason :(
jnthn If you fancy something hard...operator adverb parsing in EXPR ;)
pmichaud jnthn: definitely not this week :)
jnthn pmichaud: Fair enough. I'm not exactly longing to jump in to that one. :) 16:13
It's some 100s of spectests when we get around to it, though. 16:14
I don't even really care about it much for infixes.
It's more postcircumfixes so we can do the :delete stuff
Last time I tried to figure out how the colonpairs end up attached to the correct call in the EXPR_reduce, my head exploded. Maybe this figuring this out needs whisky instead of beer or something... 16:16
moritz it might be worth checking how niecza does it; I have more confidence that it gets it right than STD
jnthn Good point :) 16:17
Heh. So a while ago when we gave the ROADMAP its last big overhaul, we had priority 1, 2, 3... Now we've eaten all but one of the priority 1 tasks and everything else is 2s and 3s. 16:18
pmichaud \o/
tadzik woo
pmichaud with the priority 1 tasks out of the way, we probably need to focus a bit more on community building again 16:19
moritz p5 interop being the remaining 1 priority item
jnthn Right.
pmichaud docs, modules, installs, etc.
moritz +1
jnthn Indeed.
pmichaud moritz++ for starting github.com/perl6/doc
jnthn Yeah, I love that it's in a git repo. It looks easy to contribute to.
jnthn clones it 16:21
pmichaud afk
jnthn o/ 16:22
moritz: Where are we documenting things that have function forms, but not method ones?
moritz: for example, "nextsame" 16:23
moritz jnthn: nowhere yet
jnthn ok
moritz jnthn: but we can have a 'Functions.pod' or so
tadzik 2 *** throwing typed exceptions (moritz)
isn't that one completed?
moritz tadzik: the grant is completed (I hope :-), but that only covers typed exceptions from within the setting 16:24
tadzik where else would you want them? Panda has its own typed exceptions and uses them 16:25
moritz compiler, meta model, C land 16:26
compiler and C partially throw typed exceptions already
tadzik I see
grondilu once it has received objects and delta, I can suspend and continue offline later, right? 16:27
moritz yes, I think so
grondilu ok I'll try that. 16:28
16:28 grondilu left 16:30 brrt left
moritz spacebat_: removing all instances of -pie from Makefile and config_lib.pir in parrot has fixed the build for me 16:37
... except that compiling dynops in NQP is now broken, "Can't read '/home/moritz/p6/rakudo/install/runtime/parrot/include/config.fpmc' : No such file or directory" 16:38
well yes, that file is in install/lib/parrot/4.4.0-devel/include/config.fpmc
16:40 fgomez joined
TimToady rosettacode.org/wiki/Count_the_coins#Perl_6 16:41
phenny TimToady: 07:17Z <sorear> tell TimToady perhaps <[^z]> should warn too, for people with some knowledge of p6regex changes
TimToady ^^ hangs in rakudo, btw
[Coke] finds an answer at rosetta code for C with the comment /* copied from Perl6 code */ 16:42
diakopter pulls out the caddy and golf bag 16:43
TimToady: how long did you wait for it to hang 16:45
TimToady recommends installing a 'say "$n $coin"' in the routine to track the point at which it hangs
diakopter does it hang or loop
TimToady diakopter: er, the first time? 3 hours <hangs head in shame>
then my computer overheated and shut down
but it looks like a deep recursion issue of some sort 16:46
diakopter why is it ways($n - $coin, @now) 16:51
all of @now?
diakopter binary searches it 16:53
TimToady it's looking for all the ways of making change with one more dollar coin 16:54
@now is all the coins under consideration now 16:55
diakopter what *should* be the growth rate of the run-time? hm 16:56
TimToady nr: say 100000 - 67400
p6eval rakudo 0fde4a, niecza v18-6-ge52d6c3: OUTPUT«32600␤»
TimToady that's probably a clue, since it hangs on 67300
s/hangs/loops/ if you prefer 16:57
so it's some signed 16-bit limitation
well, mebbe 16:59
16:59 birdwind1pbird joined
TimToady if so, it seems like it would have to be in the match, since it's counting down by 100's there 16:59
*math
17:00 screencast joined
TimToady so it's only ~327 deep, not 32767 deep in recursion 17:01
screencast in 17:03
Hi
tadzik hello screencast
TimToady howdy 17:04
screencast I am fine
how about you ??
I am new to perl 6 I need some help ..
tadzik I'm fine, thanks.
Sure. What's the problem?
sjohnson screencast: what would to know?
TimToady *you like 17:05
sjohnson erg, still haven't woken up yet
sjohnson cat stretches
screencast I am unable to write subroutines and use them in code,,
tadzik ( `ー´)
screencast: can you show us the code?
r: say "like this, for example" 17:06
p6eval rakudo 0fde4a: OUTPUT«like this, for example␤»
TimToady or by nopasting to gist.github.com
screencast I didn't understand it..
[Coke] r: sub hi() { say "yo"}; hi 17:07
p6eval rakudo 0fde4a: OUTPUT«yo␤»
sjohnson wonders if we are being filmed for a youtube tutorial, i saw this happen before on this chan
screencast Thnaks.. 17:08
tadzik sjohnson: I was about to ask, "are you szabgab recording another screencast?" :)
sjohnson hehe
[Coke] I'm trying to look at kcachegrind data on one of the rosettacode examples. the highest self entry is in function <cycle 2> in CORE.setting
screencast no.. 17:09
I am a student from India..
new to perl
17:12 screencast left
tadzik you're welcome 17:13
TimToady a statement like "I am unable to..." does not describe your problem very well, though
sjohnson it cannot be done! 17:14
TimToady what did you try?
and what did it say?
you can show us what you tried by pasting it into gist.github.com, hitting the button for "public gist", then pasting the new URL into this channel 17:15
sjohnson or by sending us the youtube link :)
TimToady: on the side, I would like to ask you: did you have a hand in the new edition of the Camel Book? while I have the old one, I'm thinking about buying it again 17:16
TimToady I heavily edited/rewrote the first 11 chapters
sjohnson perfect 17:17
if you only fixed 5 typos, then i might just keep mine :)
but, that sounds like it's worth buying again
does it over some of the cute new switches as seen in 5.14 ?
TimToady well, a lot of that was cleaning up the prose of my co-author, so I don't know how much that counts...
it's supposed to be all about 5.14 17:18
but switches are after chapter 11, so I can't tell you :)
sjohnson should I just sit down and get a new version of perldoc, and read it top to bottom instead, or is it okay just to go with my 4th edition Camel BOok idea 17:19
17:19 cognominal left
TimToady the book is funnier 17:19
(than the docs) 17:20
sjohnson i definitely got a few laughs for sure out of 3rd edition
TimToady some of the jokes are new, and some of them never get old :)
17:21 cognominal joined
sjohnson i wonder if there will be one of those pointy-sun looking stickers on the book, that says, "Updated with new jokes!" 17:21
heheh
by the way, do you ever overlook what actually goes into perldoc? 17:22
or is it mostly handled by others without you needing to be distracted from perl6
i'm sort of thinking the camel book might be the way to get the knowledge straight from the "camel's mouth" 17:23
17:24 birdwindupbird left, birdwind1pbird left
sjohnson erg, sorry bout that. the cover itself says, "5.14" right on it. 17:32
sjohnson rubs his eyes 17:33
.oO(today's not starting out so well)
diakopter don't look a gift camel in the mouth
17:34 snearch joined
TimToady or anywhere else 17:42
sjohnson TimToady: it seems tr/// is covered in Chapter 5 17:44
sjohnson is looking at the TOC on amazon
maybe i shouldn't have said "switches", i think i'm at fault 17:45
sjohnson spanks himself 17:56
well, TimToady, I would say now, the chances of you writing about tr///r are probably very high now
sjohnson buys the book 17:57
18:00 not_gerd joined
not_gerd hello, #perl6 18:01
r: multi foo(:$bar where 1) {}; multi foo(:$baz) {}; foo
p6eval rakudo 0fde4a: OUTPUT«use of uninitialized variable $a of type Any in numeric context in sub foo at /tmp/pKF4TX3qON:1␤␤»
not_gerd there's no variable $a...
moritz there is, in the setting :( 18:03
felher The problem is that 'where 1' tries to smartmatch Any against '1', because ':$bar' isn't declare to be mandatory, right? 18:04
moritz right
felher :) 18:05
jnthn Yes, it's just that.
moritz it#s just LTA that rakudo reports a variable name that's not in the user program 18:06
jnthn r: multi foo(:$bar = 0 where 1) {}; multi foo(:$baz) {}; foo
p6eval rakudo 0fde4a: OUTPUT«===SORRY!===␤Missing block␤at /tmp/6gjp2WuA9n:1␤»
jnthn Hmm... :)
not_gerd r: multi foo(:$bar where *.defined) {}; multi foo(:$baz) {}; foo
p6eval rakudo 0fde4a: ( no output )
18:06 tokuhiro_ joined
jnthn Anyway, if you're doing "where 1" you probably may as well make it required 18:06
:$bar!
18:08 crab2313 left
moritz which type should I document next? 18:08
hm, List maybe?
jnthn There's no shortage ;) 18:09
List is a nice choice 18:10
Hash also
18:10 adu joined
moritz well, we'll need to figure out some stuff 18:10
like
jnthn may take on documenting some of the methods on code objects
18:10 tokuhiro_ left
moritz if the user says p6doc Array.join, it should pick up the one from List 18:11
jnthn Well, if p6doc is written in p6 then .^mro is your friend ;) 18:13
adu .^>
?
not_gerd I failed to get the multidispatcher to dipatch to the correct multi MAIN() via named parameters
tadzik I guess making p6doc a module will require finally understanding "where should modules install non-code resources and how to access them"
not_gerd ie `foo --bar` vs `foo --baz` 18:14
moritz adu: dispatch on the meta class
not_gerd (I'm now doing it git-style instead)
moritz r: multi sub MAIN('foo', $bar!) { } multi sub MAIN('foo', :$baz!) { } 18:15
p6eval rakudo 0fde4a: OUTPUT«===SORRY!===␤Confused␤at /tmp/LSxPLsG0xU:1␤»
jnthn missing ;
moritz r: multi sub MAIN('foo', $bar!) { }; multi sub MAIN('foo', :$baz!) { }
p6eval rakudo 0fde4a: OUTPUT«Usage:␤ /tmp/APACkipZBM foo <bar> ␤ /tmp/APACkipZBM --baz=<Any> foo ␤»
moritz r: multi sub MAIN('foo', Bool $bar!) { }; multi sub MAIN('foo', Bool :$baz!) { }
p6eval rakudo 0fde4a: OUTPUT«Usage:␤ /tmp/FHhUybtbB6 foo <bar> ␤ /tmp/FHhUybtbB6 --baz foo ␤»
adu what's the exclaimation point for? 18:16
moritz adu: see S06
adu ok
TimToady well, the first ! is redundant, but perhaps usefully so from a documentation point of view 18:18
moritz erm , I meant Bool :$bar! 18:19
adu oh ic 18:23
$bar is positional, and :$baz is named so it's optional by default
18:28 baest_ joined 18:32 baest_ is now known as baest 18:33 sjohnson left
dalek c: 4d7d3f0 | moritz++ | lib/List.pod:
start with List.pod
18:35
araujo pulls 18:38
18:41 snearch left
araujo multi method join(List:D: Str:D $separator) returns Str:D .... should be= multi method join(List:D:, Str:D $separator) returns Str:D ? 18:42
moritz, ^^
(missing ',' for the first parameter)
18:43 not_gerd left
TimToady added iterative solution to rosettacode.org/wiki/Count_the_coins#Perl_6 but it also blows up in rakudo, albeit for a different reason 18:46
18:46 birdwindupbird joined
jnthn Because Rakudo doesn't do capture stuff that way yet 18:47
19:08 adu left
moritz araujo: no 19:10
araujo: the : is the delimiter if the first parameter is the invocant
19:11 adu joined
moritz araujo: it's wrong in grep 19:12
dalek c: 49782b4 | moritz++ | lib/List.pod:
List.first, .classify
19:14
19:16 adu left
moritz r: say keys <a b c> 19:17
p6eval rakudo 0fde4a: OUTPUT«0 1 2␤»
dalek c: 1c3828a | moritz++ | lib/List.pod:
[List] fix heading levels
19:18
c: 3a341a7 | moritz++ | lib/List.pod:
[List] end, elems
moritz r: say keys(<a b c>).WHAT
p6eval rakudo 0fde4a: OUTPUT«List()␤»
19:20 tyatpi left 19:28 MayDaniel joined
dalek c: 09c424c | moritz++ | lib/List.pod:
[List] key, values, kv
19:28
araujo moritz, ah I see :) 19:29
19:32 MayDaniel left
moritz r: say List.new(List.new(1, 2), List.new(3, 4)).perl 19:33
p6eval rakudo 0fde4a: OUTPUT«(1, 2, 3, 4).list␤»
moritz r: my @a := (1, 2, 3).list; say @a[1] = 'b'; say @a; 19:39
p6eval rakudo 0fde4a: OUTPUT«Cannot assign to a non-container␤ in block <anon> at /tmp/CE4lrGBd6u:1␤␤»
dalek c: 5e7a325 | moritz++ | lib/List.pod:
[List] notes on items, sigils and flattening
19:44
19:48 benabik left
moritz r: say (1, 2, 3).list.Str 19:49
p6eval rakudo 0fde4a: OUTPUT«1 2 3␤»
19:51 brrt joined
dalek c: 560b0ce | moritz++ | lib/List.pod:
[List] Int and Str coercion methods
19:51
moritz r: say <a b c>.pick.WHAT 19:52
p6eval rakudo 0fde4a: OUTPUT«Str()␤»
tadzik news.perlfoundation.org/2012/06/hag...tured.html :) 19:57
20:01 GlitchMr left
moritz \o/ 20:03
dalek c: a14449d | moritz++ | lib/List.pod:
[List] roll, pick
c: d7636e4 | moritz++ | / (2 files):
add artistic license
20:05
c: 9356804 | moritz++ | lib/List.pod:
[List] Bool, eager, reverse
20:14
20:20 adu joined 20:22 kaare_ left
pmichaud You cannot assign to list elements. Use Arrays for that use 20:22
case instead.
(from the List.pod)
actually, assigning to lists and list elements is quite common.
as long as the list elements are containers.
adu hmm
pmichaud r: my $b = 'one'; (1, 2, $b).[2] = 'two'; say $b 20:23
p6eval rakudo 0fde4a: OUTPUT«two␤»
adu .u 𝑖 20:26
phenny U+1D456 MATHEMATICAL ITALIC SMALL I (𝑖)
pmichaud for many of the list things, do you want me to change doc to match what Rakudo currently does, or to open the items up for discussion?
20:26 sporous left
pmichaud For example, List.pod claims 20:27
multi sub elems(*@list) returns Int:D
20:27 sporous joined
pmichaud but in Rakudo it's 20:27
src/core/Any.pm:336:multi elems($a) { $a.elems }
n: my @a = 1..5; say elems(@a,@a); # curious 20:29
p6eval niecza v18-6-ge52d6c3: OUTPUT«Unhandled exception: Excess arguments to elems, used 1 of 2 positionals␤ at /home/p6eval/niecza/lib/CORE.setting line 0 (elems @ 1) ␤ at /tmp/necG4Eg65l line 1 (mainline @ 4) ␤ at /home/p6eval/niecza/lib/CORE.setting line 3917 (ANON @ 3) ␤ at /home/p6ev…
dalek c: 4cfb847 | pmichaud++ | lib/List.pod:
A few documentation improvements.
20:35
moritz pmichaud: my plan was to document the methods and subs where they logically belong, and then add the coercers later on 20:38
pmichaud in this case my question is not about where it occurs, but the signature of the sub itself 20:39
List.pod claims that sub elems takes a slurpy, but neither Rakudo nor Niecza implement it that way
moritz oh
pmichaud same for kv, values, keys, etc.
moritz then the docs are wrong
and should be fixed 20:40
pmichaud okay, fixing
araujo also add a nice example for map or/and grep 20:41
:P
moritz araujo: do you want to do that?
pmichaud++ # doc updates 20:42
dalek c: b72a3db | pmichaud++ | lib/List.pod:
Correct elems, keys, values, kv signatures.
araujo moritz, well, I think there is something in rosetta that could be re-used 20:43
pmichaud also, I think in many cases it's better to repeat the answer than to simply say "same as .X(foo)"; i.e., don't needlessly make the user request a second entry. 20:44
moritz agreed
I was just lazy
pmichaud compilers are allowed to be lazy, implementors are not. :) 20:45
also, in e.g. join, the separator isn't constrained to be Str. should I remove the constraint or replace them with Cool or ... ? 20:47
dalek c: 4f8e2aa | pmichaud++ | lib/List.pod:
The $separator argument to .join isn't constrained to Str.
20:49
moritz pmichaud: well, that's part of what I want to do with the coercers 20:50
pmichaud: though I don't yet have a clear mental model of how I want to present it
pmichaud what's p6's syntax for coercion these days (in signatures)?
or is it still nebulous?
moritz A(B) 20:51
though I can't remember which one comes where :-)
pmichaud me neither
jnthn Same way around as coercion syntax in general 20:52
Int($x) # coerce $x to Int
pmichaud so, Str(Any)
jnthn Int(Foo) # accept a Foo and coerce it to an Int
moritz ok, I'd be fine with using that in the docs
jnthn Trouble is these coercion types need to be first class, not just syntaxy stuff.
pmichaud i.e., method join would be method join(Str(Any) $separator)
jnthn So it's not entirely trivial to get them in place. 20:53
moritz well, multi method join(Str:D(Any): Str:D(Any) $separator) returns Str:D
pmichaud huh? 20:54
moritz they tend to become a bit bulky :/
pmichaud invocant is a Any there
moritz erm
List:D(Any): for the invocant
pmichaud nononono
*ANY*
1.join(' ') is valid.
moritz that's why there's an Any inside the invocant 20:55
but we do interpret the invocant as a list (even if a one-element list)
pmichaud it doesn't have to be the case that the invocant is coerced to a List, though.
anyway, I'd be willing to let that slide
wouldn't List(Any:D) be a better syntax, ooc? 20:56
20:56 AndreasX joined
pmichaud it's the invocant that has to be defined, not the List that is produced from it 20:56
same for Str(Any:D)
jnthn Why does it have to be defined?
20:56 AndreasX left
pmichaud I'm just saying that the :D seems to fall more naturally as part of the constraint than the coercion 20:57
jnthn r: Any.list
p6eval rakudo 0fde4a: ( no output )
jnthn r: Any.list.perl.say
p6eval rakudo 0fde4a: OUTPUT«(Any,).list␤»
jnthn Ah. Yeah, I'm not sure what putting :D on the coercion target type means relaly
*really
moritz well, we never coerce to a Str type object for jion
*join
pmichaud we do for the separator
i.e., Str(Any:D) makes a lot more sense to me than Str:D(Any) 20:58
the second seems like it would allow :U objects to be coerced
moritz Str(Any:D) would reject Cool.join('')
pmichaud: yes, and we do that
r: say Cool.join('')
p6eval rakudo 0fde4a: OUTPUT«use of uninitialized value of type Cool in string context in block <anon> at /tmp/liY8sFGJHR:1␤␤␤»
moritz we warn, but we still coerce to ''
which matches Str:D
pmichaud that's the invocant, not the separator.
moritz well, same story 20:59
pmichaud my example is
moritz r: say (1, 2).join(Cool)
p6eval rakudo 0fde4a: OUTPUT«use of uninitialized value of type Cool in string context in block <anon> at /tmp/gLHOcpk6_4:1␤␤12␤»
pmichaud okay
20:59 birdwindupbird left
pmichaud the :D seems unneeded in Str:D(Any) then. 20:59
jnthn Str:D($x) # what does this mean?
21:00 brrt left
moritz jnthn: dunno 21:00
jnthn Right, and I dunno what Foo:D(Bar) means either. :)
moritz pmichaud: well, from the perspective of the compiler writer there's a big difference between a coercion to Str and to Str:D
pmichaud: because if we can assume that the coercion does not return a type object, we can unbox it
jnthn Hmm. 21:01
moritz so IMHO our type system should be able to express that
so maybe Str:D($x) means something like Str($x) // die "Coercion returned an undefined value, but should not"
21:01 cognominal_ joined
pmichaud can we multidispatch on the success of the coercion? 21:01
jnthn No 21:02
moritz anyway, time for me to sleep
pmichaud i.e., would Str:U(Any) and Str:D(Any) be valid multidispatch criteria?
jnthn The multi-dispatcher sees the desired type
At the very most it might tie break on that.
But "ability to coerce" hasn't been a tie-breaker so far.
er, desired type was really unclear 21:03
It sees the type that we need to pass in the first place.
The Any, in the above examples.
pmichaud the way moritz++ is describing :D/:U on the coercion type acts more like a constraint than a coercer though
i.e., "we know it's defined, therefore we can ... "
anyway, not important for today; I just want to be sure we're not documenting constraints that don't really exist. There's already enough confusion about the meaning of my Int $x = "2"; 21:04
21:04 cognominal left
pmichaud and method join(Str $x) 21:05
araujo multi method map(List:D:, &code) returns List:D
moritz, need to remove the ',' ?
dalek c: b155c7d | pmichaud++ | lib/List.pod:
Remove commas after invocant colons in signatures; araujo++.
21:06
c: 7233ae8 | pmichaud++ | CREDITS:
Fix CREDITS file -- usernames for this repo are GitHub, not subversion.
21:07
kudo/nom: 9ad893e | pmichaud++ | CREDITS:
Fix CREDITS to reflect GitHub usernames as well as Subversion.
21:08
p: d82864d | pmichaud++ | CREDITS:
Fix CREDITS to reflect that usernames are for GitHub.
21:09
21:35 adu left, benabik joined 21:43 benabik left 21:44 benabik joined 21:48 adu joined, cognominal_ left, cognominal_ joined 22:23 raiph joined 22:35 spaceships joined 22:36 spaceships left, spaceships joined, spaceships left 22:37 rlpeacock left, spaceships joined 22:42 spaceships left
raiph re: old/new p6 on ideone.com ideone.com/veE3O 22:43
22:43 NamelessTee left, espadrine joined 22:55 spider-mario left 23:06 PacoAir left 23:12 espadrine left
araujo is latest rakudo commit compiling fine? 23:55
23:58 whiteknight joined 23:59 whiteknight is now known as Guest48609