»ö« | perl6.org/ | nopaste: paste.lisp.org/new/perl6 | evalbot usage: 'perl6: say 3;' or rakudo:, alpha:, pugs:, std:, or /msg p6eval perl6: ... | irclog: irc.pugscode.org/ | UTF-8 is our friend!
Set by lichtkind on 5 March 2010.
diakopter someone asked for something similar the other day 00:00
sjohnson in my magical dream world, i imagined: push @a, $_->{somekey} if exists; # would do it
00:01 mikehh_ is now known as mikehh 00:02 kst` joined
arnsholt sorear: The joys of Unicode =) 00:02
(And it's probably your font, rather than the terminal)
sjohnson diakopter: ... what are your thoughts on this radical feature request
or idea, rather. 00:03
i haven't requested it yet :)
00:03 kst` left
sorear sjohnson: given %_<somekey> { @a.push($_) if .exists } 00:04
good enough?
er
s/exists/defined/ and that one will work
it'll work better if you give me a bit more context 00:05
is this in a loop?
sjohnson i will give the context by pastebin example
diakopter that wouldn't autovivify?
sjohnson my brother at work asked me about it today, and i figured out a way in perl 5
so one sec
00:06 ethel left
sjohnson sorear: www.pastebin.org/208696 (dont worry, it's very simple) 00:07
sorear %h{*; "key1"}.values # I think a multidimensional hash slice will do what you need 00:09
sjohnson thanks 00:10
im looking forward to understanding perl 6 00:11
diakopter me2 00:16
00:17 eternaleye joined 00:36 snarkyboojum left 00:38 s1n joined 00:41 snarkyboojum joined
lue ohaidere 00:46
00:48 _jaldhar left
lue rakudo: my @a; @a[0..3] = (1,2,3,4); say @a 00:50
p6eval rakudo ab2322: OUTPUT«Cannot assign to readonly value␤current instr.: '&die' pc 17868 (src/builtins/Junction.pir:393)␤»
lue ō.o
diakopter large list/array refactor/rewrite imminent
lue oooh! Would that work? 00:51
diakopter I don't know
lue Hell of a lot better than pushing about 0x10000 times :) 00:52
diakopter well, you wouldn't ever type out all the pushes in the source code, would you?
or do you mean over the course of a lifetime? 00:53
(as long as you're assigning more than 1, it saves a literal push)
lue maybe I have to look at push() again. I got the feeling it did one at a time, but that's probably wrong. 00:54
sorear diakopter: are you doing the refactor? 00:55
00:55 rv2733 left 00:56 BrowserUk joined
diakopter :P no.. I just read the phone-cabal transcripts and the irclogs, and pmichaud seems to be warming up to another rewrite 00:56
transcripts: use.perl.org/~chromatic/journal/
notably: April 21 pmichaud said 'hope to work on the List implementation, especially laziness and context' 00:57
but after that, when pmichaud was chatting with TimToady and others here a week or so ago, it seemed like more rewriting needed to occur 00:58
diakopter looks for the reference 00:59
lue how would I use push to push a certain range of values, short of typing (0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, (ad nauseum))
(and yes, I do need a lot of zeroes.)
diakopter a loop?
01:00 lichtkind left
Juerd lue: 0 xx $thatmany 01:00
lue rakudo: my @a; @a.push(0 xx 3); say @a
p6eval rakudo ab2322: OUTPUT«000␤»
lue Yay! I don't suppose I could put references to @a elements inside @a that easily :) 01:01
Juerd Why not?
lue lemme try... 01:03
01:03 nihiliad left
BrowserUk rakudo: my @a= 1; my %h = 1,2; @a.push( %h{2} // () ); say @a; 01:04
p6eval rakudo ab2322: OUTPUT«1␤»
lue rakudo: my @a; @a.push(0 xx 3); loop (my $i=0; $i <= 3; $i++) { @a.push(0); @a[(i+3)] := @a[i]; }; say @a 01:06
p6eval rakudo ab2322: OUTPUT«Could not find sub &i␤current instr.: '_block58' pc 456 (EVAL_1:27900521)␤»
lue rakudo: my @a; @a.push(0 xx 3); loop (my $i=0; $i <= 3; $i++) { @a.push(0); @a[($i+3)] := @a[$i]; }; say @a
p6eval rakudo ab2322: OUTPUT«:= binding of variables not yet implemented␤current instr.: '&die' pc 17868 (src/builtins/Junction.pir:393)␤»
diakopter sorear: oh, oops.
lue something like that is what I need.
diakopter sorear: here is the reference
irclog.perlgeek.de/perl6/2010-05-04#i_2293626 01:07
pmichaud isn't yet happy with Seq and binding 01:08
so there's a lot of exploratory work that it seems he's expecting he'll be the one to shoulder
sorear thanks
01:09 patrickas left
diakopter not as notably, I'm not happy with the binding spec, because it's way too magic imho. 01:09
(oh wait, that's a tautology) :) 01:10
lue thinks of pythonic [3:6]. Everybody wants the colon.
diakopter sorear: (sorry for co-opting your description "magic" for that) 01:11
lue rakudo: my @a; @a.push(0 xx 3); @a.push (:@a[1..3] xx 3) 01:20
p6eval rakudo ab2322: OUTPUT«Confused at line 11, near [email@hidden.address] (:"␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
lue hmm..
(tried :=)
rakudo: my @a; @a.push(0 xx 3); @a.push (@a[1..3] xx 3) say @a 01:23
p6eval rakudo ab2322: OUTPUT«Confused at line 11, near [email@hidden.address] (@"␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
lue rakudo: my @a; @a.push(0 xx 3); @a.push(@a[1..3] xx 3) say @a 01:24
p6eval rakudo ab2322: OUTPUT«Confused at line 11, near [email@hidden.address] instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
01:26 BrowserUk left
lue := being unimplemented bugs me deeply. Anyone know where these kinds of things are implemented? 01:30
diakopter lue: it would take hundeds->thousands of hours to "implement" 01:34
I'm just making sure you know what you're considering undertaking 01:35
lue It's one of the two reason I switched from Py3 to P6. I'd like to at least see where it would be (I am grepping my way through the code now BTW) 01:39
diakopter it would be *everywhere*
lue: probably it would be best to solve your problem another way. if you would, please explain why you believe you need the := operator to solve your problem? I'm willing to bet several folks around here can help 01:40
(including myself)
can, and are willing
01:40 nihiliad joined
lue The NES has several "shadow" areas, where access to it defers you to some actual memory (i.e. going to 0x900 would take you to code at 0x100) [MORE] 01:41
diakopter falls off my chair 01:42
lue In Python 3, I had to write an extra method to avoid headache with updating everything (Py3 has not references)
I could do the same in P6, but references would save a lot of work. :)
(yes, I switched in the middle of writing an NES emulator to make writing the emulator easier.) 01:43
diakopter wonders about all the other NES emulators
please explain more how Py3 doesn't have references...?) 01:45
lue They're all written at least partly in x86, if they're even available for linux.
I could never find anything about pointers, or references. 01:46
sorear falls off his chair, too 01:47
if you're so adamantly opposed to interpreters
why are you writing one
and in a high-level language with no optimizations, at that
diakopter you'd be better off running an x86 os on an x86 emulator 01:48
and then running the nes emulator on that
lue I actually tried that. It was awful. 01:50
This is my last step, short of buying another computer :)
diakopter well, it'll certainly be an instructive exercise (potentially), whichever way you go.
lue sorear: if I were opposed to interpreters, I would go for C. 01:52
My goal in the middle of this (the reason I'm trying Python/Perl/etc. first) is also to make it so the program runs no matter what.
sorear: I have an old computer. I'm going to whine about virtual machines and interpreters. I know my attitude would be different if I had a new Mactel laptop. 01:53
Even compiled programs can run slow for me. Don't trust me too much when I talk about speed issues :P 01:54
rakudo: my $a = 3; my $b = \$a; say $a.WHERE; say $b.WHERE 01:57
p6eval rakudo ab2322: OUTPUT«62691056␤62685008␤»
lue is trying to figure a way to get a quick 'n' dirty := working. (Goodbye, sanity...) 01:59
02:00 Psyche^ joined 02:03 aindilis left, Patterner left, Psyche^ is now known as Patterner 02:05 donri left
lue thinks trying something less complicated first might be a good idea... 02:10
lue just to get a feel for working in compiler guts :)
02:17 \shade\ joined
lue afk (and maybe when this place is bustling with people it'll be easier to figure out my problem) 02:29
(no offense to anyone who has helped already) 02:30
02:32 ShaneC left 02:36 BrowserUk joined, BrowserUk left 02:53 fridim joined 02:55 kst left 02:58 kst joined 03:11 cdarroch left
colomon rakudo: say 3/4 cmp 5/6 03:19
p6eval rakudo ab2322: OUTPUT«-1␤»
colomon rakudo: say 3/4 <=> 5/6
p6eval rakudo ab2322: OUTPUT«-1␤»
colomon rakudo: say ~(3/4) cmp ~(5/6)
p6eval rakudo ab2322: OUTPUT«-1␤»
colomon rakudo: say 3/4 < 5/6 03:20
p6eval rakudo ab2322: OUTPUT«1␤»
colomon rakudo: say "a" cmp "b"
p6eval rakudo ab2322: OUTPUT«-1␤»
03:20 _jaldhar joined
colomon Oh, I see, Rat has special case versions of cmp. Hmmm.... 03:21
03:25 am0c left 03:35 alester joined 03:39 am0c joined
dalek meta: r247 | diakopter++ | trunk/Sprixel/ (5 files):
[perlesque] broken code commit :)
03:44
03:45 christine left 03:46 christine joined 03:54 jonrafkind left 03:55 tylerni7 joined 03:59 JimmyZ joined
sorear What does my $var is Type(Args) mean? 04:03
Do we have any pretty multi-variable graphs 'racing' Rakudo, Pugs, mildew, etc., on spectests vs. time? 04:06
diakopter :P
no; those variables would be very difficult to quantify 04:07
JimmyZ Pugs is outdate
sorear run spectest, graph
JimmyZ outdated 04:08
04:09 snarkyboojum left, snarkyboojum joined
diakopter sorear: I'm sorry; I misunderstood. 04:16
04:19 justatheory left 04:20 am0c left 04:22 thowe joined 04:27 kst left 04:34 am0c joined, kst joined
sorear std: (* + my $x); say $x; 04:42
p6eval std 30583: OUTPUT«ok 00:01 113m␤»
sorear TimToady: Should that parse? There is talk of a compiler-generated implicit block...?
er, nevermind, the answer was given three pages down 04:43
04:44 snarkyboojum left 05:08 orafu left 05:09 orafu joined 05:11 am0c left
sorear hmm, LTM requires a metaclass compatibility engine 05:17
05:19 pure1111 joined, pure1111 left
JimmyZ rakudo: (1,1, * + *, ... *).batch(28).perl.say 05:23
p6eval rakudo ab2322: OUTPUT«No exception handler and no message␤current instr.: '&fail' pc 18025 (src/builtins/Junction.pir:481)␤»
JimmyZ rakudo: (1,1, * + * ... *).batch(28).perl.say 05:26
p6eval rakudo ab2322: OUTPUT«(1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597, 2584, 4181, 6765, 10946, 17711, 28657, 46368, 75025, 121393, 196418, 317811)␤»
05:30 envi_home2 left
JimmyZ rakudo: 'hello' 05:42
p6eval rakudo ab2322: ( no output )
05:48 BrowserUk joined, BrowserUk left 05:56 snarkyboojum joined 06:03 alester left 06:06 meppl joined 06:10 JimmyZ left 06:14 kst left 06:18 kst joined 06:22 JimmyZ joined
sorear What is the difference between COMPILING::<$?FOO> and $*FOO? 06:25
06:35 jhuni joined
JimmyZ rakudo: class Foo { say method F() { 'hi'; }; }; Foo.F.say; Foo.new.F.say; 06:47
p6eval rakudo ab2322: OUTPUT«F␤hi␤hi␤»
JimmyZ rakudo: class Foo { my method F() { 'hi'; }; }; Foo.F.say; Foo.new.F.say; 06:51
p6eval rakudo ab2322: OUTPUT«hi␤hi␤»
JimmyZ rakudo: my.WHAT.say
p6eval rakudo ab2322: OUTPUT«Malformed my at line 11, near ".WHAT.say"␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
JimmyZ rakudo: class Foo { our method F() { 'hi'; }; }; Foo.F.say; Foo.new.F.say;
p6eval rakudo ab2322: OUTPUT«hi␤hi␤»
06:58 k23z__ joined
sorear TimToady: Is the bit about magical hashes for grammatical categories at the end of S02 a fossil? I think we use protoregexes in STD:: for that now 06:59
06:59 Ross joined 07:06 dalek left 07:09 dalek joined 07:12 fridim left 07:19 nihiliad left 07:28 plobsing joined 07:32 TiMBuS left 07:43 kst left 07:45 finanalyst joined
finanalyst rakudo: my @a=1,2,3; say ( ^@a ).perl 07:45
p6eval rakudo ab2322: OUTPUT«0..^[1, 2, 3]␤»
finanalyst alpha: my @a=1,2,3; say ( ^@a ).perl 07:46
07:46 Su-Shee joined
p6eval alpha 30e0ed: OUTPUT«0..^3␤» 07:46
07:55 kst joined 08:08 _jaldhar left 08:12 envi^home joined
moritz_ alpha is probably saner here 08:16
08:17 finanalyst left 08:38 snarkyboojum left
JimmyZ alpha: class Foo { my method F() { 'hi'; }; }; Foo.F.say; Foo.new.F.say; 08:40
p6eval alpha 30e0ed: OUTPUT«Method 'F' not found for invocant of class ''␤in Main (file src/gen_setting.pm, line 324)␤»
JimmyZ rakudo: class Foo { my method F() { 'hi'; }; }; Foo.F.say; Foo.new.F.say;
p6eval rakudo ab2322: OUTPUT«hi␤hi␤»
isBEKaml alpha: class Foo { !method F() { 'hi'; }; };Foo.new.F.say; Foo.F.say; 08:41
p6eval alpha 30e0ed: OUTPUT«hi␤hi␤»
isBEKaml weird, I thought ! was private...
isBEKaml goes looking at S06 and S12 08:43
JimmyZ I want create statci method
static
seems there were no static methods
isBEKaml methods are generally public. I don't think we have static methods.
JimmyZ rakudo: class Foo { my method F() { 'hi'; }; }; Foo.F.say; Foo.new.F.say; 08:44
p6eval rakudo ab2322: OUTPUT«hi␤hi␤»
JimmyZ alpha: class Foo { my method F() { 'hi'; }; }; Foo.F.say; Foo.new.F.say;
moritz_ methods are "static" if they don't access any attributes
p6eval alpha 30e0ed: OUTPUT«Method 'F' not found for invocant of class ''␤in Main (file src/gen_setting.pm, line 324)␤»
moritz_ rakudo: class F { has $!x; method a { $!x } }; F.a
p6eval rakudo ab2322: OUTPUT«Type objects are abstract and have no attributes, but you tried to access ␤current instr.: 'perl6;F;a' pc 385 (EVAL_1:22350407)␤»
isBEKaml moritz_: no accessor methods are static? 08:45
JimmyZ alpha: class Foo { has $!x; method F() { $!x; }; }; Foo.F.say; Foo.new.F.say;
p6eval alpha 30e0ed: OUTPUT«Type objects do not have state, but you tried to access attribute $!x␤in Main (file <unknown>, line <unknown>)␤»
JimmyZ alpha: class Foo { has $!x; method F() { $!x; }; }; Foo.new.F.say;
p6eval alpha 30e0ed: OUTPUT«Use of uninitialized value␤␤»
isBEKaml moritz_: the difference in behaviour seen between alpha and rakudo? my scoped methods are seen too? 08:46
JimmyZ rakudo: class Foo { has $!x =0 ; method F() { $!x; }; }; Foo.F.say;
p6eval rakudo ab2322: OUTPUT«Type objects are abstract and have no attributes, but you tried to access ␤current instr.: 'perl6;Foo;F' pc 397 (EVAL_1:169)␤»
moritz_ isBEKaml: iirc alpha thought 'my' methods were private
08:46 dalek left
JimmyZ rakudo: class Foo { has $!x =0 ; method F() { $!x; }; }; Foo.new.F.say; 08:46
08:46 hejki left
p6eval rakudo ab2322: OUTPUT«0␤» 08:46
08:46 hejki joined
moritz_ alpha generally has problems with properly scoping routines 08:47
JimmyZ alpha: class Foo { my method F() { 'hi'; }; }; Foo.F.say; Foo.new.F.say;
p6eval alpha 30e0ed: OUTPUT«Method 'F' not found for invocant of class ''␤in Main (file src/gen_setting.pm, line 324)␤»
isBEKaml moritz_: that should be the correct behaviour, right? "my"s are essentially scoped within the block, right?
moritz_ yes
JimmyZ alpha: class Foo { say method F() { 'hi'; }; }; Foo.F.say; Foo.new.F.say; 08:48
p6eval alpha 30e0ed: OUTPUT«F␤hi␤hi␤»
JimmyZ alpha has less bugs
moritz_ that's a broad oversimplification 08:49
08:50 dalek joined
pugssvn r30584 | moritz++ | [t/spec] test for rx/.../ and rx{...} quoting 08:52
moritz_ rakudo: multi sub infix:<+>() { 42 }; say 5 + 5 08:53
p6eval rakudo ab2322: OUTPUT«No applicable candidates found to dispatch to for 'infix:<+>'. Available candidates are:␤:()␤␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
moritz_ rakudo: say BEGIN 5 08:58
p6eval rakudo ab2322: OUTPUT«5␤»
09:00 Ross left, snarkyboojum joined, Ross joined
pugssvn r30585 | moritz++ | [t/spec] simpler tests for BEGIN blocks as expressions; tests RT #62188 and RT #74836 09:01
09:03 Ross left
dalek kudo: c49d32b | moritz++ | t/spectest.data:
run S04-phasers/rvalues.t
09:08
pugssvn r30586 | moritz++ | [t/spec] test for RT #74778, multiple occurences of $^a should count as a single parameter 09:12
09:15 [mark] joined 09:16 Maddingue left
pugssvn r30587 | moritz++ | [t/spec] test for RT #65738, overriding exports do not affect modules loaded later on 09:21
moritz_ these module loading tests seem very fragile to me 09:24
all split up in different files
09:32 bakedb__ joined, clintongormley joined 09:34 [mark] left
isBEKaml rakudo: class Foo { method !F() { "some stuff" }; method G() { say "some more stuff"; say F(); }; }; Foo.G; 09:34
p6eval rakudo ab2322: OUTPUT«some more stuff␤Could not find sub &F␤current instr.: 'perl6;Foo;G' pc 530 (EVAL_1:232)␤»
09:35 patrickas joined
isBEKaml rakudo: class Foo { method !F() { "some stuff" }; method G() { say "some more stuff"; say !F(); }; }; Foo.G; 09:36
p6eval rakudo ab2322: OUTPUT«some more stuff␤Could not find sub &F␤current instr.: 'perl6;Foo;G' pc 530 (EVAL_1:22350472)␤»
isBEKaml rakudo: class Foo { method !F() { "some stuff" }; method G() { say "some more stuff"; say self!F(); }; }; Foo.G;
p6eval rakudo ab2322: OUTPUT«some more stuff␤some stuff␤»
sjohnson hi
(´ー` ) 09:38
isBEKaml rakudo: class Foo { method !F() { "some stuff" }; method F() { say "I'm F..."; }; method G() { say "some more stuff"; say self!F(); }; }; Foo.G; Foo.F; 09:40
p6eval rakudo ab2322: OUTPUT«some more stuff␤some stuff␤I'm F...␤»
isBEKaml something's off... Why should we define two methods in the same class with same name but under different scopes? 09:41
cognominal www.youtube.com/watch?v=nCgQDjiotG0
oops wrong window
isBEKaml hi sjohnson 09:42
I feel this can lead to a lot of confusion... :| 09:43
09:43 will__ joined
isBEKaml alpha: class Foo { method !F() { "some stuff" }; method F() { say "I'm F..."; }; method G() { say "some more stuff"; say self!F(); }; }; Foo.G; Foo.F; 09:43
p6eval alpha 30e0ed: OUTPUT«some more stuff␤some stuff␤I'm F...␤»
09:43 will__ left
moritz_ rakudo never really enforced privacy of attributes and methods 09:44
known bug
09:44 will__ joined
sjohnson isBEKaml: hi 09:44
09:45 will__ left
isBEKaml hmm, how does std treat it? 09:45
std: class Foo { method !F() { "some stuff" }; method F() { say "I'm F..."; }; method G() { say "some more stuff"; say self!F(); }; }; Foo.G; Foo.F;
p6eval std 30587: OUTPUT«ok 00:01 113m␤»
09:45 will__ joined
isBEKaml heh 09:46
09:46 will__ left
sjohnson cognominal: interesting link nonetheless! 09:47
isBEKaml cognominal: I came across this on reddit. potato gun tests. :) 09:48
09:51 JimmyZ left 09:52 plobsing left 09:53 masak joined
masak oh hai, #perl6 09:53
isBEKaml hi masak!
09:55 jhuni left, JimmyZ joined
cognominal hi masak 09:58
masak lunch & :) 10:04
patrickas hello moritz and mazak, I just committed the latest changes ... including the linkification of readme badge 10:05
moritz_ patrickas++ 10:06
masak patrickas: cool. I have an early general badge icon. will try to push it later today.
moritz_ has registered thejoyofsix.org, and now ponders what to put up there
JimmyZ joyo? 10:09
oh joy of six
isBEKaml patrickas: cool :)
moritz_: now, perl6 has become impishly naughty! ;) 10:10
patrickas parsed it as the-joyo-fsix too :-) 10:11
isBEKaml likes the .org domain suffix to joyofsix 10:12
10:14 wknight8111 joined 10:16 k23z__ left
isBEKaml personally, I like punning perl 6 or "Perling Six" or "Perling 6" :) 10:21
10:24 \shade\ left, fda314925 left, Trey left 10:25 bbkr_ joined, bakedb__ left 10:27 \shade\ joined, fda314925 joined, Trey joined, \shade\ left, fn joined 10:32 pmurias joined
sjohnson masak: hi, long time no see 10:33
10:39 bbkr_ left
moritz_ rakudo: class X {method x (*@_) {say @_} }; X.new.x(5) 10:41
p6eval rakudo ab2322: OUTPUT«5␤» 10:42
10:43 JimmyZ left
isBEKaml moritz_: that's variable argument passing? 10:44
*@_
moritz_ yes
"slurpy" we call it 10:45
isBEKaml we call it varargs. :)
10:45 k23z__ joined
pugssvn r30588 | moritz++ | [t/spec] test for RT #72940, *@_ in method signature 10:46
isBEKaml rakudo: class X {method x (*@_) {say @_} }; my @tt = <1 2 3 3 4 5 9>;my @tt1 = <1 2 3 3 4 5 9 102384 1203941023>; X.x(@tt, @tt1);
p6eval rakudo ab2322: OUTPUT«123345912334591023841203941023␤»
isBEKaml rakudo: my $xt=139741234132659817984750128304981495681749756018048321; say $xt; say $xt.WHAT; 10:52
p6eval rakudo ab2322: OUTPUT«2934593596619636033␤Int()␤»
moritz_ that one is pretty nasty (and reported) 10:53
isBEKaml yeah, that ran into overflow in my local p6 REPL
what's the max limit of an Int() ? 10:55
or where is it documented? I'm looking at operators.pod..
moritz_ in theory Int should be a bigint
isBEKaml I was curious when I saw the varargs spitting out exactly as I gave in. "say" does stringify it without casting into types. 10:56
moritz_ more importantly, rakudo treats the insides of <...> as strings 10:57
isBEKaml I'll keep that in mind... # < ... > === qw/ / 10:58
moritz_ actually the spec says there should be some more magic 10:59
recognizing numbers and pairs inside <...> 11:00
but the stringification should still be preserved
11:00 Ross^ joined, Ross^ is now known as Ross
isBEKaml that surely must be based on what it is used with? say -> stringify. <..> -> relevant_stuff() 11:06
moritz_ rakudo: say 42 but role { method Str { "foo" } } 11:07
11:07 patrickas left
p6eval rakudo ab2322: OUTPUT«42␤» 11:07
moritz_ huh. That didn't work out as planned 11:08
isBEKaml there must be a lot of type introspection going on under the hood with < ... > 11:09
11:09 arthur-_ left
moritz_ no, just parsing magic 11:10
11:13 felipe left 11:14 Su-Shee left, gbacon left, bloonix left, skangas left, mdxi left, kcwu left, dhoss left, pnu left, moritz_ left 11:17 k23z__ left, pmurias_ joined
isBEKaml <...> doesn't seem to be treating Int()s, just Num() - I guess a broader range than Int() ? 11:18
11:18 k23z__ joined
isBEKaml rakudo: my @tt = <1234 10302984019283401293571492859841 134 983>; my @tt1 = <2498 129238742394347 134 13445>; my @ttr = @tt1 Z+ @tt; say "tt: @tt[]"; say "tt1: @tt1[]"; say "ttr: @ttr[]"; say @ttr>>.WHAT; 11:18
p6eval rakudo ab2322: OUTPUT«tt: 1234 10302984019283401293571492859841 134 983␤tt1: 2498 129238742394347 134 13445␤ttr: 3732 1.03029840192834e+31 268 14428␤Num()Num()Num()Num()␤»
isBEKaml note: the range is exceeded that of an Int(
Int()
11:19 Su-Shee joined, gbacon joined, bloonix joined, skangas joined, mdxi joined, kcwu joined, dhoss joined, pnu joined, moritz_ joined, card.freenode.net sets mode: +o moritz_
isBEKaml Zops are nice here.. :) 11:20
11:20 Ross left, clintongormley left
dalek kudo: ab01a92 | moritz++ | t/spectest.data:
correct a test name, moritz--
11:23
pugssvn r30589 | moritz++ | [t/spec] make some debugging output harmless 11:32
11:33 rv2733 joined
masak phenny: tell patrickas that the logotype/logo_32x32.png idea sounds good. 11:35
phenny masak: I'll pass that on when patrickas is around.
masak sjohnson: hi! indeed. how're you?
11:40 k23z__ left
colomon rakudo: say <1234>».WHAT 11:41
p6eval rakudo ab2322: OUTPUT«Str()␤»
colomon rakudo: say (+«<1234>)».WHAT
p6eval rakudo ab2322: OUTPUT«Num()␤»
colomon isBEKaml: note that those numbers in your example never are Ints. 11:42
masak (but, it can be argued, should be)
moritz_ as I've done before :-) 11:43
colomon I am merely describing what is, not what should be. :) 11:44
masak *nod*
isBEKaml colomon: *nods* 11:45
colomon so, is anyone else's latest Rakudo broken, or did my innocent changes last night have really weird effects?
moritz_ colomon: all fine here... except for non-zero exit statusses in some test files 11:46
isBEKaml colomon: I didn't presume them to be Int()s, < ... > magic in retaining numbers and pairs gave me the impression that it can be Int()s too..
colomon isBEKaml: < ... > magic is purely hypothetical so far, as far as I know. 11:47
moritz_: crap.
isBEKaml colomon: So it isn't in yet? :O 11:48
colomon isBEKaml: as I said, not as far as I know.
moritz_ colomon: exactly how innocent is it? :-)
colomon moritz_: I made Real and Num versions of the numeric comparison operators. 11:49
all the math and operator tests work fine.
but '' ~ '' (those are single quotes) causes a seg fault. 11:50
moritz_ colomon: try the newest parrot
colomon: lots of small string fixes since yesterday
colomon hey, that happens with an unmodified copy, too. :\
rakudo: say '' ~ ''
p6eval rakudo ab2322: ( no output )
moritz_ works fine here 11:51
isBEKaml mine segfaulted too. I built this last night. 11:52
colomon what platform are you on? it's failing for me on OS X 10.5 32-bit and 64-bit CentOS.
moritz_ 64bit Debian here 11:53
but today's parrot
snarkyboojum I can verify segfault
colomon ah. I've bumped parrot to HEAD and I'm rebuilding now.
snarkyboojum but with parrot 46393
moritz_ 46403 here 11:54
isBEKaml afk & 11:58
colomon with head (which is 46405, I think, without looking) '' ~ '' works again. 11:59
so does classify.t
moritz_ colomon: then feel free to bump PARROT_REVISION 12:00
colomon moritz_: believe me, I will, as soon as I've done a full spectest. :)
snarkyboojum same here - rebuilding with parrot 46405 has fixed the segfault here
moritz_++ :)
moritz_ so, masak doesn't need to report :-) 12:01
snarkyboojum and colomon++ (for noticing) :)
snarkyboojum stops going karma crazy
arnsholt Hmm. I got a transient segfault on make test with latest Rakudo 12:04
Known issue? 12:05
(On OS X 10.6)
moritz_ arnsholt: yes.. pleae try upgrading to parrot HEAD
colomon really needs to get around to upgrading to 10.6...
moritz_ arnsholt: it should make the segfaults go away, only a few non-zero exits should remain 12:06
arnsholt Ah, OK
sjohnson masak: not bad:)
bedtime :)
masak :) 12:07
12:09 finanalyst joined
colomon starting spectest again, but I think I hear a toddler singing in his crib.... I guess if I haven't checked patches in in 20 minutes, someone else should do the parrot bump. :) 12:10
12:10 barney joined
moritz_ tries to motivate himself to buy some foodstuff for the weekend 12:11
and after that, maybe blogging about List.classify? 12:12
snarkyboojum rakudo: use Test; ok(!( "\x[9FC4]" ~~ m/^<.isIdeographic>$/ ), q{Don't match unrelated <isIdeographic>} ); 12:13
p6eval rakudo ab2322: OUTPUT«ok 1 - Don't match unrelated <isIdeographic>␤»
snarkyboojum bizarro - that fails for me
not ok 4 - Don't match unrelated <isIdeographic>
I get 9 failures in t/spec/S05-mass/properties-derived.t 12:14
have for a while
moritz_ there are some platform specific differences wrt Unicode handling in regexes which we haven't been able to nail down yet 12:16
rakudo: say [1, 2] cmp [1, 2, 0] 12:17
p6eval rakudo ab2322: OUTPUT«-1␤»
moritz_ rakudo: say [1, 2] cmp [3, 2, 0] 12:18
p6eval rakudo ab2322: OUTPUT«-1␤»
colomon moritz_: ? 12:19
rakudo: say [1, 2] Zcmp [3, 2, 0]
p6eval rakudo ab2322: OUTPUT«-10␤»
moritz_ colomon: I just wanted to check if cmp numifies arrays 12:20
snarkyboojum strangely all the test that fail use \x[9FC4]
tests
colomon moritz_: ah.
moritz_ colomon: no bug-hunting intetions or so :-)
colomon actually, it's probably stringifying them, isn't it? 12:21
moritz_ 31896 passing tests now
colomon that wouldn't get that result, hmmmm....
moritz_ rakudo: [1, 2] cmp [0]
p6eval rakudo ab2322: ( no output )
moritz_ rakudo: say [1, 2] cmp [0]
p6eval rakudo ab2322: OUTPUT«1␤»
moritz_ you're right
not sure what the right semantics would be
colomon me neither. 12:22
(I just knew that there was <cmp>($a, $b), <cmp>(Num, Num), and some Date and Rat cmps and that's it.) 12:23
moritz_ in perl 5 it would numify
no wait
perl 5 has no "magic" cmp at all :-)
moritz_ -> shopping :/ 12:24
isBEKaml back 12:39
12:46 JimmyZ joined 12:49 iblechbot joined
dalek kudo: 7810dbe | (Solomon Foster)++ | build/PARROT_REVISION:
Bump parrot version to get string fixes.
12:54
kudo: f8ca417 | (Solomon Foster)++ | src/core/Real.pm:
Add Real and Num versions of the numeric comparison operators.
13:00 Su-Shee left, gbacon left, bloonix left, skangas left, mdxi left, kcwu left, dhoss left, pnu left, moritz_ left
masak moritz_: I just pushed a commit to the web/ directory of proto, adding a bunch of .png icons. haven't seen the updated result on the site yet, but I'm guessing these will have to be copied somewhere, somehow. 13:02
jnthn masak: What does "FRESH" mean? 13:05
masak jnthn: update within the past 90 days.
jnthn OK.
Nice idea - maybe good to have a key at the bottom that explains that? :-)
masak or simply a better hover text :P 13:06
13:06 Su-Shee joined, gbacon joined, bloonix joined, skangas joined, mdxi joined, kcwu joined, dhoss joined, pnu joined, moritz_ joined, card.freenode.net sets mode: +o moritz_
jnthn Ooh, yes, even better. 13:07
jnthn doesn't have a proto checkout on this machine...not sure if I have commit access either, thorugh probably.
masak who doesn't these days? ;) 13:08
13:08 k23z__ joined
jnthn pulls the latest Rakudo and book 13:09
moritz_ masak: you could add a homepage to the github proto page 13:10
JimmyZ ls
masak moritz_: good idea.
masak does so
diakopter pmurias: hi 13:20
pmurias_: hi
pmurias: I'm still trying to debug my broken code... 13:22
masak moritz_: hm. the proto.perl6.org site is updated now, save for the icons. what do I do? 13:25
13:25 nihiliad joined
moritz_ masak: where should the icons come from? 13:32
masak: simplest solution: change build-project-list.pl to copy them to $output_dir 13:34
masak moritz_: good idea.
masak does that
moritz_ I didn't point the web server's DocumentRoot proto/web for security reasons 13:35
like, accidental execution of perl scripts as CGI or so 13:36
masak *nod* 13:37
isBEKaml if we're storing the project icons on proto too, shouldn't there be a way to upload these things too? Consider this a future enhancement. :) 13:38
diakopter masak: what was that test you ran the other day that showed the closure fail of current rakudo
masak diakopter: gosh, there have been so many... 13:39
diakopter the sub that returned a sub
masak diakopter: but try calling the same closure-returning sub twice, executing the things in some order...
diakopter: maybe just grep for my name and 'sub foo' in the logs?
diakopter heh
masak :P 13:40
dalek meta: r248 | diakopter++ | trunk/Sprixel/ (6 files):
[perlesque] Callable[:(OptionalParamTypes --> ReturnType)] as a type now *works*
diakopter pmurias: ping
masak moritz_: hope this works. github.com/masak/proto/commit/09f01...0e320a2db7 13:42
moritz_ masak: testing it now... 13:43
of course a cp *.png might work too :-)
13:44 JimmyZ left 13:45 _jaldhar joined
isBEKaml calls it an early night. Night, #perl6! :) 13:45
moritz_ sleep well 13:46
masak isBEKaml: 'night!
13:46 isBEKaml left
moritz_ masak: icons seem to work 13:47
masak \o/
dalek meta: r249 | diakopter++ | trunk/Sprixel/t/parse_bug.t:
[perlesque] fix now-broken test since perlesque now requires the return type to

closure signatures.
pmurias diakopter: hi 13:48
diakopter pmurias: found another bug; still fixing
masak if someone sees a way to improve on the icons, feel free. I can draw, but it's not my forte.
13:49 jaldhar_ joined, _jaldhar left
moritz_ would suggest an opened book for "README", but can't draw 13:51
masak I like the idea. lurkers, give it your best shot! 13:52
moritz_ and a stethoscope for tests
masak :)
moritz_ and maybe a clock for "fresh" 13:53
13:53 jaldhar_ left 13:54 jaldhar_ joined 13:55 jaldhar_ left, jaldhar_ joined
moritz_ maybe thejoyofsix.org should collect similar things as perl6.org/fun/ 13:55
snarkyboojum looks like there's data for an "is popular" badge as well
moritz_ snarkyboojum: yes, but we (that is, masak++) decided against it 13:56
snarkyboojum ah
masak snarkyboojum: I can explain to you why if you want. :)
short story: it promotes the wrong values.
snarkyboojum was thinking along those lines
does proto have tests (not sure how you'd test it but..) 13:58
masak moritz_: if you don't put a lot of risqué innuendo on thejoyofsix.org, I'll be very disappointed :) 13:59
snarkyboojum: been thinking about developing a 'testable core' to proto.
snarkyboojum: haven't gotten around to it.
snarkyboojum rightio
you're a busy man - no doubt about it :) 14:00
masak it's my own fault. I chose to become interested in this language community where almost everything is up for grabs :)
masak gets back to his code analyzing time-traveling graphical class explorer 14:01
snarkyboojum heh
masak snarkyboojum: speaking of which, where do we stand on tardis?
snarkyboojum I haven't changed much since I pushed that branch 14:02
masak snarkyboojum: my plan for the month is basically getting sigmund going. preferably before my talk in Moscow.
snarkyboojum which is to say, v. basic yapsi integration
masak v. basic yapsi integration is still good news.
snarkyboojum++
snarkyboojum masak: well it works, but you probably want to take a look :)
masak I think I realized that we won't be able to get at $OUTER::a with the current API to Yapsi. 14:03
we'll need to do something about that.
apart from that, the best thing that could happen to Tardis is probably subroutines in Yapsi :)
snarkyboojum right, nested blocks currently break with find-var or whatever it is 14:04
masak ouch.
snarkyboojum in tardis that is
masak is there a failing test?
snarkyboojum checks
oh right.. tests :) they need completely updating 14:05
masak :)
snarkyboojum I'll get onto that in the yapsi-integration branch then :)
masak \o/ 14:14
14:18 cognominal left 14:20 cognominal joined
pugssvn r30590 | colomon++ | [t/spec] A bunch of Real to Real comparison tests. 14:24
14:28 JimmyZ joined 14:36 felipe joined, JimmyZ left 14:39 JimmyZ joined 14:42 barney left 14:44 mberends joined
dalek kudo: 91501c7 | (Martin Berends)++ | Test.pm:
[Test.pm] emit per-test timestamps only if PERL6_TEST_TIMES is set
14:47
kudo: e30bcb0 | (Martin Berends)++ | tools/test_summary.pl:
[tools/test_summary.pl] record test timings in JSON format in docs/test_summary.times
moritz_ mberends: pleasae .gitignore the generated file 14:49
mberends ok moritz_++ 14:51
JimmyZ rakudo: say 1 if 1;
p6eval rakudo ab2322: OUTPUT«1␤»
JimmyZ rakudo: say if 1;
p6eval rakudo ab2322: OUTPUT«␤»
mberends moritz_: it was already .gitignored from previous work :) 14:52
moritz_ mberends: ah, great
masak rakudo: say 14:53
p6eval rakudo ab2322: OUTPUT«␤»
masak alpha; say
alpha: say
p6eval alpha 30e0ed: OUTPUT«say requires an argument at line 10, near ""␤in Main (file src/gen_setting.pm, line 2593)␤»
JimmyZ rakudo: say if if 1; 14:54
p6eval rakudo ab2322: OUTPUT«Could not find sub &if␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
JimmyZ rakudo: sub if() { '2' }; say if if 1;
p6eval rakudo ab2322: OUTPUT«Too many positional parameters passed; got 1 but expected 0␤current instr.: 'if' pc 210 (EVAL_1:44870260)␤»
JimmyZ rakudo: sub ifs() { '2' }; say ifs if 1; 14:55
p6eval rakudo ab2322: OUTPUT«2␤»
JimmyZ bug?
rakudo: sub if() { '2' }; say if;
p6eval rakudo ab2322: OUTPUT«␤»
14:55 kfo_ joined
masak o.O 14:55
JimmyZ rakudo: sub if() { '2' }; say if();
p6eval rakudo ab2322: OUTPUT«2␤»
masak std: say if 14:56
p6eval std 30590: OUTPUT«===SORRY!===␤Undeclared routine:␤ 'if' used at line 1␤Potential difficulties:␤ Unsupported use of bare 'say'; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument at /tmp/Kl15RUYHeZ line 1:␤------> say⏏
..if␤Check fa…
masak rakudo: say if
p6eval rakudo ab2322: OUTPUT«Could not find sub &if␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
masak submits rakudobug
mberends masak: who would ever have imagined that proto (obviously a throwaway name) would become a hostname. What's next? A domain name? An RFC? A proto-col? 14:57
JimmyZ rakudo: my @a = 1, 2, 3; say (1 .. ^@a).perl.say
p6eval rakudo ab2322: OUTPUT«1..0..^[1, 2, 3]␤1␤»
JimmyZ alpha: my @a = 1, 2, 3; say (1 .. ^@a).perl.say
p6eval alpha 30e0ed: OUTPUT«1..0..^3␤1␤»
14:57 wknight8111 left
masak mberends: :P 14:57
JimmyZ masak: Is it another bug?
14:58 kfo left, kfo_ is now known as kfo
JimmyZ rakudo: my @a = 1, 2, 3; ^@a.perl.say 14:58
p6eval rakudo ab2322: OUTPUT«[1, 2, 3]␤»
moritz_ rakudo: my @a = 1, 2, 3; say (0 ..^ @a).perl 14:59
p6eval rakudo ab2322: OUTPUT«0..^[1, 2, 3]␤»
JimmyZ alpha: my @a = 1, 2, 3; (1 ... ^@a).perl.say
p6eval alpha 30e0ed: OUTPUT«don't know how to handle a right-hand side of[0, 1, 2]in series operator␤in sub »
JimmyZ rakudo: my @a = 1, 2, 3; (1 ... ^@a).perl.say
p6eval rakudo ab2322: OUTPUT«(1)␤»
JimmyZ alpha: sub take() { 'hi' }; say take; 15:02
p6eval alpha 30e0ed: OUTPUT«hi␤»
JimmyZ alpha: say take;
p6eval alpha 30e0ed: OUTPUT«too few positional arguments: 0 passed, 1 (or more) expected␤in Main (file <unknown>, line <unknown>)␤»
JimmyZ rakudo: sub take() { 'hi' }; say take; 15:03
p6eval rakudo ab2322: OUTPUT«hi␤»
finanalyst rakudo: my @x=-2,1.2,-1.4,0.2; say @x.max: { .abs }
p6eval rakudo ab2322: OUTPUT«Too many positional parameters passed; got 2 but expected between 0 and 1␤current instr.: '_block62' pc 440 (EVAL_1:22350388)␤»
finanalyst alpha: my @x=-2,1.2,-1.4,0.2; say @x.max: { .abs } 15:04
p6eval alpha 30e0ed: OUTPUT«-2␤»
JimmyZ rakudo: sub take() { 'hi' }; say ~ gather { for 1 .. 5 -> $_ { take $_; } }
p6eval rakudo ab2322: OUTPUT«Too many positional parameters passed; got 1 but expected 0␤current instr.: 'take' pc 211 (EVAL_1:25854642)␤»
jnthn rakudo: role R { method m { say 42 } }; R.m
p6eval rakudo ab2322: OUTPUT«Could not find sub &say␤current instr.: 'perl6;R[];m' pc 537 (EVAL_1:22350453)␤»
JimmyZ rakudo: sub take() { 'hi' }; say [~] gather { for 1 .. 5 -> $_ { take $_; } }
p6eval rakudo ab2322: OUTPUT«Too many positional parameters passed; got 1 but expected 0␤current instr.: 'take' pc 245 (EVAL_1:22350334)␤»
JimmyZ rakudo: sub take() { 'hi' }; say [~] gather { for 1 .. 5 -> $_ { take $_; } }; say take
p6eval rakudo ab2322: OUTPUT«Too many positional parameters passed; got 1 but expected 0␤current instr.: 'take' pc 265 (EVAL_1:96)␤»
15:04 pmurias_ left
moritz_ JimmyZ: if you don't declare take() as a multi, you hide all the outer candidates 15:04
JimmyZ rakudo: multi sub take() { 'hi' }; say [~] gather { for 1 .. 5 -> $_ { take $_; } }; say take 15:05
p6eval rakudo ab2322: OUTPUT«No applicable candidates found to dispatch to for 'take'. Available candidates are:␤:()␤␤current instr.: '_block85' pc 657 (EVAL_1:30333074)␤»
JimmyZ rakudo: say [~] gather { for 1 .. 5 -> $_ { take $_; } }; say take
p6eval rakudo ab2322: OUTPUT«12345␤too few positional arguments: 0 passed, 1 (or more) expected␤current instr.: '&take' pc 18249 (src/builtins/Capture.pir:129)␤»
jnthn I suspect that take is not currently defined as a multi.
finanalyst moritz_: is sort broken when a callable is supplied?
jnthn So even declaring a multi hides the one in the setting.
moritz_ finanalyst: don#t think so
JimmyZ alpha: multi sub take() { 'hi' }; say [~] gather { for 1 .. 5 -> $_ { take $_; } }; say take 15:06
p6eval alpha 30e0ed: OUTPUT«push_pmc() not implemented in class 'Sub'␤in Main (file <unknown>, line <unknown>)␤»
moritz_ jnthn: should it be multi? I'd think so...
JimmyZ alpha: sub take() { 'hi' }; say [~] gather { for 1 .. 5 -> $_ { take $_; } }; say take
finanalyst rakudo: my @x=-2,1.2,-1.4,0.2; say @x.max: { .abs }
p6eval alpha 30e0ed: OUTPUT«Too many positional parameters passed; got 1 but expected 0␤in Main (file src/gen_setting.pm, line 324)␤»
rakudo ab2322: OUTPUT«Too many positional parameters passed; got 2 but expected between 0 and 1␤current instr.: '_block62' pc 440 (EVAL_1:22350388)␤»
moritz_ finanalyst: what has it got to do with sort?
finanalyst sorry. max
moritz_ rakudo: my @x=-2,1.2,-1.4,0.2; say @x.sort( { .abs })[0] 15:07
JimmyZ alpha: say gather
p6eval rakudo ab2322: OUTPUT«0.2␤»
alpha 30e0ed: OUTPUT«too few positional arguments: 0 passed, 1 (or more) expected␤in Main (file <unknown>, line <unknown>)␤»
JimmyZ rakudo: say gather
p6eval rakudo ab2322: OUTPUT«Could not find sub &gather␤current instr.: '_block14' pc 29 (EVAL_1:0)␤»
colomon finanalyst: max can take a closure which takes two arguments (ie a comparison function) but not one which takes just one.
yet, that's not up to spec.
though the spec is kind of vague, as I recall.
finanalyst colomon: max worked in alpha 15:08
with one argument
colomon Anyone one a copy of Programming Languages: Principles and Practice by Kenneth C. Louden? State of the art circa 1992....
moritz_ has blogged: perlgeek.de/blog-en/perl-6/list-classify.html
finanalyst: that doesn't mean it's spec :-) 15:09
15:09 mberends left
finanalyst well it was consistent with sort 15:09
colomon I think it should be spec, but the spec is funky here.
moritz_ we can certainly talk about making it spec 15:10
colomon It takes an "Ordering" argument, which might be a closure
but "Ordering is as described in "Type Declarations""
and that section isn't there, as far as I can tell.
but maybe I'm just not looking in the right place.
gotta run to the farmer's market....
moritz_ S29:138 subset Ordering where Signature | KeyExtractor | Comparator | OrderingPair | Whatever 15:11
JimmyZ alpha: sub gather($a) { 'hi'; }; say gather { take $_; }
p6eval alpha 30e0ed: OUTPUT«hi␤»
moritz_ let's say "huh"
masak moritz_: nice post.
JimmyZ rakudo: sub gather($a) { 'hi'; }; say gather { take 'oh; }
p6eval rakudo ab2322: OUTPUT«Unable to parse blockoid, couldn't find final '}' at line 11␤current instr.: 'perl6;Regex;Cursor;FAILGOAL' pc 1696 (ext/nqp-rx/src/stage0/Regex-s0.pir:932)␤»
finanalyst if you compare the specs for sort, min and max, they are all similar, which they should be. So why do they work differently?
JimmyZ rakudo: sub gather($a) { 'hi'; }; say gather { take 'oh'; }
moritz_ masak: thanks. I kinda feel it lacks a strong finish
p6eval rakudo ab2322: OUTPUT«oh␤»
JimmyZ rakudo: sub gather($a) { 'hi'; }; say gather { take $_; } 15:12
p6eval rakudo ab2322: OUTPUT«Any()␤»
masak moritz_: I like the finish. it currently has me thinking back over recent code. :)
JimmyZ alpha: sub gather($a) { 'hi'; }; say gather { take $_; }
p6eval alpha 30e0ed: OUTPUT«hi␤»
JimmyZ alpha: sub gather($a) { 'hi'; }; say gather { take 'hello'; } 15:13
p6eval alpha 30e0ed: OUTPUT«hi␤»
15:13 [Coke] left
JimmyZ rakudo: sub gather($a) { 'hi'; }; say gather { take 'hello'; } 15:13
p6eval rakudo ab2322: OUTPUT«hello␤»
JimmyZ which one is right?
alpha: say gather { take 'hello'; } 15:14
p6eval alpha 30e0ed: OUTPUT«hello␤»
moritz_ rakudo: sub gather($a) { 'hi'; }; say gather { take('hello'); }
p6eval rakudo ab2322: OUTPUT«hello␤»
moritz_ that certainly should be "hi"
masak submits rakudobug
15:14 plobsing joined
JimmyZ and the 'take' ? 15:16
masak is never executed.
because it's in the closure passed as $a.
JimmyZ rakudo: sub take($a) { 'hi'; }; say gather { take 'hello'; } 15:17
p6eval rakudo ab2322: OUTPUT«␤»
JimmyZ alpha: sub take($a) { 'hi'; }; say gather { take 'hello'; }
p6eval alpha 30e0ed: OUTPUT«␤»
jnthn masak: Why should it be "hi"?
gather(...) is certainly a sub call
JimmyZ alpha: sub gather($a) { $a(); }; say gather { take 'hello'; } 15:18
p6eval alpha 30e0ed: OUTPUT«take without gather␤hello␤»
jnthn But gather { ... } need not be.
masak jnthn: you're right.
it's not a bug.
jnthn rakudo: sub gather($a) { say "hi" }; say gather({ take ('hello') }) 15:19
masak I now think one has to use () to distinguish the function call from the statement prefix.
p6eval rakudo ab2322: OUTPUT«hi␤1␤»
masak nothing to see here, move along :)
JimmyZ alpha: sub gather($a) { gather $a(); }; say gather { take 'hello'; }
jnthn And we get it right there. (phew) :-)
p6eval alpha 30e0ed: OUTPUT«maximum recursion depth exceeded␤in Main (file <unknown>, line <unknown>)␤»
masak JimmyZ: you need {} after 'gather'.
JimmyZ alpha: sub gather($a) { gather {$a()}; }; say gather { take 'hello'; }
p6eval alpha 30e0ed: OUTPUT«maximum recursion depth exceeded␤in Main (file <unknown>, line <unknown>)␤» 15:20
JimmyZ alpha: sub gather(Code $a) { gather {$a()}; }; say gather { take 'hello'; }
p6eval alpha 30e0ed: OUTPUT«maximum recursion depth exceeded␤in Main (file <unknown>, line <unknown>)␤»
masak hm.
JimmyZ rakudo: say ({take 'hello';}).WHAT
p6eval rakudo ab2322: OUTPUT«Block()␤»
JimmyZ alpha: sub gather(Blocak $a) { gather {$a()}; }; say gather { take 'hello'; }
p6eval alpha 30e0ed: OUTPUT«Malformed routine definition at line 10, near "gather(Blo"␤in Main (file <unknown>, line <unknown>)␤» 15:21
JimmyZ alpha: sub gather(Block $a) { gather {$a()}; }; say gather { take 'hello'; }
p6eval alpha 30e0ed: OUTPUT«maximum recursion depth exceeded␤in Main (file <unknown>, line <unknown>)␤»
JimmyZ alpha: sub gather(Block $a) { gather $a(); }; say gather { take 'hello'; }
p6eval alpha 30e0ed: OUTPUT«Nominal type check failed for parameter '$a'; expected Block but got Code instead␤in Main (file src/gen_setting.pm, line 324)␤»
pugssvn r30591 | moritz++ | [S32] sub form of min, max and minmax take the ordering argument by name
r30591 |
r30591 | Otherwise it would be too confusing that max(1, 2, 3) takes the 1 as
r30591 | comparison criterion.
dalek kudo: 30ac13b | jonathan++ | src/Perl6/Compiler/Role.pm:
Partially fix the role + lexical setting issue (but not completely :-/).
15:22
kudo: b52bbee | jonathan++ | src/glue/dispatch.pir:
Make $obj.RoleName::method() calls work.
15:22 mberends joined
JimmyZ if I create 'take' sub by myself, then I can't use the 'take sub of perl 6 ? 15:23
15:23 jonrafkind joined
moritz_ does it say anywhere that take is a sub? 15:23
JimmyZ someone said take is a sub 15:24
an gather isn't
and gather isn't
moritz_ not good enough :-)
masak S04 says it's a 'list prefix operator'. 15:25
OTOH, in the next sentence it calls it a function. :P
but that's not a contradiction in Perl 6, I guess. 15:26
moritz_ right
masak S04 is full of mentions of the 'take function'.
I'd certainly expect that if you overrode it, you'd get your version, not the original one.
moritz_ I guess you can access &OUTER::say once that's implemented 15:27
masak &OUTER::take? yes, certainly.
or do a nextsame or something.
JimmyZ nextsame?
masak JimmyZ: S06.
JimmyZ ok, thanks 15:28
moritz_ nextsame works only if it's a multi
JimmyZ take is not a multi
masak or if you wrap the original &take.
moritz_ TIMTOWTDI 15:29
masak 'nextsame' tells the dispatcher to call the next candidate with the same arguments. as far as I know, there are three situations with such dispatchers: inheritance, multi dispatch, and wrapping.
I'm still on the lookout for interesting corner cases between these :)
TimToady and, with the newest change, it is specced to *start* the multi dispatcher within a proto 15:30
jnthn I suspect that whole ot needs to be ripped up and done again some day thanks to recent changes.
*lot
TimToady or the proto just automatically sets up the dispatcher on entry to a proto, and the nextsame just finds the first entry 15:31
masak jnthn: you remember that OO/Damian/nextwith issue? was there ever a followup to that?
TimToady that does less violence to the 'nextsame' semantics
jnthn masak: I don't think we got to a conclusive answer. 15:32
masak jnthn: neither do I.
but I hardly remember the issue.
jnthn Current Rakudo semantics are the sanest answer I have to date.
There are other ways, but I think they create worse problems.
moritz_ solution: don't let Damian anywhere near Perl6 :-) 15:33
TimToady or maybe we should make scanmulti a call that precedes nextsame
jnthn scanmulti?
TimToady find the candidates
masak moritz_: you joke, but I believe Damian has contributed some wonderful simplifications too.
jnthn Ah.
moritz_: I'm not sure that it was Damian who found the issue in the first place, fwiw. He just got roped into the discussion. :-) 15:34
masak moritz_: the eventual MMD resolution mechanism was partly his idea, IIRC.
TimToady then the magic is in scanmulti instead of overloading nextsame inside a proto
moritz_ yes, I do joke
masak yeah, jnthn showed me some scary internals, we both went 'wtf?' and then we went and talked to Damian, who also looked puzzled.
moritz_ and I don't want to diminish TheDamian++'s contributions to perl6 in any way
TimToady which issue was this? 15:35
masak wishes he remembered the details
jnthn TimToady: If you do nextwith/callwith and provide arguments of different types than the initial call.
masak ah, right. 15:36
you end up outside of the already collected set of candidates.
jnthn However, we already computed our candidates based on the origian arguments.
TimToady right
jnthn *original
So the dispatch fails
Which by me is completely fine.
TimToady this seems fine to me
jnthn (the nextwith/callwith fails, I menat) 15:37
Oh, good. :-)
masak so simple!
TimToady nextwith is just for lying to the candidates you already have
if you want a new dispatch, you know where to find it
jnthn *nod* 15:38
moritz_ if you do &?ROUTINE($args), will it do a fresh multi dispatch?
or will it instead try to call this very candidate we're in?
TimToady I don't think so
not unless &?ROUTINE is a proto
masak rakudo: class A { method foo(Str $a) { say "A" } }; class B is A { method foo($a) { say "B"; nextwith(42) } }; B.new.foo("OH HAI")
p6eval rakudo ab2322: OUTPUT«B␤Nominal type check failed for parameter '$a'; expected Str but got Int instead␤current instr.: 'perl6;A;foo' pc 432 (EVAL_1:22350418)␤» 15:39
masak \o/
TimToady .() there is a low-level invoke
and now it's *always* a low-level invoke
and you get multi dispatch by low-level invoking a proto
masak rakudo: class A { multi method foo(Str $a) { say "Str" }; multi method foo(Int $a) { say "Int" } }; class B is A { method foo($a) { say $a; nextwith(42) } }; B.new.foo("OH HAI") 15:40
p6eval rakudo ab2322: OUTPUT«OH HAI␤Int␤»
masak should that work?
TimToady so .() never has to worry about multis anymore
masak the Int multi candidate is not in the initial set of candidates.
TimToady multis are ignore by the .() dispatcher
masak ah, so it should worK?
jnthn masak: Multi dispatch is a nested dispatch
TimToady .() only looks for an only/proto
that's that long-term plan 15:41
not the current setup
masak *nod*
jnthn We only look for candidates at the current inheritance "level".
masak when you say .() dispatch, that's as opposed to which other dispatches?
TimToady .method() dispatch
jnthn We don't go looking all the way up the tree until a nextwith requires us to do so
masak ok.
jnthn Since most of the time we don't need such candidates since we don't usually defer. 15:42
TimToady but the same principle holds there now too
masak seems sane.
TimToady .method() just looks for an ordinary method or proto
jnthn I *hope* that aspect of things hasn't changed.
In which case we *may* get away with just changing Rakudo's multi dispatcher and the method one can mostly stay as it is.
TimToady the difference there now is that the proto method can call multis in subclasses too 15:43
jnthn And it may not even be quite as bad a change as I fear, but it's still going to hurt.
TimToady: Please no.
TimToady please yes
jnthn TimToady: Don't do that.
TimToady you don't have to do it for Rakudo *
the current semantics fall out if you put a proto in any class with multis
jnthn I don't want to do it at all. It seems to completely mess up the idea of the multi dispatch being a nested dispatch. 15:44
TimToady it's very consistent, and I think you'll see that eventually :)
jnthn :-/
TimToady it's still a nested dispatch, just just that a method proto finds a different set of candidates 15:45
that's all
jnthn But then the method proto needs to know about the fact that it's in a class hierarchy.
TimToady and that's already how regexes have to work their protos
methods are supposed to know that!!!
that's what makes 'em methods :)
jnthn No 15:46
A class has methods
The dispatcher knows about the hierarchy.
It finds said methods.
masak I must admit that I initially expected multis to dispatch across inheritance relations. haven't completely ingested the new spec changes, but I think they now match my initial expectations.
jnthn I find this very clean.
Well, a class knows about is parents of course 15:47
But my point was more that the dispatcher finds the methods by looking at the class.
Or classes
And then just calls 'em.
And the methods themselves don't really care so much about what class they are in, or how they got called. 15:48
TimToady well, protos are always special that way
that's why they're protos
jnthn Does this mean we're going to be doing the "auto-generated proto" kind of thing too?
TimToady well, we have a choice 15:49
when we see a multi that has no proto around it
we can either generate one, or fail
bare multis can never be called
well, I suppose they can be exported into a proto's scope
jnthn That would make class C { multi method m() { say 42 } }; C.m # fail
Because there's no proto? 15:50
masak o.O
moritz_ sounds too complicated for the user
TimToady unless there's a generic proto in some base class like Any, which theyre might be
*there
masak :-/
that will invalidate a lot of existing code. 15:51
TimToady we already have 10 users...
moritz_ doesn't really see the need for such a deep change 15:52
masak TimToady: I know this was what I signed up for as an early adopter. so I'm not really complaining.
jnthn TimToady: "generic proto"
masak TimToady: but... are you sure there's a need to break things?
JimmyZ another revolution?
jnthn masak: I'm mostly complaining because I'm not sure I have the motivation to do such an epic re-write of something I've spent the last two years trying to get in shape against the spec...before it changed. :-/ 15:53
masak jnthn: I can see that.
jnthn Which is fine, because stuff getting done doesn't only depend on me.
15:53 mberends left
moritz_ not only, but mostly :( 15:54
jnthn But, well...I don't see many others hacking on this area.
masak jnthn: I can also kinda glimpse the consistency TimToady is talking about.
jnthn masak: Me too.
I do like the idea of drawing proto regex semantics and proto method semantics closer together.
masak but I don't like the fact that one how needs to declare a proto.
jnthn: me too. 15:55
that seems fundamentally sane.
15:56 JimmyZ left
moritz_ insane 15:57
masak the need to declare a proto for multis, yes. 15:58
the unification of regex and method proto semantics seems fundamentally sane.
jnthn Yes, making users declare a proto is a bit...ugh. OTOH, does the unification argue for having the proto regex protos auto-generate too if the method ones are going to. 15:59
TimToady please note that I said we had a choice there; I have not made that choice
jnthn TimToady: Aye, but one of the choices feels...very unfriendly.
TimToady giving people control when they need it is not unfriendly
defaulting to a global proto when they don't is also not unfriendly 16:00
jnthn Making them write a proto with every multi, rather than it being an option, otoh...
TimToady why are you guys panicking? I never said that
jnthn I don't get "global proto" really.
masak panics a bit less
jnthn TimToady: Maybe not, but multiple of us seem to have taken it that way. :-)
jnthn too 16:01
TimToady: Can you elaborate on what "global proto" would mean?
TimToady if for any foo() there's a (yes, generated), proto foo (|$anything_you_like) {} then I don't see much problem
whatever the least-specific signature is 16:02
jnthn *nod*
TimToady it's just a proto that allows any kind of multi in in
in it
masak does that go for multi methods too?
TimToady probably generated at the UNIT level
yes, a generic proto method in Any, or some similar place 16:03
note, however, that means a multi method could call candidates both higher and lower in the class hierarchy
to limit it to subtypes, you'd put a proto in your class
just as to limit multi subs to a lexical scope 16:04
you put a proto in that scope
16:05 hercynium left
TimToady presumably the pecking order of multi methods can be tweaked to make sure ties between class break in favor of Liskov, if that's a problem 16:05
masak TimToady: so when I declare my first multi .foo in Foo, a proto .foo gets installed in Any? 16:07
jnthn Any.methods is gonna look great. ;-)
masak without MONKEY_TYPING?
jnthn I think they'd have to be "hidden" in some way, or just "exist in theory" or something. 16:08
well
that won't work either
hmm
moritz_ or is there an Any.GENERIC_PROTO?
TimToady it might just get installed in the parentest class that needs it
masak this feels very magical. 16:09
TimToady as in "if you were to put an explicit proto, this is where you'd have put it"
moritz_ that seems to introduce a fundamental asymmetry between classes and roles
TimToady there wasn't one already? :)
moritz_ another one, I might say :-) 16:10
TimToady masak: magic is fine if it's the right magic
masak absolutely.
TimToady likewise, instead of just poking a proto into UNIT, it could go into the first lexical scope that actually uses a multi 16:11
masak but in essence, this is the kind of magic that causes definition of new classes to slip a proto into some parenter class, without the need for MONKEY_TYPING.
TimToady this might be suboptimizal though, if you're expecting multis in different scopes to "share"
moritz_ "this magic needs more magic"
TimToady masak: something like that, and we could shield the user from that to some extent, even, if we don't tell them those methods are there unless they ask specifically 16:12
if we decided that was a good thing
at least clump the proto methods in a group that can be ignored easily :)
masak I'll withhold judgment until I see this actually implemented somewhere. :) 16:13
if it's really that bad, the poor implementors will complain enough anyway.
TimToady it's also not clear to what extent that different modules will want to share the same set of default protos; but this is something we'd have to deal with anyway, under MI 16:14
colomon woah, tools/test_summary.pl just blew up badly for me. :( 16:15
Ah, it's been upgraded to require 5.10, I guess?
TimToady but I find it fundamentally comforting that any ordinary dispatch, whether functional or methodical, is looking only for a single thing to invoke, and that thing we invoke does a delegation to handle all cases of multi, and that delegation is customizable at that single point 16:16
moritz_ colomon: the only 5.10ism I spot is line 253
colomon: easy enough to change to || 16:17
TimToady and I don't see it as being that hard to get to, more of a code rearrangement of where the candidate list is calculate, but nextsame etc don't change at all
*calculated
lisppaste3 colomon pasted "tools/test_summary.pl messages" at paste.lisp.org/display/98961
moritz_ colomon: yep, change // to || on that line 16:18
colomon moritz_: was just running it using 5.10. :) but I blew a lot of error messages, so I've stopped that. 16:19
5.10 just isn't my default perl.
wow, a bit disturbed at how casually I've thrown cmp's using complex numbers about the code. Mr. Foster, those do not work! (yet) 16:21
masak std: sub if() { '2' }; say if;
p6eval std 30591: OUTPUT«Potential difficulties:␤ Unsupported use of bare 'say'; in Perl 6 please use .say if you meant $_, or use an explicit invocant or argument at /tmp/uedzAGDWOF line 1:␤------> sub if() { '2' }; say⏏ if;␤ok 00:01 113m␤»
masak o.O
so... it's OK... but I shouldn't use a bare 'say'... 16:22
what?
moritz_ std: sub foo(); foo if;
p6eval std 30591: OUTPUT«===SORRY!===␤Missing block at /tmp/IGEo2r594o line 1:␤------> sub foo()⏏; foo if;␤ expecting any of:␤ block␤ new name to be defined␤ param_sep␤ routine_def␤ signature␤ trait␤Parse failed␤FAILED 00:01 111m␤»
diakopter backtracking?
masak diakopter: possibly.
diakopter: rakudo currently does something very similar, as uncovered by JimmyZ++ earlier. 16:23
TimToady if is currently considered a terminator, as are all statement modifiers 16:24
and terminators are slightly keywordish
masak why then is the statement not an error?
the 'if' needs to be followed by an expression if it's parsed as a keyword, no? 16:25
TimToady you'd think
masak std: "OH HAI" if;
p6eval std 30591: OUTPUT«===SORRY!===␤Undeclared routine:␤ 'if' used at line 1␤Check failed␤FAILED 00:01 110m␤»
masak case in point.
TimToady well, LTA error there
masak aye. 16:26
TimToady but it shows characteristics of parsing something both as a terminator and then as a term, which is a bit odd, so probably either 16:27
1) some unnecessary backtracking, or
2) something not properly hidden inside a "suppose"
masak this all goes into the ticket.
TimToady std: sub if() { '2' }; say if(); 16:28
p6eval std 30591: OUTPUT«ok 00:01 111m␤»
TimToady and overriding the standard control words typically requires parens on the call anyway, since the control words typically steal the listop LTM slot 16:29
but anyone who writes "say if;" probably deserves a WTF sort of error message anyway :) 16:30
masak yes, but not this: 16:31
rakudo: sub if() { '2' }; say if;
p6eval rakudo ab2322: OUTPUT«␤»
diakopter std: say but but but
p6eval std 30591: OUTPUT«===SORRY!===␤Undeclared routine:␤ 'but' used at line 1,1,1␤Check failed␤FAILED 00:01 110m␤»
diakopter heh; 1,1,1
16:35 justatheory joined
masak rakudo: subset Foo where Whatever; say 1 ~~ Foo 16:36
p6eval rakudo ab2322: OUTPUT«0␤»
masak moritz_: good call on the 'Ordering' commit... but I don't see how 1 would smartmatch on Ordering in the first place. care to explain? 16:37
moritz_ masak: I'm not quite sure; I don#t understand Ordering well enough 16:38
masak: I just observed the behaviour in Rakudo
(which might get the Ordering wrong, though) 16:39
masak it probably does, then.
but as I said, I agree with the commit in general.
even if Rakudo has Ordering wrong, the change will prevent other thinkos.
moritz_ even then I think it's less confusing than getting a type check error
or a no multi to dispach to-error
masak exactly. 16:41
16:41 sundar joined
moritz_ tries to come up with a non-contrieved example for an only sub with a where-block constraint 16:43
masak sub advance_monopoly_piece(Int $steps where * > 0) { ... } 16:44
TimToady I don't think Ordering should be thought of as much of a constraint, since almost anything can smartmatch
so I agree with making it named
masak S29 thinks of Ordering as a constraint. 16:45
TimToady no much of a
*not
TimToady blames the high pollen count getting into his keyboard--yeah, that's the ticket
colomon is very confused by all this 16:46
TimToady oh wait, I'm thinking of something else
masak Matcher? 16:47
also defined in S29, by the way.
moritz_ right, Matcher is basically Any | Mu 16:48
erm
TimToady yes, Matcher
moritz_ Any|Junction
TimToady Mu where none(Bool) :)
so Ordering is more of a constraint, yes
colomon seems like we need to be able to convert Ordering to a comparison sub.
else there will be loads of boilerplate duplication in min, max, etc 16:49
TimToady if there is no intersection between the Ordering types and the types that do Orderable (or whatever role it is), then the argument for named becomes not so strong 16:51
moritz_ unless we want to make it optional
TimToady that is, I kinda agree that 1 does not look like a valid ordering 16:52
colomon afk
TimToady yes, well, then we'll have fights over whether you should write min(1,2,3) or [min](1,2,3) :)
moritz_ doesn't want to write that FAQ entry 16:53
masak clearly we should all write [1,2,3].min 16:56
moritz_
.oO( clearly there should be less ways to do it )
16:57
my proposal on p6l for removing the sub forms wasn't greeted very positively
masak rawr! 16:58
moritz_ OTOH I should probably stop listen to them (or asking them in the first place )
huh 16:59
it seems we don't really talk about smart matching anywhere in the book
masak p6l exists to convince you that your original proposal isn't so overboard after all :P
moritz_ speaking of overboard...
anyone else agrees that the @by ordering seems a bit excessive? 17:00
and that having a type constraint on an Array parameter lowers the chances of a successful dispatch? 17:01
rakudo: say 2.3 ~~ 0..*
p6eval rakudo ab2322: OUTPUT«Method 'Num' not found for invocant of class 'Block'␤current instr.: 'perl6;Mu;' pc -1 ((unknown file):-1)␤»
moritz_ alpha: say 2.3 ~~ 0..*
p6eval alpha 30e0ed: OUTPUT«012␤»
moritz_ wow
I guess 0..* shouldn't blindly whatever-curry 17:02
colomon moritz_: I think the @by ordering is pretty cool. 17:03
though obviously the create user could easily generate his own version.
TimToady hmm 17:06
std: subset Ordering where Signature | KeyExtractor | Comparator | OrderingPair | Whatever | Positional[Ordering];
p6eval std 30591: OUTPUT«ok 00:01 112m␤»
TimToady recursive subset!
colomon my mind was already blown by the possibility of | in subsets.
recursive might make my brains melt. 17:07
moritz_ anyway, I agree that we should have consistency in the interfaces of min, max, minmax and sort
dalek ok: f6d54a7 | moritz++ | src/subs-n-sigs.pod:
[subs] where-blocks on parameters
17:09
colomon feels like he is still groping for the right way to thing about Ordering... 17:10
there's one important different (IMO) between Ordering for sort and min/max/minmax 17:12
moritz_ btw I found a bug in List.classify 17:13
it stringifies the Pair keys
colomon moritz_: right, I assumed you knew that. :)
moritz_ rakudo: say (1, 1.1, 2).classify( { .floor }).perl
p6eval rakudo ab2322: OUTPUT«("2" => [2], "1" => [1, 11/10])␤»
TimToady hmm, if the default with an unspecified ordering is to try a multi dispatch on, say, the first two items, and if we want to assume that the rest of the items use the same ordering, then we maybe want some way of capturing the ordering candidate that was actually found, depending on the dwim level 17:14
colomon with sort, one prefers to get the one-arg form but can deal with getting a comparison operator
TimToady is key stringification just a rakudo limitation?
moritz_ I know how it can be fixed, but it's costly and probably not worth the effort
colomon with min/max/minmax, you pretty much always want a comparison function.
TimToady: hashes have to have Str keys at the moment.
moritz_ TimToady: rakudo stringifies hash keys, and List.classify uses hashs 17:15
bug in Pairs there's no such restriction
colomon: why would you pretty much always want a comparison function with min or max?
colomon: most of my uses of List::Util qw(max) in Perl 5 are quire straight forward
TimToady 99% of min/max will be straight numeric 17:16
99% of sort will be strings
colomon moritz_: I'm talking internally, not from the user's point of view. 17:17
with sort, you want to do a Schwartzian transform if possible
if min/max, you want to do comparisons.
(hmmm... I think ... could be wrong about the last) 17:18
TimToady well, depends on how structured your numbers are :)
you might want the min mod some number, for instance 17:19
or the number is really some kind of employee id that the middle n digits means something particular 17:20
or the number is an index into an array that has the actual comparison values 17:21
I think there's more potential overlap than you might think
but as I say, that's in the 1%, not the 99%
to me, the main question is whether the default should be forced, or dwimmy 17:22
generally, we've been going for dwimmy
on anything having to do with orderings
moritz_ so far I only had positive suprises with .sort :-) 17:23
TimToady I'm sure we can arrange some negative ones for you if you'd like...
moritz_ :/ 17:24
TimToady there are an astounding number of places to draw the line on dwimminess, depending on how much of the input we examine to guess, and how specific/generic we make our guess. 17:27
for instance, just the case of examining the first two arguments 17:28
if they are both of type Int, do we use Int's notion of <=> or something more generic?
what if we have 1 min 2.3
the sweet spot seems to be switching between Numeric and Stringy, but not assuming much more than that 17:29
moritz_ I knd think that Perl 5 programmers expect comparsion between numbers and positional to coerce to Numeric
TimToady and what do we do for 1 min "2"?
vs sort 1,"2"... 17:30
yes, my 99%s above leads me to think that people want a numeric bias some times, and a string bias other times
moritz_ so far rakudo coerces to Str in that case
TimToady sort should bias towards strings if there's doubt, but we really need something sane if we get a random mixture 17:31
with sort, at least we know we're supposed to be eager
17:31 molaf joined
TimToady so a solution that prescans the values is not out of the question 17:32
but it could be at a cost
moritz_ I wonder if Str should have a .looks-like-number mehod 17:33
TimToady one almost wants a call into an iterator that say "reify yourself eagerly and give me a type histogram"
moritz_ so that Numeric <=> Str could default to .Numeric coercion of .looks-like-number is true
TimToady well, yes, we need that in there somewhere, as a refinement of typology dwimmery 17:34
and we've done some tomfoolery with literals to make them pretend to be both numeric while remembering their original string
so maybe there's some kind of kinda-coerce-to-num-if-you-can method 17:35
that is the primitive underlying the currently specced behavior of literals like <1 2.3 foo>
or <+1-2i> for that matter 17:36
or <22/7>
moritz_ I'm still not sure if it's a good idea to inflict that magic on <...> by default
TimToady but a kinda-coerce sounds more Schwartzian than just re-blessing 17:37
I am
too many people were expecting it
moritz_ is there a quoting attribute that controls that magic?
17:37 sundar left
TimToady good question 17:37
moritz_ like Q:m<...> where :m stadns for "type magic" or so 17:38
TimToady probably worth defining one
moritz_ +1
TimToady :n for numeric, :d for dwim are both available, it seems 17:40
can't have :s for smart :) 17:41
moritz_ iirc <...> also dwims on colonpairs
so :n would not be enough
TimToady no, only «...» I thought...hmm... 17:42
moritz_ so :n for numeric, :p for pairs?
:t for typemagic
TimToady p is currently take for pathnames
*taken
qp[/etc/passwd] 17:43
moritz_ oh right
TimToady it doesn't really have to be short, if it's the default
hard thing that is possible, Q:!dwim<...>
"don't do what I mean" :) 17:44
:D even
17:44 BrowserUk joined
TimToady :!DWIM :D 17:45
moritz_ as long as it's not default on Q :-)
TimToady yes, well, it shouldn't be, nor on '' or ""
just comes in with :w and :ww, I guess 17:46
anyway, there's some primitive transformer there that should be available for deep magic 17:47
moritz_ and it should be available in method or sub form somehow
TimToady so there's .looks-like-number(:make-it-so) :)
17:48 kaare joined
moritz_ :-) 17:48
17:48 colomon left, kaare is now known as Guest37229
TimToady more like $x.mixin-numeric-type if $x.looks-like-number 17:48
17:49 BrowserUk left
TimToady or, possible, .Numeric just always does that, and leaves the old Str value available too 17:50
memory usage possibly suffers, if the Str would otherwise be GC'd
and it might not follow Least Surprise for some definitions of it 17:51
17:51 Guest37229 left
TimToady .Numbery :) 17:51
moritz_ hugme: add szabgab to book 17:53
hugme hugs szabgab. Welcome to book!
szabgab thanks
dalek meta: r250 | diakopter++ | trunk/Sprixel/ (5 files):
[perlesque] closures much closer. a couple loose ends to tie up.
17:59
TimToady maybe looks-like-number is just .dwim-number ~~ Numeric
18:00 bakedb__ joined
TimToady so maybe looks-like-number is really kinda useless, if you're going to figure it out again to do the coercion 18:00
moritz_ maybe the coercion should have a way to signaling that it was going wrong
TimToady does anyone have a use case for knowing that something looks like a number without actually doing the coercion?
moritz_ other than returning 0
TimToady that's also an idea 18:01
lemme think about that...
biab &
moritz_ maybe coercing "foo" to Numeric should really return a kind of soft fail that still behaves like 0 in numeric context 18:02
dalek ok: 9815dba | (Gabor Szabo)++ | README:
add PerlJam to README
18:03
cognominal $obj.<attr1 attr2> = < val1 val2 > # is there a hash-like syntax to manipulate many object attribtutes at once. Something like this pseudo-code?
moritz_ I'm not aware of such a feature 18:04
jnthn isn't either 18:05
moritz_ though if you want to use attributes like hash keys, you probably have a design problem
just like "variable variable names"
cognominal afk 18:15
TimToady well, there $obj.$attrname if you need it, but you'd have to write your own loop 18:22
rakudo: my $p = :foo<bar>; my $a = 'key'; say $p.$a 18:23
p6eval rakudo ab2322: OUTPUT«invoke() not implemented in class 'Perl6Str'␤current instr.: '!dispatch_variable' pc 833 (src/glue/dispatch.pir:293)␤»
TimToady alpha: my $p = :foo<bar>; my $a = 'key'; say $p.$a
p6eval alpha 30e0ed: OUTPUT«invoke() not implemented in class 'Perl6Str'␤in Main (file <unknown>, line <unknown>)␤»
TimToady pugs: my $p = :foo<bar>; my $a = 'key'; say $p.$a
p6eval pugs: OUTPUT«foo␤»
TimToady pugs++ 18:24
moritz_ rakudo: my $p = :foo<bar>; my $a = 'key'; say $p."$a"
p6eval rakudo ab2322: OUTPUT«Quoted method name requires parenthesized arguments at line 11, near ""␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
moritz_ rakudo: my $p = :foo<bar>; my $a = 'key'; say $p."$a"()
p6eval rakudo ab2322: OUTPUT«foo␤»
TimToady ah, right
pugs is before we make that hardref only
rakudo++ 18:25
pugs: my $p = :foo<bar>; my $a = 'key'; say $p."$a"()
p6eval pugs: OUTPUT«*** ␤ Unexpected "\"$"␤ expecting ".", "\187", ">>", "=", "^", operator name, qualified identifier, variable name, "...", "--", "++", "i", array subscript, hash subscript or code subscript␤ at /tmp/ZDoyHkUrFM line 1, column 42␤»
TimToady heh
18:26 ash___ joined 18:31 mssm joined
TimToady perhaps Numeric keeps the string around as the "mix out" if it feels that it was incompletely converted, and turns the straight numeric if it thinks no information was lost, other than, say, whitespace 18:32
s/turns/returns/
what do you call the base of mixin, anyway?
sorear: <sorear> What does my $var is Type(Args) mean? 18:35
I don't think it means anything; that syntax is really for traits rather than types
<sorear> hmm, LTM requires a metaclass compatibility engine 18:38
it does? did I write one by accident and not know it? 18:39
moritz_ not unheard of :-) 18:40
TimToady hadn't heard of PEGs until a little while ago :)
and now I are one, or something like that 18:41
I'm sure that I've unknowingly violated and/or invalidated any number of patents over the years... :) 18:42
maybe I should get a business patent on that... 18:43
moritz_ on unknowingly violating patents? 18:44
lue ohai o/
.oO(the USPTO needs to clean up its act, imo)
18:45
ash___ that sounds like a profitable business patent to me
moritz_ especially since it implies endless recursion
if you violate a patent, you automatically violate this new patent 18:46
ash___ I like googling recursion
moritz_ which in turn means you violate this patent agian
lue We've probably violated a patent on the concept of patents by now :) 18:47
18:47 aindilis joined
ash___ I now have very primitive array support in nq-nqp, so you can do @a := (1, 2, 3); for instance 18:48
oh, and strings, and doubles work now 18:49
lue \o/
moritz_ nqp: my @a := (1, 2, 3); @a[0] = 5; say(@a) 18:52
p6eval nqp: OUTPUT«Assignment ("=") not supported in NQP, use ":=" instead at line 1, near " 5; say(@a"␤current instr.: 'parrot;HLL;Grammar;panic' pc 500 (src/cheats/hll-grammar.pir:197)␤»
moritz_ nqp: my @a := (1, 2, 3); @a[0] := 5; say(@a)
p6eval nqp: OUTPUT«3␤»
18:52 jhuni joined
moritz_ nqp: my @a := (1, 2, 3); @a[0] := 5; say(|@a) 18:52
p6eval nqp: OUTPUT«523␤»
moritz_ that#s actually two ways in which nqp is not a proper Perl 6 subset 18:53
ash___ also, because I am lazy, in my nq-nqp i made = the same as := (for now anyway. I always default to =) 18:54
18:54 nihiliad left
ash___ moritz_: do you mean that say(@a) does its length? not its values? 18:55
18:55 nihiliad joined
ash___ and which other way? 18:55
lue why does = not work in nqp? 18:56
ash___ semantic meaning, that and implementing = is more difficult 18:58
lue
.oO(that nqp code reminded me of my need for := in rakudo)
18:59
ash___ rakudo: my $a := 1; # still broke?
p6eval rakudo ab2322: OUTPUT«:= binding of variables not yet implemented␤current instr.: '&die' pc 17868 (src/builtins/Junction.pir:393)␤»
ash___ okay, not broke, but NYI
19:02 tylerni7 left
dalek meta: r251 | diakopter++ | trunk/Sprixel/src/ (2 files):
[perlesque] still more progress.
19:03
lue for implementing :=, <naive>wouldn't you just have to get the location of the RHS and set the LHS to its location?</naive>
19:04 colomon joined
moritz_ ash___: yes, and 2) is that binding a list to @a should make @a immutable 19:05
lue I get the feeling though, if that's all it takes, it's not as easy as it sounds.
moritz_ that's binding, not assignment
19:05 tylerni7 joined, tylerni7 left, tylerni7 joined
masak lue: did you read my recent blog post about binding and assignment? 19:06
ash___ moritz_: ah, i see, makes sense 19:07
19:07 k23z__ left
moritz_ also say(@foo) and say(|@foo) should be the same, since say() has a slurpy arg 19:07
ash___ I wonder if I could get away with making lists immutable, I wonder if mutable lists are used in the nqp grammar
moritz_ rakudo: sub f(*@x) {say @x.join(',') }; my @a = (1, 2); f(@a); f(|@a) 19:08
p6eval rakudo ab2322: OUTPUT«1,2␤1,2␤»
moritz_ ash___: under the hood it's all ResizablePMCArrays
lue eh, no. where be your blog?
ash___ nqp: say(|(1, 2, 3)); say((1, 2, 3)); # it seems to flatten both of those, but @a doesn't get flattened
p6eval nqp: OUTPUT«123␤123␤»
moritz_ ash___: adding immutability would be another abstraction layer
masak lue: use.perl.org/~masak/journal/40246
19:08 fn left
moritz_ perlgeek.de/blog-en/perl-6/list-cla....writeback 19:10
the last comment made me think
Su-Shee moritz_: classify: group ip adresses by mask, domains by tld, any internet protocol containing headers ("all mail having x-foobar: blabla"), objects having attribute xy (?)
moritz_ shouldn't it really return a hash?
you could still do my :(@even, @odd) := |@list.classify(...) 19:11
but I think all implementations will use a hash internally anyway
so why not just return the hash?
lue reading masak's blog, be back in a bit. 19:14
ash___ moritz_: all implementations will use a hash internally where?
colomon ash___: in classify 19:17
lue good post. := seems more like something I need.
colomon actually, most implementations will probably just crib moritz_++'s lovely version. :)
lue ( I bet the Periodic Table of Operators is outdated by now :) ) 19:19
colomon lue: yup.
I really wish it would get updated so I could buy a nice copy to hang on my wall. 19:20
or as a t-shirt!
masak lue: it is, a bit.
lue: prefix:<=> is in there, for example.
colomon It predates the Z metaop 19:21
etc.
lue I'd like to see it updated too. I'd consider updating it, but I know almost 0 about all the operators that exist :) 19:23
masak the original author has recently expressed interest in doing another update. 19:24
lue \o/ I'd like to have one as a 1024x768 wallpaper (yeah right) 19:25
19:25 jaldhar_ left
ash___ I wonder what it would take to get perl6 on the jvm.... or is that a good choice for a platform? 19:28
masak the thought has occurred to people.
moritz_ diakopter++ has done much research on backend platforms 19:29
masak doing some large-ish percentage would probably be reasonably possible. :)
moritz_ I'm sure he has a more informed opinion than me
diakopter not about the jvm, but I imagine it would end up looking similar to what I've built on the clr 19:30
ash___ I know of other languages on the jvm that have multi-methods (like clojure) but I don't know of any with dynamic grammars, or of any other languages at all that have dynamic grammars... 19:31
diakopter cue jonrafkind 's paper link
moritz_ are ranges purely numeric? 19:32
19:32 jaldhar_ joined
ash___ rakudo: say 'a' .. 'd' # ? does that count as numeric? 19:32
p6eval rakudo ab2322: OUTPUT«abcd␤»
diakopter perlesque: my $a = sub (int $b --> Callable[:(int --> int)]) { say($b); return sub (int $c --> int) { say('$b: ' ~ $b); say('$c: ' ~ $c); return ($c * $b) } }; my $d = $a(5); my $e = $a(7); say($d(3)); say($e(11)); 19:33
p6eval perlesque: OUTPUT«5␤7␤$b: -1412522840␤$c: 3␤57398776␤$b: -1412522912␤$c: 11␤1642117152␤»
ash___ although that might be doing the character code of 'a', and incrementing till it gets to the character code for 'd' and then converting to strings...
rakudo: say 'a' .. 'Z'
p6eval rakudo ab2322: OUTPUT«␤»
diakopter Hah. it works, kinda. there's some kind of value-type unboxing failure in the code generation, so you're seeing the memory address of the arg $b
ash___ hmm 19:34
colomon rakudo: say 'a' ... 'Z'
p6eval rakudo ab2322: OUTPUT«Decrement out of range␤current instr.: 'perl6;Perl6Exception;throw' pc 15354 (src/builtins/Associative.pir:46)␤»
diakopter but it works, generically.
ash___ std: say 'a'..'z'
p6eval std 30591: OUTPUT«ok 00:01 112m␤»
colomon interesting....
ash___ std: 'a'..'Z'
p6eval std 30591: OUTPUT«ok 00:01 110m␤»
moritz_ rakudo: say 'a'..'z'
p6eval rakudo ab2322: OUTPUT«abcdefghijklmnopqrstuvwxyz␤»
moritz_ rakudo: say 'a'...'z'
diakopter pmurias: around?
colomon ash___: I'm 99% certain STD doesn't check the end values of ranges.
p6eval rakudo ab2322:
..OUTPUT«abcdefghijklmnopqrstuvwxyzaaabacadaeafagahaiajakalamanaoapaqarasatauavawaxayazbabbbcbdbebfbgbhbibjbkblbmbnbobpbqbrbsbtbubvbwbxbybzcacbcccdcecfcgchcicjckclcmcncocpcqcrcsctcucvcwcxcyczdadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzeaebecedeeefegeheiejekelemeneoepeqereseteuevewex…
moritz_ bug 19:35
colomon woah.
ash___ lol, that sure is a bug
colomon thought that one worked.
Range is broken, but series is usually smarter.
moritz_ submits rakudobug
ash___ rakudo: say 1...10; say 'az' ... 'd';
p6eval rakudo ab2322: OUTPUT«12345678910␤azbabbbcbdbebfbgbhbibjbkblbmbnbobpbqbrbsbtbubvbwbxbybzcacbcccdcecfcgchcicjckclcmcncocpcqcrcsctcucvcwcxcycz␤»
colomon rakudo: say 'a', 'b' ... 'z'
diakopter rakudo: say 'aa'...'z'
moritz_ huh? range semed to work, for low case to lower case
p6eval rakudo ab2322: OUTPUT«abcdefghijklmnopqrstuvwxyz␤»
rakudo ab2322:
..OUTPUT«aaabacadaeafagahaiajakalamanaoapaqarasatauavawaxayazbabbbcbdbebfbgbhbibjbkblbmbnbobpbqbrbsbtbubvbwbxbybzcacbcccdcecfcgchcicjckclcmcncocpcqcrcsctcucvcwcxcyczdadbdcdddedfdgdhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydzeaebecedeeefegeheiejekelemeneoepeqereseteuevewexeyezfafbfcfdfefffgfhfifjfk…
lue I'd still like range to go over all of unicode (that's best left to a module probably) 19:36
diakopter rakudo: say 'aa'...'a'
p6eval rakudo ab2322: OUTPUT«Decrement out of range␤current instr.: 'perl6;Perl6Exception;throw' pc 15354 (src/builtins/Associative.pir:46)␤»
lue rakudo: say 'ø'..'Ø'
p6eval rakudo ab2322: OUTPUT«␤»
colomon moritz_: unless someone's fixed it, Range is badly broken in general for string ranges.
rakudo: say 'a', 'b' ... 'z'
p6eval rakudo ab2322: OUTPUT«abcdefghijklmnopqrstuvwxyz␤»
colomon heh, if that works, the series fix might be the easiest thing ever.
moritz_ rakudo: say 'a' .. 'd'
p6eval rakudo ab2322: OUTPUT«abcd␤»
19:37 jaldhar_ left
TimToady we talked about making single chars a special case that is exempt from "carry" 19:37
19:37 envi^home left
TimToady that is, you don't get carry unless the endpoint is at least 2 chars 19:38
masak TimToady: are you blocking on something other than time/tuits for emit_p5 in viv?
TimToady no, just tuits
19:38 kensanata joined
lue rakudo: say '¡'..'¢' # just testing 19:38
TimToady it's really just reporducing the hierarchical parts of gimme5
p6eval rakudo ab2322: ( no output )
TimToady the un6() parts are already mostly there 19:39
masak is thinking about having a look at it at some point
TimToady reporduction is overrated
moritz_
.oO( after tardis, the book and gsoc? ;-)
19:39 nihiliad left
masak moritz_: something like that :) 19:39
diakopter (if masak were to put time into that, diakopter's efforts would be assisted)
moritz_ speaking of the book, I've sent a patch for Pod::PseudoPod::LaTeX to chromatic 19:40
masak diakopter: what makes you interested in emit_p5?
diakopter b/c I want to make a version of it that emit_perlesque
moritz_ that makes the =begin screen...=end screen sections appear in the latex output
diakopter emit_perlesque ho 19:45
masak ponders the ramifications of successfully teaching the #perl6 community to tell him that he doesn't have time to branch out to new projects :) 19:46
diakopter masak: focus 19:47
masak wise words.
diakopter synopses: focus 19:48
masak :P
diakopter synopses: become synoptic
masak the reason I'm looking in viv right now is that I'm copying parts of it for sigmund. the reason I'm spending time on sigmund is that I need a bit of non-vapor for my talk in Moscow in a week and a bit. :) 19:49
moritz_ masak: have you submitted a title for your talk yet? 19:50
masak yes.
moritz_ so, what is it?
masak I'll nopaste it and the abstract.
please hold.
gist.github.com/394738 19:52
moritz_ nice :-) 19:53
so how time-travely is tardis these days?
masak it totally does the time travel part.
right now it seems to have a bit of trouble with blocks. 19:54
but we'll fix that soon.
I really like how it fell out that Tardis::Debugger subclasses Yapsi::Runtime and just adds a method to collect variable data along the way. :)
ash___ moritz_: where do I email the perl cla to? Or do i have to snail mail it? 19:55
19:55 Heame joined, finanalyst left
masak ash___: you have to snail mail it. 19:56
colomon I believe it's the Michigan address.
ash___ ah, got ya
they should setup an email address like parrot :P
colomon (The first address I found on the web was wrong, and the CLA got bounced back to by the post office.) 19:57
19:58 Su-Shee left
Heame Hi all. Is Damian Conway still a part of the perl6 thing? 19:58
moritz_ more or less, yes 19:59
we don't see much of him in here
Heame is he ever around here?
:)
TimToady he doesn't do irc 20:00
moritz_ but he's still active, discusses with larry, occasionally gives talks etc
Heame Ta.
20:00 Heame left, colomon left
lue I wonder. I always here of another, more popular #perl6 channel. Haven't seen it yet. 20:00
masak lue: if you find it, let us know. 20:01
TimToady lue: are you often subject to hallucinations?
lue no! :) But I was told that a while ago.
TimToady then maybe you need a better BS detector :)
lue guess that's another circuit broken in this TARDIS :/ 20:02
I'm curious; why does Damian not do irc? 20:03
TimToady there isn't anyone around here we can't psychoanalyze into negative self-esteem :)
he doesn't have ADD 20:04
lue there are a couple atoms in the corner waiting to recieve more electrons :)
20:04 colomon joined
pmurias diakopter: pong 20:06
lue perl6: my @a=2,3; @a[1] := @a[0]; @a[1]=5; say @a[0]; 20:10
p6eval elf 30591: OUTPUT«2␤»
..pugs: OUTPUT«5␤»
..rakudo ab2322: OUTPUT«:= binding of variables not yet implemented␤current instr.: '&die' pc 17868 (src/builtins/Junction.pir:393)␤»
lue ooh! pugs gets it right. 20:11
20:11 molaf left
moritz_ alpha: my @a=2,3; @a[1] := @a[0]; @a[1]=5; say @a[0]; 20:12
p6eval alpha 30e0ed: OUTPUT«rtype not set␤in Main (file <unknown>, line <unknown>)␤»
lue it seems like wouldn't be that difficult to implement, but I hardly know anything about rakudo's guts :) 20:13
rakudo: my $a = 3; my $b = 2; $b.WHERE = $a.WHERE; say $b # hmm... (probably read-only value :/) 20:15
p6eval rakudo ab2322: OUTPUT«Cannot assign to readonly value␤current instr.: '&die' pc 17868 (src/builtins/Junction.pir:393)␤»
20:16 meppl left
pugssvn r30592 | pmurias++ | [mildew] update to current perlesque 20:19
sorear jnthn!!! 20:20
20:20 jhuni left
sorear I fixed that bug already, in a different way, as part of my changes to make lexicals work in the REPL 20:20
(Do I need a CLA to get patches reviewed now too? :()
20:21 lue left
masak definitely not. 20:21
are you saying you've got variables working in the REPL?
moritz_ sorear: jnthn is on vacation, more or less, so you need to be patient a bit :-)
diakopter refactoring generated code is easier than refactoring handwritten code. 20:23
20:23 lue joined
lue who doesn't love their G3 Pismo laptop shutting down randomly? I do! 20:24
sorear TimToady: In very broad terms, metaclass compatibility is that, if Foo is a subclass of Bar, Foo.HOW does all of the roles thar Bar.HOW does 20:25
TimToady: any subclass of Cursor needs to regenerate LTM tables at compose time
TimToady: that means, that any subclass of Cursor needs to be built with a metaclass that does GrammarHOW's roles 20:26
TimToady: STD can get away with it because gimme5's metamodel is built for a grammar; Rakudo will need something much more general or much uglier. I'd prefer the former ;)
20:27 mssm left
sorear masak: yes. 20:28
masak sorear++!
lue yes to what?! 20:29
masak lue: working variables in the REPL.
apparently, sorear didn't think macros were awesome enough for one week. :P
lue :( ) 20:30
(jawdrop)
sorear getting prototype macros was much easier than I thought
but there are lots of dark corners that need to be explored, so production-quality macros are as hard as ever
masak still; prototype macros are infinitely more awesome than nothing. 20:31
sorear masak: There are some interesting leads still in topic/lexical-persistence. Essentially, it turns out that the machinery needed to persist lexicals in the REPL is exactly the same as the machinery required to compile the setting in multiple translation units (less memory, more parallelism, win all around) 20:39
however, our current !UNIT_START machinery requires either having a complete setting or no setting 20:40
masak huh.
sorear due to initializing %*ENV and @*ARGS
masak I see.
sorear which makes compiling half of the setting impossible
moritz_ doesn't understand 20:42
most of the setting doesn't need %*ENV or @*ARGS 20:43
20:43 justatheory left, [Coke] joined 20:44 am0c joined
sorear moritz_: no, but the code which resumes lexical scopes does 20:44
because the code which resumes lexical scopes is also responsible for capturing arguments from parrotland
it does the main(@argv) vs. main (@*ARGS) impedence match 20:45
moritz_ and can't that be factored out? 20:46
sorear perhaps, but I'm not sure of the best way
I suppose I could just experment :) 20:47
moritz_ I mean, discouple the lexical scope resuming from setting up these variables 20:48
sorear When should the variables be set up? 20:49
moritz_ in a separate PIR sub?
sorear When should that sub be called?
At the start of any module which does not claim to be part of the setting?
moritz_ !set_up_process_variables or so 20:50
sorear Is that supposed to be the name of the sub? 20:52
moritz_ yes
or is it written in Perl 6? 20:53
by convention the internal PIR subs start with a !
20:54 fn joined
sorear well, the problem is that Parrot doesn't make args available anywhere except the :main sub of the packfile being loaded 20:55
so we need to put something there to capture the arguments
however, if we put "something there to capture the arguments" in the setting, and the Hash class hasn't been defined yet - bang
moritz_ unless you introduce a second step 20:56
masak what do the '.' nodes represent in the YAML output from viv?
sorear Do elaborate.
moritz_ where you store it an parrot hash
somehwere in a private, global variable
sorear And only set up the contextuals in a late setting INIT block?
moritz_ yeah, something like that 20:57
sorear I like it.
I'll try that nextg.
21:00 kensanata left, orafu left 21:01 orafu joined 21:03 iblechbot left
sorear goes into the rakudo makefile and adds 'time' to all the command variables. I wonder if this should be automable? 21:06
moritz_ sure, the makefile is generated 21:07
sorear "can be"
"can be", absolutely
it's just something I've done enough times that I wonder if there ought to be a Configure.pl stage for it
diakopter pmurias: Triumph! :D 21:09
perlesque: my $a = sub (int $b --> Callable[:(int --> int)]) { say($b); return sub (int $c --> int) { say('$b: ' ~ $b); say('$c: ' ~ $c); return ($c * $b) } }; my $d = $a(5); my $e = $a(7); say($d(3)); say($e(11)); 21:10
moritz_ sorear: trying a simple patch to Configure.pl ... but need to rebuild parrot first
p6eval perlesque: OUTPUT«5␤7␤$b: 5␤$c: 3␤15␤$b: 7␤$c: 11␤77␤»
diakopter perlesquel: .
p6eval perlesquel: OUTPUT«5␤7␤$b: 5␤$c: 3␤15␤$b: 7␤$c: 11␤77␤real 0.05␤user 0.05␤sys 0.00␤»
diakopter masak: ^^ that's the test you were trying on rakudo earlier 21:11
dalek meta: r252 | diakopter++ | trunk/Sprixel/ (6 files):
[perlesque] strongly typed closures with Perl 6 declaration syntax.
moritz_ diakopter: now go and port the man-or-boy test to perlesque 21:12
masak diakopter: groovy.
diakopter where's man-or-boy
moritz_ t/spec/integration/man-or-boy.t
masak is there anything more to man-or-boy than just getting cloning of closures right?
moritz_ just needs closures, conditionals and arithmetics 21:13
diakopter hm
I think I'd better look at that wikipedia article instead of porting from the Perl 6
diakopter finds salvation in the C# example on rosettacode 21:14
moritz_ sorear: first approximation: 21:15
$maketext =~ s{(?<!\\\n)^\t(?!\s*-?cd)}{\ttime }mg;
in Configure.pl
diakopter I mean, er, the JavaScript example 21:16
diakopter finished porting 21:26
moritz_ sorear: pushed Configure patch
sorear oooh 21:27
diakopter perl6.pastebin.com/NiUF985w
creating a test file for it
moritz_ $maketext =~ s{(?<!\\\n)^\t(?!\s*-?cd)(?=[^\n]*\S)}{\ttime }mg;
sorear hmm, building latest rakudo on latest parrot took 19 minutes real, an increase of 8 minutes from last time
real time, however, fell by 1 minute
moritz_ huh. 21:28
I thought that string caching thing should have sped up pbc_to_exe quite a bit
sorear so someone seems to have made a time/memory "trade"off that affects core.pir generation
it does
pbc_to_exe and parrot -o perl6.pbc are mere blips now
core.pir generation, however, is getting slower (again)
it's swap bound for me 21:29
dalek kudo: 7247277 | moritz++ | Configure.pl:
[Configure] experimental timing option for Makefile
sorear before immutable strings and the COW fixes went in, core.pir generation was taking ~12 hours; I can't complain about the current state of affairs at all :)
diakopter feels stupid 21:31
lue diakopter: why? 21:32
21:32 fn left, fn joined
diakopter cuz I inverted the typenames and varnames in the A function when porting :D 21:32
21:33 fn left 21:34 \shade\ joined
lue ooh. 21:35
21:40 rv2733 left
diakopter man_or_boy found a couple bugs so far 21:45
:)
moritz_ you know, the first bug it found in Rakudo was a regression in "is copy" :-) 21:46
I only ported it Perl 6 when rakudo's lexical implementation was pretty good
arnsholt I suppose there's a reason it's called man or boy test ^^
moritz_ :-) 21:47
lue what is man_or_boy? Is it like initiation for Rakudo?
arnsholt lue: en.wikipedia.org/wiki/Man_or_boy_test 21:48
It's originally from ALGOL
masak I now have a small p5 script that uses viv output to tell me when a sub references 'self' or uses OO twigils, or when a method doesn't. 21:49
ash___ moritz_: is there a man or boy test for nqp? 21:51
masak good night, #perl6. 21:55
21:55 masak left 21:57 thowe left
lue night masak 21:58
sorear man or boy is a torture test for lexical closures and call-by-expression 22:01
22:01 ethel joined
lue afk 22:04
22:08 chitragupt_ joined, chitragupt_ left
sorear jnthn: How does $rolemaker work in your newest patch? 22:10
22:14 kaare joined 22:15 kaare is now known as Guest72415 22:17 Guest72415 left, chitragupt_ joined 22:18 chitragupt left, dual left 22:19 chitragupt_ left, chitragupt joined 22:21 pmurias left 22:22 dual joined
diakopter moritz_: whee 22:24
(man_or_boy.t works correctly now) 22:25
22:25 chitragupt_ joined
dalek meta: r253 | diakopter++ | trunk/Sprixel/ (6 files):
[perlesque] fix bugs exposed by man_or_boy.t
22:25
meta: r254 | diakopter++ | trunk/Sprixel/Main.cs:
[perlesque] disable test debug mode
diakopter C:\Projects\CSMeta\Sprixel\bin\Debug>perlesque.exe ..\..\t\man_or_boy.t 22:27
-67
arnsholt Congrats 22:28
diakopter thanks
takes about a quarter second 22:29
I'll time it on linux
too bad the program is too long to enter into p6eval, I think
22:31 chitragupt_ left
diakopter sweet 22:34
it does fit.
perlesque: sub A(int $k,Callable[:(-->int)] $x1,Callable[:(-->int)] $x2,Callable[:(-->int)] $x3,Callable[:(-->int)] $x4,Callable[:(-->int)] $x5-->int) {my Callable[:(-->int)] $B;$B=sub (-->int) {$k-=1;return A($k,$B,$x1,$x2,$x3,$x4)};if $k<=0 {return ($x4()+$x5())};return $B()};sub K(int $n-->Callable[:(-->int)]) {return sub (-->int) {return $n}};say(A(10,K(1),K(-1),K(-1),K(1),K(0)))
p6eval perlesque: OUTPUT«-67␤»
diakopter perlesquel: .
p6eval perlesquel: OUTPUT«-67␤real 0.05␤user 0.04␤sys 0.01␤»
22:42 chitragupt_ joined, chitragupt_ left 22:43 TiMBuS joined 22:45 arnsholt_ joined 22:48 bakedb__ left 22:49 [Coke]_ joined, Gruber joined, buu_ joined 22:50 buu_ left, yahooooo7 joined 22:51 buu left 22:53 wasy_ joined 22:54 [Coke] left, tylerni7 left, s1n left, yahooooo left, buubot left, jql left, arnsholt left, Dori10 left, Grrrr left, diakopter left, wasy_ is now known as wasy
sorear diakopter: not going to implement HM and shorten those ugly type sigs to nothing? :p 22:54
22:56 jaldhar_ joined 22:58 diakopter joined
diakopter I musta been netsplit 22:58
22:59 yahooooo7 left, gbacon left, bloonix left, skangas left, mdxi left, kcwu left, dhoss left, pnu left, moritz_ left 23:00 yahooooo7 joined, gbacon joined, bloonix joined, skangas joined, mdxi joined, kcwu joined, dhoss joined, pnu joined, moritz_ joined, card.freenode.net sets mode: +o moritz_, yahooooo7 left, gbacon left, bloonix left, skangas left, mdxi left, kcwu left, dhoss left, pnu left, moritz_ left 23:01 yahooooo7 joined, gbacon joined, bloonix joined, skangas joined, mdxi joined, kcwu joined, dhoss joined, pnu joined, moritz_ joined, card.freenode.net sets mode: +o moritz_ 23:02 s1n joined
sorear diakopter: not going to implement HM and shorten those ugly type sigs to nothing? :p 23:06
diakopter well... 23:07
sorear it would help you fit more code on the p6eval command
diakopter heh
23:08 ChanServ sets mode: +o diakopter
diakopter afaik, Perl 6 specifies no type inference except at the entire-program level 23:08
sorear Perl 6 specifies no type inference 23:09
"type inference" in a Perl 6 compiler is actually value inference, aka variable range analysis
a very standard optimization
23:09 buubot joined
diakopter I think I read somewhere in the Minor Prophets that they can be inferred in optimizations... yeah. 23:10
it only really would help for things that are used only as native types anyway
sorear diakopter: being able to eliminate the multi dispatch to !STORE in $a = $b is a huge win 23:11
diakopter true.
I'm not there yet. :) I intentially don't remember more of the Perl 6 spec than I plan to implement in the next month or two. 23:12
intentionally
sorear Hmm. Does anyone know offhand how much slower it is to compile N pbcs then run pbc_merge, over just concatenating the pir and running imcc once?
diakopter rakudo: sub A(int $k,Callable[:(-->int)] $x1,Callable[:(-->int)] $x2,Callable[:(-->int)] $x3,Callable[:(-->int)] $x4,Callable[:(-->int)] $x5-->int) {my Callable[:(-->int)] $B;$B=sub (-->int) {$k-=1;return A($k,$B,$x1,$x2,$x3,$x4)};if $k<=0 {return ($x4()+$x5())};return $B()};sub K(int $n-->Callable[:(-->int)]) {return sub (-->int) {return $n}};say(A(16,K(1),K(-1),K(-1),K(1),K(0))) 23:13
p6eval rakudo ab2322: OUTPUT«Invalid typename in parameter declaration at line 11, near " $k,Callab"␤current instr.: 'perl6;HLL;Grammar;panic' pc 501 (ext/nqp-rx/src/stage0/HLL-s0.pir:327)␤»
diakopter perlesque: sub A(int $k,Callable[:(-->int)] $x1,Callable[:(-->int)] $x2,Callable[:(-->int)] $x3,Callable[:(-->int)] $x4,Callable[:(-->int)] $x5-->int) {my Callable[:(-->int)] $B;$B=sub (-->int) {$k-=1;return A($k,$B,$x1,$x2,$x3,$x4)};if $k<=0 {return ($x4()+$x5())};return $B()};sub K(int $n-->Callable[:(-->int)]) {return sub (-->int) {return $n}};say(A(15,K(1),K(-1),K(-1),K(1),K(0)))
p6eval perlesque: OUTPUT«-3250␤»
diakopter heh 23:14
perlesque: sub A(int $k,Callable[:(-->int)] $x1,Callable[:(-->int)] $x2,Callable[:(-->int)] $x3,Callable[:(-->int)] $x4,Callable[:(-->int)] $x5-->int) {my Callable[:(-->int)] $B;$B=sub (-->int) {$k-=1;return A($k,$B,$x1,$x2,$x3,$x4)};if $k<=0 {return ($x4()+$x5())};return $B()};sub K(int $n-->Callable[:(-->int)]) {return sub (-->int) {return $n}};say(A(35,K(1),K(-1),K(-1),K(1),K(0)))
p6eval perlesque: OUTPUT«␤Native stacktrace:␤␤ mono [0x48b560]␤ mono [0x41b0df]␤ /lib/libpthread.so.0 [0x2acb713dba80]␤ mono [0x5cc70d]␤ mono [0x5cc846]␤ /lib/libpthread.so.0 [0x2acb713dba80]␤ mono [0x5c1ebd]␤ mono [0x5c2cdc]␤ mono [0x5c2ffb]␤ mono [0x5c319b]␤ mono [0x5cb29c]␤
diakopter tick tock
p6eval ../lib/libpthread.so.0 [0x2acb7…
diakopter sweet
sorear did it crash?
diakopter yeah
(I changed the depth exponent from 10 to 35 23:15
)
oh, I guess it didn't crash
it tried to use more memory than that perl resource limiter would let it 23:16
that's a lot of activation records.
sorear aren't they GCd? 23:17
23:17 \shade\ left
diakopter yeah but apparently man_or_boy creates a very large graph of them 23:17
hm. 20 completes, but 25 doesn't 23:18
20 -> -175416
22 -> -865609
oh look, they're there in that wikipedia table :) 23:19
23:22 \shade\ joined
diakopter the advantage of perlesque over just plain C# (on the CLR) is that the C# solutions will run out of stack space much much more quickly that perlesque's frame trampoline will run out of heap space. 23:23
as chromatic wrote, I'm doomed to writing trampolines the rest of my life. 23:24
apparently
sorear where did he write this?
diakopter looks
hm. some blog comment/reply 23:25
on ... /me tries to remember
oh I remember 23:26
argh. maybe it wasn't he 23:28
found it! 23:34
(not written by chromatic) 23:35
wait, yes it was. argh.
www.perlmonks.org/?node_id=836442
and another 23:39
use.perl.org/comments.pl?cid=70351&sid=43716
(not that I dispute what he wrote... in fact just the contrary)
ok I've reached my 10 hour screen-time limit for the day; afk 23:40