»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:, niecza:, std:, or /msg camelia perl6: ... | irclog: irc.perl6.org | UTF-8 is our friend!
Set by sorear on 25 June 2013.
colomon I have to kill it by hand to complete a smoke run. 00:00
TimToady m: infix:<*>(Any,Any)
camelia rakudo-moar 2e9a1d: OUTPUT«use of uninitialized value of type Any in numeric context in block <unit> at /tmp/y0hPY59RX7:1␤␤use of uninitialized value of type Any in numeric context in block <unit> at /tmp/y0hPY59RX7:1␤␤»
colomon is very happy to just to have completed a few smoke runs again, mind you. a nice predictable hang is annoying but not fatal. 00:01
TimToady m: my $any = Any.new; infix:<*>($any,$any))
camelia rakudo-moar 2e9a1d: OUTPUT«===SORRY!=== Error while compiling /tmp/mTIQNd30_2␤Unexpected closing bracket␤at /tmp/mTIQNd30_2:1␤------> my $any = Any.new; infix:<*>($any,$any)⏏)␤»
TimToady m: my $any = Any.new; infix:<*>($any,$any)
camelia rakudo-moar 2e9a1d: OUTPUT«Cannot call 'Numeric'; none of these signatures match:␤:(Mu:U \v: *%_)␤ in sub infix:<*> at src/gen/m-CORE.setting:4404␤ in block <unit> at /tmp/RL5Y04JVoA:1␤␤»
00:02 chenryn joined 00:04 telex left
TimToady m: my $mu = Mu.new; infix:<*>($mu,$mu) 00:04
camelia rakudo-moar 2e9a1d: OUTPUT«Cannot call 'infix:<*>'; none of these signatures match:␤:(Any $x = { ... })␤:(Any \a, Any \b)␤:(Real \a, Real \b)␤:(Int:D \a, Int:D \b --> Int)␤:(int $a, int $b --> int)␤:(Num:D \a, Num:D \b)␤:(num $a, num $b)␤:(Rational \a, Rational \b)…»
TimToady m: subset Foo of Array; multi infix:<*>(Foo $, Real $) { "tada" }; say [ 0, 2 ] * 0; 00:05
camelia rakudo-moar 2e9a1d: OUTPUT«tada␤»
00:05 chenryn left
TimToady we have a signature with Real, but not one with Numeric 00:05
that might be considered an oversight 00:06
00:06 telex joined
grondilu well, that is weird: 00:10
use Chess::PGN; say "1. e4" ~~ /<Chess::PGN::game>/; # works
use Chess::PGN; say "1. e4" ~~ /<Chess::PGN::game>+/; # hangs
00:10 dj_goku_ joined
TimToady can it match ''? 00:11
grondilu yes
TimToady well, it's probably doing that multiple times 00:12
grondilu hum
TimToady maybe +? $
grondilu TimToady++
yes, well spotted 00:13
dj_goku_ so I came across this example: (*/2)(4) 00:14
grondilu should give 2
TimToady looks like 2 to me
dj_goku_ there is an implict multiplication?
TimToady */2 is implicitly a closure, same as { $_ / 2 } 00:15
dj_goku_ reading over this btw: learnxinyminutes.com/docs/perl6/
TimToady yeah, that's rather...terse... :)
dj_goku_ well for the most part I get most of it. :D 00:16
TimToady couldn't hope for more :)
dj_goku_ I thought perl6 was a lot different from p5.
TimToady it is, except where it isn't :) 00:17
00:17 kurahaupo left
grondilu dj_goku_: */2 is an example of what is called *autopriming* in case you want to look it in the specs 00:17
timotimo other words related to this: WhateverCode 00:18
TimToady we stole * from typeglobs, and used it for more interesting things
dj_goku_ well I guess the part I am hung up on is (.5)(4) != 2, (.5)*(4) == 2 00:20
grondilu is there something between Real and Numeric that includes Complex? 00:21
TimToady no
the (4) is the argument to the closure 00:22
grondilu can probably use Real anyway
TimToady so it's like sub foo ($x) { $x / 2 }; foo(4)
dj_goku_ oh 00:23
so (*/2) is an anonmous sub, and (4) is calling that sub with a value of 4. Right? 00:24
TimToady don't even really need the parens 00:25
m: my $x = * / 2; say $x(4)
camelia rakudo-moar 2e9a1d: OUTPUT«2␤»
TimToady the parens are only to bind the / tighter than the .()
dj_goku_ interesting. 00:26
TimToady can even call it as a fake method
m: my $x = * / 2; say 4.$x
camelia rakudo-moar 2e9a1d: OUTPUT«2␤»
dj_goku_ haha interesting. 00:27
grondilu didn't know about that 00:28
oh yes it's the same as in $arg.&f 00:30
jack_rabbit Is there syntax for turning an infix operator into a function?
timotimo knew that
grondilu jack_rabbit: use the full name &infix:<symbol>
jack_rabbit gotcha. 00:31
grondilu m: say &infix:<+>(1, 1)
camelia rakudo-moar 2e9a1d: OUTPUT«2␤»
grondilu there's also .assuming
(but last time I tried it was working great) 00:32
*wasn't
m: say &infix:<+>.assuming(*, 2)( 1)
camelia rakudo-moar 5f9cd5: OUTPUT«Too many positional parameters passed; got 3 but expected between 0 and 2␤ in sub infix:<+> at src/gen/m-CORE.setting:4394␤ in sub CURRIED at src/gen/m-CORE.setting:3387␤ in block <unit> at /tmp/X_znV7HFt_:1␤␤»
grondilu m: say &infix:<+>.assuming(2)( 1) 00:33
camelia rakudo-moar 5f9cd5: OUTPUT«3␤» 00:34
TimToady you don't need the & there 00:36
just as you don't need to say &foo(1)
oh, well, you need it for assuming 00:37
I was loking at the first one
m: say infix:<+>(1,1)
camelia rakudo-moar 5f9cd5: OUTPUT«2␤»
TimToady that's what I mean
grondilu m: my %a{Array}; %a{[0, 1]}++ xx 2; say %a; 00:38
camelia rakudo-moar 5f9cd5: OUTPUT«([0, 1] => 1, [0, 1] => 1).hash␤»
grondilu n: my %a{Array}; %a{[0, 1]}++ xx 2; say %a; 00:39
camelia niecza v24-109-g48a8de3: OUTPUT«===SORRY!===␤␤Postconstraints, and shapes on variable declarators NYI at /tmp/TVsqNFGSrg line 1:␤------> my %a{Array}⏏; %a{[0, 1]}++ xx 2; say %a;␤␤Unhandled exception: Check failed␤␤ at /home/p6ev…»
grondilu j: my %a{Array}; %a{[0, 1]}++ xx 2; say %a;
camelia rakudo-jvm 5f9cd5: OUTPUT«(timeout)»
grondilu expected ([0, 1] => 2).hash
was I asking too much or something? 00:40
because I realize consolidating on structured keys must be complicated.
j: my %a{Array}; %a{[]}++ xx 2; say %a; 00:41
camelia rakudo-jvm 5f9cd5: OUTPUT«([] => 1, [] => 1).hash␤»
grondilu m: my %a{Array}; %a{[]}++ xx 2; say %a;
camelia rakudo-moar 5f9cd5: OUTPUT«([] => 1, [] => 1).hash␤»
00:42 Mouq joined
Mouq ping! 00:42
yoleaux 26 Aug 2014 11:13Z <moritz> Mouq: FYI, perl6/doc htmlify.p6 now needs latest rakudo + latest Pod::To::HTML
Mouq m: say [0, 1].WHICH 00:43
camelia rakudo-moar 5f9cd5: OUTPUT«Array|55709040␤»
Mouq grondilu: ^^
grondilu is not sure what WHICH is. 00:44
Mouq m: say set(0,1).WHICH # for example
camelia rakudo-moar 5f9cd5: OUTPUT«Set|Int|0 Int|1␤»
Mouq .WHICH is an object's unique ID
grondilu hum
timotimo hey there mouq!
how are you doing? :)
Mouq An Array can be pushed to, so can't get a unique ID based on its values 00:45
grondilu if which is what is used in a typed array that's not really helpful
Mouq timotimo: Hey! Decent, hbu?
timotimo: Just finished my first week of college, lots of fun and work :)
grondilu m: say .WHICH for [] xx 3 00:47
camelia rakudo-moar 5f9cd5: OUTPUT«Array|55509952␤Array|55510016␤Array|55510080␤»
timotimo i'm all right :)
Mouq m: say $(0, 1).WHICH # Hmmmm 00:48
camelia rakudo-moar 5f9cd5: OUTPUT«Parcel|73234664␤»
grondilu I read in S02 that WHICH is supposed to give the same output for objects that have the same content value. 00:49
so it's kind of like a marshalization or something, isn't it? 00:51
Mouq m: my @a; my @b; say set($@a, $@b)
camelia rakudo-moar 5f9cd5: OUTPUT«set(, )␤»
Mouq m: my @a; my @b; say set($@a, $@b).WHICH
camelia rakudo-moar 5f9cd5: OUTPUT«Set|Array|80678544 Array|80678608␤»
Mouq @a and @b can be changed after the creation of the set
grondilu oh ic 00:52
well, no I don't. 00:53
what's the difference with WHERE then? 00:54
m: say .WHERE for [] xx 3
camelia rakudo-moar 5f9cd5: OUTPUT«139868124857736␤139868124869416␤139868124874136␤»
Mouq didn't know WHERE was a thing
00:54 zacts left
timotimo Mouq: on moarvm you can use nativecast and a CStruct repr to reach right into an MVMObjects internal stuff by getting its WHERE :D 00:55
grondilu m: (my %a{Array}){[]}++ xx 2; say %a
camelia rakudo-moar 5f9cd5: OUTPUT«([] => 1, [] => 1).hash␤»
Mouq :O
m: (my %a{Array}){@}++ xx 2; say %a 00:56
camelia rakudo-moar 5f9cd5: OUTPUT«No such method 'succ' for invocant of type 'Parcel'␤ in sub postfix:<++> at src/gen/m-CORE.setting:1942␤ in block <unit> at /tmp/kRTrOOW_EO:1␤␤»
grondilu m: (my %a{Array}){[]}++ xx 2; say %a # should really return ([] => 2).hash IMHO
camelia rakudo-moar 5f9cd5: OUTPUT«([] => 1, [] => 1).hash␤»
Mouq m: (my %a{Array}){$@}++ xx 2; say %a
camelia rakudo-moar 5f9cd5: OUTPUT«([] => 2).hash␤»
grondilu the very idea of ([] => 1, [] => 1).hash is just wrong to me
00:57 xenoterracide joined
grondilu looks at Mouq's solution 00:57
Mouq m: say 1.WHERE
camelia rakudo-moar 5f9cd5: OUTPUT«140483368194624␤»
grondilu m: (my %a{Array}){$([0, 1])}++ xx 2; say %a 00:58
camelia rakudo-moar 5f9cd5: OUTPUT«([0, 1] => 1, [0, 1] => 1).hash␤»
grondilu m: (my %a{Array}){static @ = [0, 1]}++ xx 2; say %a
camelia rakudo-moar 5f9cd5: OUTPUT«===SORRY!=== Error while compiling /tmp/JvrMw2Nu6L␤Undeclared routine:␤ static used at line 1␤␤»
Mouq m: (my %a{Array}){$=[0,1]}++ xx 2; say %a # bare sigil variables are stateful now, I believe 00:59
camelia rakudo-moar 5f9cd5: OUTPUT«([0, 1] => 1, [0, 1] => 1).hash␤»
grondilu m: (my %a{Array}){state @ = [0, 1]}++ xx 2; say %a
camelia rakudo-moar 5f9cd5: OUTPUT«No such method 'succ' for invocant of type 'Parcel'␤ in sub postfix:<++> at src/gen/m-CORE.setting:1942␤ in block <unit> at /tmp/m9wnGPuYXV:1␤␤»
Mouq m: (my %a{Array}){state$=[0,1]}++ xx 2;
camelia rakudo-moar 5f9cd5: OUTPUT«Unhandled exception: cannot stringify this␤ at src/gen/m-BOOTSTRAP.nqp:831 (/home/p6eval/rakudo-inst-2/languages/nqp/lib/Perl6/BOOTSTRAP.moarvm:bind_sig:128)␤ from src/gen/m-CORE.setting:9982 (/home/p6eval/rakudo-inst-2/languages/perl6/runtime/CORE…»
Mouq Uhh
TimToady m: my @a = [1,2]; my @b = [3,4]; my $s = set($@a, $@b); say $s; push @b, 5; say $s 01:02
camelia rakudo-moar 5f9cd5: OUTPUT«set(1 2, 3 4)␤set(1 2, 3 4 5)␤»
grondilu m: my %a{Array}; my %a{[]} = $++ for ^3; say %a{[]}
camelia rakudo-moar 5f9cd5: OUTPUT«Potential difficulties:␤ Redeclaration of symbol %a␤ at /tmp/qu6Mf2votq:1␤ ------> my %a{Array}; my %a{[]} ⏏= $++ for ^3; say %a{[]}␤Odd number of elements found where hash initializer expected␤ in method STORE at s…»
TimToady the identity of a container is its containerness, not its contents
01:03 xenoterracide left
TimToady lvalues are abstract locations, unlike rvalues, which are not 01:03
grondilu ok. So I should not use Arrays for my keys, but rather an immutable type, right? 01:04
TimToady yes
grondilu m: say (1, 2).WHAT
camelia rakudo-moar 5f9cd5: OUTPUT«(Parcel)␤»
TimToady m: my %a{Array}; %a{[]} = $++ for ^3; say %a.keys
camelia rakudo-moar 5f9cd5: OUTPUT« ␤»
TimToady m: my %a{Array}; %a{[]} = $++ for ^3; say %a.elems 01:05
camelia rakudo-moar 5f9cd5: OUTPUT«3␤»
grondilu m: my %a{Parcel}; %a{(1, 2)}++; say %
camelia rakudo-moar 5f9cd5: OUTPUT«cannot stringify this␤ in method at_key at src/gen/m-CORE.setting:9982␤ in sub postcircumfix:<{ }> at src/gen/m-CORE.setting:2792␤ in sub postcircumfix:<{ }> at src/gen/m-CORE.setting:2827␤ in block <unit> at /tmp/gjNResNTOc:1␤␤»
grondilu m: my %a{Parcel}; %a{(1, 2)}++; say %a
camelia rakudo-moar 5f9cd5: OUTPUT«cannot stringify this␤ in method at_key at src/gen/m-CORE.setting:9982␤ in sub postcircumfix:<{ }> at src/gen/m-CORE.setting:2792␤ in sub postcircumfix:<{ }> at src/gen/m-CORE.setting:2827␤ in block <unit> at /tmp/hhdiomRPYF:1␤␤»
grondilu m: my %a{Parcel}; %a{(1, 2).item}++; say %a
camelia rakudo-moar 5f9cd5: OUTPUT«($(1, 2) => 1).hash␤»
01:05 jerrycheung left
grondilu m: my %a{Parcel}; %a{(1, 2).item}++ xx 2; say %a 01:05
camelia rakudo-moar 5f9cd5: OUTPUT«($(1, 2) => 2).hash␤»
grondilu \o/
TimToady m: say (1,2) === (1,2)
camelia rakudo-moar 5f9cd5: OUTPUT«False␤»
grondilu m: my %a{Parcel}; %a{(1, 2).item}++ xx 10; say %a 01:06
camelia rakudo-moar 5f9cd5: OUTPUT«($(1, 2) => 10).hash␤»
grondilu m: my %a{Parcel}; %a{().item}++ xx 10; say %a
camelia rakudo-moar 5f9cd5: OUTPUT«($( ) => 10).hash␤»
grondilu cool
TimToady we only sort of have an immutable tuple type
grondilu you mean apart from Parcel?
TimToady m: say (1,2).WHICH
camelia rakudo-moar 5f9cd5: OUTPUT«Parcel|63731816␤»
Mouq TimToady: Should that be more like Parcel|Int|1 Int|2 ? 01:07
TimToady it's counting itself as a container, albeit an immutable container
it can contain mutables though, ($x,$y)
grondilu for all intends and purposes, can I consider that Parcel is Perl6's Tuple?
TimToady but probably we should think about that more
01:08 FROGGS_ joined
TimToady well, we just said its WHICH is not exactly value based yet 01:08
oops, being called (again) to dinner &
01:09 zacts joined, aborazmeh joined 01:11 FROGGS left
grondilu m: my %a{Parcel}; %a{().item}++; $a{().item}++; say %a 01:12
camelia rakudo-moar 5f9cd5: OUTPUT«===SORRY!=== Error while compiling /tmp/JPx1Nug6g7␤Variable '$a' is not declared. Did you mean '%a'?␤at /tmp/JPx1Nug6g7:1␤------> %a{Parcel}; %a{().item}++; $a{().item}++⏏; say %a␤ expecting any of:␤ …»
grondilu m: my %a{Parcel}; %a{().item}++; %a{().item}++; say %a
camelia rakudo-moar 5f9cd5: OUTPUT«($( ) => 1, $( ) => 1).hash␤»
grondilu indeed. Not value based.
grondilu is disappointed
Mouq m: my %a{Capture}; %a{\(0,1)}++; %a{\(0,1)}++; say %a 01:14
camelia rakudo-moar 5f9cd5: OUTPUT«(Capture.new(list => (0, 1,)) => 2).hash␤»
Mouq Hack-y..
grondilu That looks acceptable 01:15
m: my %a{Capture}; %a{\(0,1)}++ xx 4; say %a
camelia rakudo-moar 5f9cd5: OUTPUT«(Capture.new(list => (0, 1,)) => 4).hash␤»
grondilu m: my %a{Capture}; %a{\()}++ xx 4; say %a 01:16
camelia rakudo-moar 5f9cd5: OUTPUT«(Capture.new() => 4).hash␤»
grondilu Mouq++
I think I can use that.
though I would need to convert a Capture into a list or array at some point. 01:17
m: say (\(0, 1))[0]
camelia rakudo-moar 5f9cd5: OUTPUT«0␤»
grondilu m: say (\(0, 1))[].WHAT
camelia rakudo-moar 5f9cd5: OUTPUT«(List)␤»
grondilu m: say (\(0, 1))[*]
camelia rakudo-moar 5f9cd5: OUTPUT«0 1␤»
grondilu well, that was easy
Mouq :) 01:18
grondilu I've just tried in what I was currently doing, and it actually works. Thanks. 01:20
It's a pity we don't have a Tuple type, though. 01:21
01:21 zoosha left
TimToady well, just derive from Parcel and override its WHICH :) 01:24
actually, we should simply make a Parcel's WHICH derived from the component WHICHs 01:25
which will automatically account for the value/container distinction of its components 01:26
grondilu Capture is actually more convenient because I don't have to use .item to prevent flattening
TimToady well, that too
m: say \(1,2).WHICH
camelia rakudo-moar 5f9cd5: OUTPUT«Capture|(Int|1)(Int|2)␤»
TimToady oh, that's already correct
grondilu m: say \(1,2).WHICH xx 2 01:27
camelia rakudo-moar 5f9cd5: OUTPUT«Capture|(Int|1)(Int|2) Capture|(Int|1)(Int|2)␤»
TimToady parcels should really work the same way
01:28 diakopte1 is now known as diakopter
grondilu though the cleanest would probably to define my own type, allow instanciation with a circumfix:«e[,]»(Int *@), and define my own WHICH 01:30
TimToady parcels ought to act like tuples 01:31
grondilu yeah but frankly, I hate to work with them. Their behavior is kind of odd
TimToady though you'd want a decont-ish constructor
what bothers you 01:33
?
grondilu flattening, for one
TimToady well, that's lazy
parcels are completely agnostic on the subject
m: my $p := (1,(1,2),3); say $p.elems 01:34
camelia rakudo-moar 5f9cd5: OUTPUT«4␤»
grondilu oh, then I guess that's me not mastering the flattening rules in Perl 6. Not too surprising. That's one thing I need to improve on.
TimToady ah, that's .elems flattinging it
m: my $p := (1,(1,2),3); say $p.lolelems
camelia rakudo-moar 5f9cd5: OUTPUT«No such method 'lolelems' for invocant of type 'Parcel'␤ in block <unit> at /tmp/6Sra52YjSn:1␤␤»
TimToady m: my $p := (1,(1,2),3); say $p.lol.elems
camelia rakudo-moar 5f9cd5: OUTPUT«3␤»
TimToady m: my $p := (1,(1,2),3); say $p.flat.elems 01:35
camelia rakudo-moar 5f9cd5: OUTPUT«4␤»
TimToady m: my $p := (1,(1,2),3); say $p.count 01:36
camelia rakudo-moar 5f9cd5: OUTPUT«No such method 'count' for invocant of type 'Parcel'␤ in block <unit> at /tmp/uQ38UvjzSY:1␤␤»
TimToady hmm, I thought we have a raw method of some sort for that
m: my $p := (1,(1,2),3); say $p.^methods
camelia rakudo-moar 5f9cd5: OUTPUT«BUILD Parcel Capture elems item flat list lol reverse rotate at_pos STORE FLATTENABLE_LIST FLATTENABLE_HASH fmt of Bool Numeric Str ACCEPTS gist perl DUMP␤»
01:37 jerrycheung joined
TimToady n: my $p := (1,(1,2),3); say $p.elems 01:38
camelia niecza v24-109-g48a8de3: OUTPUT«3␤»
TimToady yes, it's not flattening in niecza
grondilu do you think Parcel.WHICH will behave as Capture.WHICH any time soon?
TimToady dunno, seems like an easy fix 01:39
and I could be argued into making .elems return 3
if we're going to make parcel behave more like an official tuple type
grondilu well, if as you said Parcel are agnostic regarding flattening, then Parcel.elems is not defined, is it?
TimToady well, it just implies that you requested flattening currently, but we could undo that 01:40
.map is the same way
grondilu ok 01:41
wouldn't it be simpler to have a Tuple type, though?
TimToady not if parcel already is one
grondilu well, yeah I guess. 01:42
TimToady we do need a better way of calling nqp::decont though
grondilu does not know what that is 01:43
Mouq m: my $a = 4; my $b = ($a,); $b[0] = 5 01:44
camelia ( no output )
Mouq m: my $a = 4; my $b = (nqp::decont($a),); $b[0] = 5 01:45
camelia rakudo-moar 5f9cd5: OUTPUT«Cannot modify an immutable Int␤ in method assign_pos at src/gen/m-CORE.setting:1867␤ in sub postcircumfix:<[ ]> at src/gen/m-CORE.setting:2566␤ in block <unit> at /tmp/JLLol1Fa0F:1␤␤»
01:45 Mouq left 01:49 aborazmeh left
grondilu oh, "decontenarize". I could have guessed that. 01:49
TimToady so we need a tuple constructer that deconts, probably
or a method, or something
grondilu wouldn't it need its own syntax? 01:50
TimToady depends on when you want it bound
you can write (1, (2,3), 4).decont right now with a bit of monkey typing
grondilu maybe a "freeze" method.
TimToady well, I'd hope for something shorter, but yeah
grondilu though "decont" is probably fine 01:51
TimToady well, that's the jargon, but I don't really like it
grondilu a unicode braket maybe?
01:51 aborazmeh joined, jerrycheung left
TimToady maybe, but perhaps decont should be decoupled from that 01:53
(decont 1, (2,3), 4)
if it were a listop, for instance
though I note that [1,(2,3),4] has both flattening and decont built in
well, decont and then recont inside the array 02:00
grondilu S-expressions are cool. If we had native support for them, we could make immutable types easily, couldn't we? 02:01
like my $a = (1, 2).S
TimToady Lisp doesn't consider s-exprs to be immutable 02:02
grondilu oh, doesn't it? My bad, then.
TimToady that's sort of a later notion in FP 02:03
in Lisp it's more convention
grondilu I thought everything was immutable in FP
TimToady well, Lisp likes to think of itself as FP, but doesn't enforce it 02:04
diakopter not when you write interpreters and monads to simulate mutating state!
^ (whether everything is immutable in FP) 02:05
grondilu what about my $a = constant (1, 2) ? 02:06
or even:
what about my $a = constant $ = (1, 2) ? 02:07
TimToady doesn't decont
grondilu m: my $a = constant $ = (1, 2); $a[]
camelia ( no output )
grondilu m: my $a = constant $ = (1, 2); say $a[]
camelia rakudo-moar 5f9cd5: OUTPUT«1 2␤»
grondilu m: my $a = constant $ = (1, 2); $a[0] = pi; say $a
camelia rakudo-moar 5f9cd5: OUTPUT«Cannot modify an immutable Int␤ in method assign_pos at src/gen/m-CORE.setting:1867␤ in sub postcircumfix:<[ ]> at src/gen/m-CORE.setting:2566␤ in block <unit> at /tmp/7Kdcutzjon:1␤␤»
TimToady m: my $x = 42; constant a = (1,$x); $x = 43; say a
camelia rakudo-moar 5f9cd5: OUTPUT«1 (Any)␤»
TimToady oh, duh
m: my $x; BEGIN $x = 42; constant a = (1,$x); $x = 43; say a 02:08
camelia rakudo-moar 5f9cd5: OUTPUT«1 42␤»
TimToady I guess it deconts
m: my $x; BEGIN $x = 42; constant a := (1,$x); $x = 43; say a
camelia rakudo-moar 5f9cd5: OUTPUT«1 42␤»
TimToady makes sense, for constant 02:09
grondilu a constant is not a type though, so I can't make a typed array for it, can I?
TimToady I think the type can stay tuple
er, parcel
grondilu but I can not create something like that at runtime. 02:11
(which is very restricting) 02:12
TimToady m: sub fix (|c) { c.deepmap: { nqp::decont($_) } }; say(fix 1,(2,3),4).perl 02:13
camelia rakudo-moar 5f9cd5: OUTPUT«:(1, 2, 3, 4)␤»
grondilu m: sub fix (|c) { c.deepmap: { nqp::decont($_) } }; say(fix 1,(2,3),4).WHICH xx 2 02:14
camelia rakudo-moar 5f9cd5: OUTPUT«:(1, 2, 3, 4)␤:(1, 2, 3, 4)␤»
TimToady hmm
grondilu that would do
TimToady deepmap shouldn't flatten
m: sub fix (|c) { c.deepmap: { nqp::decont($_) } }; say(fix 1,(2,3),4).WHAT 02:15
camelia rakudo-moar 5f9cd5: OUTPUT«:(1, 2, 3, 4)␤»
TimToady oops
m: sub fix (|c) { c.deepmap: { nqp::decont($_) } }; say (fix 1,(2,3),4).WHAT
camelia rakudo-moar 5f9cd5: OUTPUT«(Parcel)␤»
grondilu the say takes it all
TimToady m: sub fix (|c) { c.deepmap: { nqp::decont($_) } }; say (fix 1,(2,3),4).perl
camelia rakudo-moar 5f9cd5: OUTPUT«(Capture.new(list => (1, 2, 3, 4,)),)␤»
grondilu m: sub fix (|c) { c.deepmap: { nqp::decont($_) } }; say (fix 1,(2,3),4).WHICH xx 2
camelia rakudo-moar 5f9cd5: OUTPUT«Parcel|74683024 Parcel|74683224␤»
TimToady deepmap still failing 02:16
grondilu m: sub fix (|c) { c.deepmap: { nqp::decont($_) } }; say (fix 1,(2,3),4).WHAT
camelia rakudo-moar 5f9cd5: OUTPUT«(Parcel)␤»
TimToady m: sub fix (**@c) { @c.deepmap: { nqp::decont($_) } }; say (fix 1,(2,3),4).perl
camelia rakudo-moar 5f9cd5: OUTPUT«(1, (2, 3), 4)␤»
TimToady that's betterish
m: sub fix (**@c) { @c.deepmap: { nqp::decont($_) } }; say (fix 1,(2,<buckle my shoe>),4).perl
camelia rakudo-moar 5f9cd5: OUTPUT«(1, (2, ("buckle", "my", "shoe")), 4)␤»
TimToady m: my @foo = <buckle my shoe>; sub fix (**@c) { @c.deepmap: { nqp::decont($_) } }; say (fix 1,(2,@foo),4).perl 02:17
camelia rakudo-moar 5f9cd5: OUTPUT«(1, (2, Array.new("buckle", "my", "shoe")), 4)␤»
TimToady hmm, deepmap not descending into @foo, I guess 02:18
m: my @foo = <buckle my shoe>; sub fix (**@c) { @c.deepmap: { nqp::decont($_) } }; say (fix 1,(2,$@foo),4).perl
camelia rakudo-moar 5f9cd5: OUTPUT«(1, (2, ["buckle", "my", "shoe"]), 4)␤»
TimToady anyway, decont is failing on that level
m: my @foo = <buckle my shoe>; sub fix (**@c) { @c.deepmap: { nqp::decont($_) } }; say (fix 1,(2,\@foo),4).perl 02:20
camelia rakudo-moar 5f9cd5: OUTPUT«(1, (2, Capture.new(list => ("buckle", "my", "shoe",))), 4)␤»
TimToady m: my @foo = <buckle my shoe>; sub fix (**@c) { @c.deepmap: { nqp::decont($_) } }; say (fix 1,(2,@foo.list),4).perl
camelia rakudo-moar 5f9cd5: OUTPUT«(1, (2, Array.new("buckle", "my", "shoe")), 4)␤»
TimToady m: my @foo = <buckle my shoe>; sub fix (**@c) { @c.deepmap: { nqp::decont($_) } }; say (fix 1,(2,@foo.Parcel),4).perl
camelia rakudo-moar 5f9cd5: OUTPUT«(1, (2, (ListIter.new(),)), 4)␤»
TimToady m: my @foo = <buckle my shoe>; sub fix (**@c) { @c.deepmap: { nqp::decont($_) } }; say (fix 1,(2,fix @foo),4).perl 02:21
camelia rakudo-moar 5f9cd5: OUTPUT«(1, (2, (["buckle", "my", "shoe"],)), 4)␤»
TimToady hmm, that's wrongish
anyway, it's not so far off of being there
02:22 nbrown__ joined
TimToady m: my @foo = <buckle my shoe>; sub fix (**@c) { @c.deepmap: { nqp::decont($_) } }; say (1,(2,@foo),4).tree(*.&fix).perl 02:22
camelia rakudo-moar 5f9cd5: OUTPUT«(((1, 2, "buckle", "my", "shoe", 4),).list.item,)␤»
TimToady m: my @foo = <buckle my shoe>; sub fix (**@c) { @c.deepmap: { nqp::decont($_) } }; say (1,(2,$@foo),4).tree(*.&fix).perl 02:23
camelia rakudo-moar 5f9cd5: OUTPUT«(((1, 2, ["buckle", "my", "shoe"], 4),).list.item,)␤»
TimToady the question is whether the tuple contains a reference or a copy of @foo 02:24
grondilu m: my $foo = <buckle my shoe>; sub fix (**@c) { @c.deepmap: { nqp::decont($_) } }; say (1,(2,$foo),4).tree(*.&fix).perl
camelia rakudo-moar 5f9cd5: OUTPUT«(((1, 2, ("buckle", "my", "shoe"), 4),).list.item,)␤»
TimToady regrets the spam 02:25
m: say (1,(2,3),4)[2]
camelia rakudo-moar 5f9cd5: OUTPUT«3␤»
02:26 nbrown__ left 02:32 jerrycheung joined, noganex joined
grondilu m: .say for *..* 02:32
02:33 xenoterracide joined
grondilu ^ just trolling :) 02:33
camelia rakudo-moar 5f9cd5: OUTPUT«(timeout)-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-Inf␤-I…»
grondilu lol, makes sense.
TimToady you'll note that it didn't time out :)
oh wait, it di
m: say *..*
camelia rakudo-moar 5f9cd5: OUTPUT«-Inf..Inf␤»
TimToady m: say (*..*).list 02:34
camelia rakudo-moar 5f9cd5: OUTPUT«-Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -Inf -…»
TimToady that one didn't :)
grondilu that's kind of awesome
TimToady m: say (*..*).reverse
camelia rakudo-moar 5f9cd5: OUTPUT«Cannot .reverse from an infinite list␤ in method gist at src/gen/m-CORE.setting:13276␤ in sub say at src/gen/m-CORE.setting:14211␤ in block <unit> at /tmp/4ntEakyBKC:1␤␤»
TimToady aww
grondilu you were hoping for +Int +Inf .... 02:35
?
TimToady kinda :)
kinda not :)
02:35 noganex_ left
TimToady thing is, there's no such range as +Inf .. -Inf, since that's just () 02:36
ranges are not autoreversing
grondilu oh yeah indeed
02:36 BenGoldberg left
grondilu m: say grep * > 0, *..*; # no way that would work, right? 02:38
camelia rakudo-moar 5f9cd5: OUTPUT«(timeout)»
TimToady maybe "snap", for take a snapshot of the tuple
grondilu m: say first * > 0, *..*; # no way that would work, right? 02:39
TimToady seems unlikely
camelia rakudo-moar 5f9cd5: OUTPUT«(timeout)»
TimToady we're not trying to invent algebra
02:40 colomon left 02:44 jerrycheung left
TimToady m: say *..* minmax 0..* 02:44
camelia rakudo-moar 5f9cd5: OUTPUT«(timeout)»
TimToady hmm
that oughta work
m: say (*..*) minmax (0..*)
camelia rakudo-moar 5f9cd5: OUTPUT«(timeout)» 02:45
TimToady m: say (*..*).bounds minmax (0..*).bounds 02:46
camelia rakudo-moar 5f9cd5: OUTPUT«-Inf..Inf␤»
TimToady I guess that expands, it doesn't contract 02:47
well, see rosettacode.org/wiki/Set_of_real_numbers#Perl_6 02:48
02:49 nbrown__ joined 02:50 kjs_ joined 02:53 nbrown__ left 02:56 njmurphy joined 02:58 aborazmeh left
grondilu "relatively simple are the convex sets" 02:58
I think what is meant is, is "connex"
grondilu corrects it 02:59
grondilu checks and realizes the correct word is "connected" 03:00
("connexe" being the French word) 03:01
masak grondilu: no, it should be "convex". 03:04
(good time-of-day, #perl6) 03:05
grondilu looks up "convex"
TimToady yes, no "holes"
caves are holes
masak "In Euclidean space, an object is convex if for every pair of points within the object, every point on the straight line segment that joins the pair of points is also within the object." -- en.wikipedia.org/wiki/Convex_set 03:06
that analogy is valid down to 1-space, the real line.
TimToady not what a topologist calls a "hole" of course
masak I think the term "convex hull" could've worked here, too. 03:07
diakopter heh
03:07 PZt left
grondilu Fine. Reverting to convex. 03:07
masak grondilu++ # shared learning 03:13
03:18 rindolf joined 03:20 aborazmeh joined 03:22 xenoterracide left 03:26 aborazmeh left 03:41 firefish5000 left
masak TimToady: I recently dipped into algebraic topology. result: I now have an eerie sense of what a hole "feels" like if you're a group. 03:42
03:50 kjs_ left
masak hoelzro: congratulations on your upcoming marriage! 03:54
it may be an institution, but it's one to which many of us are happy to be committed. :P
TimToady last SciAm has an article indicate we may have been largely monogamous for the last N million years, and that this perhaps accounts for some of our social skills as a species 03:56
masak also, hoelzro++ # docker image
03:58 Alina-malina joined
jack_rabbit Hey, would someone take a look at this? I must be missing something obvious. lpaste.net/110283 04:00
The error is: Type 'HTTPParser::Request' is not declared at HTTPParser.p6:72
04:02 njmurphy left
TimToady I would guess that you're clobbering the previous HHTPParser package somehow; maybe try stubbing class HTTPParser {...} at the front 04:03
masak m: sub circumfix:<ev[ ]>(*@L) { die "List needs an even number of elements, but got @L.elems()" unless @L %% 2; @L }; say ev[ 1, 2, 3, 4 ].perl 04:04
camelia rakudo-moar 5f9cd5: OUTPUT«Array.new(1, 2, 3, 4)␤»
masak m: sub circumfix:<ev[ ]>(*@L) { die "List needs an even number of elements, but got @L.elems()" unless @L %% 2; @L }; say ev[ 1, 2, 3 ].perl
camelia rakudo-moar 5f9cd5: OUTPUT«List needs an even number of elements, but got 3␤ in sub circumfix:<ev[ ]> at /tmp/MjBtAROxkq:1␤ in block <unit> at /tmp/MjBtAROxkq:1␤␤»
masak grondilu: ^^ that's how I'd do the even-item lists thing
TimToady or stub the Request class and then declare the parent package name next
masak in fact, I would try it with multis, but that gave me suspicious errors. golfing.
jack_rabbit TimToady, can you see quite how? 04:05
TimToady, Should I put literally class HTTPParser {}; at the beginning?
04:05 xenoterracide joined
TimToady I mean ... literally 04:05
that will tell the later def that it's redefining, and perhaps not clobber the existing contents of the package 04:06
grondilu masak: yeah I thought about using circumfix as well. Not decided yet.
TimToady "class Foo {...}" is how you stub a class 04:07
masak grondilu: I don't know if it's just impl weakness -- probably -- but I find that `subset` and `where` still falls short of doing manual precondition testing.
TimToady if you need a forward reference
masak ooh.
jack_rabbit TimToady, weird. That seems to work.
TimToady, can you tell why it's clobbering?
masak m: sub circumfix:<ev[ ]>(*@L) { PRE { @L %% 2 }; @L }; say ev[ 1, 2, 3 ].perl
camelia rakudo-moar 5f9cd5: OUTPUT«Precondition '{ @L %% 2 }' failed␤ in sub circumfix:<ev[ ]> at /tmp/AH7DRG4w1q:1␤ in block <unit> at /tmp/AH7DRG4w1q:1␤␤»
masak better :)
m: sub circumfix:<ev[ ]>(*@L) { PRE { @L %% 2 }; @L }; say ev[ 1, 2, 3, 4 ].perl 04:08
camelia rakudo-moar 5f9cd5: OUTPUT«Array.new(1, 2, 3, 4)␤»
TimToady ordinarily people will put the shorter classes before the longer classnames
masak \o/
diakopter if you make it a multi can you put the filter as a parameter constraint?
TimToady so you would never see that the earlier class clobbered its package space
04:08 kaare_ joined
jack_rabbit TimToady, don't I need to declare the classes that the shorter one has as members before it? 04:09
masak diakopter: yes, but I got wyrd messages from a chaotic realm doing that. so I stopped.
grondilu In case you guys have time to give it some thought: what I really want to do is a type that is a list of increasing positive integers. Then I want to define a multiplication on this type so that the result of the multiplication is the increasing list of combined integers, along with the sign of the permutaiton required to get this list.
TimToady so it might be considered a bug that the implicit package declared by class HTTPParser::Foo doesn't consider it stubbed
diakopter o_O
masak: dare I ask where is this chaotic realm
masak grondilu: increasing but not necessarily contiguous, right?
grondilu not necessarily contiguous indeed 04:10
masak diakopter: the concept of 'where' reveals your frailty, mortal.
TimToady m: class Foo::Bar {}; class Foo { has Foo::Bar $.x }
camelia ( no output )
TimToady that seems to work, though...
masak grondilu: didn't grok the "sign of the permutation" part.
grondilu signature is more accurate I think 04:11
TimToady m: class Foo::Bar {}; class Foo { }; class Foo::Baz { has Foo::Bar $.x }
camelia ( no output )
TimToady hmm, can't seem to reproduce my thinking
grondilu (1, 2, 3) -> (2, 1, 3) has a -1 signature for instance.
diakopter m: class Foo::Foo::Bar { say Foo::Foo; } 04:12
camelia rakudo-moar 5f9cd5: OUTPUT«(Foo)␤»
grondilu (en.wikipedia.org/wiki/Parity_of_a_permutation)
masak grondilu: ok, but "required to get this list" from what other list, then?
grondilu you start from two lists, and you get a third 04:13
masak oh, ok, so you concat factor1 and factor2?
grondilu the initial list is the concatenation of the first two
TimToady star-m: class Foo::Bar {}; class Foo { has Foo::Bar $.x }
camelia ( no output )
masak grondilu: got it.
grondilu I which there was an option to the sort function to get the signature of the permutaiton, but maybe that's asking a lot. 04:15
*wish
masak m: class IncList { has @.values; submethod PRE { @!values eqv @!values.sort } }; say IncList.new(:values(1, 5, 3))
camelia rakudo-moar 5f9cd5: OUTPUT«IncList.new(values => Array.new(1, 5, 3))␤»
masak submits NYI rakudobug
m: say [1, 5, 3] eqv [1, 5, 3].sort 04:16
camelia rakudo-moar 5f9cd5: OUTPUT«False␤»
jack_rabbit TimToady, thanks for the help. I'm still not sure exactly what was wrong with the code before.
I'd really like to know.
04:16 xenoterracide left
grondilu masak: you can consider integers to be unique in the concatenated list because if they appear twice they ought to disappear. 04:17
TimToady jack_rabbit: it's because it's already in a module of that name 04:18
jack_rabbit Oh, so I can't have a class of the same name as the module? 04:19
masak FROGGS++ # star
grondilu: ok, so kind of like a sorted set. 04:20
diakopter m: class Foo::Foo::Bar { say Foo::Foo; class Foo::Foo { say Foo::Foo }; say Foo::Foo } 04:21
grondilu it's about my recent interest in Geometric Algebra. What I want to do is to learn how to multiply unitary blades.
camelia rakudo-moar 5f9cd5: OUTPUT«(Foo)␤(Foo::Foo)␤(Foo::Foo)␤»
diakopter o_O
One of these FooFoos is not like the other
grondilu so now that I think about it, repeating numbers do matter because the number of steps to have them join together can change the sign of the permutation. 04:22
diakopter m: class Foo::Foo::Bar { say Foo::Foo; class Foo::Foo { ... }; class Foo::Foo { say Foo::Foo }; say Foo::Foo }
camelia rakudo-moar 5f9cd5: OUTPUT«===SORRY!=== Error while compiling /tmp/04o8J5bytx␤The following packages were stubbed but not defined:␤ Foo::Foo␤at /tmp/04o8J5bytx:1␤------> oo::Foo { say Foo::Foo }; say Foo::Foo }⏏<EOL>␤ expecting …»
diakopter er wut
looks defined-ish to me 04:23
masak m: class IncList { has @.values; submethod BUILD(:@!values) { PRE { @!values.sort eqv @!values } } }; say IncList.new(:values(1, 2, 3)) # why in the world does this precond fail? 04:24
camelia rakudo-moar 5f9cd5: OUTPUT«Precondition '{ @!values.sort eqv @!values }' failed␤ in submethod BUILD at /tmp/OUPeteVt6X:1␤ in method BUILDALL at src/gen/m-CORE.setting:918␤ in method bless at /home/p6eval/rakudo-inst-1/languages/perl6/runtime/CORE.setting.moarvm:1␤ in met…»
masak oh, result of .sort is of a different type, perhaps?
yep, Parcel vs Array. 04:25
m: say (1, 2, 3) eqv [1, 2, 3]
camelia rakudo-moar 5f9cd5: OUTPUT«False␤»
masak must it be thus?
it's kind of annoying. 04:26
grondilu m: say [^10].sort.WHAT
camelia rakudo-moar 5f9cd5: OUTPUT«(Parcel)␤»
TimToady an array is nothing like a parcel
grondilu testing increasingness can be done with [<]
masak m: class IncList { has @.values; submethod BUILD(:@!values) { PRE { [@!values.sort] eqv @!values } } }; say IncList.new(:values(1, 2, 3)) # this works 04:27
camelia rakudo-moar 5f9cd5: OUTPUT«IncList.new(values => Array.new(1, 2, 3))␤»
masak grondilu: good point.
m: class IncList { has @.values; submethod BUILD(:@!values) { PRE { [<] @!values } } }; say IncList.new(:values(1, 5, 3))
camelia rakudo-moar 5f9cd5: OUTPUT«Precondition '{ [<] @!values }' failed␤ in submethod BUILD at /tmp/NVY44_BdJX:1␤ in method BUILDALL at src/gen/m-CORE.setting:918␤ in method bless at /home/p6eval/rakudo-inst-1/languages/perl6/runtime/CORE.setting.moarvm:1␤ in method new at src…»
masak cute!
avuserow_ FROGGS++ # pushing through with a star release
04:27 avuserow_ is now known as avuserow
grondilu didn't know about a PRE phaser 04:28
masak suggestion: emit a summary of all the values that figure in the precondition, saving a debugging iteration.
grondilu: I would've put it on the class instead of in BUILD, but that's NYI. 04:29
m: class IncList { has @.values; submethod BUILD(:@!values) { PRE { [<] @!values } }; method gist { "inc[{@.values.join(", ")}]" } }; sub circumfix:<inc[ ]>(*@values) { IncList.new(:@values) }; multi infix:<(*)>(IncList $l, IncList $r) { IncList.new(:values(($l.values X* $r.values).sort.squish)) }; say inc[1, 2] (*) inc[2, 4] 04:33
camelia rakudo-moar 5f9cd5: OUTPUT«inc[2, 4, 8]␤»
masak grondilu: I believe that's a start.
m: class IncList { has @.values; submethod BUILD(:@!values) { PRE [<] @!values }; method gist { "inc[{@.values.join(", ")}]" } }; sub circumfix:<inc[ ]>(*@values) { IncList.new(:@values) }; multi infix:<(*)>(IncList $l, IncList $r) { IncList.new(:values(($l.values X* $r.values).sort.squish)) }; say inc[1, 2] (*) inc[2, 4] 04:34
camelia rakudo-moar 5f9cd5: OUTPUT«inc[2, 4, 8]␤»
masak (in fact, can skip the block for the PRE phaser)
grondilu no you're not supposed to multiply the integers of the list
masak oh!
just concat them. got it.
m: class IncList { has @.values; submethod BUILD(:@!values) { PRE [<] @!values }; method gist { "inc[{@.values.join(", ")}]" } }; sub circumfix:<inc[ ]>(*@values) { IncList.new(:@values) }; multi infix:<(*)>(IncList $l, IncList $r) { IncList.new(:values(($l.values, $r.values).sort.squish)) }; say inc[1, 2] (*) inc[2, 4] 04:35
camelia rakudo-moar 5f9cd5: OUTPUT«inc[1, 2, 4]␤»
masak released a new version :P
grondilu avoid putting a common integer in both list as this is a special case.
masak er, but one I explicitly wanted to test... 04:36
grondilu so for instance [1, 3] and [2, 4]
masak m: class IncList { has @.values; submethod BUILD(:@!values) { PRE [<] @!values }; method gist { "inc[{@.values.join(", ")}]" } }; sub circumfix:<inc[ ]>(*@values) { IncList.new(:@values) }; multi infix:<(*)>(IncList $l, IncList $r) { IncList.new(:values(($l.values, $r.values).sort.squish)) }; say inc[1, 3] (*) inc[2, 4]
camelia rakudo-moar 5f9cd5: OUTPUT«inc[1, 2, 3, 4]␤»
grondilu should give -[1, 2, 3, 4]
masak ok, siggie is the remaining bit.
grondilu that's the most tedious part I'm afraid. 04:37
masak time to do it in a gist instead.
I guess the siggie can be computed as (-1) ** [+] @displacements 04:38
where each number in @displacements is the diff in position between actual and sorted.
grondilu I'm glad to see you're motivated. If you want to do it all the way the rule for an integer appearing in both lists is that you should "move" one towards the other one and if the number of step is n then you multiply the signature by (-1)^n 04:39
masak right.
I think what I said comes down to that.
04:39 pyrimidine joined
masak and so the problem reduces to computing @displacements in a nice way. 04:39
grondilu it seems to be this indeed. You can sort as in a squish but in the end all pairs of identic numbers must disappear. 04:40
04:40 pyrimidine left
grondilu "pairs" not triplets or more. E.g 3,4,4,4,5 -> 3,4,5 04:41
04:42 bjz_ left
masak oh, the displacement has to be done post-squish. I kind of assumed that. 04:42
04:42 bjz joined
grondilu hum not really 04:42
masak oh, I see what you're saying. 04:43
grondilu first you displace, counding the number of displacement. then you remove all pairs of conitguous numbers
I mean pairs of contiguous identical numbers
masak what about the case 2,4,3,4,5 04:44
grondilu that will in the end give -[2,3,5]
masak where did the 4s go?
grondilu poofed
masak this is a new requirement I didn't hear about until now.
grondilu 2,4,3,5 -> -[2,3,4,4,5] -> -[2,3,5] 04:45
I added it a bit earlier.
I promess after this that's all :)
masak ok, things made sense for me up until that point. giving up. sorry. 04:46
grondilu ahh nevermind. Thanks for trying.
hoelzro masak: thanks!
grondilu 2,4,3,4,5 -> -[2,3,4,4,5] -> -[2,3,5] # fixing typo just in history 04:47
04:49 pyrimidine joined
pyrimidine Hola; seeing an error when I am running local tests for bioperl6 04:51
masak hi pyrimidine 04:52
go on. :)
pyrimidine o/
Merging GLOBAL symbols failed: duplicate definition of symbol CodonTable
masak pyrimidine: usually from importing two modules/files that declare the same module/class. 04:53
pyrimidine I'm running a 'use Bio::Tools::CodonTable' in the tests, but later on I am running some tests with a 'use Bio::PrimarySeq' (which also has a 'use Bio::Tools::CodonTable')
These don't declare the same class 04:54
masak ah, so a diamond pattern usage kind of thing?
pyrimidine no
masak sounds like it.
pyrimidine let's see, I'll point to github
masak A -> B, C; B, C -> D
pyrimidine masak: github.com/cjfields/bioperl6/blob/...imarySeq.t 04:55
oh wait, I think I see it 04:56
nm, wrong URL: github.com/cjfields/bioperl6/blob/...donTable.t
I run all the tests I need, then pull in PrimarySeq using 'use Bio::Tools::PrimarySeq' here: github.com/cjfields/bioperl6/blob/...ble.t#L174 04:57
I can probably golf that down quite a bit 04:58
05:01 kurahaupo joined 05:03 mberends left
pyrimidine masak: gist.github.com/cjfields/ec8d7ed93e72db10854f 05:03
masak looks 05:05
pyrimidine I can see what the problem is (CodonTable is used by PrimarySeq, so 'has' but no 'extends/does'). I wouldn't expect there to be a collision. 05:07
masak ok, abstracting away from the specifics:
your file T uses module C which declares a global type. 05:08
then, a bit later, your file T uses another module P which transitively uses C, again.
the collision seems to come from those two separate uses of C.
masak tries to confirm this
so it's not really a diamond, it's T -> C, P; P -> C 05:09
hm. 05:10
pyrimidine yep
masak just setting up that situation locally doesn't trigger the error.
pyrimidine: would you be willing to golf the files down to the bare minimum? that'd be interesting.
pyrimidine will try
masak (like really the bare minimum. if the files end up having one line in them, that's optimal.)
kurahaupo masak: do you really need that trailing newline ? :) 05:14
masak heh. 05:15
well, I tend to view the golfing as being on tokens, not characters. so I'm not too bothered by the newline.
besides, how many lines would you say that a file without a trailing newline has?
kurahaupo according to wc, 0 05:16
after all, if you concateate such a file with another file that has N lines, the result is a file with N lines 05:17
masak yes, though wc's man page refers to them as "newlines", not "lines".
05:17 kaare__ joined
masak m: say "".lines.elems 05:18
camelia rakudo-moar 5f9cd5: OUTPUT«0␤»
masak m: say "I told you it was soap".lines.elems
camelia rakudo-moar 5f9cd5: OUTPUT«1␤»
05:20 kaare_ left
pyrimidine masak: github.com/cjfields/perl6-testcase 05:23
it's... odd
kurahaupo mutters quietly in the corner about mad dwimmery
05:23 jack_rabbit left 05:24 SamuraiJack joined
pyrimidine masak: ran using "prove -e 'perl6' -l t/CodonTable.t" 05:25
masak pyrimidine: did you need 'use Test' for it to trigger?
and 'done()'?
I doubt that, since this is a compile-time thing.
pyrimidine nope, just tried it w/o 'use Test'/done
masak pyrimidine: does it still trigger without the 'class Bio::PrimarySeq;' line? 05:26
pyrimidine yep
masak clones and plays around with it
pyrimidine: s/Codontable/CodonTable/ in PrimarySeq.pm6 05:28
pyrimidine: after that change, everything runs fine here. 05:29
This is perl6 version 2014.08-128-g72852f1 built on MoarVM version 2014.08-36-g7938703
pyrimidine testing it out... 05:30
nope, still a problem. 05:31
05:35 jack_rabbit joined
pyrimidine I'll run a clean checkout just to make sure, but changing the case didn't make a difference 05:36
masak em, changing the case was necessary for me to get it running in the first place. 05:37
if I didn't, I got an error that it didn't find the module.
are you on a case-insensitive file system, perchance?
pyrimidine that's my thought: Mac OS X 05:38
05:38 JimmyZ joined
pyrimidine is testing this on a Linux box 05:41
btw, on the Mac: This is perl6 version 2014.08-163-g5f9cd51 built on MoarVM version 2014.08-55-ga5ae111 05:44
masak wow, I'm so behind. 05:45
masak git pulls and rebuilds
pyrimidine I think it's a namespace thing 05:46
if I remove the Bio* namespace it works fine 05:47
masak interesting.
pyrimidine Also have to save the files in the base directory. It's odd 05:49
pyrimidine just pushed a few more 05:51
grondilu m: module Foo { subset Bar of Str is export where /\!/ }; import Foo; say "foo!" ~~ Bar; 05:52
camelia rakudo-moar 5f9cd5: OUTPUT«True␤»
masak pyrimidine: both the test files run fine here. I'm now on 2014.08-163-g5f9cd51 too.
pyrimidine about to test on our linux server 05:53
yep, passes there without problems 05:55
masak: so, first test fails for me on Mac but second passes. On Linux both pass. 05:56
05:56 SamuraiJack left
pyrimidine more specifically, CodonTable.t fails, but CodonTable2.t passes 05:56
pyrimidine is going to sleep, golfed out 05:57
should I go ahead and file a bug? 05:58
05:58 SamuraiJack joined
masak yes, please. 05:59
pyrimidine will do. thanks!
masak pyrimidine++
pyrimidine masak: RT or GitHub?
nm, found it (RT) 06:00
masak aye. 06:02
grondilu got surprised by the =END not being valid anymore. Fortunately he remembered that it has been replaced by =finished lately. 06:04
*=finish
06:06 cxreg2 is now known as cxreg 06:07 darutoko joined
pyrimidine masak: done, RT #122660 06:10
synopsebot Link: rt.perl.org/rt3//Public/Bug/Displa...?id=122660
pyrimidine Night! 06:11
06:11 pyrimidine left
grondilu p6: say "".split(':').perl 06:15
camelia rakudo-{parrot,jvm,moar} 5f9cd5: OUTPUT«("",).list␤»
..niecza v24-109-g48a8de3: OUTPUT«[""].list␤»
grondilu was expecting [] for some reason 06:16
06:17 kaare__ left, kaare__ joined
masak grondilu: what would you expect "foo".split(':') to result in? 06:17
grondilu yeah, makes sense 06:23
thing is I got "" from joining [] and that was not reversible 06:24
m: say [].join(":").perl 06:25
camelia rakudo-moar 5f9cd5: OUTPUT«""␤»
grondilu m: say [].join(":").split(":").perl
camelia rakudo-moar 5f9cd5: OUTPUT«("",).list␤»
grondilu I was taking for granted that split would reverse join, but it doesn't in the degenerate case 06:26
m: say <foo bar>.join(":").split(":").perl 06:27
camelia rakudo-moar 5f9cd5: OUTPUT«("foo", "bar").list␤»
grondilu m: say [].join 06:29
camelia rakudo-moar 5f9cd5: OUTPUT«␤»
grondilu m: say [].join.perl
camelia rakudo-moar 5f9cd5: OUTPUT«""␤»
grondilu it's a bit odd that [].join returns the same thing as [""].join 06:30
but that's ok. Not a big deal. 06:32
masak m: ["", "", "", ""].join 06:35
camelia ( no output )
masak m: say ["", "", "", ""].join.perl
camelia rakudo-moar 5f9cd5: OUTPUT«""␤»
masak that's like saying "it's a bit odd that [+]() returns the same thing as [+](0)"
m: say [+](); say [+](0) 06:36
camelia rakudo-moar 5f9cd5: OUTPUT«0␤0␤»
grondilu it's indeed the same thing. The fact remains that as a consequence split is not the inverse of join. 06:37
moritz it's simply that '' is the neutral element of string concatenation
moritz mumbles something about monoids 06:38
06:38 anaeem1 joined
masak it goes deeper than that. split and join may feel like mutual inverses, but I don't think they ever promised that. 06:43
it's more like they are adjoint functors, actually. 06:44
grondilu so you know, this happened as I decided to just join my arrays before using them as keys for a hash. I thought it would be simpler. So I wrote something like %h{@a.join(':')}++. But then when I wrote .split(':') for %h.keys it did not work as expected where @a was initially [] 06:45
masak doesn't see why not 06:46
oh, ok; I do.
grondilu because I was testing @a == 0
masak will you ever have a case of @a eqv [""] ? 06:47
grondilu yes
oh sorry I mean no
masak I'm just wondering which of the two paths you'll want to take here.
right, ok. so you in effect want "" to map to () by some operation that is almost like .split(':') 06:48
grondilu what I really want is to reliably serialize arrays for use as a key. 06:49
split/join proved to not work if not careful of degenerate cases 06:50
masak m: sub strictsplit($s) { my @L = $s.split(":"); @L eqv [""] ?? Array.new !! @L }; say strictsplit($_).perl for "foo:bar", "foo", "" 06:52
camelia rakudo-moar 5f9cd5: OUTPUT«Array.new("foo", "bar")␤Array.new("foo")␤Array.new()␤»
06:53 virtualsue joined
masak grondilu: a lot of things in programming prove to not work if one is not careful of degenerate cases :) 06:54
grondilu definitely
masak grondilu: more specifically, I think that this is a case of you having unusual requirements rather than .split being wrongly spec'd
grondilu :/ 06:55
Well, I wouldn't have to serialize arrays for use as a key if we had a proper Parcel.WHICH (see backlog)
masak that we should indeed have. 06:56
there are a lot of small annoyances with .WHICH that I look forward to us straightening out.
06:56 domidumont joined 06:57 virtualsue left 07:03 dolmen joined
moritz note that .WHICH will only work for your use case if the array/parcel elements are all of value types 07:06
07:53 dolmen left 08:02 JimmyZ_ joined 08:03 JimmyZ left 08:04 JimmyZ_ is now known as JimmyZ 08:11 mj41 joined, gfldex joined 08:12 ivan`` left, JimmyZ_ joined 08:13 JimmyZ left, JimmyZ_ is now known as JimmyZ 08:17 ivan`` joined 08:24 SamuraiJack left 08:32 kurahaupo_ joined, FROGGS_ is now known as FROGGS 08:33 kurahaupo left 08:41 mberends joined 08:43 Alina-malina left 08:44 Alina-malina joined, kurahaupo_ left 08:46 JimmyZ_ joined 08:47 JimmyZ left, JimmyZ_ is now known as JimmyZ 08:49 bpalmer joined
FROGGS .tell coloman: why does the OpenSSL smoke test complain about LibraryMake when LibraryMake itself is green? 09:07
yoleaux FROGGS: What kind of a name is "coloman:"?!
FROGGS .tell colomon why does the OpenSSL smoke test complain about LibraryMake when LibraryMake itself is green? 09:08
yoleaux FROGGS: I'll pass your message to colomon.
09:18 anaeem1 left, anaeem1 joined
masak moritz: but they all seem to be value types in grondilu's case. 09:20
09:23 anaeem1 left 09:27 bpalmer left 09:28 JimmyZ_ joined, MilkmanDan joined 09:29 JimmyZ left, JimmyZ_ is now known as JimmyZ 09:30 kurahaupo joined 09:39 JimmyZ_ joined 09:41 jerrycheung joined, JL235__ left 09:42 JimmyZ left, JimmyZ_ is now known as JimmyZ 10:00 cognome_ left, cognome joined 10:04 cognome left 10:06 spider-mario joined 10:17 bbkr joined 10:34 brrt joined 10:38 JimmyZ_ joined, kaare__ left 10:39 JimmyZ left 10:40 JimmyZ_ is now known as JimmyZ 10:43 SamuraiJack joined 10:47 colomon joined 10:52 kjs_ joined 10:53 JimmyZ_ joined 10:55 JimmyZ left, JimmyZ_ is now known as JimmyZ 10:59 zakharyas joined
colomon smoker ran to completion on its own last night! \o/ grondilu++ 11:02
yoleaux 09:08Z <FROGGS> colomon: why does the OpenSSL smoke test complain about LibraryMake when LibraryMake itself is green?
11:03 mberends left
colomon FROGGS: Might mean LibraryMake isn't installing to the right place or something? 11:07
masak stray idea: gist.github.com/masak/d59749975a1d4e200903 -- comments/scorn/amusement welcome. 11:09
FROGGS colomon: hmmm, weird
11:10 brrt left
colomon remembers how he tests these things…. 11:11
actually looks like the problem is the other way around. LibraryMake correctly installs to /home/smoker/emmentaler/installlib/lib/LibraryMake.pm6.moarvm 11:19
but OpenSSL isn't looking there to find it.
nine masak: your grammar seems less strict on white space than your classes. 11:20
masak nine: how so? they're all tokens.
oh! 11:21
yes.
nine: corrected ':' to ': '
nine masak: my gut feeling says that your grammar generator would become too complicated too quickly for this to be really useful. But if you know someone who needs a topic for a bachelor's thesis, this would certainly be very interesting. 11:24
masak I think that you're right. 11:25
it *would* be interesting to see how far one could push this. 11:26
I had a related thought as I was writing this, though:
jnthn imagines feeding a bachelor student the Grammar::Generative project :)
Such cruelty :)
masak jnthn: you mean costudent, surely
jnthn masak: Categorically not... :P 11:27
masak I think my absolute ideal environment for putting together a Perl 6 grammar would be a web application where one started by writing a test case, an input that one wanted to parse. application would immediately take that and turn it into a grammar that just parsed the whole big blob of text and nothing else. 11:28
lizmat_ on the low-hangning segfaulting front:
$ perl6 t/spec/integration/99problems-51-to-60.t
masak but then one would go into that grammar and selectively apply refactors and generalizations, all the time keeping the original input passing.
lizmat_ segfaults consistently for me
FROGGS lizmat_: look at my paste in #moarvm 11:30
11:30 lizmat_ is now known as lizmat
dalek ast: f8edcac | (Elizabeth Mattijsen)++ | S32-exceptions/misc.t:
Unfudge now passing test
11:31
colomon hmmm, lots of modules failing because they can't find LibraryMake, not just OpenSSL 11:38
FROGGS colomon: can you rename the installed file from .pm6.moarvm to .pm.moarvm? 11:39
colomon FROGGS: think that's it? It's not terribly easy to do in the middle of a smoke test run 11:40
lizmat Looking at S01:120, one could get the impression that "use v5" should be part of the core 11:41
synopsebot Link: perlcabal.org/syn/S01.html#line_120
FROGGS colomon: I have no idea, really
lizmat although probably not part of the core settings
FROGGS lizmat: I know
lizmat: but it tends to be too big to be part of the compiler
lizmat too big as in: adding to much time for a make ? 11:45
*too
FROGGS exactly 11:46
11:47 zakharyas left 11:53 brrt joined 11:56 Akagi201 joined 12:06 rindolf left 12:13 bbkr left
dalek kudo/nom: 428e0e6 | (Elizabeth Mattijsen)++ | src/core/Process.pm:
Make initialization of $*TMPDIR lazy

This takes off about .005 off the startup of Perl6, effects in spectest are not visible, perhaps because many of the tests use $*TMPDIR implicitely.
12:13
colomon FROGGS: actually, I think the problem might be with panda? 12:19
lizmat m: my $a = do { return 42 }
camelia ( no output )
lizmat $ MVM_SPESH_DISABLE=1 perl6 -e 'my $a = do { return 42 }' 12:20
Segmentation fault: 11
segfaults locally for me
can someone confirm ?
colomon seems to throw me in the REPL?!? 12:21
lizmat: ^^
ah, no, I see
seg fault on OS X
and linux 12:22
lizmat also in the REPL
12:22 kaare_ joined, rindolf joined
colomon lizmat: wasn't actually the REPL, I missed the closing quote in my copy-n-paste so the shell wanted more input. 12:23
lizmat actually, I can golf it down to just { return }
$ MVM_SPESH_DISABLE=1 perl6 -e '{ return }'
Segmentation fault: 11
hmmm... actually just return is enough 12:24
lizmat rakudobugs
colomon lizmat: confirmed for just { return }, too 12:25
lizmat $ perl6-p -e 'return'
Attempt to return outside of any Routine
is what it probably should be
r: say EVAL "return 42; die" # slightly related 12:28
camelia rakudo-{parrot,jvm,moar} 5f9cd5: OUTPUT«42␤»
lizmat are we expecting a retiurn in an EVAL to return from the EVAL sub ?
12:43 cibs joined 12:44 cognome joined 12:47 JimmyZ_ joined, Gruber joined
colomon FROGGS: okay, I think broadly speaking the problem here is that the customer smoker installlib directory isn't making it to the instance of rakudo that tries to build OpenSSL 12:48
12:50 grondilu_ joined, mj41_nb joined 12:51 cxreg2 joined, btyler_ joined 12:53 brrt left 12:57 JimmyZ left, mj41 left, grondilu left, Grrrr left, renormalist left, btyler left, cxreg left, Alula_ left 12:58 telex left 13:00 telex joined 13:01 renormalist joined 13:09 chenryn joined 13:15 colomon left 13:17 colomon joined
colomon aha! 13:20
emmentaler carefully sets PERL6LIB before calling into panda
panda carefully sets aside the exisitng PERL6LIB to construct one of its own 13:21
13:21 Gruber is now known as Grrrr
colomon errr, no, it's trying to use the existing one.... 13:22
13:28 jerrycheung left 13:29 JimmyZ joined
dalek kudo/nom: 02e73a2 | (Elizabeth Mattijsen)++ | src/core/List.pm:
.join instead of join() shaves off one indirection
13:30
13:30 JimmyZ_ left
13:33 JimmyZ_ joined 13:34 JimmyZ left 13:35 JimmyZ_ is now known as JimmyZ
colomon huh. the withp6lib command definitely seems to be building up a workable PERL6LIB, but then the actual build command ignores it? 13:36
13:41 guru joined, guru is now known as ajr_ 13:43 mj41_nb left 13:45 JimmyZ_ joined
dalek kudo/nom: 684002d | (Elizabeth Mattijsen)++ | src/core/Hash.pm:
Make Hash.gist according to spec
13:46
13:48 JimmyZ left, JimmyZ_ is now known as JimmyZ 13:53 jerrycheung joined 13:58 SamuraiJack left
dalek kudo/nom: d417459 | (Elizabeth Mattijsen)++ | src/core/Hash.pm:
Be consistent in use of self
14:00
moritz o/
14:01 zakharyas joined
lizmat now that we have stable .WHICH 14:03
does anybody have an idea on how to fix: 14:04
m: my @a; @a[0]=@a; @a.say
jnthn lizmat: Glad to see that's being taken advantage of already :)
camelia rakudo-moar 428e0e: OUTPUT«(timeout)»
14:05 colomon left 14:07 colomon joined 14:08 araujo left 14:11 araujo joined
moritz lizmat: I guess you'd have to keep a %SEEN hash somewhere, and consider it in .perl 14:11
colomon lizmat's on a roll again! \o/
moritz lizmat: but I can only think of solutions that aren't thread safe 14:12
lizmat well, the %SEEN would first need to create a hash for the thread it's in
and have that protected
moritz is there a stash THREAD:: ? like GLOBAL::, but local to the current thread? 14:13
lizmat I was hoping to create a generic mechanism that could be used by all .perl methods
I don't think there is a THREAD::
moritz if there were, it'd be the ideal place to put such a thing 14:14
lizmat
.oO( I think I can hear jnthn already scream: NOOOOOOOOO.... :-)
14:15
14:16 nbrown__ joined
lizmat OTOH, perhaps this could be lazily created 14:16
masak %*SEEN, a dynamic variable. 14:17
ISTR dynamic variables already DTRT with threads, too.
jnthn Well, we have a $*THREAD, but I'd be a little wary of it
Dynvars are the safe thing here.
masak seems like the obvius hook to hang it on to me. 14:18
obvious*
as this is a structural recursion, so the variable is tied to a process, not an object or a lexical scope.
lizmat but how can I create a dynvar at the start thread level from a sub? 14:19
as we don't want to create this dynvar every time we start a thread, right ? 14:20
jnthn I don't really see how it relates to threading, tbh; feels jus tlike straight dynvar usage to me
lizmat so if two threads start to construct a .perl representation using a %*SEEN hash, they will never interfere with each other ? 14:21
jnthn lizmat: Provided it's a real lexical in a callframe rather than a GLOBAL fallback, sure 14:22
lizmat: my %*FOO; # really declares a lexical, just one we can find by looking down the call stack 14:23
and threads have their own call stacks.
lizmat ah, yes, I get that
14:23 denis_boyun_ joined
lizmat my %h = a => { b => 1 } 14:23
Hash.perl is called twice creating a .perl of %h 14:24
how will it know one call is the "outer" without having some global state ?
by checking for %*SEEN.defined ?
jnthn It's not about outer 14:25
It's about caller
and yeah, it can be done that way
lizmat sorry, caller
jnthn my %*SEEN := CALLER::<%*SEEN> // Hash{Mu}.new; # or so 14:26
Though I'd call it something a little less generic
lizmat hmmm...
jnthn %*GIST-SEEN and %*PERL-SEEN maybe
14:27 JimmyZ left
lizmat still, that would only be a pattern, and not a generic solution :-( 14:28
jnthn What problem are you wanting a general solution for? 14:29
lizmat for the .perl case, I would also probably need to be able to represent 'my @a; @a[0]=@a' as a single statement
m: my @a; @a[0]; say @a
camelia rakudo-moar 428e0e: OUTPUT«␤»
lizmat m: my @a; @a[0]=@a; say @a 14:30
camelia rakudo-moar 428e0e: OUTPUT«(timeout)»
TimToady masak: yes, we determined last night that Parcel probably needs to have a .WHICH that is based on its component .WHICHes, so that parcels of values behave like proper tuples
shower & 14:31
masak I missed that discussion, but I already assumed it'd have to.
if it were a simple hash code, I'd expect it to use all of its component hash codes. 14:32
lizmat m: say (1,).WHICH # so this should become Parcel|Int|1 ?
camelia rakudo-moar 428e0e: OUTPUT«Parcel|60273496␤»
lizmat masak: ^^^ ? 14:34
jnthn We probably need to stop constructing strings for ObjAt...
And start making it an integer.
But that needs work on hashes more generally
But anyway, it means combining integers in some good way 14:35
Loads of literature on that
colomon mmmmm, integers
masak +1 to stop with the strings
lizmat also: for .perl and friends, we probably also need to have a way to determine if the object type is value base or not
*based 14:36
jnthn: so you're saying that now that .WHICH is unique for each object during the lifetime of a process 14:37
we don't need the type in ObjAt anymore ?
14:37 pmurias joined
jnthn lizmat: Important note; unique for each object during the lifetime of *that object*. 14:37
lizmat: Once you start combining them, conflicts are, of course, possible. 14:38
lizmat ah, so the same nqp::objectid can still occur for 2 objects during the lifetime of the process
jnthn lizmat: That's how we generally understand hash codes, though.
14:39 nbrown__ left
colomon jnthn: does that imply that memoize needs to hold a copy of each object its called with so the objectid stored in the cache doesn't get recycled 14:40
masak colomon: I think that's a case of "both ways". 14:41
jnthn colomon: Sure, but that's how any non-perfect hash has to work anyway.
masak colomon: some will want memoize to keep stuff alive; some will want it to not leak. 14:42
jnthn colomon: Hashes always have the real values of their keys to hand, in general, to make sure it's not a false positive.
14:46 zakharyas left
moritz lizmat: we can't get rid of the type in ObjAt, because value types don't use the object ID in there 14:48
lizmat: value types use a representation of the value, and we need to be able to distinguish 1 from "1"
(though we should use the object ID of the type, not the type name, for that 14:49
14:49 xenoterracide joined
lizmat moritz: that's not the issue 14:49
jnthn Indeed. nqp::objectid(thing.WHAT)
lizmat it's just that when creating a .perl representation of e.g. (1,1,1,1,1)
I don;'t want the 2nd and later "1" to be represented by the first value of the parcel 14:50
or in P5 data::dumper format:
moritz yes, that should only be done for reference types
xfix Just asking. Is it possible to match a set of elements in any order, but every element can be matched only once? For example, let's say I want to match "", "a", "b", "ab", "ba", but not "aba" or "bb"?
lizmat $VAR1 = ( 1, $VAR1[1], $VAR1[1],... )
moritz so we need to come up with a way of asking a type if it's a value type or a reference type 14:51
lizmat yes
xfix Int is immutable, isn't it?
moritz xfix: yes
xfix: also yes
jnthn lizmat: I think it's for the .perl method of the type in question to know whether it should go looking in the seen hash...
xfix moritz: ok, now how can I match "", "a", "b", "ab", "ba", but not "aba" or "bb"? 14:52
jnthn "Am I a reference type? Do I caontain other things? OK, I should check..."
xfix (now that I got an answer that I can)
moritz xfix: $thing eq any("", "a", "b", "ab", "ba")
lizmat jnthn: good point, but that just makes that pattern to be more spread out over the whole settings
moritz xfix: or in a regex, [ '' | 'a' | ' b' | 'ab' | 'ba ] 14:53
xfix: (+ the closing quote I forgot)
lizmat but I guess, there is no other way than that :-(
xfix Uhm, yeah. But well, I have more tokens than just "a" and "b".
And I don't want to exponentially write the regex.
moritz xfix: then maybe you should ask the question you actually wanted to know the answer of
masak xfix: all(@things) eq any(@tokens) && @things.uniq == @things
xfix Thanks. 14:54
moritz masak++ # reading minds better than I do
jnthn lizmat: Hm, true... 14:55
timotimo how about doing that with a Bag instead?
masak m: my @tokens = <a b>; for [], [<a>], [<a b>], [<a b a>] -> @things { say all(@things) eq any(@tokens) && @things.uniq == @things }
camelia rakudo-moar d41745: OUTPUT«True␤True␤True␤False␤»
timotimo like "the bag's values are all 1 and the keys are a subset of the @tokens" 14:56
masak xfix: if I wanted to do it in a regex, I'd simply scan token by token, check that it's among the ones I accept, and keep a %seen hash.
xfix Thanks, this sounds great. 14:57
jnthn lizmat: Maybe there would be some way to factor out the check...like a method perl-or-seen(&how-to-perl) { ... }
lizmat: And then Hash.perl does something like method perl() { self.perl-or-seen({ ...code that does what .perl does today in this closure })
lizmat: And if the thing has been seen then we never call that closure and hand back the seen value... 14:58
lizmat handing back the seen value is not a solution either
you want to return something that refers to the first place seen in the structure
jnthn uh, I mean like a string that corresponds to it.
$VAR1 or so 14:59
14:59 nbrown__ joined
lizmat ok 14:59
jnthn That is, .perl-or-seen is always returning a string.
lizmat ok, yes, that makes sense
jnthn That can then even be used by those who want to make their own types play along with this. 15:00
masak m: my @tokens = <a b>; for "", "a", "ab", "aba" -> $input { say $input ~~ /^ (@tokens)* $/ && @0>>.Str.uniq == @0 } # xfix
camelia rakudo-moar d41745: OUTPUT«True␤True␤True␤False␤»
lizmat we don't have a smart way to refer to the current base data structure, do we?
grondilu_ p6: (sub (Int @) {})([^3]);
masak xfix: couldn't figger out a way to do it all from inside the regex
xfix Thanks.
I'll use a set anyway.
15:00 grondilu_ is now known as grondilu
camelia ( no output ) 15:00
..rakudo-jvm d41745: OUTPUT«(timeout)»
..rakudo-moar d41745: OUTPUT«Type check failed in binding <anon>; expected 'Positional[Int]' but got 'Array'␤ in sub at /tmp/tmpfile:1␤ in block <unit> at /tmp/tmpfile:1␤␤»
..rakudo-parrot d41745: OUTPUT«Type check failed in binding; expected 'Positional[Int]' but got 'Array'␤ in sub at /tmp/tmpfile:1␤ in block <unit> at /tmp/tmpfile:1␤␤»
jnthn lizmat: No, but could do the smae kinda dynvar trick I mentioned before...
15:00 grondilu left, grondilu joined
masak xfix: sure, that works too. 15:00
15:03 nbrown__ left
grondilu p6: (sub (Int @) {})(my Int @ = ^3); # OK, found relevant spec in S14 15:05
camelia ( no output )
dalek osystem: 17b10a3 | Carlin++ | META.list:
add Crypt::Reop

NativeCall interface for reop
15:06
15:07 denis_boyun_ left, kurahaupo left, denis_boyun joined
grondilu n: subset Foo of Int; (sub (Foo @) {})(my Foo @ = ^3); 15:08
camelia niecza v24-109-g48a8de3: OUTPUT«Unhandled exception: Constraint type check failed for parameter '' in 'ANON'␤ at /tmp/H1Xc59dv52 line 0 (ANON @ 1) ␤ at /tmp/H1Xc59dv52 line 1 (mainline @ 4) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4595 (ANON @ 3) ␤ at /home/p6eval/…»
15:10 cxreg2 is now known as cxreg, nbrown__ joined 15:12 mberends joined 15:14 nbrown__ left
timotimo oooh, it's not terribly long until the advent calendar is going to happen again 15:15
jnthn Wonder if we'll find anything to write about this year... :P
timotimo hmm. sounds difficult 15:16
jnthn ;)
timotimo i didn't do anything at all!
jnthn Time for some rest here...hopefully will feel up to writing code again by tomorrow evening...
15:16 nbrown__ joined
jnthn 'night 15:16
timotimo get well soon! :) 15:17
15:21 BizarreCake joined
lizmat gnight jnthn and get well! 15:21
15:23 mj41_nb joined 15:24 nbrown__ left 15:27 denis_boyun left
masak yes, 'night, #perl6, and sweet dreams. 15:28
moritz early night in south sweden today? :-)
15:28 jepeway joined 15:31 kjs_ left 15:32 jerrycheung left, jepeway left
lizmat moritz: afaik, masak is at +0800 GMT 15:33
moritz lizmat: oh, I must have missed some travel announcement :-) 15:34
timotimo he's in china with jnthn afaict 15:36
grondilu std: (sub (Hash{Int} %) {})(my Hash{Int} % = 1 => 2); # not sure I can use a typed array as a parameter
camelia std 53b3ca6: OUTPUT«ok 00:01 133m␤»
grondilu n: (sub (Hash{Int} %) {})(my Hash{Int} % = 1 => 2); # I know moar fails. Testing Niecza 15:37
camelia niecza v24-109-g48a8de3: OUTPUT«===SORRY!===␤␤WHENCE blocks not allowed on declarative type names at /tmp/SRFjZccbdG line 1:␤------> (sub (Hash{Int}⏏ %) {})(my Hash{Int} % = 1 => 2); # I k␤␤WHENCE blocks not allowed on declarative ty…»
15:40 jepeway joined
jepeway 'lo? 15:46
15:49 brrt joined
brrt lizmat: confirmed for return. i suspect the optimizer may throw away the return lexotic? 15:51
lizmat it even happens with MVM_SPESH_DISABLE=1 ?
$ perl6 --optimize=0 -e 'return' 15:52
Segmentation fault: 11
also with --optimize=0
15:52 Alula_ joined
brrt hmmm 15:53
ok, then i just don't know. there is at any rate no RETURN lexotic there
and moar returns null where it should return a register
(a register that might return contain null, but that's not the point) 15:54
s/return//
i... don't think i've a commit bit for rakudo, but it seems to me that the routine thinks NULL is acceptable as a return value 15:55
so it seems to be the best fix is to not deref the register pointer immediately
(oh, i should've said, it burns on src/vm/moar/ops/perl6_ops.c:466 15:56
lizmat seems wrong to fix it there, as that is hot code 15:57
I'd rather see this fixed by adding an outer frame or sub or whatever, that would then throw if entered from a return 15:58
then we'd only have the overhead if something's wrong, not for every return
brrt hmmm
it's not really a cheap function as it is
15:59 mj41_nb left
brrt but maybe you're right and this should be caught much earlier 15:59
anyway, it /does/ do the right thing :-) 16:00
lizmat brrt: I think I have a solution at the P6 level 16:04
brrt more awesome :-) 16:05
lizmat spectesting now
brrt anyway, this is the fix at c level: gist.github.com/bdw/cc441decdeec2ff692be
timotimo we have a piece of optimization that throws away returns if they are at the end of a block 16:07
maybe that happens here?
lizmat perhaps... anyways, I'll try brrt's fix 16:08
and make sure we don't lose too much in the spec test
grondilu std: my (%a{Int}, %b{Int});
camelia std 53b3ca6: OUTPUT«ok 00:01 127m␤»
grondilu m: my (%a{Int}, %b{Int});
camelia rakudo-moar d41745: OUTPUT«===SORRY!=== Error while compiling /tmp/zuiLfqm9vJ␤Unable to parse expression in declarator; couldn't find final ')' ␤at /tmp/zuiLfqm9vJ:1␤------> my (%a⏏{Int}, %b{Int});␤ expecting any of:␤ scoped…»
16:12 anaeem1 joined 16:13 anaeem1 left 16:14 anaeem1 joined 16:17 mj41_nb joined
dalek kudo/nom: b6bc387 | (Elizabeth Mattijsen)++ | src/vm/moar/ops/perl6_ops.c:
Fix for #122667, as suggested by brrt++
16:18
synopsebot Link: rt.perl.org/rt3//Public/Bug/Displa...?id=122667
brrt do we lose a lot? 16:19
16:19 nbrown__ joined 16:20 xinming_ joined
lizmat I don't see it in the spectest 16:21
my other fix made quite a lot spectests fail
so, I shelved it in favour of your solution 16:22
16:24 nbrown__ left, xinming left 16:28 nbrown__ joined, mj41_nb left 16:32 nbrown__ left 16:34 kurahaupo joined 16:40 mberends left 16:41 vendethiel joined
vendethiel o/, #perl6. 16:43
colomon \o
16:44 mberends joined
vendethiel I've been backlogging during my trip (tired of >24h travel) and I've seen some people stumbling on minor "issues" 16:45
(feel free to just .tell anyway in these cases)
16:46 Rounin_ is now known as Rounin
timotimo issues with what now? 16:51
vendethiel tutorial
timotimo thought so 16:52
vendethiel I've also seen grondilu++ struggling a bit with flattening, reminded me that's a very important part I didn't cover yet.
timotimo good thing we have new people looking at that stuff
grondilu n: sub f {...}; sub f {};
camelia niecza v24-109-g48a8de3: OUTPUT«===SORRY!===␤␤Illegal redeclaration of routine 'f' (see line 1) at /tmp/LsZhuiFJxh line 1:␤------> sub f {...}; sub f ⏏{};␤␤Potential difficulties:␤ &f is declared but not used at /tmp/LsZhuiFJxh lin…»
timotimo yes, flattening is definitely A Thing.
grondilu: fortunately, there is no need to stub subs 16:53
m: f(1); sub f(Int $a) { say $a }
camelia rakudo-moar d41745: OUTPUT«1␤»
vendethiel also, going to push Sprockets code working with filters now. If somebody wants to create a web framework with asset managing, it'd fit right in
grondilu there's no need but I wanted to do it anyway to pre-declare. For tidying.
vendethiel (I only need to create a grammar to parse manifest files now. Not pushed yet, as I had no internet when I wrote that piece of code) 16:54
grondilu like predeclare everything on the top of my module.
16:54 anaeem1_ joined 16:55 anaeem1 left 16:57 anaeem1_ left 16:59 erkan joined 17:00 immortal left
timotimo m: my &foo; sub foo(Int $a) { say $a }; foo(5); 17:00
camelia rakudo-moar d41745: OUTPUT«===SORRY!=== Error while compiling /tmp/sF63gysyjg␤Redeclaration of routine foo␤at /tmp/sF63gysyjg:1␤------> my &foo; sub foo(Int $a) { say $a }⏏; foo(5);␤ expecting any of:␤ postfix␤ stat…»
timotimo :\
m: my &foo; &foo := sub foo(Int $a) { say $a }; foo(5);
camelia rakudo-moar d41745: OUTPUT«===SORRY!=== Error while compiling /tmp/Y62T9os9Qx␤Redeclaration of routine foo␤at /tmp/Y62T9os9Qx:1␤------> &foo; &foo := sub foo(Int $a) { say $a }⏏; foo(5);␤ expecting any of:␤ postfix␤ …»
timotimo m: my &foo; &foo := anon sub foo(Int $a) { say $a }; foo(5);
camelia rakudo-moar d41745: OUTPUT«===SORRY!=== Error while compiling /tmp/BpczuWECof␤Redeclaration of routine foo␤at /tmp/BpczuWECof:1␤------> &foo := anon sub foo(Int $a) { say $a }⏏; foo(5);␤ expecting any of:␤ postfix␤ …»
timotimo shouldn't "anon sub foo" work properly?
moritz it should, IMHO 17:05
m: my &bar; &bar := anon sub foo { }; &foo 17:07
camelia rakudo-moar d41745: OUTPUT«===SORRY!=== Error while compiling /tmp/laBqDIbosF␤Cannot use bind operator with this left-hand side␤at /tmp/laBqDIbosF:1␤------> my &bar; &bar := anon sub foo { }⏏; &foo␤ expecting any of:␤ statem…»
moritz m: my &bar; &bar = anon sub foo { }; &foo
camelia rakudo-moar d41745: OUTPUT«===SORRY!=== Error while compiling /tmp/vbQbZy0Fao␤Undeclared routine:␤ &foo used at line 1␤␤»
moritz m: my &bar; &bar = anon sub foo { };
camelia ( no output )
moritz m: my &bar; &bar = anon sub bar { };
camelia rakudo-moar d41745: OUTPUT«===SORRY!=== Error while compiling /tmp/CyI9IeAVzA␤Redeclaration of routine bar␤at /tmp/CyI9IeAVzA:1␤------> my &bar; &bar = anon sub bar { }⏏;␤ expecting any of:␤ statement list␤ horizont…»
17:11 zakharyas joined 17:15 araujo left 17:16 nbrown__ joined, ajr_ left 17:20 nbrown__ left 17:22 araujo joined 17:24 brrt left 17:25 BizarreCake left 17:28 ivanshmakov left 17:39 raiph joined 17:45 ivanshmakov joined
dalek kudo/nom: 59df77e | (Elizabeth Mattijsen)++ | src/ (2 files):
Make Parcel.WHICH value based

As discussed earlier today. Not sure whether it is a good idea to cache the .WHICH string. Caching is easily removed should that be found to be the right thing.
17:52
moritz m: my $parcel = (my $x = 42, 1); say $parcel.WHICH; $x = 5; say $parcel.WHICH 17:55
camelia rakudo-moar b6bc38: OUTPUT«Parcel|67691520␤Parcel|67691520␤»
lizmat $ 6 'my $parcel = (my $x = 42, 1); say $parcel.WHICH; $x = 5; say $parcel.WHICH' 17:56
Parcel|(Int|42)(Int|1)
clearly not right
m: my $p = (42,1); $p[0] = 5 17:57
camelia rakudo-moar b6bc38: OUTPUT«Cannot modify an immutable Int␤ in method assign_pos at src/gen/m-CORE.setting:1867␤ in sub postcircumfix:<[ ]> at src/gen/m-CORE.setting:2566␤ in block <unit> at /tmp/3nyrFGoxAt:1␤␤»
lizmat m: my $p = (my $x = 42,1); $p[0] = 5
camelia ( no output )
spider-mario r: 1..10 ==> [+] 17:59
m: 1..10 ==> [+]
camelia rakudo-jvm b6bc38: OUTPUT«(timeout)»
( no output )
( no output )
spider-mario m: 1..10 ==> [+] ==> say
camelia rakudo-moar b6bc38: OUTPUT«===SORRY!=== Error while compiling /tmp/zzdTFUAYJJ␤Preceding context expects a term, but found infix ==> instead␤at /tmp/zzdTFUAYJJ:1␤------> 1..10 ==> [+] ==>⏏ say␤»
vendethiel spider-mario: use explicit parens for the time being 18:00
spider-mario okay
vendethiel m: 1..10 ==> [+]() ==> say()
camelia rakudo-moar b6bc38: OUTPUT«55␤»
vendethiel not sure they are needed on [+]
spider-mario they are, my example is badly chosen
m: 1..10 ==> [+] ==> my $sum;
camelia rakudo-moar b6bc38: OUTPUT«===SORRY!=== Error while compiling /tmp/m3dpwPggY3␤Preceding context expects a term, but found infix ==> instead␤at /tmp/m3dpwPggY3:1␤------> 1..10 ==> [+] ==>⏏ my $sum;␤»
vendethiel there's a RT already for that 18:01
spider-mario oh, ok
lizmat moritz: attempting fix 18:02
motitz: $ 6 'my $parcel = (my $x = 42, 1); say $parcel.WHICH; $x = 5; say $parcel.WHICH' 18:03
Parcel|(140460802207184)(Int|1)
if the value is a container, just use the nqp::objectid of it 18:04
FROGGS timotimo / arnsholt / jnthn: what's the most pleasing C globals syntax? "my Str $version is global('C') is symbol($optional)"? or "... is cglobal($optional-name)"?
timotimo / arnsholt / jnthn: or more like: "my Str $version:from<C>"? 18:05
lizmat m: my $parcel = (my $ = 42, 1); say $parcel.perl # also incorrect
camelia rakudo-moar b6bc38: OUTPUT«$(42, 1)␤»
moritz lizmat: without having backlogged yet, I think I disagrew tih Parcel.WHICH being value-based 18:07
after all it's a container which can have mutable elements
lizmat S07:55
synopsebot Link: perlcabal.org/syn/S07.html#line_55
moritz "A Parcel is immutable, although the elements of a Parcel may be either mutable or immutable." 18:08
that doesn't say it's a value type
dalek kudo/nom: d06f7a9 | (Elizabeth Mattijsen)++ | src/core/Parcel.pm:
Use nqp::objectid for containers in WHICH
18:09
lizmat Moritz: Mouq started it at irclog.perlgeek.de/perl6/2014-08-31#i_9273480 18:10
18:10 molaf__ joined 18:13 molaf_ left 18:17 nbrown__ joined, Mouq joined
lizmat m: say (1,2) === (1,2) 18:17
camelia rakudo-moar b6bc38: OUTPUT«False␤»
lizmat $ 6 'say (1,2) === (1,2)' 18:18
True
my fix makes one TODO test pass 18:20
my ($x, $y) = <a b>;
ok(«$x $y» === <a b>, "«$x $y» interpolation works correctly");
18:21 nbrown__ left
dalek kudo/nom: b4f6b54 | Mouq++ | src/Perl6/Actions.nqp:
Anniversarily conclude commit ce3ea392

This makes, e.g., `my $perl = 5; say $perl.:<++>` print "6", as though
  `++$perl` had been written
18:22
FROGGS std: my $perl = 5; say $perl.:<++> 18:23
camelia std 53b3ca6: OUTPUT«ok 00:01 124m␤»
FROGGS what the
Mouq Not really a high-priority feature :P but it's spec 18:24
FROGGS a weird bit of the spec :o) 18:25
lizmat with my Parcel.WHICH change, one spectest breaks: is(<a b c> === <a b c>, False); 18:29
clearly, roast is inconsistent
Mouq moritz: I see many advantages to having Parcel have a value-based .WHICH, and none to it having the old .WHICH provided the new is done correctly
lizmat Mouq: do you think my patches are the correct way, or not ? 18:30
18:30 erkan left
Mouq lizmat: I think so :) I was curious if there were negative consequences from it, though. lizmat++ 18:31
lizmat well, one TODO passes now, another test fails now
18:31 erkan joined, raiph left
lizmat $ 6 'my $p1 = (my $x = 42,1); my $p2 = (my $y := $x,1); say $p1 === $p2' 18:32
True
18:33 raiph joined
lizmat would you consider that to be correct ? 18:33
Mouq m: my $x = 42; my $y := $x; say $y.VAR.name; 18:36
camelia rakudo-moar 59df77: OUTPUT«$x␤»
Mouq really doesn't know
m: my $x = 42; my $z = 24; my $y := $x; say $y.VAR.name; $y := $z; say $y.VAR.name 18:37
camelia rakudo-moar 59df77: OUTPUT«$x␤$z␤»
grondilu I have a module that seems to work fine but when I try to use it and call an exported function I get a === SORRY === can not find method 'origin' 18:39
*origin
no: orig
grondilu copy/pastes the exact error message:
Cannot find method 'orig'
moritz is that with precompilation? 18:40
grondilu no
not that I know of anyway
Mouq grondilu: I got that writing my last commit when I forgot to include :node($/) to the QAST::Op 18:41
grondilu I'm not doing anything that complicated 18:43
18:43 zakharyas1 joined
grondilu tries to strip the module while keeping reproducing the error 18:44
18:44 denis_boyun_ joined
Mouq m: my $x = 42; my $z = 24; my $y := $x; my $p := ($y,); $p.Parcel = 56; say $x; $y := $z; $p.Parcel = 56; say $z 18:44
camelia rakudo-moar 59df77: OUTPUT«56␤24␤»
18:45 zakharyas left
Mouq lizmat: ^^ $p still contains a reference to $x. So it would appear that your last snippit is correct 18:46
AFAICT
lizmat thanks for checking!
Mouq grondilu: You're not, but you may be tickling a bug in Rakudo 18:47
I mean, you definitely are
But that's at least a pointer to where the bug lies :P 18:48
grondilu m: module Foo { sub circumfix:<e[ ]>(*@) is export { "hi" } }; import Foo; say e[1];
camelia rakudo-moar 59df77: OUTPUT«===SORRY!===␤Cannot find method 'orig'␤»
grondilu ^ here
it works fine with sub e(*@) is export 18:49
colomon about to afk to drive home, but here's what I'm seeing with the OpenSSL build failure. Somehow panda is calling an "override the normal build process" Build.pm even though OpenSSL doesn't have a Build.pm file. 18:50
grondilu and *@ does not matter:
m: module Foo { sub circumfix:<e[ ]> is export { "hi" } }; import Foo; say e[ ];
camelia rakudo-moar 59df77: OUTPUT«===SORRY!===␤Cannot find method 'orig'␤»
18:51 colomon left
lizmat module Foo { sub circumfix:<e[ ]>(*@) is export { "hi" } }; import Foo; say ::.keys.grep: { m/circumfix/ }; # oddly enough, it *is* exported 18:51
m: module Foo { sub circumfix:<e[ ]>(*@) is export { "hi" } }; import Foo; say ::.keys.grep: { m/circumfix/ }; # oddly enough, it *is* exported
camelia rakudo-moar 59df77: OUTPUT«&circumfix:<e[ ]>␤»
lizmat m: module Foo { sub circumfix:<e[ ]>(*@) is export { "hi" } }; import Foo; say circumfix:<e[ ]>(1); # calling it by its long name works 18:52
camelia rakudo-moar 59df77: OUTPUT«hi␤»
Mouq m: module Foo { sub postfix:<~>(*@) is export { "hi" } }; import Foo; say 1~; 18:53
camelia rakudo-moar 59df77: OUTPUT«hi␤»
Mouq m: module Foo { sub postcircumfix:<e[ ]>(*@) is export { "hi" } }; import Foo; say 1\e[4];
camelia rakudo-moar 59df77: OUTPUT«===SORRY!===␤Cannot find method 'orig'␤»
lizmat m: module Foo { sub circumfix:<zap[ ]>(*@) is export { "hi" } }; import Foo; say zap[1]; # it's not the name 'e'
camelia rakudo-moar 59df77: OUTPUT«===SORRY!===␤Cannot find method 'orig'␤»
Mouq I believe it's any non-standard circumfix 18:54
18:54 darutoko left
grondilu m: module Foo { sub circumfix:<a b> is export { "hi" } }; import Foo; say a b; 18:54
camelia rakudo-moar 59df77: OUTPUT«===SORRY!===␤Cannot find method 'orig'␤»
lizmat it's happening in the optimizer 18:55
it's trying to generate a X::Undeclared exception
%opts<line> := HLL::Compiler.lineof($op.node.orig, $op.node.from, :cache(1)); 18:56
18:56 beastd joined
lizmat is the line it actually fails on 18:56
18:59 raiph left
lizmat seems it required an extra & in its name: trying to find &&circumfix:<zap[ ]> 18:59
FROGGS m: multi trait_mod:<is>(Mu:U $v, :$cglobal!) { say 42 }; my int8 $foo is cglobal; # why does this no worky? 19:01
camelia rakudo-moar 59df77: OUTPUT«===SORRY!=== Error while compiling /tmp/zy6zVVl4lG␤Can't use unknown trait 'is cglobal' in a variable declaration.␤at /tmp/zy6zVVl4lG:1␤------> al!) { say 42 }; my int8 $foo is cglobal⏏; # why does this no worky?[0…»
19:03 Akagi201 left
FROGGS nvm 19:04
Mouq lizmat: Yeah, looks like Grammar.nqp LL 4154, 4166 are at fault 19:07
(Indirectly)
lizmat testing fix
Mouq m: module Foo { sub term:<foo>(*@) is export { "hi" } }; import Foo; say foo 19:08
camelia rakudo-moar 59df77: OUTPUT«===SORRY!===␤Cannot find method 'orig'␤»
lizmat 4178 also, I would guess then 19:09
$ 6l 'module Foo { sub circumfix:<zap[ ]>(*@) is export { "hi" } }; import Foo; say zap[1];'
hi
19:10 raiph joined
lizmat running spectest now 19:10
Mouq lizmat: Does you fix break sub circumfix before an import, though?
19:11 Sterver joined
lizmat do you have an example ? 19:11
19:11 Ven joined
vendethiel soo. some little stuff I picked up while working durin gthe afternoon ... 19:11
Sterver hi all
Ven m: Nil.push: 1; # this loops
camelia rakudo-moar 59df77: OUTPUT«(timeout)»
Ven m: my @a; [$@a][0].push: 1; say @a.perl; # is this supposed to work? useful that it does, but I kinda expected $ to return a "different" "reference".
camelia rakudo-moar 59df77: OUTPUT«Array.new(1)␤»
Mouq lizmat: Does `sub circumfix:<e[ ]>(*@) { "hi" }; say e[1]` still work? 19:12
Ven Also: say $*OUT.slurp, type some stuff, CR then ^D will give "write string requires an object with REPR MVMOSHandle" (might be a MoarVM bug, can't repro on camelia)
and lastly, is there already a package of a method to get a temp file? I actually wanted to buffer output, but had to resort to creating the file manually etc
FROGGS hi Sterver
lizmat Mouq: nope, that now breaks with 'cannot find .orig'
Ven o/ Sterver
lizmat hmmm... so you could argue it's something in the export mechanism 19:13
Ven dumps some "bug reports" here and there
Mouq The LTA error can be fixed by adding :node($/) to the lines mentioned above, but yeah, I think it's an issue with do_import
or export
FROGGS Ven: I hope either 'here' or 'there' is RT
Sterver How can I repair this: ===SORRY!=== Error while compiling PORN.p6 multi-dimensional indexes not yet implemented. Sorry. at PORN.p6:18 ------> }⏏<EOL>
Ven FROGGS: both are "this channel" 19:14
FROGGS :/
Ven as I'm not sure what should happen
Sterver this is that part of code: pastebin.com/2Aq3h3L7
Ven I should probably report the moarvm one to the github repo, tho?
lizmat Ven: anything called on Nil should give Nil
Ven lizmat: well, here, it gives an infinite loop
also, I've asked before, but: why??
Mouq Sterver: That part of the code is probably not what is causing the error
19:14 domidumont left
FROGGS Sterver: what is in the lines before 18? 19:15
Sterver oh, wait
17 my $percentage = (100-$runs/$poc*100);
Mouq Sterver: what's perl6 -v ? 19:16
FROGGS Sterver: no, there must be something accessing an array
19:16 kjs_ joined
Sterver Mouq: This is perl6 version 2013.12 built on parrot 5.9.0 revision 0 19:16
lizmat wow, that's *ancient* ! 19:17
Sterver FROGGS, i dont use arrays in this program
FROGGS Sterver: this error message is not even in our codebase anymore... so perhaps upgrading to a newer rakudo version will help
Mouq Sterver: Recommended solution: github.com/tadzik/rakudobrew
Sterver oh.. ok :) 19:18
19:18 nbrown__ joined
Sterver thanks, i'll try 19:18
lizmat Mouq: with the :node additions, we now get: Variable '&&circumfix:<zap[ ]>' is not declared
which clearly shows the problem
FROGGS Sterver: build for MoarVM backend, this will take just threeish minutes and you are done
Ven err, do I need to explicitly list every module in the META.info?
Sterver are here any lunchpad repos for actual perl6?
Ven I mean, package
Sterver: lunchpad repos?
FROGGS Ven: every direct dependency
Ven: no, dists 19:19
Ven FROGGS: what?
FROGGS Ven: distributions
19:19 pyrimidine joined
Sterver Ven: for ubuntu I ment launchpad.net/ubuntu 19:19
Ven alright.
You were replying to that part...
FROGGS: "direct dependency"?
Sterver probably not :D 19:20
FROGGS Ven: I thought you were asking if you need to list the deps of your deps
dalek kudo/nom: 8007565 | (Elizabeth Mattijsen)++ | src/Perl6/Grammar.nqp:
Make import errors less LTA

Instead of "Cannot find method 'orig'", we now get a proper error message when not finding an exported operator. Mouq++ for directions.
FROGGS Ven: but I think you're'nt
Ven FROGGS: no, I mean every package my code has
FROGGS Ven: no, the top level one is enough, so one entry per repository you depend on 19:21
Ven I mean perl6 "package"
not ecosystem packages
Mouq lizmat: Now to figure out WTF is going wrong with import/export :D
lizmat yup
FROGGS Ven: yes, I understand
Ven I don't think so...
FROGGS: ie I have Sprockets, Sprockets:::File, do I need provides: {Sprockets: ..., Sprockets::File:...}? 19:22
FROGGS Ven: you do not need to list every namespace you depend on
Ven I know I'm really unclear
19:22 nbrown__ left
FROGGS Ven: yes, you do need to put in every namespace you provide 19:22
Ven only the one with the `is export` "main"s/classes?
alright. thanks
FROGGS Ven: even when you declare several namespaces per file, list every namespace that point to the same file
Ven noted. 19:24
is there some kind of ordering in ecosystem/META.list?
19:25 Sqirrel joined
FROGGS Ven: no 19:25
Ven then... 19:26
dalek osystem: 4d19641 | Nami-Doc++ | META.list:
Add Sprockets
Ven \o/
lizmat Mouq: I'm starting to think it may be a codegen issue on the zap[1]
Ven first published package. Now I'll focus back on my preprocessors... 19:27
FROGGS Ven: what is that?
Ven FROGGS: Ruby/Rails's Sprockets-thingie.
pyrimidine masak: found out the problem thanks to FROGGS++. Had a PERL6LIB in my env pulling in an old module which caused problems. Updated RT #122660
synopsebot Link: rt.perl.org/rt3//Public/Bug/Displa...?id=122660
Ven asset manager for the web.
FROGGS pyrimidine: \o/ 19:28
pyrimidine: also, that BEGIN { @*INC.push... } made me curious :o)
Ven FROGGS: basically, responsible for "manifest" asset files, preprocessor usage, etc.
Mouq lizmat: That was my first though, but maybe add_categorical just expects something different than do_import feeds it
lizmat Mouq: --target=ast seems to indicate QAST::Op(call &&circumfix:<zap[ ]>) zap[1]
Mouq *thought
FROGGS pyrimidine: because 'use lib' unishifts, and that usually make more sense
pyrimidine FROGGS++ (again). Yep, and RAKUDO_MODULE_DEBUG=1 helped work that out 19:29
Mouq lizmat: Gimme a bit to test a possible fix...
FROGGS nice
Mouq spectest & 19:30
jepeway so...might somebody point me to some LHF I could take a beginners swing at?
FROGGS jepeway: this? RT #122319 19:34
synopsebot Link: rt.perl.org/rt3//Public/Bug/Displa...?id=122319
jepeway looks 19:36
FROGGS jepeway: and/or this: RT #122173
synopsebot Link: rt.perl.org/rt3//Public/Bug/Displa...?id=122173
19:38 mberends left 19:39 SamuraiJack joined
jepeway FROGGS: think I'll chew away at the timezone tests, thanks. 19:39
FROGGS ++jepeway 19:40
jepeway well, FROGGS++ for the pointing out 19:42
mr-foobar jnthn: I wonder if this can be useful for jvminterop web.stanford.edu/class/cs243/joeq/j...rUtil.html 19:44
carlin are those timezone tests supposed to actually work?
19:44 chenryn left
carlin they rely on rakudo being able to work out DST in various timezones 19:44
19:50 avuserow left
carlin if I do, DateTime.new('2014-02-01T07:00:00Z').local 19:51
the result is 2014-02-01T19:00:00+1200
those tests expect the result to be: 2014-02-01T18:00:00+1300
lizmat vendethiel: the basic problem with Nil.push is really: 19:52
carlin because my timezone was in DST in February
lizmat m: say Nil.^mro
camelia rakudo-moar b4f6b5: OUTPUT«Nil (Iterator) (Iterable) (Cool) (Any) (Mu)␤»
carlin I don't think that's right
jepeway carlin: yeah, I'm thinking the test's notion of DST is...off. trying to confirm.
lizmat any method that exists in these classes, is tried with Nil as self
some give errors:
m: say Nil.first-index 19:53
camelia rakudo-moar b4f6b5: OUTPUT«Cannot call 'first-index'; none of these signatures match:␤:(Any: Bool:D $t, *%_)␤:(Any: Regex:D $test, *%_)␤:(Any: :D $test, *%_)␤:(Any: $test, *%_)␤ in block <unit> at /tmp/wbqho2BkYx:1␤␤»
lizmat and others (like the auto-vivifying .push and .unshift) loop
jepeway m: use Test; note 'foo'
camelia rakudo-moar b4f6b5: OUTPUT«foo␤»
lizmat all add .push and .unshift to Nil for now, to prevent hanging
vendethiel can we fix that?
:| 19:54
jepeway shouldn't that be "# foo"?
lizmat jepeway: no
vendethiel jepeway: note is not from Test
jepeway or am I showing 5er bias?
lizmat m: use Test; diag "foo"
camelia rakudo-moar b4f6b5: OUTPUT«# foo␤»
jepeway aha!
vendethiel at least I don't think so
lizmat m: note
camelia rakudo-moar b4f6b5: OUTPUT«Noted␤» 19:55
lizmat :-)
19:57 SamuraiJack left
jepeway m: note 'eep' ; say 'eel' 19:58
camelia rakudo-moar b4f6b5: OUTPUT«eep␤eel␤»
jepeway what's the diff 'twixt the 2? can note be suppressed, eg? 19:59
grondilu m: module Foo { our @a := 1 xx *; our sub f { @a[^3] } }; @Foo::a[0] = -1; say Foo::f;
camelia rakudo-moar b4f6b5: OUTPUT«1 1 1␤»
grondilu n: module Foo { our @a := 1 xx *; our sub f { @a[^3] } }; @Foo::a[0] = -1; say Foo::f;
camelia niecza v24-109-g48a8de3: OUTPUT«Unhandled exception: Writing to readonly scalar␤ at /tmp/nBlWe0As6y line 1 (mainline @ 4) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4595 (ANON @ 3) ␤ at /home/p6eval/niecza/lib/CORE.setting line 4596 (module-CORE @ 576) ␤ at /home/p6e…»
grondilu rakudo should have died here as well 20:00
jepeway (can I be asking these elementary q's here? I'll be patient re: answers and understand should none come) 20:01
grondilu don't ask to ask
FROGGS jepeway: I think note() prints to stderr
lizmat note is say to STDERR (or $*ERR as it's called here)
dalek kudo/nom: ccee46e | Mouq++ | src/Perl6/World.nqp:
Fix exporting circumfixes and terms
lizmat Mouq++ 20:02
dalek ast: 00a2b66 | Mouq++ | / (2 files):
Add test for exporting circumfixes
grondilu lizmat++ Mouq++. Awesome guys
jepeway grondilu: hokay. 20:03
lizmat, FROGGS: got it. 20:04
20:04 kaare_ left
Mouq badly wants slangy macros for a project he's working on 20:06
20:07 Sterver left
lizmat m: Nil = 3 # feels this should fail somehow 20:09
camelia ( no output )
grondilu ok 20:10
20:10 grondilu left 20:12 raiph left 20:14 broquaint joined 20:16 brrt joined, brrt left 20:17 raiph joined 20:18 nbrown__ joined 20:20 avuserow joined 20:21 grondilu joined 20:22 nbrown__ left
Ven std: $_ = 1 20:23
camelia std 53b3ca6: OUTPUT«ok 00:01 123m␤»
Ven eh. thought this was a p5ism somewhat?
lizmat but one that is allowed, afaik 20:24
Ven: BTW, soon it will do:
$ 6 'Nil.push'
Attempted to push to Nil.
vendethiel lizmat: thanks! Was trying to figure out why prove was running blind for a while
I know I asked some other stuff ... like $@some_var.push: 1; pushing to @some_var, handy but "how does it work"y; too 20:26
lizmat I was focussing on potential hangs... 20:27
and am about to call it a night...
20:28 ecocode joined
dalek kudo/nom: 0099d69 | (Elizabeth Mattijsen)++ | src/core/Nil.pm:
Some cleanup in Nil handling.

  - Making sure specific methods wil catch all possible params combinations
  - Adding several modifying methods to have them die (possible infiniloops)
  - Add 'sink' method, because RESTRICTED setting apparently needs that
  vendethiel++ for mentioning issues
20:32
vendethiel lizmat++ 20:33
dalek ecs: c6448fe | (Elizabeth Mattijsen)++ | S02-bits.pod:
Make attempting changes to Nil cause an exception.
20:35
lizmat goodnight, #perl6& 20:37
timotimo gnite lizmat :)
Mouq 'night lizmat++
Ven gnite !
pyrimidine lizmat++
20:44 flussence joined 20:46 nbrown__ joined 20:47 flussence left, flussence joined 20:53 Ven left 20:54 raiph left 20:56 dolmen joined 21:00 zakharyas1 left
dalek c: ecb3848 | (Kamil Kułaga)++ | bin/p6doc-index:
s/$*PROGRAM_NAME index/$*PROGRAM_NAME build/

there is no such option index
21:04
21:05 denis_boyun___ joined, denis_boyun_ left 21:08 molaf__ left 21:09 JL235__ joined 21:10 cooper joined, cooper left, cooper joined 21:11 cooper left, cooper joined, cooper left, cooper joined
grondilu p6: class Foo { method postcircumfix:<[ ]>(Int $n) { "$n\!" } }; say Foo.new[5]; 21:11
camelia rakudo-jvm ccee46: OUTPUT«(timeout)» 21:12
..rakudo-moar ccee46: OUTPUT«Index out of range. Is: 5, should be in 0..0␤ in method gist at src/gen/m-CORE.setting:13287␤ in sub say at src/gen/m-CORE.setting:14222␤ in block <unit> at /tmp/tmpfile:1␤␤»
..niecza v24-109-g48a8de3: OUTPUT«5!␤»
..rakudo-parrot ccee46: OUTPUT«Index out of range. Is: 5, should be in 0..0␤ in method gist at gen/parrot/CORE.setting:13225␤ in method gist at gen/parrot/CORE.setting:1107␤ in sub say at gen/parrot/CORE.setting:14180␤ in sub say at gen/parrot/CORE.setting:14167␤ in blo…»
21:12 nbrown__ left 21:13 xinming_ left
Mouq We need to warn on method postcircumfix:*, but it's pretty much deprecated in Rakudo 21:16
jepeway FROGGS: so...a quick q re: DateTime.in-timezone() b/4 I gotta run. 21:17
grondilu Mouq: what do you mean?
21:18 dolmen left
grondilu do you mean I should use a sub maybe? 21:18
jepeway FROGGS: seems like there's 2 notions of "timezone." first is "my locale's offset from GMT."
FROGGS: second is "the set of rules my locale uses to determine offset from GMT for any given time." 21:19
Mouq grondilu: Yeah a multi, the method forms no longer work, except postcircumfix:<( )>, though method invoke is preferred to that now
21:20 gfldex left
Mouq grondilu: Alternatively, use method at_pos if you only care about single values 21:20
FROGGS jepeway: I'm not sure I am the best person to ask... masak has implemented the DateTime stuff in P6, and drolsky is the gof of Perl 5's DateTime
jepeway FROGGS: I think the temporal/local tests conflate the two.
FROGGS jepeway: yeah, I guess that is likely
jepeway FROGGS: gof?
grondilu tries at_pos 21:21
FROGGS jepeway: 'god', sorry
jepeway FROGGS: (np.) I can ask masak later, then. 21:22
FROGGS yeah, might be the best
21:23 pyrimidine left 21:28 JL235__ left 21:29 kjs_ left, nbrown__ joined 21:30 khisanth_ joined 21:31 JL235 joined
jepeway hm. gotta golf my q down a bit. but gotta run, instead. 21:31
21:32 Khisanth left, raiph joined 21:33 rindolf left 21:34 avuserow left 21:41 ggoebel1111111 joined, Mouq left 21:43 ggoebel1111110 left 21:48 pmurias left, Mouq joined
dalek kudo/nom: 94952d9 | Mouq++ | src/core/Capture.pm:
:() is for Signatures, \() for Captures

Makes Capture.gist more round-trippy
21:51
kudo/nom: 1cbbe5e | Mouq++ | src/core/Nil.pm:
Merge branch 'nom' of github.com/rakudo/rakudo into nom
Mouq m: my (*@a, :$from, :$to, :$classical) := \(<plasm dram>, :from<a>, :to<ata>) 21:55
camelia ( no output )
21:57 cotto left, cotto joined 22:01 colomon joined 22:03 pdcawley joined 22:08 cooper left 22:09 raiph left 22:13 avuserow joined
Mouq m: \(:key<a>).WHICH 22:13
camelia rakudo-moar 0099d6: OUTPUT«Cannot find method 'keys': no method cache and no .^find_method␤ in submethod WHICH at src/gen/m-CORE.setting:7239␤ in block <unit> at /tmp/GukOZ87ZrD:1␤␤»
dalek kudo/nom: ebccb2a | Mouq++ | src/core/Capture.pm:
Fix \(:key<a>).WHICH
22:14
22:17 telex left 22:18 telex joined
grondilu p6: class Foo {}; multi infix:<+>(Foo $, Foo $) { 1 }; say [+] Foo.new xx 4; 22:19
camelia rakudo-jvm 0099d6: OUTPUT«(timeout)»
..niecza v24-109-g48a8de3: OUTPUT«Unhandled exception: Cannot use value like Foo as a number␤ at <unknown> line 0 (ExitRunloop @ 0) ␤ at /home/p6eval/niecza/lib/CORE.setting line 300 (Any.Numeric @ 6) ␤ at <unknown> line 0 (ExitRunloop @ 0) ␤ at /home/p6eval/niecza/lib/COR…»
..rakudo-parrot 0099d6: OUTPUT«Cannot call 'Numeric'; none of these signatures match:␤:(Mu:U \v: *%_)␤ in any at gen/parrot/BOOTSTRAP.nqp:1221␤ in method Numeric at gen/parrot/CORE.setting:1070␤ in sub infix:<+> at gen/parrot/CORE.setting:4400␤ in sub infix:<+> at gen/p…»
..rakudo-moar 0099d6: OUTPUT«Cannot call 'Numeric'; none of these signatures match:␤:(Mu:U \v: *%_)␤ in sub infix:<+> at src/gen/m-CORE.setting:4396␤ in sub at src/gen/m-CORE.setting:17951␤ in block <unit> at /tmp/tmpfile:1␤␤»
timotimo grondilu: may need to add candidates for only (Foo $) 22:20
a candidate*
Mouq m: class Foo {}; multi infix:<+>(Foo $, Foo $?) { 1 }; say [+] Foo.new xx 4;
camelia rakudo-moar 0099d6: OUTPUT«Cannot call 'Numeric'; none of these signatures match:␤:(Mu:U \v: *%_)␤ in sub infix:<+> at src/gen/m-CORE.setting:4396␤ in sub at src/gen/m-CORE.setting:17951␤ in block <unit> at /tmp/7ZoB34hcRY:1␤␤»
Mouq m: class Foo {}; multi infix:<+>(Foo $?, Foo $?) { 1 }; say [+] Foo.new xx 4; 22:21
camelia rakudo-moar 0099d6: OUTPUT«Cannot call 'Numeric'; none of these signatures match:␤:(Mu:U \v: *%_)␤ in sub infix:<+> at src/gen/m-CORE.setting:4396␤ in sub at src/gen/m-CORE.setting:17951␤ in block <unit> at /tmp/5oePjYQSSn:1␤␤»
Mouq really wishes that would display the Capture it's called with
timotimo aye.
Mouq tries to fulfill that wish 22:22
timotimo i don't really know what to do at the moment
22:22 denis_boyun___ left
timotimo p6 related stuff, i mean 22:22
cognome r: use lib 'FOOO'; say @*INC 22:26
camelia rakudo-moar 0099d6: OUTPUT«file:/home/p6eval/rakudo-inst-1/languages/perl6/lib inst:/home/p6eval/rakudo-inst-1/languages/perl6␤»
..rakudo-jvm 0099d6: OUTPUT«file:/home/p6eval/rakudo-inst-1/languages/perl6/runtime file:/home/p6eval/rakudo-inst-1/languages/perl6/lib file:/home/p6eval/rakudo-inst-1/languages/nqp/lib file:/home/p6eval/rakudo-inst-1/languages/perl6/lib inst:/home/p6eval/rakudo-inst-1/languages/perl6␤»
..rakudo-parrot 0099d6: OUTPUT«file:/home/p6eval/rakudo-inst-1/lib/parrot/6.7.0-devel/languages/perl6/lib inst:/home/p6eval/rakudo-inst-1/lib/parrot/6.7.0-devel/languages/perl6␤»
cognome it drops it silently because of inadequate format? 22:27
Mouq m: class Foo {}; multi infix:<+>(Foo $, Foo $) { 1 }; multi infix:<+> (Numeric $, Foo $) { 1 }; say [+] Foo.new xx 4; 22:29
camelia rakudo-moar 0099d6: OUTPUT«1␤»
Mouq It does (Foo + Foo) + Foo, which is 1 + Foo 22:30
grondilu hum yeah 22:32
p6: class Foo {}; multi infix:<+>(Foo $, Foo $) { Foo.new }; say [+] Foo.new xx 4;
camelia rakudo-jvm 1cbbe5: OUTPUT«(timeout)» 22:33
..rakudo-{parrot,moar} 1cbbe5: OUTPUT«Foo.new()␤»
..niecza v24-109-g48a8de3: OUTPUT«Foo.new(...)␤»
grondilu I guess I'm missing a case in my module.
grondilu tries to find a simple example closer to his issue 22:35
m: class Foo {}; multi infix:<+>(Foo $, Foo $) { 1 }; say [+] Foo.new xx 2; 22:36
camelia rakudo-moar 1cbbe5: OUTPUT«1␤»
grondilu m: class Foo {}; multi infix:<+>(Foo $, Foo $) { 1 }; say [+] Foo.new;
camelia rakudo-moar 1cbbe5: OUTPUT«Cannot call 'Numeric'; none of these signatures match:␤:(Mu:U \v: *%_)␤ in sub infix:<+> at src/gen/m-CORE.setting:4395␤ in sub at src/gen/m-CORE.setting:17947␤ in block <unit> at /tmp/MZMUd47oZS:1␤␤» 22:37
22:40 nbrown__ left 22:42 nbrown__ joined 22:46 nbrown__ left 22:48 beastd left
Mouq Aww, surprisingly the Captures coming from NQP land are NQP Captures. Maybe they can be coerced somehow 22:55
22:58 xragnar_ joined, xragnar left, xragnar_ is now known as xragnar 23:10 nbrown__ joined
Mouq Oh... it's a... MVMCallCapture? 23:13
jnthn: What would be the best way to approach keeping a copy of the original Capture a routine is called with, for error reporting purposes? I'm concerned with how it would effect performance 23:16
23:17 colomon left 23:20 colomon joined 23:22 nbrown__ left 23:24 avuserow left 23:27 avuserow joined 23:31 spider-mario left 23:34 fathogwash joined, xenoterracide left, fathogwash left 23:36 silverpuff joined, nbrown__ joined 23:37 robinsmidsrod left 23:38 robinsmidsrod joined 23:39 dwarring joined 23:41 colomon left 23:42 nbrown__ left 23:43 BenGoldberg joined 23:44 avuserow left, colomon joined 23:45 silverpuff left 23:47 jepeway left 23:53 jerrycheung joined 23:55 eiro left, eiro joined, immortal joined 23:56 erkan left, Psyche^ left, Psyche^ joined 23:59 nebuchad` joined