»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: irc.perl6.org | UTF-8 is our friend! Set by moritz on 25 December 2014. |
|||
adu | why can't I access enum members? | 00:07 | |
yoleaux | 12 Jan 2015 11:38Z <timotimo> adu: perl6 .new() isn't like __init__ or __new__, it's like python's .frob or .blubber or .yoink; also, new calls bless calls BUILDALL calls BUILD unlike what geekosaur said, and skids wrongly wrote bless(*, ...), but the * as first argument is wrong nowadays | ||
12 Jan 2015 11:44Z <moritz> adu: see perlgeek.de/blog-en/perl-6/object-c...ation.html and doc.perl6.org/language/classtut#Constructors | |||
masak | adu: indeed, why can't you? | ||
m: enum Foo <a b>; say b | |||
camelia | rakudo-moar 050686: OUTPUT«b» | ||
masak | I can ;) | ||
adu | pastie.org/9828545 | 00:08 | |
masak | no idea from just that paste. | 00:09 | |
adu | the only difference I can think of is that CAST::Op is a class, and CAST::Type is a role | 00:10 | |
TimToady | so name it with the class it ends up with instead? | ||
adu | I can't just s/role/class/ because then I'd have to change 12 files | 00:11 | |
TimToady | .oO("We can't fix this--we have 11 users already...") |
00:12 | |
adu | ok, it works if CAST::Type is a class | 00:13 | |
TimToady | enum names work more like sub names than like methods | ||
arguably, it might be possible to make the role names work instead, but I'd like jnthn++'s opionion on that | 00:14 | ||
adu | so I should move the enum somewhere else? | 00:15 | |
can I put enums in their own file? | |||
TimToady | roles are primarily for abstracting sets of methods, and have not been heavily thought through for other generic purposes | ||
I don't see why not, offhand | 00:16 | ||
could certainly be put into their own module and exported | |||
assuming we fixed that | |||
00:19
sirdancealot left
|
|||
TimToady | m: module Stuff { enum MyEnum is export <foo bar baz>; }; import Stuff; say baz | 00:20 | |
camelia | rakudo-moar 050686: OUTPUT«baz» | ||
TimToady | yes, fixed last Friday | ||
I guess Perl 6 is mature now :P | |||
TimToady kinda thought that whole discussion was a little silly to anyone who has had a 14-year-old in the house | 00:21 | ||
they generally oscillate in maturity ±10 years or so | |||
so you should not be astonished if Perl 5 acts 24 one day and 4 the next day... | 00:23 | ||
00:27
colomon left
|
|||
TimToady | s/5/6/ # can't spell today | 00:28 | |
00:28
gfldex left
|
|||
TimToady | .oO(Can you call it spelling if it's numbers? If not, what do you call it?) |
00:29 | |
masak | counting. | 00:31 | |
TimToady | but I wasn't counting, I was just typing a digit | ||
adu | uh oh | 00:32 | |
Type check failed in assignment to '$!op'; expected 'CAST::OpKind' but got 'OpKind' | |||
masak | ooh :) | ||
adu | I'm so confused | ||
TimToady | if I accidentally typed 555 instead of 666, would that be miscounting the Number of the Beast? | ||
that seems wrongish | 00:33 | ||
adu | TimToady: is it supposed to do that? | 00:34 | |
TimToady | my last utterance was your answer | ||
exporting a type should not make it a different type | 00:35 | ||
adu | github.com/andydude/p6-c-parser/bl...OpKind.pm6 | 00:36 | |
japhb | .oO( 668 -- the number of the neighbor of the beast ) |
00:37 | |
adu | but what's really puzzling me is that it should be CAST::OpKind::OpKind::call that works, but CAST::OpKind::call also works | ||
TimToady | CAST::OpKind is the name of the module, not the name of the enum | ||
adu | but then why would both work? | 00:38 | |
TimToady | because enum exports to its immediate surroundings | ||
m: my enum X <a b c>; say X::a: say a | |||
adu | ah | ||
camelia | rakudo-moar 050686: OUTPUT«aCannot call 'say'; none of these signatures match::(Obsolete:D $: *%_):($: *%_) in block <unit> at /tmp/76vcJh8XGq:1» | ||
TimToady | oh, X is taken | 00:39 | |
m: my enum XX <a b c>; say XX::a: say a | |||
camelia | rakudo-moar 050686: OUTPUT«aCannot call 'say'; none of these signatures match::(Obsolete:D $: *%_):($: *%_) in block <unit> at /tmp/UjQGzde8PW:1» | ||
TimToady | um... | ||
masak | colon. | ||
TimToady | ah | ||
m: my enum XX <a b c>; say XX::a; say a | |||
camelia | rakudo-moar 050686: OUTPUT«aa» | ||
TimToady | error message is a bit LTA though | 00:41 | |
m: my enum XX <a b c>; say XX::a.^methods | |||
camelia | rakudo-moar 050686: OUTPUT«enums pair perl pick roll Int invoke Str Numeric gist kv key value Int Num Rat FatRat abs Bridge chr sqrt base expmod is-prime floor ceiling round lsb msb narrow Range sign conj rand sin asin cos acos tan atan atan2 sec asec cosec acosec cotan acotan sinh …» | ||
TimToady | m: my enum XX <a b c>; say XX::a.say(a) | 00:42 | |
camelia | rakudo-moar 050686: OUTPUT«Cannot call 'say'; none of these signatures match::(Obsolete:D $: *%_):($: *%_) in block <unit> at /tmp/1rxt9WMdaV:1» | ||
adu | my enum XX <a b c>; my XX $kind; say $kind; | ||
m: my enum XX <a b c>; my XX $kind; say $kind; | |||
camelia | rakudo-moar 050686: OUTPUT«(XX)» | ||
adu | maybe the error is actually that it's Nil | ||
00:44
dayangkun joined
00:49
ajr joined,
ajr is now known as Guest92299
00:51
skids joined
00:52
Guest92299 left
00:53
kaare__ joined,
Mso150_e joined
00:54
Mso150 left
|
|||
masak | 'night, #perl6 | 00:54 | |
00:58
colomon joined
01:01
ajr_ joined
01:02
ajr_ left
01:11
cognominal joined
01:18
Ven joined
01:20
yeahnoob joined
|
|||
adu | TimToady: I figured it out | 01:21 | |
I had to declare it "my OpKind" instead of "my CAST::OpKind" | 01:22 | ||
I still don't quite understand why there is any difference between the two | |||
s/my/has/ | |||
TimToady | CAST::OpKind is the name of the module, not anything in it or exported from it | ||
adu | ah | ||
so CAST::OpKind::OpKind might have worked | 01:23 | ||
TimToady | nod | ||
adu needs to think more | |||
TimToady thinks adu++ needs to give the enum a different name from the module | 01:24 | ||
adu | lol | ||
maybe CAST::Ops::OpKind? | |||
TimToady thinks adu++ needs to give the module a different name from the enum, rather | 01:25 | ||
adu | :) | ||
TimToady ponders the pragmatic ambiguity of "make these things different" | 01:26 | ||
01:27
broski left
01:29
Rounin joined
|
|||
raydiak | good evening, #perl6 | 01:37 | |
m: Buf.new.[0, 1] = 2, 3 # this should be reported as a bug, correct? | 01:38 | ||
camelia | rakudo-moar 050686: OUTPUT«Cannot modify an immutable Int in method STORE at src/gen/m-CORE.setting:8022 in sub postcircumfix:<[ ]> at src/gen/m-CORE.setting:2829 in block <unit> at /tmp/r28g6o8w_a:1» | ||
TimToady | already reported, I think | ||
raydiak | thank you | ||
TimToady | but you might make sure there's a test :) | ||
01:39
dayangkun left
|
|||
raydiak looks | 01:39 | ||
hm...I see buf scattered across several test files, not sure where it would belong, still looking | 01:42 | ||
adu | how do I get a character from a string? | 01:47 | |
raydiak! | 01:48 | ||
raydiak | maybe it would go in S09-subscript/slice.t ? | ||
adu! | |||
there's also S03-operators/buf.t , kinda feels like a better place in with other buf stuff, but idk if slicing tests would go with "operators" or not | 01:51 | ||
01:52
BenGoldberg joined
|
|||
raydiak | adu: if you mean "a character by index", that's .substr | 01:52 | |
adu | raydiak: thanks | 01:53 | |
raydiak | you're welcome :) | ||
01:53
Ven left
|
|||
raydiak | bah gotta run for a bit already...back in a while | 01:53 | |
02:05
vukcrni left
02:06
vukcrni joined
02:24
cognominal left
|
|||
adu | how do I parse an int? | 02:24 | |
m: Int("5") | |||
camelia | ( no output ) | ||
adu | m: say Int("5") | ||
camelia | rakudo-moar 050686: OUTPUT«5» | ||
adu | wow | 02:25 | |
japhb | adu: Or just +, if you can accept any Numeric value. | 02:28 | |
02:28
adu left
|
|||
colomon | note, however | 02:28 | |
japhb | m: say +"5.24", +"3", +"4+5i"; | ||
camelia | rakudo-moar 050686: OUTPUT«5.2434+5i» | ||
colomon | m: say Int("5 fish") | 02:29 | |
camelia | rakudo-moar 050686: OUTPUT«Cannot convert string to number: trailing characters after number in '5⏏ fish' (indicated by ⏏) in method Int at src/gen/m-CORE.setting:13942 in method Int at src/gen/m-CORE.setting:6237 in block <unit> at /tmp/4DY6uXgHT9:1» | ||
japhb | m: .say for +"5.24", +"3", +"4+5i"; | ||
camelia | rakudo-moar 050686: OUTPUT«5.2434+5i» | ||
japhb | m: .WHAT.say for +"5.24", +"3", +"4+5i"; | ||
camelia | rakudo-moar 050686: OUTPUT«(Rat)(Int)(Complex)» | ||
skids | I must say the error messages have become so awesome it's almost easier to code perl6 scripts than perl5. | 02:30 | |
They usually tell me exactly where the typo/thinko is and what it is. | |||
The only exception being when Any hits a string or numeric context (line number often wrong) and when a undefined type object is hit (doesn't say what type the undef was). | 02:33 | ||
02:34
bjz joined
02:39
bjz left
|
|||
b2gills | m: multi sub test ( int \a ){ say a.WHAT; say 'int' }; multi sub test ( Int \a ){ say a.WHAT }; test (my int $ = 1); | 02:39 | |
camelia | rakudo-moar 050686: OUTPUT«(Int)int» | ||
b2gills | Nevermind, of course it promotes it to an Int if you use a method on it. | 02:40 | |
skids | m: multi sub test ( int \a ){ say a ~~ int; say 'int' }; multi sub test ( Int \a ){ say a.WHAT }; test (my int $ = 1); | 02:43 | |
camelia | rakudo-moar 050686: OUTPUT«Falseint» | ||
02:43
cognominal joined
|
|||
raydiak | back | 02:43 | |
putting my buf slice test in S09-subscript/slice.t unless anyone objects | |||
b2gills | The most difficult things in programming is naming things, the second most difficult thing is figuring out where to put the tests | 02:47 | |
raydiak | and I guess third is finding the ticket number I should attach to the test :) | 02:48 | |
ah well, will report just in case, better to have a dup than none | 02:51 | ||
02:56
adu joined
|
|||
skids | m: my %d; %d.push("b" => "c"); %d.perl.say; %d.push(:a(1)); %d.perl.say; | 03:04 | |
camelia | rakudo-moar 050686: OUTPUT«("b" => "c").hash("b" => "c").hash» | ||
_4d47 | whats the best way to include ./lib to run a module tests ? ufo, @*INC, export PERL6LIB ? | 03:06 | |
colomon | prove -e "perl6 -Ilib" t/whatever | ||
dunno if that's best, but it's what I always do. :) | |||
raydiak | m: sub foo { @_.perl.say }; foo("b" => "c"); foo(:a(1)); | 03:07 | |
camelia | rakudo-moar 050686: OUTPUT«Array.new("b" => "c")Unexpected named parameter 'a' passed in sub foo at /tmp/PWMdgm4LZB:1 in block <unit> at /tmp/PWMdgm4LZB:1» | ||
03:07
kurahaupo joined
|
|||
_4d47 | cool thanks i like it | 03:08 | |
skids | I've been staring to move away from @*INC to "use lib './lib';" | ||
raydiak | is "#?rakudo skip 'RT #123594'" the right thing to do when adding a test which currently fails? | 03:16 | |
synopsebot | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=123594 | ||
raydiak | idk much about those magic little comments we have in roast | ||
raydiak figures out how to read the README and use fudge to answer his own question (the answer seems to be yes) | 03:24 | ||
dalek | ast: b8e8171 | raydiak++ | S09-subscript/slice.t: Add test for RT #123594 |
03:25 | |
synopsebot | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=123594 | ||
03:28
noganex joined
|
|||
skids | heh. bot chaining win. | 03:29 | |
03:31
noganex_ left
03:37
adu left
03:49
telex left
03:50
telex joined
04:02
kurahaupo left
04:14
adu joined
04:25
anaeem1 joined
04:28
yeahnoob left,
_4d47 left
04:31
yeahnoob joined
|
|||
adu | lol | 04:34 | |
I think I just came up with a name for this | 04:36 | ||
transformation between c syntax and semantics | |||
04:37
yeahnoob left
04:38
yeahnoob joined,
yeahnoob left
04:39
yeahnoob joined,
yeahnoob left,
yeahnoob joined
04:40
yeahnoob left,
yeahnoob joined
04:46
tinyblak joined,
tinyblak left
04:47
tinyblak joined,
BenGoldberg left
04:50
kaleem joined
04:55
tinyblak_ joined
04:56
tinyblak left
05:01
leont left
05:06
Rounin left
05:12
gcole left
05:13
tinyblak_ left,
tinyblak joined
05:14
kurahaupo joined
05:15
yeahnoob left
05:20
tinyblak_ joined,
tinyblak left
05:29
vendethiel left
05:30
kaleem left
05:36
vendethiel joined
05:38
kurahaupo left
05:39
tinyblak_ left
05:40
tinyblak joined
05:48
kurahaupo joined
06:00
Rounin joined
06:05
xfix joined
06:08
rindolf joined,
sirdancealot joined
06:12
[Sno] left
06:13
yeahnoob joined,
yeahnoob left
06:16
yeahnoob joined
06:17
yeahnoob left
06:19
kurahaupo left
|
|||
moritz | m: .say for Signature.^attributes.map: { .^name } | 06:27 | |
camelia | rakudo-moar 050686: OUTPUT«BOOTSTRAPATTRBOOTSTRAPATTRBOOTSTRAPATTRBOOTSTRAPATTRBOOTSTRAPATTR» | ||
moritz | m: .say for Rat.^attributes.map: { .^name } | 06:28 | |
camelia | rakudo-moar 050686: OUTPUT«AttributeAttribute» | ||
06:42
kaleem joined
06:45
mr-foobar left
06:57
szabgab joined
06:58
szabgab left
07:03
[Sno] joined
07:11
Patterner joined
07:15
Psyche^ left
07:21
darutoko joined
07:33
gfldex joined
07:41
FROGGS left
07:42
kaleem left
07:47
FROGGS joined
07:49
FROGGS left
07:50
Sqirrel left
07:51
gfldex left
07:52
FROGGS[mobile] joined
07:59
eiro joined
|
|||
eiro | hello | 07:59 | |
FROGGS[mobile] | hi | 08:01 | |
JimmyZ | 😹 | 08:05 | |
08:10
xfix left
08:16
zakharyas joined
08:21
FROGGS joined
08:25
davido_ left
08:28
FROGGS[mobile] left
08:29
davido_ joined
08:35
Ugator joined,
eternaleye left
08:37
eternaleye joined
08:38
silug left
08:55
fhelmberger joined
08:56
slavik left
|
|||
CurtisOvidPoe | m: say 1/(.1 + .2 - .3) # divide by zero error | 08:59 | |
camelia | rakudo-moar 050686: OUTPUT«Type check failed for return value; expected 'Int' but got 'Failure' in any return_error at src/vm/moar/Perl6/Ops.nqp:649 in method floor at src/gen/m-CORE.setting:11400 in method Str at src/gen/m-CORE.setting:11421 in method gist at src/ge…» | ||
08:59
adu left
|
|||
CurtisOvidPoe | I don’t know how easy it would be, but a more user-friendly error message might help there. | 08:59 | |
moritz | agreed | 09:00 | |
iirc we have a bug report open for that | |||
CurtisOvidPoe | m: say 1.1/(.1 + .2 - .3) | ||
camelia | rakudo-moar 050686: OUTPUT«Type check failed for return value; expected 'Int' but got 'Failure' in any return_error at src/vm/moar/Perl6/Ops.nqp:649 in method floor at src/gen/m-CORE.setting:11400 in method Str at src/gen/m-CORE.setting:11421 in method gist at src/ge…» | ||
CurtisOvidPoe | That’s strange. I would expect that it would at least say “expected ‘Real’” | ||
lizmat | m: 1.1 / (my $a = 0) | ||
camelia | ( no output ) | ||
lizmat | m: say 1.1 / (my $a = 0) | 09:01 | |
camelia | rakudo-moar 050686: OUTPUT«Type check failed for return value; expected 'Int' but got 'Failure' in any return_error at src/vm/moar/Perl6/Ops.nqp:649 in method floor at src/gen/m-CORE.setting:11400 in method Str at src/gen/m-CORE.setting:11421 in method gist at src/ge…» | ||
CurtisOvidPoe | moritz: thanks. | ||
moritz | CurtisOvidPoe: it's from some internal helper function | ||
lizmat | method floor(Rational:D:) returns Int:D { | ||
09:01
FROGGS[mobile] joined
|
|||
lizmat | maybe we need to lose the "returns Int:D ? | 09:02 | |
CurtisOvidPoe | Unfortunately, that’s a from a key slide in my talk and I can’t omit that example. | ||
jnthn | morning, #perl6 | ||
CurtisOvidPoe | Question: “returns Int” makes sense to me, but what does the :D mean? | ||
moritz | lizmat: if it can fail, yes | ||
lizmat tries and runs spectest | |||
moritz | CurtisOvidPoe: that it's a defined Int | ||
jnthn | lizmat: Sounds like the Int:D is overly restrictive, yes. | ||
moritz | CurtisOvidPoe: ie not the type object | 09:03 | |
lizmat | $ 6 'say 1/(my $a=0)' | 09:04 | |
Divide by zero | |||
is that better ? | |||
jnthn | Surely... :) | 09:05 | |
lizmat | CurtisOvidPoe: is that what you expect? | ||
$ 6 'my $a = 1/($=0); say $a.WHAT; say $a' | 09:06 | ||
(Rat) | |||
Divide by zero | |||
aka, you *do* get a Rat returned, but as soon as you want to do anything with it, it fails | 09:07 | ||
moritz | if that's a feature, we have to give up all type constraints on return values from methods in Rat | 09:10 | |
09:11
mvuets joined
|
|||
lizmat | some test failures, but from tests checking the exception type (which clearly has changed) | 09:12 | |
moritz: I removed the constraints from Rational.floor/ceiling: they were the only ones with return constraints | |||
09:13
abraxxa left
|
|||
dalek | kudo/nom: 9672c0d | lizmat++ | src/core/Rational.pm: Rational.floor/ceiling less anal about return vals |
09:13 | |
moritz | lizmat++ | 09:14 | |
09:14
abraxxa joined
09:15
jluis left
|
|||
dalek | ast: 8da006e | lizmat++ | S03-operators/arith.t: Fix changed exception type for 3/0 |
09:19 | |
jnthn | lizmat: Related: rt.perl.org/Ticket/Display.html?id=123077 | 09:20 | |
09:23
jluis joined
09:24
sqirrel_ joined
09:29
FROGGS[mobile] left
|
|||
lizmat | afk for ~2 hours& | 09:33 | |
moritz | m: say 1/0 | 09:35 | |
camelia | rakudo-moar 050686: OUTPUT«Type check failed for return value; expected 'Int' but got 'Failure' in any return_error at src/vm/moar/Perl6/Ops.nqp:649 in method floor at src/gen/m-CORE.setting:11400 in method Str at src/gen/m-CORE.setting:11421 in method gist at src/ge…» | ||
moritz | still the bad old rakudo | ||
09:36
tinyblak left,
tinyblak joined
|
|||
CurtisOvidPoe | lizmat: yes, that’s much better :) | 09:38 | |
09:39
kjs_ joined,
dakkar joined
09:41
tinyblak left
|
|||
masak | antenoon, #perl6 | 09:46 | |
FROGGS | o/ #perl6 | ||
I'll be at the FOSDEM \o/ | |||
CurtisOvidPoe | Yay! | 09:52 | |
09:53
sqirrel_ left
|
|||
nwc10 | with or without the FROGGletS? | 09:57 | |
09:58
kaleem joined
|
|||
FROGGS | nwc10: without | 10:02 | |
it is too complicated to get all of 'em with me | |||
I mean, we are talking about four hobbits here (wife + three kids) | 10:03 | ||
I just need to find good topics now and prep my talks :/ | 10:04 | ||
jnthn | FROGGS: I'm also pondering topic :) | 10:05 | |
(So you're not alone :)) | |||
FROGGS | jnthn: :o) | ||
jnthn: if you have spare topics left at the end... don't hesitate to share please | 10:06 | ||
JimmyZ | NSA! :P | 10:07 | |
FROGGS | that's certainly a jnthnish topic, aye | ||
I could imagine a NativeCall talk | 10:08 | ||
10:08
rurban joined
|
|||
moritz | that would be nice | 10:08 | |
speaking of which: both the sqlite and the postgresql client API are great from a nativecall POV | |||
FROGGS | like a walk through... | ||
hmmm | |||
and I bet I can spend more time on NativeCall than on v5 or slangs in general other the other things I usually talk about | 10:09 | ||
moritz: so you'd favour that somebody extends DBDish::Pg? | 10:11 | ||
10:11
cognominal left
|
|||
jnthn | FROGGS: A NativeCall talk would be nice; it tends to be well received by many folks who try it. | 10:11 | |
moritz | FROGGS: no objections to that, but I just wanted to point to useful APIs that can be cleanly nativecalled (as examples for such a talk) | 10:12 | |
FROGGS | jnthn: exactly my motivation | ||
moritz: my first thought was: "Shout a libname and we'll bind it!" but I dunno how well that would work out :o) | |||
10:13
slavik joined
|
|||
moritz | FROGGS: live demos are always very risky | 10:13 | |
jnthn | Terribly if somebody shouts "ncurses!" :) | ||
moritz | and I guess you don't want to bind something non-trivial in the front of an audience | 10:14 | |
Rounin | How awful... Next time you should shout "OpenGL" | ||
Then again, repetitive bindings like that can probably be auto-generated to some extent | 10:16 | ||
raydiak still hopes to make creating bindings a little less laborious when C::Parser is ready | |||
btyler_ also hopes that | 10:17 | ||
10:17
Alina-malina left
10:22
Alina-malina joined
|
|||
FROGGS | yeah | 10:24 | |
10:25
virtualsue joined
|
|||
FROGGS | moritz: I guess that live coding is the extrem of live demos, and we all know the rule of live demos :o) | 10:25 | |
but I might stick to libXML | 10:27 | ||
dalek | kudo/nom: 39be5fb | jnthn++ | src/Perl6/World.nqp: Remove dead code. |
10:32 | |
kudo/nom: a6ac643 | jnthn++ | src/Perl6/Actions.nqp: Don't static-inline routine with `is copy` trait. Fixes RT#118183. |
|||
synopsebot | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=118183 | ||
ast: 3b76c73 | jnthn++ | S06-traits/is-copy.t: Test for RT#118183. |
|||
synopsebot | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=118183 | ||
10:34
denis_boyun_ joined
10:37
tinyblak joined
10:39
tinyblak left,
tinyblak joined,
tinyblak left,
tinyblak joined
|
|||
masak | today's mini-challenge: a 4x4 grid has 24 internal walls. in the power set of these, some of the members are "mazes", by definition grids with a unique path between every two squares. how many mazes exist? | 10:41 | |
a number is fine. (but it should be found with Perl 6, not with oeis.org) | |||
cute ASCII art is even better. | 10:42 | ||
10:42
tinyblak_ joined,
tinyblak_ left,
tinyblak_ joined
|
|||
moritz | is that really a *mini* challenge? | 10:44 | |
masak | solution can fit in ~50 LoC by my estimate. so yes. | ||
10:45
tinyblak left
|
|||
jnthn | 50 lines of Perl 6 can do quite a bit :P | 10:48 | |
masak | I'm not contesting that. | 10:59 | |
10:59
tinyblak joined
11:02
tinyblak left,
tinyblak_ left,
tinyblak joined
|
|||
dalek | kudo/nom: 0885ec3 | jnthn++ | src/Perl6/Grammar.nqp: Whine about redeclarations of labels. Fixes RT#120632. |
11:03 | |
synopsebot | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=120632 | ||
dalek | ast: b57a00b | jnthn++ | S04-statements/label.t: Test duplicate labels are whined about. Covers RT#120632. |
||
synopsebot | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=120632 | ||
11:08
Mso150_e left
|
|||
dalek | p/6pe: 9d6ba70 | jnthn++ | src/vm/moar/QAST/QASTOperationsMAST.nqp: Map nqp:: ops for parametricity on MoarVM backend. |
11:19 | |
p/6pe: 98b770c | jnthn++ | t/nqp/87-parametric-6model.t: Some initial tests for 6model parametric ops. |
|||
p/6pe: f90dd15 | jnthn++ | t/nqp/87-parametric-6model.t: Basic tests for parameterization interning. |
|||
11:20
sirdancealot left
11:25
Rounin left
|
|||
dalek | ast: f031a89 | lizmat++ | S02-types/ (2 files): Fudge questionable tests |
11:27 | |
11:33
colomon left
|
|||
masak | hah. I don't even recall submitting RT #120632. :) | 11:34 | |
synopsebot | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=120632 | ||
11:35
colomon joined
|
|||
jnthn | Well, now the redecl error is a-OK :P | 11:38 | |
11:48
kaleem left
|
|||
dalek | kudo/nom: 42bb409 | lizmat++ | src/core/ (3 files): Add custom HashIter constructors The idea being that we don't need to figure out at run time what type of iteration we need. Hopefully a better target for inlining this way. Shows about a 3% speedup in .keys/kv/values/pairs/invert. Also reads better, I think. |
11:57 | |
lizmat | ^^^ also seems to give 1.5% improvement in Text::CSV benchmark | 12:01 | |
masak | nice! | ||
12:04
uniejo joined
12:06
tinyblak_ joined
12:07
tinyblak_ left,
tinyblak_ joined,
tinyblak left
12:13
uniejo left
12:18
grondilu joined
12:20
kaare__ left
|
|||
vendethiel | for previous discussion: wouldn't have Failure as a bottom type make sense? | 12:25 | |
TuxCM | lizmat, I reworked through my CSV_XS changes and got another 10% while implementing options (see test-t.pl) | 12:33 | |
lizmat++ | 12:34 | ||
12:34
tinyblak joined
12:36
tinyblak_ left
12:40
xfix joined,
xfix left,
xfix joined
12:42
tinyblak left,
tinyblak joined
|
|||
masak | vendethiel: TimToady has repeatedly hinted that Failure is effectively our bottom type. | 12:42 | |
12:45
kaleem joined
12:46
rhr left
12:54
colomon left,
anaeem1 left
12:56
colomon joined
12:58
tinyblak left
12:59
tinyblak joined
13:00
brrt joined
|
|||
lizmat | .oO( in the end, it is all a mistake ) |
13:02 | |
13:02
rurban left
13:03
skids left
|
|||
moritz | in some sense, Failure as a bottom type isn't too far off | 13:03 | |
because you can call any method on it | |||
which is a requirement for good bottom type | 13:04 | ||
psch | hi #perl6 \o | 13:09 | |
brrt | lizmat, in perl6 io, and especially newio, who is responsible for encoding of strings | ||
btw, 'Buf' is our bag-of-bytes type right | |||
13:09
colomon left
|
|||
moritz | Blob is the most general bag-of-thingies type | 13:10 | |
and Blob[uint8] the most general bag-of-bytes type | 13:11 | ||
dalek | kudo/nom: fdf18b3 | lizmat++ | src/core/Array.pm: Streamline Array.at_pos - reduce number of boxings/unboxings - get better errors on Inf/NaN Gives about 15% speedup in @a[Int $b] access. Adding a separate Int candidate did not give the desired speedup effect: not sure why that is, maybe the overhead of having another candidate? Unfortunately, not very noticeable in the test-suite. |
||
moritz | and Buf is supposed to be writable, but isn't quite yet | ||
masak | moritz: also, Failure gets through most typechecks. | ||
13:11
jack_rabbit left
|
|||
lizmat | m: say Failure ~~ Int | 13:11 | |
camelia | rakudo-moar 42bb40: OUTPUT«False» | ||
lizmat | m: say 1/($=0) | 13:12 | |
camelia | rakudo-moar 42bb40: OUTPUT«Divide by zero in method Numeric at src/gen/m-CORE.setting:13949 in sub infix:<-> at src/gen/m-CORE.setting:4615 in method Str at src/gen/m-CORE.setting:11427 in method gist at src/gen/m-CORE.setting:4450 in sub say at src/gen/m-CORE.se…» | ||
13:12
sirdancealot joined
|
|||
lizmat | afk for a few hours& | 13:12 | |
masak | m: sub foo(--> Int) { fail }; my $x = foo; say "alive" | ||
camelia | rakudo-moar 42bb40: OUTPUT«Type check failed for return value; expected 'Int' but got 'Failure' in any return_error at src/vm/moar/Perl6/Ops.nqp:649 in sub foo at /tmp/WcESj2YqJO:1 in block <unit> at /tmp/WcESj2YqJO:1» | ||
masak | huh. | ||
lizmat | that's *exactly* the problem! :-) | 13:13 | |
13:13
Rounin joined,
grondilu left,
colomon joined
13:14
rindolf left
|
|||
jnthn | And making it work has a notable cost. | 13:14 | |
FROGGS | moritz: there is a subbuf-rw fwiw | 13:15 | |
moritz | FROGGS: yes | ||
FROGGS: my point is that it's not mutable in all the places where it should be | |||
(iirc) | |||
masak | jnthn: one that could be optimized away? | ||
brrt | but anyway. if in perl6 i have a file handle, and I write a string to it, who is going to do the encoding of the string | ||
FROGGS | moritz: correct | ||
jnthn | Suppose we have $a + $b + $c and we statically known all are of type Int | ||
moritz | brrt: the file handle has an encoding associated | ||
brrt | hmm | 13:16 | |
what happens if i write something unencodable | |||
FROGGS | brrt: assplosion | ||
moritz | you get an exception, I believe | ||
jnthn | We can not statically inline the second + there, because we cannot rely on return types contributing static knowledge - short of looking deeper. | ||
So we push more things towards dynamic optimization, and mostly leave static to be useful for native types. | 13:17 | ||
That said, if Int:D rejects failure, we may be able to keep the benefits. | |||
13:20
jack_rabbit joined
13:21
leont joined
13:30
tinyblak left
13:31
tinyblak joined,
jack_rabbit left
13:35
rindolf joined
13:36
baest_ joined
13:38
baest left,
leont left
13:40
baest_ is now known as baest,
synopsebot left
13:41
rjbs left
13:42
rjbs joined,
pmichaud left
13:43
pmichaud joined,
jack_rabbit joined
13:47
FROGGS left
13:51
leont joined
13:58
kjs_ left
13:59
anaeem1 joined,
jack_rabbit left,
telex left
14:00
anaeem1 left,
telex joined,
kjs_ joined
14:01
synopsebot joined
14:02
tinyblak_ joined
14:04
Rounin left
14:05
tinyblak left,
tinyblak_ left
|
|||
[Coke] | TimToady: how do you feel about renaming isNaN to is-NaN for is-prime parity? | 14:06 | |
14:06
tinyblak joined
14:09
rurban joined
|
|||
psch | p6: my $x = 5; say nqp::isint(nqp::decont($x)) # this still confuses me | 14:16 | |
camelia | rakudo-{parrot,moar} 42bb40: OUTPUT«0» | ||
psch | especially in tandem with: | ||
$ ./perl6 -e'my $x = 5; say nqp::isint(nqp::decont($x))' | |||
1 | |||
that's perl6-j | |||
14:17
rhr joined
|
|||
jnthn | Int in Perl 6 is a P6opaque with a P6bigint located within it. | 14:19 | |
p6: say nqp::isint(Int); say nqp::isint(int); | 14:20 | ||
camelia | rakudo-{parrot,moar} 42bb40: OUTPUT«01» | ||
jnthn | I'm a bit curious about the -j discrepancy. | ||
psch | mvm check repr identity, jvm checks for StorageSpec.CAN_BOX_INT | 14:23 | |
...at least if i'm looking at the right spots, which is interp.c:2615 and Ops.java:2350 | 14:25 | ||
14:28
kaleem left
|
|||
[Coke] | imgur.com/gallery/CJfnAL7 - a little nicer than the ones I have! | 14:32 | |
tadzik | whoa | 14:33 | |
14:40
skids joined
14:47
kjs_ left
14:51
kjs_ joined
14:56
anaeem1 joined
15:01
kjs_ left,
kjs_ joined
15:02
donaldh joined
15:03
kaleem joined
15:10
tinyblak left
15:27
adu joined,
adu left
15:31
kjs_ left,
[Sno] left
15:33
treehug88 joined
15:37
treehug88 left
15:40
treehug88 joined
|
|||
hoelzro | o/ #perl6 | 15:44 | |
psch | o/ hoelzro | 15:45 | |
jnthn: so jvm is wrong and should also check for REPR id instead of the storagespec? | 15:46 | ||
which means i'll have to do that myself in RakudoJavaInterop, which isn't bad because it gives me a convenient spot to check for values > Long.MAX_VALUE i guess | 15:47 | ||
15:47
spider-mario joined,
FROGGS joined
|
|||
[Coke] | thanks, all you groovy perl6 people. | 15:48 | |
FROGGS | o/ | ||
jnthn | psch: Well, inconsistency is certainly wrong... The JVM way does mean you're asking "can this unbox to a native int"... | 15:49 | |
psch | o/ FROGGS | ||
jnthn | ...which may be useful. | 15:50 | |
Mebbe try changing it to be inline with Moar and Parrot, and see if spectest is happy. | 15:51 | ||
psch | right, i'll try that and see what falls out | 15:52 | |
got something else right now though, result will come in about 2 hours i think :) | |||
psch will bbl & | 15:53 | ||
15:58
kaleem left
16:02
kjs_ joined
|
|||
pyrimidine | re: panda, is there a way to run bootstrap/rebootstrap or install w/ different backends? IN other words, maybe have a panda (for the default) and panda-j/panda-p (for JVM or Parrot)? | 16:06 | |
*panda-m (for the default moar) # just to clarify | 16:07 | ||
FROGGS | pyrimidine: that is what you will get in a not too distant future for free | ||
hoelzro | if two multis exist that have the same signature except for a where condition on a parameter, and both wheres match the incoming value, what determines which is called? | 16:08 | |
FROGGS | pyrimidine: the "eleven" branches of rakudo+panda will create foo,foo-m,foo-j and foo-p scripts for every binary that gets installed | ||
hoelzro | ex. my multi conjugate(Str $verb where /'вить' $/) { ... } ; my multi conjugation(Str $verb where /'ить' $/) { ... } ; say conjugate('язвить') | 16:09 | |
FROGGS | hoelzro: the first declared IIRC | ||
jnthn | hoelzro: design.perl6.org/S12.html#Constrain...Candidates | ||
hoelzro | ah, thanks FROGGS + jnthn | ||
jnthn | But what FROGGS said | ||
There's an RT recently filed on this by CurtisOvidPoe++, but Rakudo is to spec on this one, so it's not a bug. | 16:10 | ||
pyrimidine | FROGGS: ok, thx. | ||
FROGGS: Just making sure it isn't implemented now (e.g. I'm missing something obvious :) | |||
FROGGS | so it is the first hit in the method table | ||
pyrimidine: correct, it is not available yet | |||
jnthn | Could be a spec issue, though I already argued this one out with TimToady plenty. :) | ||
So I'm not convinced he's likely to change his mind. | 16:11 | ||
jnthn was for "ambiguous" also | 16:12 | ||
FROGGS | jnthn: but checking for ambiguity would not be cheaper, right? | ||
CurtisOvidPoe | It the issue with that ticket is because runtime checking is so expensive? Would any compile-time checks work (or is that the halting problem?) | 16:13 | |
16:14
denis_boyun_ left
|
|||
jnthn | CurtisOvidPoe: Well, the administrative issue with the ticket is that we use RT for implementation bugs, and github.com/perl6/specs/issues for specification issues. :) | 16:14 | |
16:15
_4d47 joined
|
|||
CurtisOvidPoe | Ah, I had no idea. | 16:15 | |
jnthn | CurtisOvidPoe: Compile time resolution quickly ends up being the halting problem. | ||
16:17
mr-foobar joined
|
|||
jnthn | CurtisOvidPoe: I can't personally help much with the issue, though, in so far as I originally implemented it as complaining about ambiguity, and argued for the same semantics you are, but TimToady was insistent on "first match wins" for constraint types (for nominal types, we do care about ambiguity). | 16:17 | |
So eventually after a couple of debates on it, I ended up dragging Rakudo in line with spec. | 16:18 | ||
I think performance was one argument, but "equivalence with given/when semantics" is the other I remember. | 16:19 | ||
CurtisOvidPoe | I wonder about the roles issue then. Maybe there could at least be a warning when there’s potential ambiguity if multiple roles provide mutli-methods with the same name? One of the biggest problems with inheritance and mixins is ordering. | ||
I can buy the equivalence with given/when. It’s roles and inheritance where it bytes. If you have a muli in a parent or child, I assume the child wins? Is that tested? | 16:20 | ||
And if I have a class and a role and the role is composed into the class, which is considered “first”? | 16:21 | ||
(sorry if I’m beating a dead horse and being annoying) | |||
16:22
_4d47 left
|
|||
jnthn | The inheritance one has a nice easy answer: the invocant of a method is typed to match the enclosing class, and multi-dispatch on methods doesn't treat the invocant parameter specially in any way, so the first parameter in the child class has a narrower and so wins. | 16:23 | |
CurtisOvidPoe | That makes perfect sense. | ||
jnthn | The roles case has a bit more going on. When you write a method in a role, the invocant's type is the generic type ::?CLASS. That is to say, every Perl 6 role is implicitly parametric on the type it is composed into. Composition thus first instantiates the role, and copies the instantiated method into the method table of the class. So the method the multi-dispatcher actually sees has an invocant typed with the class that composed the method. | 16:26 | |
16:26
Sir_Ragnarok_ joined
|
|||
CurtisOvidPoe | And if there’s ambiguity, the “native” class multi is first? | 16:27 | |
That might be hard if we’re flattening at compile-time. | |||
CurtisOvidPoe is just guessing. | |||
jnthn | In the absence of subset/where that is ambiguous at present. | 16:28 | |
Since - as you correctly point out - we flattened things at compile time. | |||
16:29
Sir_Ragnarok left
|
|||
jnthn | You can, if you go introspecting deeply enough, figure out what methods came from roles. | 16:29 | |
I *think* | 16:30 | ||
moritz | you can | ||
jnthn | moritz: .package? | ||
moritz | .^roles | ||
jnthn | Oh, I meant from the Method object itself. | ||
moritz | and then look into the roles | 16:31 | |
jnthn | Ah, true. | ||
16:31
zakharyas left
|
|||
jnthn | That'd be more round-about, but yes. | 16:31 | |
moritz | but .package might work too | ||
jnthn | It's probably also worth noting that various very obvious ambiguities in multis could be pointed out at compile time, but are not yet. | 16:33 | |
16:33
brrt left
16:34
molaf joined
16:49
kaleem joined
16:50
KCL_ joined
16:52
salv0 left
17:03
anaeem1 left
17:04
anaeem1 joined
17:06
Sir_Ragnarok joined,
Sir_Ragnarok_ left
17:09
anaeem1 left,
salv0 joined
|
|||
dalek | rl6-roast-data: 2e529d4 | coke++ | / (5 files): today (automated commit) |
17:11 | |
17:12
virtualsue left,
rurban left
17:13
anaeem1_ joined
17:14
mvuets left
17:16
anaeem1_ left
|
|||
[Coke] | no failures in a few days, that's good. | 17:16 | |
jnthn | Nice | ||
Especially as there's been a flow of patches too :) | |||
17:16
anaeem1 joined
|
|||
[Coke] | mmm, rakudo.moar-jit has gone from 32907 to 33025 passes in 4 days. | 17:17 | |
vendethiel | nice :D. | 17:19 | |
17:20
kaleem left
17:21
anaeem1 left
|
|||
jnthn | Dinner time here soon, and I plan to continue working on the 6model parametric bits this evening. :) | 17:24 | |
17:24
fhelmberger left
17:26
abraxxa left
|
|||
timotimo likes | 17:26 | ||
bon appetit | |||
17:27
anaeem1 joined
17:28
[Sno] joined
|
|||
hoelzro | [Coke]: regarding Mojo6, are you going to try to preserve the "no dependencies" nature of Mojo5? | 17:35 | |
hoelzro may have some tuits tonight | 17:36 | ||
17:44
dakkar left,
anaeem1 left
17:45
treehug88 left
17:46
ab5tract joined
|
|||
hoelzro | I've noticed I often accidentally type a lexical variable (ie. $name) instead of the attribute that I mean ($!name). I was thinking I could add a helpful error message; would it be ok if it were just Variable '$name' is not declared. Did you mean '$!name'? | 17:47 | |
or should it be more particular? | |||
[Coke] | hoelzro: in general, I don't particular care for "no dependencies", but I've always worked places where installing dependencies was trivial. | 17:49 | |
so, probably depends on how hard it is to satisfy. | |||
hoelzro | [Coke]: I was thinking of trying my hand at writing Mojo::CSS, and I wouldn't mind avoiding some reinventing of the wheel for the HTML/CSS parsing | 17:50 | |
jdv79 | ugexe: its not the uri commit - the ssl.close call is hanging. | 17:51 | |
PerlJam | even mojo5 isn't really "no dependencies" | 17:54 | |
17:56
sirdancealot left,
gfldex joined
17:58
treehug88 joined
|
|||
hoelzro | PerlJam: fair enough =) | 18:00 | |
PerlJam | plus, it seems to me that getting working would win on the -Ofun factor initially :) | 18:01 | |
*it | |||
arnsholt | hoelzro: Suggesting $!foo for $foo sounds reasonable to me. Should be possible to implement as an extension to our existing "name missing" stuff | 18:02 | |
hoelzro | PerlJam: yeah, I was thinking of using dependencies to get it working; the question is do I then try to make it dependency-less? | 18:03 | |
arnsholt: yeah, I don't think it'll be to hard; I'm just wondering if the error should be more clear | |||
something like "There's no lexical '$name', but you have an attribute called '$!name'. Did you mean that?" | 18:04 | ||
18:04
_4d47 joined
|
|||
arnsholt | Might be nicer. I think your original suggestion is nice as well | 18:04 | |
It's a bit more concise | |||
PerlJam | aye, me too | ||
18:05
kaare__ joined
|
|||
hoelzro | ok, how about I just leave the copy as-is, and others can improve if desired later? | 18:05 | |
18:06
eternaleye left
18:07
_4d47 left
18:08
donaldh left
18:09
eternaleye joined
|
|||
jnthn | hoelzro: About CSS, I think there's already a module in the ecosystem that does CSS parsing, and it looked like a lot of work/thought had gone into it. | 18:12 | |
18:13
FROGGS_ joined
|
|||
jnthn | hoelzro: +1 to suggesting an existing $!name if $name does not exist | 18:13 | |
hoelzro | jnthn: I saw that! I intend to make use of it =) | ||
18:14
KCL_ left,
pmurias joined
|
|||
itz | will FOSDEM have a State of the Butterfly in addition to Get Ready to Party? | 18:15 | |
lizmat | itz: not that I'm aware of (atm) | ||
18:16
FROGGS left
18:18
zakharyas joined
18:19
IllvilJa joined
|
|||
PerlJam idly wonders what Camelia looked like in her pupal stage | 18:21 | ||
actually, camelia has been a pupa for about 15 years now, IMHO (Perl 5 was the caterpillar :) | |||
ab5tract | that caterpillar's got humps! | 18:22 | |
PerlJam | .oO( camelpillar? ) |
||
ab5tract has been imagining a Perl 6 camel as having fractal humps :) | 18:23 | ||
Perl 6: Even the humps have humps. Plenty of places to find a comfortable seat! | 18:24 | ||
[Coke] | hoelzro: please please jump in, even if you steal the repo to do it. :) happy to give out bits there, since I've been so lazy. | 18:25 | |
PerlJam | perl6.org could have some imagery of a chrysalis slowly opening and Camelia emerging :) | ||
18:27
Mso150 joined
|
|||
[Coke] | hoelzro: you're a collaborator on github.com/coke/mojo6 if you like. | 18:27 | |
18:27
dwarring joined
|
|||
lizmat | [Coke]: wrt to isNaN vs Is-NaN, I don't have much of a feeling about that | 18:29 | |
PerlJam | dwarring: did someone mentioning CSS somehow summon you? | ||
lizmat | [Coke]: but with regards to e.g. exists_key vs exists-key (aka anything with an underscore currently) | ||
18:29
virtualsue joined
|
|||
lizmat | [Coke]: I think those should be kebabcased with the underscored version deprecated | 18:29 | |
PerlJam | lizmat++ (That should be the "p6 standard" IMHO) | 18:30 | |
lizmat | yup | ||
:-) | |||
dwarring sips caffine & backlogs | 18:31 | ||
ab5tract | lizmat++ | 18:32 | |
18:33
anaeem1_ joined
|
|||
ab5tract | fwiw, i think the isNan Is-Nan makes sense too. smells like a YAPE otherwise ;) | 18:34 | |
*YAPAE | |||
18:36
pmurias left
|
|||
[Coke] | yapae? | 18:36 | |
18:37
mvuets joined
|
|||
woolfy | nine: ping | 18:38 | |
dalek | ecs: 1ca7203 | coke++ | S99-glossary.pod: fix link |
||
ab5tract | [Coke]: Yet Another Potentially Awkward Explanation - perl6advent.wordpress.com/2014/12/...us-corner/ | 18:41 | |
dalek | ecs/newio: 8284cda | jnthn++ | S12-objects.pod: Correct spec of context aspects of the self term. |
18:42 | |
ecs/newio: 1ca7203 | coke++ | S99-glossary.pod: fix link |
|||
ecs/newio: f907cb8 | lizmat++ | S (2 files): Merge branch 'master' into newio |
|||
PerlJam | ab5tract: might want to add that to S99 | 18:44 | |
[Coke] | btw, not "Is-NaN" but "is-NaN". also, I wonder if "is-nan" would be ok. | 18:47 | |
18:49
anaeem1_ left
|
|||
ab5tract | PerlJam: i would be honored :D | 18:50 | |
18:51
sirdancealot joined
|
|||
dwarring | hoelzro: CSS::Grammar implements a basic selector parser - based on www.w3.org/TR/2011/REC-css3-selectors-20110929/ | 18:54 | |
CSS::Module extends this - its based on www.w3.org/TR/css3-selectors/ | 18:55 | ||
18:55
anaeem1 joined,
beastd joined
|
|||
dwarring | which is what Mojo::CSS implements | 18:56 | |
18:57
virtualsue left
|
|||
dwarring | these modules do parsing only no attempt at implementing a CSS selector engine | 18:58 | |
18:58
anaeem1 left
|
|||
dwarring | ...so wide open | 18:58 | |
18:59
anaeem1 joined
|
|||
dwarring | Mojo::DOM and Mojo::CSS look interesting | 19:00 | |
itz | I hadn't noticed perltricks.com/article/144/2015/1/1...-in-Perl-6 | 19:01 | |
19:01
Sqirrel joined
|
|||
dalek | kudo/nom: b4a936e | lizmat++ | src/core/List.pm: Streamline List.at_pos for 15/20% improvement |
19:02 | |
kudo/nom: ac75b0a | lizmat++ | src/core/List.pm: Handle List.at_pos(Inf/NaN) better |
|||
kudo/nom: 389326a | lizmat++ | src/core/ (2 files): Make sure X::Item exceptions are thrown properly Stubbing X::Item too late, would cause a "Cannot find &Item" error, probably because X *was* already stubbed, and X::Item was interpreted as a sub in X. |
|||
19:03
anaeem1 left
|
|||
dalek | ecs: 08e5b67 | PerlJam++ | S99-glossary.pod: [S99] Add YAPAE |
19:03 | |
19:04
Mso150_b joined
19:05
Mso150 left,
telex left
19:06
telex joined,
eternaleye left
19:07
eternaleye joined
|
|||
ab5tract | [Coke]: ah, the capital 'I' did seem suspicious to me | 19:08 | |
lizmat | jnthn: how would you feel of about only making int/Int candidates for at_pos in classes, and a catchall at_pos in Any that would the Any->int conversion ? | 19:09 | |
ab5tract | keeping the casing of the type seems important to me | ||
lizmat | perhaps a Numeric catcher as well, which would do the Inf/Nan check | 19:10 | |
19:12
rjbs left
|
|||
ab5tract | PerlJam: ah, thanks for adding :) i just finished filing a PR when i saw it announced here :) | 19:12 | |
jnthn | Why do we have an is-NaN method, ooc? | 19:18 | |
Is ~~ NaN not workable | |||
? | |||
lizmat: That would probably save some duplication... | 19:19 | ||
lizmat | yes, quite some, and reduce the number of candidates significantly | ||
jnthn | lizmat: It'd imply a level of delegation, but that's probably not a big problem. | 19:20 | |
lizmat | which would also be good, right ? | ||
it would be punishing the programs that don't use int/Int for [] | |||
jnthn | Well, the dispatch cache is keyed on the types that actually show up. | ||
So if a program hits just a selection of candidates, the cache is quickly primed and the number of candidates matters rather less | |||
lizmat | types that actually show up where? | 19:21 | |
jnthn | In calls | 19:22 | |
lizmat | but if in the setting, we don't see a call with a certain type, how would a program than handle that? | ||
dwarring | hoelzro: example CSS selector parse... | ||
perl6-m -I blib/lib -MCSS::Module::CSS3 -e'my $actions = CSS::Module::CSS3::Actions.new; say CSS::Module::CSS3.parse( q<input[class~="foo"]>, :rule<selectors>); say $/.ast.perl' | |||
jnthn | lizmat: The cache is built dynamically at runtime. | ||
lizmat | or is the cache outside of the setting | ||
ok | |||
jnthn | lizmat: It depends on what types actually show up at runtime, like much of our optimization :) | 19:23 | |
lizmat | yeah, ok | ||
jnthn | lizmat: So if somebody never does @foo[$a_str] then that candidate won't be in the multi dispatch cache. | ||
19:23
kurahaupo joined
|
|||
dwarring | perl6-m -I blib/lib -MCSS::Module::CSS3 -e'my $actions = CSS::Module::CSS3::Actions.new; say CSS::Module::CSS3.parse( q<input[class~="foo"]>, :rule<selectors>, :$actions); say $/.ast.perl' | 19:23 | |
lizmat | well, I'm streamlining at_pos candidates now for all classes | ||
jnthn | The number of candidates being less is good of course for overall code size in memory. | ||
lizmat | yup | ||
and when that's done, I'll see about reducing the number of candidates (except in Any) | 19:24 | ||
and see what that brings us :) | |||
jnthn | And good if the program uses so many of the candidates or so crazy range of types on a candidate that it overflows the multi cache and we fall back to the slower path. | ||
lizmat | ok | 19:25 | |
jnthn | Thankfully, megamorphic things ain't hugely common. | ||
lizmat | so reducing candidates is good :-) | ||
19:25
CurtisOvidPoe left
|
|||
jnthn | lizmat: Yes, to a degree | 19:27 | |
ugexe | jdv79: those messages you got with my examples are also known to be produced by older versions of openssl with AES-ni (and from what you posted your openssl is not up to date) | ||
jnthn | lizmat: For example, turning two multi candidates into a single one that does a type check is unhelpful. | 19:28 | |
lizmat | yeah, got that :-) | ||
this is exactly what I'm splitting in a lot of cases now | |||
jnthn | OK. Then sounds like you're doing very agreeable things. :) | 19:29 | |
lizmat | yeah :-) | ||
jnthn ponders whether to work on 6pe JVM port, or on figuring out the bounded serialization interaction with it... | 19:30 | ||
Mebbe I should do the port so I can remember how this code I wrote a month ago works. :) | |||
ab5tract | JVM is a huge "production ready" checkbox, imo | 19:32 | |
jercos | I presume 6pe is not IPv6 over MPLS? >.> | 19:33 | |
TimToady | datapoint: I had a helper doing quiz scorekeeping this past weekend, and he duplicated the dataentry using the JVM while I used MoarVM to run our quiz editor; both performed flawlessly | 19:34 | |
jnthn | \o/ | ||
TimToady | and he was running on a Mac | 19:35 | |
(which is why he had the JVM version from December, because MoarVM was still flakey on Mac back then) | |||
19:36
kjs_ left
|
|||
jnthn | Yeah, OSX is a good canary for some reason or toher. | 19:36 | |
*other | |||
lizmat | m: say (1,2,3,4.5)[-1] | 19:38 | |
camelia | rakudo-moar 389326: OUTPUT«===SORRY!=== Error while compiling /tmp/xXEOxdv6nAUnsupported use of a negative -1 subscript to index from the end; in Perl 6 please use a function such as *-1at /tmp/xXEOxdv6nA:1------> say (1,2,3,4.5)[-1]⏏<EOL>…» | ||
TimToady | I'm fine with hypehening 'is' functions in general | ||
El_Che | TimToady: you heard the Language track at fosdem is at Sunday? | ||
lizmat | m: my $a = (1,2,3,4.5); say $a[-1] | ||
camelia | rakudo-moar 389326: OUTPUT«===SORRY!=== Error while compiling /tmp/4G6lTlWbXZUnsupported use of a negative -1 subscript to index from the end; in Perl 6 please use a function such as *-1at /tmp/4G6lTlWbXZ:1------> my $a = (1,2,3,4.5); say $a[-1]…» | ||
lizmat | hmmm.... | ||
TimToady | El_Che: yes | ||
TimToady gets to have the 'last word' :) | |||
lizmat | there *are* other presentations in that room after that, though | ||
but not in the "Language" track | 19:39 | ||
El_Che | "And now, I declare all other languages obsolete" :) | ||
19:39
bartolin joined
|
|||
vendethiel | please tell me fosdem will have some kind of recording | 19:39 | |
TimToady | nah, just obsolescent :) | ||
El_Che | vendethiel: it has | ||
to my surprise there is an other Perl talk just before TimToady's | |||
TimToady | "There's More Than One Way To Talk About It!" | 19:42 | |
FROGGS_ | who's speaking? rjbs? | ||
El_Che | fosdem.org/2015/schedule/event/des...ry_module/ | ||
the perl talks arein the dev room saturday | |||
hehe | 19:43 | ||
lizmat | Dana | ||
FROGGS_ | "Fastest bigint probable prime testing to 10k digits".... I wonder how we do compete | 19:44 | |
19:44
uniejo joined
|
|||
TimToady | well, we do is-prime with libtommath | 19:45 | |
woolfy | El_Che++ | 19:46 | |
El_Che | woolfy++ | ||
(that's how we say hi nowadays?) :) | |||
woolfy | oO(let's ++ eachother more often!) | 19:47 | |
El_Che | Is that a hint for Larry for Presenting Perl++ at Fosdem? :) | ||
19:47
uniejo left
|
|||
woolfy | :-) | 19:50 | |
dalek | p: 1200c79 | peschwa++ | src/vm/jvm/NQP/Ops.nqp: Implement missing falsey(num) for JVM backend. Before this the new test in nqp/13-op.t killed NQP with a VerifyError due to invalid bytecode. |
19:51 | |
psch | got sidetracked by that when running tests for the nqp::isint change... :) | 19:52 | |
dalek | kudo/nom: 958cbe7 | lizmat++ | src/core/Parcel.pm: Streamline Parcel.at_pos, for about 10% improvement |
||
19:57
kjs_ joined
|
|||
jnthn | psch++ | 19:58 | |
ab5tract | speaking of ++, i owe psch++ # now the mountains of perl6-processing are visible enough to plot a base camp | 20:00 | |
\ | |||
dalek | kudo/nom: 28e93b6 | lizmat++ | src/core/Range.pm: Streamline Range.at_pos: not much to win here |
20:01 | |
20:01
cognominal joined
20:03
kurahaupo left
|
|||
hoelzro | [Coke]: cool, thanks! | 20:08 | |
dwarring: thanks for the example! | |||
dwarring | hoelzro: np | 20:09 | |
20:12
cognominal left,
kurahaupo joined
|
|||
[Coke] | jnthn: (remove isNaN) works for me. | 20:19 | |
20:19
kjs_ left
20:22
zakharyas left
20:26
darutoko left,
beastd left
20:35
amoquin joined
|
|||
amoquin | masak: Is the mini-challenge orientation-dependent? | 20:36 | |
Heh | |||
20:36
amoquin is now known as Mouq
|
|||
Mouq | better | 20:36 | |
20:41
rindolf left,
ab5tract left
20:44
kjs_ joined
20:48
virtualsue joined
20:51
ab5tract joined,
telex left
20:52
telex joined
20:56
rurban joined
21:02
zakharyas joined
21:05
synopsebot left,
eternaleye left
21:06
Util left,
eternaleye joined
21:08
kurahaupo left
|
|||
dalek | p/6pe: 648d0ca | jnthn++ | src/vm/jvm/runtime/org/perl6/nqp/runtime/IndyBootstrap.java: Quiet warnings about variable name _. |
21:09 | |
p/6pe: c194b3a | jnthn++ | src/vm/jvm/runtime/org/perl6/nqp/sixmodel/ (4 files): Stub in STable parametricity extensions on JVM. |
|||
p/6pe: 7661100 | jnthn++ | src/vm/jvm/QAST/Compiler.nqp: Map parametric 6model nqp:: ops on JVM. They're not yet implemented, but it gets the test file compiling. |
|||
ab5tract | sub prune_array( $list, $indices ) { [ for $list.kv { $^v unless $indices (cont) $^k } ] } | 21:10 | |
21:10
telex left
|
|||
ab5tract | ^^ this solution makes me happy | 21:10 | |
21:10
zakharyas1 joined
21:11
zakharyas left,
hugme joined,
ChanServ sets mode: +v hugme
21:12
synopsebot joined
21:13
Util joined
|
|||
ab5tract | not that there was really a problem floating around, but that showed up out of the mists today. | 21:13 | |
it worked well as an example to explain the $^ twigil (or is it a stwigil when the sigil and twigil are presented in combination) | 21:15 | ||
21:16
Mso150_b_g joined,
Mso150_b left
21:17
telex joined
|
|||
moritz | lizmat: + multi method at_pos(Parcel:D: Int \pos) is rw { | 21:18 | |
+ my $pos = nqp::unbox_i(pos); | |||
lizmat: shouldn't it be Int:D \pos | 21:19 | ||
21:19
rhr left
|
|||
moritz | and then my int $pos = nqp::unbox_i(pos) ? | 21:19 | |
21:19
Juerd left
21:21
rhr joined,
synopsebot left
21:22
pmichaud left,
Juerd joined
21:23
Util left,
Util joined,
synopsebot joined
21:25
Mso150_b_g_d joined
|
|||
psch | jnthn: replacing the check for StorageSpec.CAN_BOX_INT with REPR.equals(P6int.class) (and similarly for the other is$type ops) doesn't seem to cause any roast failures | 21:25 | |
21:26
Mso150_b_g left
|
|||
psch | all i got was what looks like a Supply-flap, in S17-supply/unique.t | 21:26 | |
jnthn: i'm wondering if we want an op along the lines of what isint on jvm does currently though. | |||
jnthn | psch: Only if we have a use case ;) | 21:27 | |
21:27
pmichaud joined
|
|||
lizmat | moritz: entirely correct :-) | 21:28 | |
psch | jnthn: i have exactly on use case, for unmarshaling towards java types, which is jvm-specific | ||
*one | |||
i can definitely make do with isbig_I and checking StorageSpec myself though | 21:29 | ||
jnthn | Yeah, if you're already in Java land just do it... | ||
lizmat | m: my $a; $a[Int] = 1 | ||
jnthn | (With the StorageSpec) | ||
camelia | rakudo-moar 28e93b: OUTPUT«Invocant requires an instance, but a type object was passed in method Bridge at src/gen/m-CORE.setting:4905 in sub infix:<<> at src/gen/m-CORE.setting:4828 in sub postcircumfix:<[ ]> at src/gen/m-CORE.setting:2736 in block <unit> at /tmp/HU…» | ||
21:30
xfix left
21:32
synopsebot left,
Util left,
Mouq left,
Alina-malina left,
vukcrni left,
amkrankruleuen left,
dj_goku left,
jakesyl_insomnia left,
prime left,
sven_123 left,
broquaint left,
ribasushi left,
Hor|zon left,
dagurval_ left,
sergot left,
atta left,
telex left,
hugme left,
sirdancealot left,
FROGGS_ left,
vike left,
dylanwh left,
araujo left,
go|dfish left,
xinming left,
frew left,
pyrimidine left,
Mso150_b_g_d left,
kaare__ left,
treehug88 left,
berekuk left,
TuxCM left,
ggoebel111111112 left,
avuserow_ left,
tadzik left,
Woodi left,
mst left,
pochi left,
ka05 left,
ingy left
21:33
Sqirrel left,
Sir_Ragnarok left,
mr-foobar left,
zoosha left,
yakudza left,
Khisanth left
|
|||
dwarring | r: say "abc".substr(0,4) | 21:34 | |
camelia | rakudo-{parrot,moar} 28e93b: OUTPUT«abc» | ||
dwarring | r: say "abc".substr(*-4) | ||
camelia | rakudo-moar 28e93b: OUTPUT«===SORRY!===Start argument to substr out of range. Is: -1, should be in 0..3» | ||
..rakudo-parrot 28e93b: OUTPUT«Start argument to substr out of range. Is: -1, should be in 0..3 in method gist at gen/parrot/CORE.setting:13906 in method gist at gen/parrot/CORE.setting:1165 in sub say at gen/parrot/CORE.setting:16640 in sub say at gen/parrot/CORE.sett…» | |||
dalek | kudo/nom: 6306593 | moritz++ | src/core/Parcel.pm: micro-optimize at_pos a bit more |
||
21:34
skaufman1 joined,
ingy joined,
daxim joined,
jnthn joined,
cxreg joined,
mtj- joined,
mathw joined,
El_Che joined,
Timbus joined,
tinita_ joined,
leedo_ joined,
muraiki joined,
robinsmidsrod joined,
Guest22354 joined,
nine joined,
cibs joined,
sivoais joined,
MilkmanDan joined,
atta joined,
ka05 joined,
sergot joined,
dagurval_ joined,
Hor|zon joined,
pochi joined,
ribasushi joined,
broquaint joined,
mst joined,
sven_123 joined,
Woodi joined,
pyrimidine joined,
tadzik joined,
avuserow_ joined,
SABFOSP joined,
ggoebel111111112 joined,
frew joined,
TuxCM joined,
dj_goku joined,
xinming joined,
go|dfish joined,
berekuk joined,
araujo joined,
amkrankruleuen joined,
dylanwh joined,
vike joined,
vukcrni joined,
treehug88 joined,
kaare__ joined,
FROGGS_ joined,
sirdancealot joined,
Mouq joined,
hugme joined,
telex joined,
Util joined,
synopsebot joined,
jakesyl_insomnia joined,
Sqirrel joined,
Sir_Ragnarok joined,
mr-foobar joined,
zoosha joined,
yakudza joined,
Khisanth joined,
sinisalo.freenode.net sets mode: +v hugme,
Alina-malina joined
|
|||
dwarring | ^^ I wonder if that usage of .substr should be more forgiving | 21:35 | |
21:35
telex left,
sivoais left,
vukcrni left,
sivoais_ joined
|
|||
Mouq | I'm surprised I'm blanking on how to write "all but the last element"... Surely there's a better way than @a[^(*-1)] | 21:35 | |
dwarring a lot can happen in a minute | |||
[Coke] | moritz: so now we cannot have a bigints worth of things in a parcel? | 21:36 | |
TimToady | 0..*-2 mebbe | ||
21:36
frew left,
xinming left,
Alina-malina left,
sivoais_ left,
jakesyl_insomnia left
|
|||
dwarring | just a[*-1] ? | 21:36 | |
21:36
[Sno] left,
leont left,
Ugator left,
davido_ left,
bbkr left,
nyuszika7h left,
Grrrr left,
masak left,
jantore_ left,
woshty left,
wtw left,
avar left,
xinming joined,
frew joined,
telex joined
21:37
timotimo left
|
|||
[Coke] | dwarring: @a[0..^*-1] | 21:37 | |
lizmat | Mouq: @a[0..*-2] | ||
21:37
Alina-malina joined,
vukcrni joined,
[Sno] joined,
leont joined,
Ugator joined,
davido_ joined,
bbkr joined,
Grrrr joined,
masak joined,
jantore_ joined,
woshty joined,
wtw joined,
avar joined
|
|||
[Coke] | ... TimToady's is saner, I think. | 21:37 | |
21:38
brrt joined,
jakesyl_insomnia joined,
skarn joined,
rhr left,
ab5tract left,
spider-mario left,
clkao left,
rmgk left,
lue left,
mls left,
Pleiades` left,
torbjorn left,
lestrrat left,
labster left,
felher left,
ponbiki left,
epochbell left,
ajr joined
21:39
ajr is now known as Guest58559,
Guest58559 is now known as ajr_
21:40
gfldex left,
gfldex joined
|
|||
dwarring all BUT last element 8-) | 21:41 | ||
21:41
nyuszika7h joined
|
|||
lizmat | m: my @a = ^10; say @a[0..*-2] | 21:41 | |
camelia | rakudo-moar 28e93b: OUTPUT«0 1 2 3 4 5 6 7 8» | ||
TimToady | bad netweather today... | 21:42 | |
21:42
rhr joined,
ab5tract joined,
spider-mario joined,
clkao joined,
rmgk joined,
lue joined,
mls joined,
Pleiades` joined,
torbjorn joined,
lestrrat joined,
labster joined,
felher joined,
ponbiki joined,
epochbell joined
21:43
timotimo joined,
jakesyl_insomnia left,
esaym153 left,
lizmat left,
FlipBill left,
tony-o left,
awwaiid left,
psch left,
nwc10 left
|
|||
TimToady | ab5tract: your (cont) code might be more efficient if you guarantee $indices is a set outside the loop | 21:43 | |
21:43
esaym153 joined,
lizmat joined,
FlipBill joined,
tony-o joined,
awwaiid joined,
psch joined,
nwc10 joined,
perlfan joined
|
|||
TimToady | otherwise might rebuild the set every iteration | 21:43 | |
21:43
eiro left,
yoleaux left,
jakesyl_insomnia joined,
jakesyl_insomnia left,
eiro joined,
yoleaux joined,
DarthGandalf joined,
sinisalo.freenode.net sets mode: +v yoleaux
21:44
DarthGandalf left,
timotimo left,
skarn left,
vukcrni left,
Juerd left,
zakharyas1 left,
eternaleye left,
rurban left,
kjs_ left,
baest left,
jluis left,
Patterner left,
vendethiel left,
Vlavv left,
geekosaur left,
dalek left,
lumimies left,
danaj left,
haroldwu left,
PerlJam left,
jferrero left,
JimmyZ left,
avalenn left,
hobbs left,
Celelibi left,
ggherdov left,
nebuchadnezzar left,
gtodd left,
btyler_ left
|
|||
TimToady | in the absence of a "sufficiently smart optimizer" | 21:44 | |
21:45
DarthGandalf joined,
sivoais joined
21:46
nyuszika7h left
|
|||
ab5tract | TimToady: thanks for the suggestion | 21:47 | |
21:48
ajr_ left,
brrt left,
pmichaud left,
virtualsue left,
mvuets left,
sunnavy left,
ugexe left,
ruoso left,
mattp_ left,
eMBee left,
apejens left,
kshannon left,
vukcrni joined,
nyuszika7h joined,
jakesyl_insomnia joined
|
|||
ab5tract was actually assuming the presence of such a sufficiently smart optimizer | 21:49 | ||
sub prune_array( $list, $indices is copy ) { $indices .= Set; [ for $list.kv { $^v unless $indices (cont) $^k } ] } | |||
moritz | [Coke]: that's going to be hard :-) | 21:50 | |
21:50
ggherdov joined,
Celelibi joined,
dalek joined,
timotimo joined,
skarn joined,
Juerd joined,
zakharyas1 joined,
rurban joined,
kjs_ joined,
baest joined,
jluis joined,
Patterner joined,
vendethiel joined,
Vlavv joined,
geekosaur joined,
lumimies joined,
danaj joined,
haroldwu joined,
jferrero joined,
PerlJam joined,
JimmyZ joined,
avalenn joined,
hobbs joined,
nebuchadnezzar joined,
gtodd joined,
btyler_ joined,
Spot__ joined,
xiaomiao joined,
jakesyl_insomnia left,
jakesyl_insomnia joined,
brrt joined
|
|||
moritz | [Coke]: if you have 8 billion GB of RAM, maybe | 21:50 | |
TimToady | that's a heck of a lot of ram | 21:51 | |
21:51
skarn left,
ChanServ sets mode: +v dalek
21:52
ggherdov left,
ggherdov joined,
mattp__ joined,
colomon left,
eternaleye joined,
skarn joined
21:53
molaf left,
slavik left,
mephinet left,
integral left,
woolfy left,
[Tux] left,
flussence left,
lsm-desktop left,
yogan left,
bcode left,
fwilson left,
obra left,
renormalist left,
kst left,
krunen left,
Exodist left,
osfameron left,
huf left,
[Coke] left,
sjn left,
yeltzooo9 left,
kshannon_ joined,
molaf joined,
slavik joined,
mephinet joined,
integral joined,
woolfy joined,
[Tux] joined,
flussence joined,
lsm-desktop joined,
yogan joined,
bcode joined,
fwilson joined,
obra joined,
renormalist joined,
kst joined,
krunen joined,
Exodist joined,
huf joined,
osfameron joined,
[Coke] joined,
sjn joined,
yeltzooo9 joined,
dg joined,
cosimo joined,
charsbar_____ joined,
pnu joined
|
|||
psch | marshaling of listy types to jvm is limited to 2**31 - 6 already, so small parcels don't hurt there at least :) | 21:54 | |
21:54
simcop2387 joined,
PZt left,
ilbot3 left,
hoelzro left
|
|||
psch | s/jvm/java/ | 21:54 | |
fsvo "small" | |||
21:54
PZt joined,
isacloud joined,
camelia joined,
profan joined,
BooK joined,
ivan`` joined,
arnsholt joined,
sorear joined,
SHODAN joined,
ilbot3 joined,
hoelzro joined,
sinisalo.freenode.net sets mode: +v camelia,
PZt left,
mattp__ left,
sivoais left,
IllvilJa left,
salv0 left,
petercommand left,
breinbaas left,
itz left,
moritz left,
Maddingue left,
djanatyn left,
Bucciarati left,
BinGOs left,
Gothmog_ left,
TimToady left,
anocelot left,
jtpalmer left,
jdv79 left,
salparadise left
21:55
ajr_ joined,
WAAWSLC joined,
pmichaud joined,
virtualsue joined,
mvuets joined,
sunnavy joined,
ugexe joined,
ruoso joined,
mattp_ joined,
eMBee joined,
apejens joined,
kshannon joined,
raydiak joined,
prammer joined,
sunnavy_ joined,
mattp_ left,
kshannon left,
sunnavy left,
mvuets left
21:57
dwarring left,
vladtz left,
stux|RC-only joined,
sivoais joined,
dwarring joined,
vladtz joined
|
|||
masak | amoquin: it's up to you whether you want to count different flips/rotations as equivalent or not. | 21:57 | |
lizmat | m: say (0,1,2,3,4)[5]; say (0,1,2,3,4).list[5] # this seems inconsistent | 21:58 | |
camelia | rakudo-moar 28e93b: OUTPUT«(Mu)Nil» | ||
21:58
nyuszika7h left
|
|||
lizmat | m: my @a=^5; say @a[5] | 21:58 | |
camelia | rakudo-moar 28e93b: OUTPUT«(Any)» | ||
21:59
mattp__ joined,
IllvilJa joined,
salv0 joined,
petercommand joined,
breinbaas joined,
itz joined,
moritz joined,
Maddingue joined,
mtj_- joined,
orevdiabl joined,
erdic joined,
oetiker joined,
retupmoca joined,
djanatyn joined,
salparadise joined,
Bucciarati joined,
BinGOs joined,
Gothmog_ joined,
TimToady joined,
anocelot joined,
jdv79 joined,
jtpalmer joined
22:00
nyuszika7h joined
|
|||
TimToady | ah, there's a global notice about the netsplits, which are not unexpected | 22:01 | |
dalek | p/6pe: a2814dc | jnthn++ | src/vm/jvm/runtime/org/perl6/nqp/runtime/Ops.java: Port parametric interning to point MoarVM does it. With this, JVM passes all the parametric 6model tests so far, just as MoarVM does. |
||
Heuristic branch merge: pushed 36 commits to rakudo/newio by lizmat | |||
22:02
skarn left,
eternaleye left,
simcop2387 left,
ggherdov left,
Celelibi left,
dalek left,
timotimo left,
Juerd left,
zakharyas1 left,
rurban left,
kjs_ left,
baest left,
jluis left,
Patterner left,
vendethiel left,
Vlavv left,
geekosaur left,
lumimies left,
danaj left,
haroldwu left,
PerlJam left,
jferrero left,
JimmyZ left,
avalenn left,
hobbs left,
nebuchadnezzar left,
gtodd left,
btyler_ left,
Spot__ left,
xiaomiao left,
telex left
|
|||
lizmat is going to sleep out the splits | 22:02 | ||
moritz | good night lizmat | 22:03 | |
jnthn | 'night, lizmat | ||
masak | good night, lizmat | ||
22:05
sivoais left,
baest joined
22:06
skids left,
Spot__ joined,
simcop2387 joined,
skarn joined,
eternaleye joined,
ggherdov joined,
timotimo joined,
Juerd joined,
zakharyas1 joined,
rurban joined,
kjs_ joined,
jluis joined,
Patterner joined,
vendethiel joined,
Vlavv joined,
geekosaur joined,
lumimies joined,
danaj joined,
haroldwu joined,
jferrero joined,
PerlJam joined,
JimmyZ joined,
avalenn joined,
hobbs joined,
nebuchadnezzar joined,
gtodd joined,
btyler_ joined,
xiaomiao joined,
Celelibi joined
22:07
treehug88 left,
Spot__ left,
Spot__ joined,
sivoais joined,
Celelibi left,
ggherdov left,
zakharyas1 left
22:08
skarn left,
dalek joined,
ChanServ sets mode: +v dalek,
simcop2387 left,
Celelibi joined,
skarn joined
22:09
donaldh joined,
simcop2387 joined
22:10
telex joined,
ggherdov joined
22:11
molaf left,
timotimo left
22:14
telex left
22:19
timotimo joined
22:22
telex joined
22:24
ajr_ left
22:27
colomon joined,
donaldh left,
sirdancealot left
|
|||
jnthn | sleep & | 22:30 | |
japhb | o/ | ||
22:32
sirdancealot joined
22:37
andreoss joined
|
|||
brrt | yes, me too | 22:38 | |
22:38
brrt left
|
|||
andreoss | may two lazy lists be mutually recursive in perl6? | 22:43 | |
japhb | m: my @a; my @b; @a := { @b * 2 } ... *; @b := { @a + 1 } ... *; say @a[^5]; say @b[^5]; | 22:46 | |
camelia | rakudo-moar e2c18c: OUTPUT«Inf Inf Inf Inf InfInf Inf Inf Inf Inf» | ||
22:46
sirdancealot left
|
|||
Mouq | m: my @a; my @b; @a := { @b[(state$)++] * 2 } ... *; @b := 0,{ @a[(state$)++] + 1 } ... *; say @a[^5]; say @b[^5]; | 22:47 | |
camelia | rakudo-moar e2c18c: OUTPUT«0 2 6 14 300 1 3 7 15» | ||
japhb | m: my @a; my @b; @a := 0, { @b[$^i] * 2 } ... *; @b := 0, { @a[$^i] + 1 } ... *; say @a[^5]; say @b[^5]; | ||
camelia | rakudo-moar e2c18c: OUTPUT«0 0 0 0 00 1 1 1 1» | ||
japhb | m: my @a; my @b; @a := 0, { @b[$^i + 1] * 2 } ... *; @b := 0, { @a[$^i] + 1 } ... *; say @a[^5]; say @b[^5]; | 22:48 | |
camelia | rakudo-moar e2c18c: OUTPUT«use of uninitialized value of type Nil in numeric context in block <unit> at /tmp/Vr5yN8SlDa:1This type does not support positional operations in block at src/gen/m-CORE.setting:8408 in method reify at src/gen/m-CORE.setting:8384 in met…» | ||
psch | m: my @a; my @b; @a := 0, 1, { @b[$^i] * 2 } ... *; @b := 0, 1, { @a[$^i] + 1 } ... *; say @a[^5]; say @b[^5]; | 22:50 | |
camelia | rakudo-moar e2c18c: OUTPUT«0 1 2 4 100 1 2 3 5» | ||
andreoss | $^i has special meaning here? | ||
psch | m: say 1, 2, { $^a } ... 10 | 22:51 | |
camelia | rakudo-moar e2c18c: OUTPUT«1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...» | ||
andreoss | m: my @a; my @b; @a := 0, 1, { @b[$_] * 2 } ... *; @b := 0, 1, { | ||
@a[$_] + 1 } ... *; say @a[^5]; say @b[^5]; | |||
camelia | rakudo-moar e2c18c: OUTPUT«===SORRY!=== Error while compiling /tmp/TvDxbQZ2OzUnable to parse expression in block; couldn't find final '}' at /tmp/TvDxbQZ2Oz:1------> , 1, { @b[$_] * 2 } ... *; @b := 0, 1, {⏏<EOL>» | ||
andreoss | m: my @a; my @b; @a := 0, 1, { @b[$_] * 2 } ... *; @b := 0, 1, { @a[$_] + 1 } ... *; say @a[^5]; say @b[^5]; | ||
camelia | rakudo-moar e2c18c: OUTPUT«0 1 2 4 100 1 2 3 5» | ||
andreoss | ok | 22:52 | |
psch | andreoss: the ^-twigil syntax is useful e.g. when you want more than argument to the block | ||
m: say 1, 2, { $^a } ... 10 | |||
camelia | rakudo-moar e2c18c: OUTPUT«1 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 ...» | ||
psch | err | ||
m: say 1, 2, { $^a + $^b } ... 10 | |||
camelia | rakudo-moar e2c18c: OUTPUT«1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 2178309 3524578 5702887 9227465 14930352 24157817 39088169 63245986 102334155 165580141 267914296 433494437 701408733 …» | ||
psch | m: say 1, 2, { $^a + $^b } ... 55 # that's how it stops... | ||
camelia | rakudo-moar e2c18c: OUTPUT«1 2 3 5 8 13 21 34 55» | ||
psch | *more than *one* argument... :) | 22:53 | |
andreoss | {@a[$^i]} ... * will be depending on index than | ||
so will work only for equally sized lists, not good | 22:54 | ||
psch | it takes the index from the current list and uses it to look up the next value from the other list, yes | ||
lazy lists are potentially infinite | |||
22:54
spider-mario left,
kurahaupo joined
|
|||
japhb | Takes the previous value from the current list, not the index. | 22:55 | |
andreoss | s/equally sized/eqaully fast growing/ | ||
psch | japhb: "takes the previous value from the current list as the index for the other list" was my intended meaning. that didn't get clear i think | 22:56 | |
japhb | andreoss, when the term on the left side of ... is a block, that block is inspected for parameter count, and that many previous values from the list are given to the block | ||
m: my @a; my @b; @a := 0, 1, { @b[$_] * 2 } ... *; @b := 0, 1, { @a[$_] + 1 } ... *; say @a[^10]; say @b[^10]; | |||
camelia | rakudo-moar e2c18c: OUTPUT«use of uninitialized value of type Nil in numeric context in block <unit> at /tmp/trfuVUGpsI:1use of uninitialized value of type Nil in numeric context in block <unit> at /tmp/trfuVUGpsI:1This type does not support positional operations i…» | ||
japhb | Wah ...? | ||
m: my @a; my @b; @a := 0, 1, { @b[$_] * 2 } ... *; @b := 0, 1, { @a[$_] + 1 } ... *; say @a[^5]; say @b[^5]; | 22:57 | ||
camelia | rakudo-moar e2c18c: OUTPUT«0 1 2 4 100 1 2 3 5» | ||
japhb | m: my @a; my @b; @a := 0, 1, { @b[$_] * 2 } ... *; @b := 0, 1, { @a[$_] + 1 } ... *; say @a[^6]; say @b[^6]; | ||
camelia | rakudo-moar e2c18c: OUTPUT«use of uninitialized value of type Nil in numeric context in block <unit> at /tmp/vyvOwdeX6T:1use of uninitialized value of type Nil in numeric context in block <unit> at /tmp/vyvOwdeX6T:1This type does not support positional operations i…» | ||
japhb | Weird. | ||
m: my @a; my @b; @a := 0, 1, { @b[$_] * 2 } ... *; @b := 0, 1, { @a[$_] + 1 } ... *; say @a[^5]; say @b[^10]; | |||
camelia | rakudo-moar e2c18c: OUTPUT«0 1 2 4 10use of uninitialized value of type Nil in numeric context in block <unit> at /tmp/3q6kE3V1wI:1This type does not support positional operations in block at src/gen/m-CORE.setting:8408 in method reify at src/gen/m-CORE.setting:83…» | ||
japhb | Oh ah, yes, running off each other's buffers. | 22:58 | |
I guess the point is it's *possible* to have mutually recursive infinite lists without too much work. Getting them really *right* is more work. | 22:59 | ||
And of course, you can just do it a pile of other ways. | |||
andreoss | my @odds; my @evens; @odd = 1,3, @evens.map(* + 1); @evens = 2,@odd.map(* + 1); say @odd[^3]; | 23:00 | |
Mouq | andreoss: assignment is eager | 23:01 | |
23:01
virtualsue left
|
|||
Mouq | my @odds; my @evens; @odd := 1, @evens.map(* + 1); @evens := 2,@odd.map(* + 1); say @odd[^3]; | 23:01 | |
andreoss | m: my @odds; my @evens; @odd := 1,3, @evens.map(* + 1); @evens := 2,@odd.map(* + 1); say @odd[^3]; | ||
camelia | rakudo-moar e2c18c: OUTPUT«===SORRY!=== Error while compiling /tmp/SQOFUgkij6Variable '@odd' is not declared. Did you mean '@odds'?at /tmp/SQOFUgkij6:1------> my @odds; my @evens; @odd⏏ := 1,3, @evens.map(* + 1); @evens := 2, exp…» | ||
andreoss | m: my @odds; my @evens; @odds := 1,3, @evens.map(* + 1); @evens := 2,@odd.map(* + 1); say @odd[^3]; | ||
camelia | rakudo-moar e2c18c: OUTPUT«===SORRY!=== Error while compiling /tmp/VD5MuuA5OLVariable '@odd' is not declared. Did you mean '@odds'?at /tmp/VD5MuuA5OL:1------> .map(* + 1); @evens := 2,@odd.map(* + 1)⏏; say @odd[^3];» | ||
andreoss | i'm writing code here because perl6 doesn't work inside Emacs btw | 23:03 | |
ab5tract | andreoss: you can start an individual chat with camelia | 23:04 | |
andreoss | m: my @odds; my @evens; @odds := 1,3, @evens.map(* + 1); @evens := 2, @odds.map(1 + *); say @odds[^5]; | ||
camelia | rakudo-moar e2c18c: OUTPUT«1 3» | ||
psch | m: my @odds; my @evens; @odds := 1,3, @evens.map(* + 1) ... *; @evens := 2, @odds.map(1 + *) ... *; say @odds[^7]; | 23:05 | |
camelia | rakudo-moar e2c18c: OUTPUT«1 3 5 7 9 11 13» | ||
psch | andreoss: you didn't make the lists lazy | ||
err | |||
infinite | |||
lazy they couldve been, but they didn't generate more elements | |||
andreoss | isn't ...* stuff a range? | 23:06 | |
psch | m: (1...*).WHAT.say | ||
camelia | rakudo-moar e2c18c: OUTPUT«(List)» | ||
psch | m: (1..*).WHAT.say | ||
camelia | rakudo-moar e2c18c: OUTPUT«(Range)» | ||
andreoss | foo...* = foo, foo+1, etc i mean | ||
vendethiel | m: my $a = 5; say ($a, *+1 ... *)[^10]; | 23:07 | |
camelia | rakudo-moar e2c18c: OUTPUT«5 6 7 8 9 10 11 12 13 14» | ||
vendethiel | andreoss: this? | ||
andreoss | vendethiel: i wanted mutual recursion between lists | 23:08 | |
vendethiel | oooh, backlogging again | ||
andreoss | vendethiel: what your code was supposed to show? | 23:09 | |
vendethiel | that you can "iterate off" a value | ||
psch | andreoss: you need ... * to have the lists continue to generate values | 23:16 | |
m: my @a := 1,2,3; @a.infinite.say; @a := 1,2,3...*; @a.infinite.say | 23:18 | ||
camelia | rakudo-moar e2c18c: OUTPUT«Nil1» | ||
23:19
kjs_ left
23:20
jack_rabbit joined
23:21
kjs_ joined
23:25
kjs_ left
|
|||
andreoss | m: multi car2([$x, *@xs], [$y, *@ys] where $x == $y) { $x, $y }; say car2([1,2,3], [1,3,5]); | 23:27 | |
camelia | rakudo-moar e2c18c: OUTPUT«Cannot call 'infix:<==>'; none of these signatures match::(Any $?):(Any \a, Any \b):(Real \a, Real \b):(Int:D \a, Int:D \b):(int $a, int $b):(Num:D \a, Num:D \b --> Bool):(num $a, num $b --> Bool):(Rational:D \a, Rational:D \b):(…» | ||
andreoss | m: multi car2([$x, *@xs], [$y, *@ys]) { $x, $y }; say car2([1,2,3], [1,3,5]); | ||
camelia | rakudo-moar e2c18c: OUTPUT«1 1» | ||
andreoss | a bug? | 23:28 | |
psch | m: sub f ($a, $b where $a == $b) { 1 }; say f 1, 1 | 23:29 | |
camelia | rakudo-moar e2c18c: OUTPUT«1» | ||
psch | considering that ^^^ works i'd say "maybe". i'm not sure subsignature can be used in post-constraints outside of themselves | ||
andreoss: maybe check the specs | 23:30 | ||
i'll go to bed o/ | |||
23:30
telex left
23:32
telex joined
23:33
clkao left,
Spot__ left
|
|||
Mouq has been trying to do the lazy @odd/@even snippet with Supplies and finds it surprisingly difficult | 23:44 | ||
Dang immutability and all :P | |||
lue found she somehow gets duplicate entries in a Set while trying to solve masak's mini-challenge; hopefully updating rakudo will fix it :) . | |||
Mouq | lue: What kind of entities are they? I.e. are you sure they have the same .WHICH ? | 23:45 | |
lue | Mouq: the set I get in the end is set($(0, 0),$(0, 1),$(0, 2),$(2, 0),$(2, 1),$(2, 2),$(0, 0),$(1, 0),$(2, 0),$(0, 2),$(1, 2)) | ||
masak has a solution to his own mini-challenge which is 33 LoC, but which counts rotations/flips as distinct | 23:46 | ||
lue | The weird thing is that I _do_ eliminate some duplicates when I convert it to a set, just not all of them, apparently :/ | ||
Mouq | m: say $(0,0) === $(0,0) | ||
camelia | rakudo-moar e2c18c: OUTPUT«True» | ||
Mouq | Oh, huh | ||
lue | m: Array.new($(0, 0), $(0, 1), $(0, 1), $(0, 2), $(2, 0), $(2, 1), $(2, 1), $(2, 2), $(0, 0), $(1, 0), $(1, 0), $(2, 0), $(0, 2), $(1, 2), $(1, 2), $(2, 2)).Set.perl.say | ||
camelia | rakudo-moar e2c18c: OUTPUT«set($(0, 0),$(0, 1),$(0, 2),$(2, 0),$(2, 1),$(2, 2),$(1, 0),$(1, 2))» | ||
lue | if I take the array and convert it to a set in a snippet like that, it works. Somehow. | 23:47 | |
23:47
skids joined
|
|||
Mouq | m: say $(0,0) === (0,0) | 23:47 | |
camelia | rakudo-moar e2c18c: OUTPUT«True» | ||
Mouq | m: say $(0,0) === (0;0) | ||
camelia | rakudo-moar e2c18c: OUTPUT«False» | ||
lue | That's why I'm hoping a recent Rakudo will solve it, 'cos otherwise I don't know. | 23:49 | |
23:50
bbkr left
|
|||
lue | masak: my solution is 179 lines so far (granted there are plenty of comments). I think I might be just a bit out of shape on this whole programming thing :P . | 23:51 | |
andreoss | /part | 23:52 | |
23:52
andreoss left
|
|||
masak | lue: don't fret. I'm creating majorly. | 23:52 | |
cheating* | |||
(and I learned a thing or two about spanning trees on grids in the process.) | |||
lue | I suppose if updating rakudo doesn't work, I could switch to Complex numbers and hope that solves it :P . | 23:55 | |
masak | I don't really like using Complex as a 2-tuple. | 23:56 | |
IMO, it's a code smell to use Complex as a pair of reals without using any aspects of its multiplication. | 23:57 | ||
Mouq loved to use them as LoLs before he implemented LoLs :P | |||
23:58
adu joined
|
|||
lue | masak: Of course Complex numbers aren't the best choice here, but if I find lists don't want to behave properly (yet again), I'll use complex numbers instead. | 23:59 |