»ö« 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! | feather will shut down permanently on 2015-03-31
Set by jnthn on 28 February 2015.
jepeway hm...anybody about? got a likely think-o I could use some help with. 00:30
TimToady nope, nobody here
jepeway heh. "us chickens," eh? 00:31
timotimo i'm still here
jepeway coolio. 00:32
so, i'm trying to create a role that specifies a/some multi methods.
jepeway when i do that role in a class and call one of those methods, I get a "ambiguous method call" error. 00:33
so...
m: role A { multi method a(Int $i) {...}; multi method a(Str $s) {...}; }; class B does A { multi method a(Int $i){0xa}; multi method a(Str $s) {"a"}; } ; B.new.a(0).say 00:34
camelia rakudo-moar a94d68: OUTPUT«Ambiguous call to 'a'; these signatures all match:␤:(B $: Int $i, *%_)␤:(B $: Int $i, *%_)␤ in block <unit> at /tmp/bibrhPJqwr:1␤␤»
jepeway what do I miss, here?
timotimo huh, interesting 00:35
well, you could make it work by providing a proto method a inside B, perhaps
TimToady looks kinda like a bug to me
timotimo agreed
TimToady a ... shouldn't be counted as a real candidate
jepeway ah. 00:36
timotimo right, we should already be detecting that
jepeway so, proto method would be a workaround?
s/would/might/
TimToady mebbe
timotimo hopefully it won't give you a "you should have provided these two multi methods!" thing 00:37
TimToady I'm not sure the ... stub really works to require multi candidates
timotimo m: role A { multi method a(Int $i) {...}; multi method a(Str $s) {...}; }; class B does A { multi
camelia rakudo-moar a94d68: OUTPUT«5===SORRY!5===␤Whitespace required after keyword 'multi'␤at /tmp/VswDEPkWIy:1␤------> 3tr $s) {...}; }; class B does A { multi7⏏5<EOL>␤Missing block␤at /tmp/VswDEPkWIy:1␤------> 3tr $s) {...}; }; class B does A { multi7⏏5<EOL>…»
timotimo oops
TimToady it's mostly been used at an only/proto granularity till now
timotimo m: role A { multi method a(Int $i) {...}; multi method a(Str $s) {...}; }; class B does A { proto method a(|) { * }; multi method a(Int $i){0xa}; multi method a(Str $s) {"a"}; } ; B.new.a(0).say
camelia rakudo-moar a94d68: OUTPUT«Ambiguous call to 'a'; these signatures all match:␤:(B $: Int $i, *%_)␤:(B $: Int $i, *%_)␤ in block <unit> at /tmp/3YYp8pIGwG:1␤␤»
timotimo huh.
the multis from the role are at the same "level"
TimToady they aren't being overridden the way an only or proto method would be 00:38
timotimo maybe an "only proto" would help :P 00:39
TimToady m: role A { proto method a(|) { * }; multi method a(Int $i) {...}; multi method a(Str $s) {...}; }; class B does A { multi method a(Int $i){0xa}; multi method a(Str $s) {"a"}; } ; B.new.a(0).say 00:40
camelia rakudo-moar a94d68: OUTPUT«Ambiguous call to 'a'; these signatures all match:␤:(B $: Int $i, *%_)␤:(B $: Int $i, *%_)␤ in block <unit> at /tmp/eV7FzX4tMQ:1␤␤»
TimToady protos are already only
TimToady well, for now, don't stub multis in a role 00:40
timotimo well, well, well. this begs for some roast tests
jepeway hokay. 00:41
TimToady but it seems kinda reasonable to want to do that
jepeway does that mean there's no way to say "if you do this role, you gotta implement this multi method"? 00:42
TimToady unless there's some deep jnthn-sized reason to not want to do that...
not currently
jepeway or do I just drop the stub ... ?
TimToady that will still be ambiguous, and wrong as well :)
TimToady at the moment, all you can do is write a backstop method there that checks the type against a list 00:43
TimToady m: role A { multi method a(::T $i) { die "Oops" if T ~~ Int|Str}; }; class B does A { multi method a(Int $i){0xa}; multi method a(Str $s) {"a"}; } ; B.new.a(0).say 00:45
camelia rakudo-moar a94d68: OUTPUT«10␤»
TimToady m: role A { multi method a(::T $i) { die "Oops" if T ~~ Int|Str}; }; class B does A { multi method a(Str $s) {"a"}; } ; B.new.a(0).say
camelia rakudo-moar a94d68: OUTPUT«Oops␤ in method a at /tmp/KGNLFSDhXK:1␤ in block <unit> at /tmp/KGNLFSDhXK:1␤␤»
TimToady m: role A { multi method a(::T $i where Int|Str) { die "Oops" }; }; class B does A { multi method a(Str $s) {"a"}; } ; B.new.a(0).say 00:46
camelia rakudo-moar a94d68: OUTPUT«Oops␤ in method a at /tmp/NMLnwxjpPV:1␤ in block <unit> at /tmp/NMLnwxjpPV:1␤␤»
TimToady equivalently
TimToady but that won't help you at COMPOSE time 00:47
m: role A { multi method a(::T $i where Int|Str) {...}; }; class B does A { multi method a(Str $s) {"a"}; } ; B.new.a(0).say
camelia rakudo-moar a94d68: OUTPUT«Stub code executed␤ in block <unit> at /tmp/vFSlanz6je:1␤␤»
jepeway gets the backstop method after a hard stare 00:52
should I submit a bug report? 00:53
and thanks, tt^2 :)
jepeway err.../[Tt][Tt] ** 2/? 00:55
jepeway well, gtg. hope to be around a bit more. 01:00
ciao.
ugexe is there some way to augment the class composing the role somehow to include the proto whatever() { ... } ? 01:02
moritz \o 06:56
nwc10 o/ 06:59
FROGGS o/ 07:00
Ven \o, #perl6 07:07
nwc10 yay, we have balance again 07:08
brrt \o 07:13
jnthn \o/ 07:16
[Tux] o/ 07:20
[Tux] tony-o, good work on CSV::Parser. that did a huge speedup! 07:21
dalek ecs: 6e2a5ae | (Stéphane Payrard)++ | S99-glossary.pod:
S99 : fixing broken links
07:22
[Tux] gist.github.com/Tux/e8a6036ccb2a69abe1a1 07:23
still I do see an overall slowdown
brrt compared to p5? 07:24
[Tux] brrt, see gist: compared to itself over time 07:27
github.com/Tux/CSV/blob/master/README.speed for a longer table (since 2014.10) 07:28
[Tux] commutes ... 07:29
sergot moarning \o 07:32
RabidGravy boom! 07:49
labster morning all o/ 08:13
tadzik 'morning! 08:40
nine A good, quiet morning to everyone! 09:18
moritz morning? which timezone are you in? :-) 09:29
FROGGS UGT of course :o) 09:30
moritz good ol' UGT 09:31
eli-se good morning 09:44
lizmat good morning, #perl6! (still legal in my timezone :-) 09:45
lizmat gently nudges timotimo
andreoss what is __SUB__ in perl6? 10:24
moritz &?SUB 10:25
iirc
no, &?ROUTINE
lizmat m: my @a = ^10; @a>>.say # I assume this is intentional, even though we don't hyper this just yet ? 11:44
camelia rakudo-moar a94d68: OUTPUT«9␤7␤5␤3␤1␤8␤6␤4␤2␤0␤»
lizmat m: my @a = "A", "C", "E"...*; say @a[^10] # is this a bug, sorta expected A C E G I K M O Q S 11:49
camelia rakudo-moar a94d68: OUTPUT«A C E F G H I J K L␤»
lizmat afk& 11:51
psch lizmat: S03:1939 says only numeric sequence don't need a generating closure 11:53
synbot6 Link: design.perl6.org/S03.html#line_1939
psch m: my @a = "A", "C", "E", { .succ.succ } ... *; say @a[^10]
camelia rakudo-moar a94d68: OUTPUT«A C E G I K M O Q S␤»
dalek kudo-star-daily: 61e174d | coke++ | log/ (2 files):
today (automated commit)
12:48
andreoss &?ROUTINE seems to refer only to one multi sub from which it was called, to to the whole defenition of function 12:49
*not to the ... 12:50
andreoss moritz: is there a way to call the multi sub (not one of multies) within itself? 12:52
not using its name i mean
psch m: multi f(Int $) { "Int" }; multi f(Str $) { "Str" }; multi f($a) { ::('&' ~ &?ROUTINE.name)($a.Str) }; say f(3/4) # horribly hacky, there's probably a better way... 12:53
camelia rakudo-moar a94d68: OUTPUT«Str␤»
moritz m: m: multi f(Int $) { "Int" }; multi f(Str $) { "Str" }; multi f($a) {
camelia rakudo-moar a94d68: OUTPUT«5===SORRY!5=== Error while compiling /tmp/iuEivf7nAW␤Missing block␤at /tmp/iuEivf7nAW:1␤------> 3multi f(Str $) { "Str" }; multi f($a) {7⏏5<EOL>␤»
moritz m: m: multi f(Int $) { "Int" }; multi f(Str $) { "Str" }; multi f($a) { &?ROUTINE.proto.('Str') } 12:54
camelia ( no output )
moritz m: m: multi f(Int $) { "Int" }; multi f(Str $) { "Str" }; multi f($a) { &?ROUTINE.proto.('Str') }; f Any
camelia rakudo-moar a94d68: OUTPUT«Method 'proto' not found for invocant of class 'Sub'␤ in sub f at /tmp/9XzHe3nLCR:1␤ in sub f at /tmp/9XzHe3nLCR:1␤ in block <unit> at /tmp/9XzHe3nLCR:1␤␤»
moritz m: m: multi f(Int $) { "Int" }; multi f(Str $) { "Str" }; multi f($a) { &?ROUTINE.dispatcher.('Str') }; f Any 12:55
camelia ( no output )
moritz m: m: multi f(Int $) { "Int" }; multi f(Str $) { "Str" }; multi f($a) { say &?ROUTINE.dispatcher.('Str') }; f Any 12:55
camelia rakudo-moar a94d68: OUTPUT«Str␤»
moritz andreoss: ^^ seems that &?ROUTINE.dispatcher does what you want
andreoss thanks
colomon wonders if he can get his system up and running on JSON::Fast before his current $work run using JSON::Tiny finishes. 12:56
timotimo o/ 12:57
colomon: as i said, JSON::Fast ought to be just replacing the use statement
colomon timotimo: here’s hoping! 13:01
first step, however, is building a new rakudo on my Mac. :) 13:02
then I can do some timings.
timotimo right
colomon luckily for my process, I suspect the JSON::Tiny-based $work will take at least 4 more hours.
(that’s running on my Linux box)
colomon timotimo: JSON::Fast 13:12
*fetch stage failed for JSON::Fast: source-url meta info missing
btyler colomon: I remember you poked around with the Jansson binding, but found it unsuitable -- why was it no good again?
timotimo damn, didn't i fix that?
colomon btyler: I don’t remember the exact issues, but I think the fact that it required a complete overhaul of my code was the problem. 13:13
timotimo it's in support.source, isn't it?
because that's where i put it
btyler oh O_o
timotimo it used to be in support.source-url, but i was told that's wrong
colomon timotimo: I don’t have any idea what you are talking about there. 13:15
what is the url of the JSON::Fast source?
timotimo META.info
FROGGS timotimo: github.com/FROGGS/p6-Inline-C/blob...A.info#L11
timotimo "source" : "git://github.com/timo/json_fast.git"
btyler it exports to-json and from-json, which should be pretty much indistinguishable from the JSON::Tiny versions
timotimo huh?
btyler: actually, it doesn't export to-json, because rakudo's core setting already seems to have that
timotimo and trying to export that gives a nasty redeclaration error 13:16
btyler wat
timotimo m: say to-json(["hi", "btyler"])
camelia rakudo-moar a94d68: OUTPUT«[␤ "hi",␤ "btyler"␤]␤»
btyler well, maybe I'll poke at it this evening. I didn't see that when I was fixing the tests a few days ago
timotimo now i have a source-url in my meta.info as well 13:17
btyler to the new AT-POS methods
colomon btyler: when I tried it, the data structure it returned was 100% different from the one JSON::Tiny returned. 13:18
timotimo: panda install git://github.com/timo/json_fast.git worked for me. :)
timotimo oh, cool 13:19
btyler colomon: ah, maybe before I split it into 'dump into native p6 data structure' (from-json) and 'keep this as a jansson object' (jansson-from-json) 13:19
timotimo ah, i must have somehow missed you mentioning jansson
btyler keeping it as a jansson object is way faster, but emulating everything you might do with a normal p6 structure was a bit much
anyways, no big deal, just pondering, because 4 hours of mostly JSON processing sounds painful 13:20
timotimo yes! ouch.
btyler also, timotimo, what's going on with the core to-json? I have a sub to-json is export, and that's the one that gets called 13:22
and no warnings about redec
timotimo er 13:23
wow
that's dumb
i made a silly copy-paste mistake
and now i'll need a fully built rakudo to run the tests 13:24
moritz btyler: redeclarations in inner scopes never warn
btyler makes sense. now I'm wondering how timo encountered it, though 13:25
FROGGS good question
timotimo don't look at the source 13:26
it's very embarassing 13:27
btyler colomon: anyways, if you have a test case where JSON::Jansson::from-json returns something wildly different from JSON::Tiny::from-json, I'd be delighted to take a look and fix it 13:28
(unless it's just jansson being broken, but that would surprise me)
dalek kudo/nom: abc3875 | timotimo++ | src/Perl6/Compiler.nqp:
mention --profile-filename in the usage message
13:30
hoelzro o/ #perl6 13:33
DrForr just booked for YAPC::NA, and I gather Evozon is booking me for ::EU. 13:39
timotimo JSON::Fast now has to-json again 13:40
or ... for the first time
timotimo i'll have some more modules to "fix" 14:10
hm. or maybe not 14:11
DrForr grouses about line comments. 14:13
[ptc] does anyone have admin rights on the perl6/perl6-examples repo? 14:40
I'd like to turn on Travis builds for that repo 14:41
moritz I do 14:43
what do I have to do?
PerlJam greetings
moritz \o PerlJam
PerlJam What's new in the world today? (Is there a release tomorrow?) 14:44
FROGGS PerlJam: there is AFAIK 14:45
PerlJam masak++ for that at least :) 14:48
Doesn't look like anyone has signed up for future releases though.
[Coke] wonders if anyone else is avoiding it due to the new signing requirements. 14:49
PerlJam huh. 14:50
PerlJam takes a stab at predicting the future ...
dalek kudo/nom: bd25f32 | PerlJam++ | docs/release_guide.pod:
claim the August release
PerlJam not I. I'm just busy-ish 14:51
PerlJam Also ... is it really a *requirement*? OR just a suggestion? 14:52
moritz it says you can skip the step 14:53
moritz [Coke]: why do the signing requirements make you avoid the release process? 14:56
[Coke]: I'm wondering if there's something I can do to lower the threshold
[Coke] it was already a pita. What's the purpose of adding the signatures? 14:58
(those are two separate things. doing a release was already a pita. this just puts it over my threshold of time investment) 14:59
moritz [Coke]: the purpose is to strengthen trust by making the downloads verifiable 15:04
timotimo would it be problematic to let someone else do the signature for the release manager? 15:05
FROGGS creating the key just took 5 minutes here fwiw 15:06
[Coke] "strengthen trust" ? 15:06
[ptc] moritz: sorry, had to zip off for a minute
timotimo a freshly created key isn't worth terribly much, though ;)
[ptc] moritz: it'd be good if you could flip the build switch on travis-ci.org for perl6-examples
timotimo we perl6ers need to network among ourselves and especially people outside the perl6 community with our gpg keys
[ptc] moritz: that's all that's needed :-)
moritz timotimo: well, I wouldn't sign a package that somebody made and that I downloaded over plain http 15:07
timotimo right, that's what i feared
moritz [Coke]: how would you check if a tarball was tempered with?
timotimo tampared* iirc
[Coke] by verifying with the hashes posted by the release manager.
btyler tampered :)
[Coke] btyler++ 15:08
timotimo er, did i really type "tampared"? :)
i did mean "tampered"
thanks
[Coke] the tarballs aren't tied back to git necessarily anyway. 15:09
moritz [Coke]: if somebody compromised the webserver, they can just change the hashes; and our release announcements and the downloads are hosted on the same server
timotimo that's correct, especially the star tarballs
moritz [Coke]: hence signing the tarballs
[Coke] ah, two signatures. 15:10
timotimo .o( starballs )
dalek ecs: 7a811c0 | (Stéphane Payrard)++ | S99-glossary.pod:
S99: new entries. Expanded some others
moritz [ptc]: done 15:13
[ptc] moritz: sweet! thanks :-)
colomon loading an 8 meg JSON file takes a long time. 15:14
timotimo i hear you :(
dalek ecs: 5cc19b5 | lizmat++ | S99-glossary.pod:
Fix typo, cognominal++
15:15
colomon timotimo: it’s been more than 40 minutes now even with JSON::Fast
timotimo ah, damn 15:16
how's the RAM usage?
colomon looks like 2 GB
timotimo mhm 15:17
cognominal Someday we need to hook the glossary to the IRC log 15:18
dalek pan style="color: #395be5">perl6-examples: 9f9be8f | paultcochrane++ | .travis.yml:
Add initial Travis-CI configuration
15:21
pan style="color: #395be5">perl6-examples: 92b0269 | paultcochrane++ | categories/cookbook/0 (6 files):
Merge branch 'master' of github.com:perl6/perl6-examples
nine colomon: what JSON file is that? 15:27
tony-o [Tux]: did you run that with the Buffer only version?
|Tux| latest checkout
gist.github.com/Tux/de990d9294125224c129 15:28
*that* is my test-script 15:29
colomon nine: it’s generate by my $work software to try to quanitfy what the CAD file it loaded in looks like, so I can compare between different runs of the importer.
nine colomon: so non-publishable?
colomon nine: this particular one, yes 15:30
nine: here’s the beginning: gist.github.com/colomon/afed34519bcd4f82ebb5
dalek Heuristic branch merge: pushed 54 commits to rakudo/newio by lizmat
colomon nine: I can generate one a public domain CAD file and share it. 15:31
probably not the same length, but...
tony-o |Tux|: i wonder how the 'buf' branch compares, it only uses Buffers
nine colomon: I found a 1.1 MB json file on my disk. I guess that suffices for a quick test
|Tux| sh$ for i in $(seq 1 10000); do echo 'hello,","," ",world,"!"'; done > /tmp/hello.csv 15:32
that is what the CSV file looks like. You can do the tests yourself 15:33
colomon nine: I just found a 2.8 MB file I can share, if you’d like. 15:34
btyler colomon: I'd be interested too :)
particularly if you find something where JSON::Tiny and JSON::Jansson generate different data structures using from-json
colomon btyler, nine: Google Drive upload okay for you guys? 15:35
btyler sure
timotimo we have a fast xml parser already, right? something based on libxml?
tony-o timotimo: froggs was working on libxml 15:36
timotimo: someone else wrote a PP xml parser, i wrote an html to xhtml parser based on it (both are slow) 15:37
timotimo right, i've been using exemel, i think
to parse the opengl api file
(i haven't done more than from-xml it yet)
took about a minute, IIRC
tony-o the exemel one is what i was referring to ^ 15:38
tony-o it's slow, so is my xhtml converter 15:38
nine colomon: time perl6 -e 'use JSON::XS:from<Perl5>; JSON::XS::decode_json("Holtkamp.json".IO.slurp(:bin))'
colomon: real 0m3.858s
colomon: With a 1.1 MB test file. Maybe interesting to you?
btyler nine: the question is how long it takes to serialize into a P6 data structure :)
JSON::XS is beastly fast at both parsing and creating the data structure, but I bet crossing the p5/p6 boundary is going to hurt 15:39
colomon btyler, nine: drive.google.com/file/d/0BzQNY9oWj...sp=sharing
timotimo sort of like an hllize operation?
nine btyler: that call returns it as a P6 data structure. Add a say and it'll take a second more
dalek pan style="color: #395be5">perl6-examples: 9e74d4f | paultcochrane++ | categories/euler/prob002- (2 files):
[euler] make output consistent for prob002
pan style="color: #395be5">perl6-examples: 4019e24 | paultcochrane++ | .travis.yml:
Add missing module dependencies to install step
timotimo nine: only a second? that probably means that perl5 is doing the stringification of the whole structure, eh? 15:40
colomon nine: yes, that’s definitely interesting. I’ve been trying to resist rewriting it in p5, so if I can get the speed of p5 from p6, that’s definitely intriguing. :)
dalek kudo/newio: b4f2ad9 | lizmat++ | src/core/Str.pm:
Fix mergo
nine timotimo: no, I get a Hash 15:41
timotimo oh? wow
that's the many megabytes big file, yes? that's neat
colomon afk
nine To be honest, I'm quite a bit surprised myself. I thought it could be faster than JSON::Fast, but had no idea about those orders of magnitude
timotimo: 1.1 MB 15:42
nine 15 seconds for the 2.7 MB parasolid-globe.x_t.json 15:43
nine@sphinx:~> time perl6 -e 'use JSON::XS:from<Perl5>; JSON::XS::decode_json("parasolid-globe.x_t.json".IO.slurp(:bin)).keys.say' 15:44
Instances Objects Counts Header
real 0m15.601s
Did I mention that I really love the integrated Inline::Perl5 support? Saves me a lot of typing :)
hoelzro since tomorrow is the release, is it possible to have the tab completion stuff I wrote merged in?
dalek ecs: dd31858 | lizmat++ | / (6 files):
Turn @*INC/%*CUSTOM_LIB into @?INC/%?CUSTOM_LIB

These should only be changeable at compile time, so make them at least look like compile-time constants.
15:45
lizmat hoelzro: I'm afraid looking at your branch, fell through the cracks at the QA hackathon :-( 15:46
nine I wonder if JSON::Tiny could transparently switch to JSON::XS if Inline::Perl5 and JSON::XS are installed. That could speed up rakudo startup until FROGGS++'s serialization changes land...
hoelzro =(
I wish I could've been there!
FROGGS[mobile] nine: I dont think this would work out in the setting 15:48
nine FROGGS[mobile]: yeah, to load Inline::Perl5 you'd have to have the JSON parsed already for one...
timotimo right, the point is that we require the json stuff in order to be able to load the database of installed modules
nine Easy fix: merge Inline::Perl5 into Rakudo ;)
timotimo ouch :)
FROGGS[mobile] :p
and nativecall
timotimo "use NativeCall" goes through the database, too, though
dalek kudo/nom: e0b3401 | TimToady++ | src/Perl6/Grammar.nqp:
remove silly YOU_ARE_HERE restriction

We're supposed to be able to define settings in terms of other settings in the outer scope. That's why they're settings, not preludes.
15:49
masak good afternoon, #perl6
FROGGS[mobile] TimToady: that means we have to reopen a certain RT 15:50
TimToady good, because that's the wrong way to fix whatever the problem was
FROGGS[mobile] I'll provide the ticket number as soon as I am at my laptop 15:51
TimToady 'kay, thanks
FROGGS[mobile] star-m: say {YOU_ARE_HERE} # something like that 15:52
camelia star-m 2015.03: OUTPUT«1␤»
TimToady if there's a closed RT for which that is the fix, it should surely fail a test, right?
nine Our little JSON experiment tells me that converting data is quite fast already. So NativeCall's call overhead seems to be the main performance blocker in Inline::Perl5.
FROGGS[mobile] TimToady: aye 15:53
TimToady part of the problem is that the actual mechanism is currently acting more like a prelude than a setting
if you put the {YOU_ARE_HERE} in a loop, it only gets called once, despite the loop 15:54
but we can use {YOU_ARE_HERE} already in settings based on other settings 15:55
TimToady notes also that the RESTRICTED setting doesn't have a {YOU_ARE_HERE} because of this arbitary restriction, so it assumes it has prelude semantics instead 15:56
well, except it does add the lexical scope, I'll give it that
Ven \o, masak
TimToady in any case, the intent of the original design is nestable settings, each with its own {YOU_ARE_HERE} 15:58
lizmat TimToady: how would one setting load another ? 16:00
TimToady it's compiled with that other setting 16:01
I mean statically nestable, not dynamically
RT #115372 is the YOU_ARE_HERE test in question, I think 16:02
synbot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=115372
[ptc] m: my @a = 1, 2, [3, 4], 5; say @a.perl
camelia rakudo-moar bd25f3: OUTPUT«[1, 2, [3, 4], 5]<>␤»
hoelzro lizmat: any chance you or someone else could look at it today? =) 16:03
hoelzro I made that chance shortly after 2015.03 went out, hoping it would make it into 2015.04 16:06
lizmat hoelzro: I really feel too noob to be able to judge the branch :-( 16:07
hoelzro bummer 16:08
I remember FROGGS[mobile] wanted to take a look a while ago
but it needed updating against master/nom
dalek pan style="color: #395be5">perl6-examples: 14825c2 | paultcochrane++ | categories/euler/prob (4 files):
[euler] rename *.p6 to *.pl

This is to be consistent with the other files in this category
16:12
pan style="color: #395be5">perl6-examples: c742177 | paultcochrane++ | t/categories/99-problems.t:
Correct expected output after .perl output changes

See rakudo(nom):80afb7d for more details
ssqq dalek: specs S05-regex.pod line:596 <say "@()"> should be <say "{@()}"> 16:19
ssqq p6: if 'str' ~~ m:g/ \w / { say "@() {@()}" } 16:20
camelia rakudo-moar e0b340: OUTPUT«@() s t r␤»
ssqq p6: 'str' ~~ / <any> / 16:22
camelia rakudo-moar e0b340: OUTPUT«P6opaque: no such attribute '$!pos'␤ in method ACCEPTS at src/gen/m-CORE.setting:16803␤ in block <unit> at /tmp/tmpfile:1␤␤»
andreoss is there a function to split a list in X parts or in parts of Y length? 16:23
moritz you can use comb to do the latter 16:24
with a regex /.**1..4/ for example
m: say 'abcdefghijklm'.comb(/.**1..4/) 16:25
camelia rakudo-moar e0b340: OUTPUT«abcd efgh ijkl m␤»
andreoss comb is a method of Str, not Array
moritz oh, list, sorry 16:26
[ptc] yay! the examples tests now pass!
moritz m: my @a = 1..10; say gather while @a take @a.splice(4) 16:27
camelia rakudo-moar e0b340: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Hee0_56KpI␤Missing block␤at /tmp/Hee0_56KpI:1␤------> 3my @a = 1..10; say gather while @a7⏏5 take @a.splice(4)␤ expecting any of:␤ infix␤ infix stopper␤ parameterized…»
moritz m: my @a = 1..10; say gather while @a { take @a.splice(4) }
m: my @a = 1..10; .say for gather while @a { take @a.splice(4) } 16:28
camelia rakudo-moar e0b340: OUTPUT«(timeout)»
rakudo-moar e0b340: OUTPUT«(timeout)5␤6␤7␤8␤9␤10␤»
moritz m: my @a = 1..10; say @a.splice(4) 16:30
camelia rakudo-moar e0b340: OUTPUT«5 6 7 8 9 10␤»
moritz m: my @a = 1..10; .say for gather while @a { take @a.splice(0, 4) }
camelia rakudo-moar e0b340: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤»
moritz m: my @a = 1..10; .say for gather while @a { take item @a.splice(0, 4) }
ugexe comb is a method of cool
camelia rakudo-moar e0b340: OUTPUT«1 2 3 4␤5 6 7 8␤9 10␤»
moritz ugexe: but if you call it on a list, it'll coerce to Str first -- not what andreoss wants
ugexe ah
PerlJam andreoss: .rotor would almost work if it did the right thing with an overlap of 0 16:31
ssqq p6: 'str' ~~ / <print> /
camelia rakudo-moar e0b340: OUTPUT«Cursor<140104630153016>Cursor<140104630197984>P6opaque: no such attribute '$!pos'␤ in method ACCEPTS at src/gen/m-CORE.setting:16803␤ in block <unit> at /tmp/tmpfile:1␤␤»
moritz the downside of the method above is that it destroys the array
ssqq built-in token <print> have not implement, so the debug info should be more readable.
dalek rl6-roast-data: 7dcbd9f | coke++ | / (9 files):
today (automated commit)
PerlJam m: my @a = 1..10; say @a.rotor(4,0).perl 16:32
camelia rakudo-moar e0b340: OUTPUT«($(1, 2, 3, 4), $(5, 6, 7, 8), $(9, 10))␤»
PerlJam oh, it does do the right thing with a 0 overlap.
I wonder why I thought it was broken
(whoever implemented rotor)++ 16:33
PerlJam Mouq++ looks like 16:34
moritz PerlJam++ has the best solution
moritz has never used rotor before
dalek c: ad05f16 | moritz++ | WANTED:
Add List.rotor to WANTED
andreoss m: multi split-by(\n, *[]) { } ; multi split-by(\n, *@xs ) { @xs[0 ... n -1] , split-by(n, |@xs[n .. *]).list; } ; say split-by(3, 1 ... 10).perl; 16:35
camelia rakudo-moar e0b340: OUTPUT«Nil␤»
andreoss m: multi split-by(\n, *[]) { } ; multi split-by(\n, *@xs ) { @xs[0 ... n -1] , split-by(n, |@xs[n .. *]).list; } ; say split-by(3, @(1 ... 10)).perl; 16:37
camelia rakudo-moar e0b340: OUTPUT«((1, 2, 3), ((4, 5, 6), (7, 8, 9), (10, Any, Any)))␤»
andreoss .splice is an ugly mutator
PerlJam andreoss: why 0 ... n-1 instead of just ^n ?
dalek pan style="color: #395be5">perl6-examples: 65086c1 | paultcochrane++ | categories/euler/prob003-eric256.pl:
[euler] simplify output to ease testing
16:38
pan style="color: #395be5">perl6-examples: aabe746 | paultcochrane++ | categories/euler/prob003-hexmode.pl:
[euler] finish partially complete implementation
pan style="color: #395be5">perl6-examples: 34d4855 | paultcochrane++ | t/categories/euler.t:
Add initial tests for Euler project examples
ugexe m: my @a = 1,2,3; my $x = 0; say @a[0 ... $x].perl; say @a[^$x].perl 16:39
camelia rakudo-moar e0b340: OUTPUT«(1,)␤()␤»
andreoss PerlJam: i'm yet not used to it 16:40
though this won't work with infinite lists, since they cannot be slurped 16:41
ugexe i had that 0..0 vs ^0 confusion trick me before 16:42
dalek ast: 1c80e0b | TimToady++ | S04-blocks-and-statements/pointy.t:
{YOU_ARE_HERE} is reserved for settings
16:56
kudo/nom: 4bf8538 | TimToady++ | src/Perl6/Grammar.nqp:
{YOU_ARE_HERE} is reserved for settings
PerlJam Will that be YOU-ARE-HERE in the future? 16:58
TimToady thinks the s:g/_/-/ business is a bit hobgobliny 17:02
_ is still perfectly fine for internals
PerlJam perhaps, but I *like* - more than _ :-)
TimToady how many settings have you written lately?
PerlJam good point 17:03
TimToady maybe we should make it {yOUaREhERE} instead...
ugexe {*~*urhere*~*} 17:05
TimToady
.oO(we have ur here here)
anyway, at least I can compile my CORN setting now, even if it doesn't work quite right yet 17:06
PerlJam
.oO( Will the other one be named CORP? )
17:08
TimToady ayup
that's how niecza++ has 'em
and we probably need a setting that does nothing except be a derived setting, just for namespace testing purposes 17:10
not sure if we want to make RESTRICTED official...
m: say SETTING::pi; # though it did flush out this one
camelia rakudo-moar e0b340: OUTPUT«3.14159265358979␤»
TimToady m: say UNIT::OUTER::pi; # though it did flush out this one
camelia rakudo-moar e0b340: OUTPUT«(Any)␤»
TimToady (what it used to say) 17:11
TimToady anyway, roast currently has 0 tests for settings 17:11
andreoss why there's grep-index, but no map-index? 17:13
timotimo what is map-index supposed to be? 17:14
PerlJam still thinks *-index should go away, so map has it right :)
timotimo i mean, grep-index gives you the index of things it matched back
andreoss .map-index would pass an index to mapper function
PerlJam andreoss: why? 17:15
timotimo so ... kind of like @foo.keys.map?
or more like @foo.pairs.map?
andreoss @x.map-index: { @y[$_] } # replaces @x with @y 17:16
TimToady why wouldn't you just map the list of indices then?
@x.keys.map: { @y[$_] } 17:17
andreoss it's two calls indead of one
TimToady it's mental baggage 17:17
TimToady and why not just subscript in that case? 17:18
@y[@x.keys]
PerlJam andreoss: you're optimizing the wrong thing if that's the argument for map-index 17:18
TimToady or even @y[^@x] 17:19
TimToady agrees that the -index forms probably should go away in favor of adverbs, in which case we get more than just :k semantics 17:21
TimToady grep is just a content-based slicer, if you think about it 17:25
TimToady andreoss: slurpies can take infinite lists; the "slurpiness" is notional 17:37
m: sub foo(*@stuff) { say @stuff[^10] }; foo(0,1,*+*...*) 17:38
camelia rakudo-moar 4bf853: OUTPUT«0 1 1 2 3 5 8 13 21 34␤»
andreoss m: multi split-by(\n, *[]) { } ; multi split-by(\n, *@xs ) { @xs[^ n].item , split-by(n, |@xs[n .. *]).list; }; say split-by(3, my @x = 1..10)[^2].perl; 17:42
camelia rakudo-moar 4bf853: OUTPUT«($(1, 2, 3), $(4, 5, 6), $(7, 8, 9), $(10,))␤»
andreoss m: multi split-by(\n, *[]) { } ; multi split-by(\n, *@xs ) { @xs[^ n].item , split-by(n, |@xs[n .. *]).list; }; say split-by(3, my @x = 1..*)[^2].perl; 17:43
camelia rakudo-moar 4bf853: OUTPUT«()␤»
timotimo interesting, i hadn't realized that yet 17:45
skids
.oO(Just think of _ as uppercase -)
17:47
DrForr Could someone riddle me this: gist.github.com/drforr/2f5407a2479731ff4082 18:18
FROGGS DrForr: 18:30
- { <COMMENT>*
+ { [ <COMMENT> \s*]*
TimToady or \n? 18:33
DrForr So whitespace only applies inside a rule, not between invocations. Got it.
(lazy wording, I know, but I'm doing several hings...)
TimToady or <COMMENT> *
DrForr I'll take the latter form, thanks. 18:34
colomon btw, reading in the 8 MB file with JSON::Fast is now up to 4.94 GB. 18:42
just killed it 18:43
TimToady Headline: "France foils terror attack"...no, unless France somehow encourages people to shoot themselves in the leg if they're about to be bad 18:44
FROGGS hoelzro: did you force-pushed to your three branches by any change? 18:46
brrt waitwhat 18:47
FROGGS chance*
brrt TimToady: headlines have been nonsense since there have been headlines
almost as much as deadlines
raydiak m: 'foo' ~~ /<{'o ** 2'}>/ # known? 18:49
camelia rakudo-moar 4bf853: OUTPUT«5===SORRY!5=== Error while compiling EVAL_0␤Quantifier quantifies nothing␤at EVAL_0:1␤------> 3anon regex { ^o\c[32]**7⏏5\c[32]2}␤»
FROGGS eww 18:50
nine colomon: may sound strange, but have you tried JSON::Tiny? Sounds more like you encounter an endless loop.
raydiak FROGGS: that's the exact same thing I thought last night before I ran around an ripped all the spaces out of my project's pattern strings :P 18:51
FROGGS raydiak: why do you have pattern strings at all? 18:52
raydiak FROGGS: my project uses the strings for other things too, so I need them in a string form, so I just generate the regexen from the strings (along with other stuff) 18:53
colomon nine: yes, I tried it, and it took just as long. 18:54
hoelzro FROGGS: yes 18:56
nine colomon: that's not exactly encouraging :(
FROGGS hoelzro: that does not help
grrr, and my connection to github is flaky 18:57
hoelzro =/
hoelzro if you have the tab-completion branch checked out, just git fetch and git reset --hard origin/tab-completion 18:58
after that, you can perl Configure.pl --gen-moar and it should work fine
moritz hopes nobody wants to merge before the release tomorrow
hoelzro moritz: I would like to, but I am willing to hold off to guarantee stability 18:59
dalek kudo/nom: f1d5d0f | lizmat++ | src/core/Any.pm:
Deprecate grep-index in favour of grep :index
19:01
lizmat TimToady: suggestions on how to handle last-index ? :index and :from-end ? 19:03
FROGGS hoelzro: github.com/rakudo/rakudo/pull/391#...t-95306400 19:06
brrt oh btw
hoelzro interesting...thanks FROGGS
I'll have a look 19:07
brrt i apparently made a new perl convert in the last few months
(that brings me up to two, if i may brag)
FROGGS a new perl convert? what does that mean? 19:08
lizmat TimToady: re grep vs grep-index: I always thought that it was a design smell if the return value changed depending on an attribute 19:09
brrt somebody who didn't use perl and now does. he's
FROGGS brrt: ahh, gotcha
lizmat also: grep() "is rw", whereas I don't think grep :index should be "is rw"
brrt our new sysadmin, used to use sed/awk and now perl 19:10
lizmat TimToady: so maybe the whole f1d5d0f is bogus, as some of the candidates are "is rw" and some aren't
jnthn: is it a problem if some mmd candidates are "is rw" and some aren't ?
TimToady :k, :kv, :p should follow the same policy as subscripting does 19:22
lunch & 19:23
hoelzro FROGGS: thanks for the test; I seem to have forgotten to test the situation where linenoise isn't installed =/
tony-o where does panda install bin/ files to when used in conjunction with rakudobrew ? 19:26
FROGGS tony-o: to "%*CUSTOM_LIB<site>/bin" I guess 19:32
tony-o for rakudobrew, shouldn't it install to .rakudobrew/bin ? 19:39
or at least be linked there. .
hoelzro FROGGS: I'll fix that after work tonight; I guess it'll have to wait until May =/ 19:41
FROGGS hoelzro: well, quite some ppl use HEAD anyway (via rakudobrew for example) 19:42
hoelzro true
hoelzro that's something I hadn't thought of; in order to get history back, in addition to the new features, one needs to install Linenoise 19:43
perhaps I should patch rakudobrew to tell people that post-install? 19:44
FROGGS dunno how rakudobrew could handle that 19:45
hoelzro FROGGS: just after installing rakudo, it would print "you should probably 'panda Linenoise'" 19:46
FROGGS yes, we can put that into our makefile perhaps 19:47
hoelzro that works too 19:48
that can come post-merge =)
FROGGS sure :o) 19:49
timotimo i'll most likely cover the week + a half when the release comes out tomorrow 19:50
torbjorn im using a grammar to parse some javascript (or dart actually), a portion of which contains foo:"bar", baz:"test" , which I parse with a rule. is there a way to add those key:value pars to real names in the capture? ie have foo => "bar" be in there as if it were a named capture 20:03
ofcourse its a small matter to fix it afterwards, but it would be nice to have it all served on a platter from the grammar
arnsholt torbjorn: $<sensible_name>=[...] 20:05
torbjorn yeah, but could i pick up that sensible_name from the text that im parsing? 20:06
arnsholt Or if it's a subrule you want to have a less generic name <key=.identifier>
FROGGS torbjorn: that's what you do in the actions
torbjorn otherwise it'd be foo:$<foo>=[\w+]
arnsholt Oh, like that. No, I don't think there's a simple way to do it
Can't really see why you'd want it either, TBH 20:07
FROGGS make that pair a subrule, and then: make ~$<key> => ~$<val>
... in the action
arnsholt Yeah, that's the sensible way to do it
torbjorn googles grammar actions
my perl 6 fu is not all that (yet!)
FROGGS m: say ("foo:bar" ~~ /(\w+) ':' (\w+) { make ~$0 => ~$1 } /).made 20:08
camelia rakudo-moar f1d5d0: OUTPUT«foo => bar␤»
arnsholt torbjorn: Nothing magical, just a class with the same names as your grammar rules
FROGGS torbjorn: what is happening here in the block would have to go into an action method
arnsholt Then, when a rule matches, the corresponding action method is called, with the match object as an argument
torbjorn ah. so i see, seems to fit perfectly, as you say
arnsholt Then MyGrammar.parse($string, :actions(MyActions.new)) 20:10
torbjorn great
FROGGS m: grammar G { rule TOP { (\w+) ':' (\w+) } }; class A { method TOP($/) { make ~$0 => ~$1 } }; say G.parse( "foo:bar", :actions(A) ).made
camelia rakudo-moar f1d5d0: OUTPUT«foo => bar␤»
dalek pan style="color: #395be5">perl6-examples: f97eb16 | (David Warring)++ | categories/parsers/CSSGrammar.pm:
[CSSGrammar.pm] removed case sensitivity
20:23
dalek kudo/nom: 049fe61 | lizmat++ | src/core/Any.pm:
Revert "Deprecate grep-index in favour of grep :index"

  <TimToady> :k, :kv, :p should follow the same policy as subscripting does
My patch only partially addresses this, and it seems inappropriate to put this in just before the release tomorrow.
20:32
dalek ast: dc55cec | TimToady++ | S05-interpolation/regex-in-variable.t:
test things broken if we escape in MAKE_REGEX

  (Injection attacks need to be solved in a more fundamental way anyway.)
20:37
kudo/nom: 7bef4a3 | TimToady++ | src/core/Cursor.pm:
remove EVAL bandaid in MAKE_REGEX for now

Escaping characters obscures the actual injection attack vulnerability, and breaks other things. (A better solution will be to not use interpolation.)
TimToady m: say "foo" ~~ /<{" o ** 2 "}>/ 21:24
camelia rakudo-moar 7bef4a: OUTPUT«「oo」␤»
TimToady m: say "foo" ~~ /<{"^ o ** 2 ";}>/ 21:26
camelia rakudo-moar 7bef4a: OUTPUT«「oo」␤»
TimToady m: say "foo" ~~ /<{"« o ** 2 ";}>/
camelia rakudo-moar 7bef4a: OUTPUT«「oo」␤»
TimToady m: say "foo" ~~ /<{"<![o]> o ** 2 ";}>/ 21:27
camelia rakudo-moar 7bef4a: OUTPUT«Nil␤»
TimToady something's eating some zero-width assertions but not others
lizmat maybe something's on a diet ? 21:28
TimToady m: say "foo" ~~ /<{"<!after 'f'> o ** 2 ";}>/ 21:29
camelia rakudo-moar 7bef4a: OUTPUT«「oo」␤»
TimToady it's like something's doing a substr
m: say "foo" ~~ /<{"<at 1> o ** 2 ";}>/ 21:31
camelia rakudo-moar 7bef4a: OUTPUT«cannot numify this␤ in regex at EVAL_0:1␤ in method ACCEPTS at src/gen/m-CORE.setting:16795␤ in block at src/gen/m-CORE.setting:16682␤ in method INTERPOLATE at src/gen/m-CORE.setting:16671␤ in method ACCEPTS at src/gen/m-CORE.setting:16795…»
TimToady m: say "foo" ~~ /<{"<at(1)> o ** 2 ";}>/
camelia rakudo-moar 7bef4a: OUTPUT«Nil␤»
TimToady m: say "foo" ~~ /<{"<at(0)> o ** 2 ";}>/
camelia rakudo-moar 7bef4a: OUTPUT«「oo」␤»
TimToady sure seems like something is doing substr
masak 'night, #perl6 21:53
lizmat gnight masak 21:54
tony-o what is that supposed to do TimToady ? 22:21
raydiak it *should* do the same thing as if you removed the '<{"' and '";}>' (which runs the code in the <{ }> and inserts the resulting string as part of the regex instead of as a literal string) 22:27
lizmat good night, #perl6! 23:00
raydiak good night lizmat 23:01
raydiak anyone know some good words for a state in between purely fixed vs variable, static vs dynamic, along those lines? only thing I can think of is "slushy" which underwhelms me 23:17
(or a bunch of prefixes which make longer more awkward words, like quasi- etc) 23:18
skids flexible? 23:19
cognominal and persistent vs mutable, another axis where your slushy may lie? a way to say, I have no idea about what ur thinking about. 23:20
raydiak yes I need more words to make me seem more articulate when I have no idea what I'm thinking about :) 23:21
skids Well, flex would imply bending without breaking. Transient would imply having a normal value which is occasionally changed then reverted back. 23:22
Then there's hard/firm/soft but that's overloaded already. 23:25
cognominal In the persistent world à la clojure, a transient is somehing that you can't revert. It is a stateful hack hidden within the confine of a function.
clojure.org/transients
raydiak need something to have a name before it can be used, but what "it" is, and thus the most appropriate name, is often still a very "flexible" concept when the name is chosen...same problem with children 23:26
cognominal Not to say that transient is not an appropriate word for what you think but it is already taken. 23:27
I am reading Programming Clojere and it is eye opening. Too bad Rich Hickey is hang on ??? (whatever is the lipian word for code as data) 23:30
raydiak I will have to think more specifically about how to describe this, and that will probably help find the word...thanks for the words and ideas, they help the entropy pool immensely :)
timotimo what kind of insights does the "programming clojure" book hold? 23:32
cognominal it is a long time that a O'Reilly book made me such a big effect comparable to Programming Perl
skids cognomial: I think "transient" got that connotation because engineers get overheard talking about derivatives as if they were quantities. 23:33
cognominal I guess a TimToady is necessary here.
for the beotian I am, transient in electronic sounds like some intermediary step you don't want to know about (just like the transient in Clojure that breaks the functional fiction) 23:34
TimToady++
cognominal en.wikipedia.org/wiki/Homoiconicity was the word I searched. 23:36
skids cognomial: and in electronic, that's exactly what it means when viewed outside the time domain, but the people saying it, are working in the time domain :-)
cognominal Probably a curse word in the Perl world where we believe on the merits of syntax.
skids erm s/time/frequency/ 23:37
ugexe metamorphic perhaps, or differentiation 23:39
cognominal timotimo, one insight is the merit of persistent structures for concurrency
TimToady raydiak: what activity might cause it to vary? 23:41
cognominal I have not yet read Masak blog about mazes but in PJ there is an interesting maze implementation, a conway life game as well that may interest him
ssqq p6: map(* * 2, ^5) 23:55
camelia ( no output )
ssqq p6: say map(* * 2, ^5) 23:56
camelia rakudo-moar 7bef4a: OUTPUT«0 2 4 6 8␤»
ssqq p6: say map(**2, ^5)
camelia rakudo-moar 7bef4a: OUTPUT«5===SORRY!5=== Error while compiling /tmp/tmpfile␤Unable to parse expression in argument list; couldn't find final ')' ␤at /tmp/tmpfile:1␤------> 3say map(**7⏏052, ^5)␤ expecting any of:␤ infix␤ infix stopper␤»
TimToady m: say **.WHAT
camelia rakudo-moar 7bef4a: OUTPUT«(HyperWhatever)␤»