»ö« 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 masak on 12 May 2015.
dalek href="https://modules.perl6.org:">modules.perl6.org: 734174d | (Zoffix Znet)++ | web/assets/css/style.css:
Fix travis buttons display on mobile
00:00
Skarsnik Oh sorry 00:01
I push, pull? the pull request
Zoffix \o/ 00:02
RabidGravy Skarsnik, just hit merge in the github
Zoffix, the travis status has a ghost "Travis" behind on Chrome of you're looking ;0
Skarsnik Yes, I mean the proper term was "I merged the request"
RabidGravy ah 00:03
coolio
Zoffix RabidGravy, yeah, the above commit should fix that
Skarsnik hm, should I had received a mail for the request btw?
RabidGravy groovy
00:03 spider-mario left
RabidGravy Skarsnik, usually :) 00:04
right, I think bed is calling
toodlepip
Zoffix \o 00:05
00:07 AlexDaniel joined 00:09 RabidGravy left 00:11 Ven left, Ven joined 00:15 f3ew left, rjbs left
cognominal Does panda install scripts? I don't see that mentionned in doc.perl6.org/language/modules ? I have not yet read the new doc about the package ecosystem. 00:15
llfourn cognominal: "nd possibly a bin directory for executable programs and scripts." -- /language/modules :) 00:17
00:17 f3ew joined, rjbs joined
llfourn though I have never tested it personally 00:17
Zoffix Running "panda install ufo" would be the conclusive test :) github.com/masak/ufo/
panda install ufo ..... ==> Successfully installed ufo 00:18
dalek href="https://modules.perl6.org:">modules.perl6.org: c6f1a06 | (Zoffix Znet)++ | web/index-project-list.tmpl:
Fix logotype display on mobile (Closes #25)
cognominal oops 00:19
llfourn cognominal: it's a tad unorganised...that should be in the distributing modules section really
cognominal so, there is no META.info convention to advertise it to panda? 00:20
llfourn afaik no 00:22
cognominal there is a bin/panda so, that would really be dogfood
00:26 Ven left
cognominal S22 talks about bin/, but not about advertising scripts in META.info 00:26
it is about time I clean my code to make it available. 00:27
psch ugexe: i don't think mental illnesses come with fun drugs. well, ADHD excepted, but with a year long commit streak that's probably out... :) 00:29
Zoffix :) 00:30
pink_mist haha, psch++ # very good point
cognominal psch, you mean -Ofun drugs? 00:31
psch cognominal: drugs optimized for fun were made illegal in the 60s i read 00:32
Zoffix W00t \o/ the sprite commit to modules.perl6.org reduced 51 HTTP requests per page load to just 7 :) and soon I'll reduce that to just 3 :P 00:33
00:33 Ven joined 00:41 Ven left 00:42 rurban joined
dalek href="https://modules.perl6.org:">modules.perl6.org: 49bb82f | (Zoffix Znet)++ | web/index.tmpl:
Optimize page load speed

Move sprite CSS to the end of page, to load last, since it only has non-essential base64-encoded images
00:46
00:47 Ven joined 00:49 aborazmeh joined, aborazmeh left, aborazmeh joined
dalek href="https://modules.perl6.org:">modules.perl6.org: 01bb818 | (Zoffix Znet)++ | web/assets/js/main.js:
Fix sort-by-name breakage
00:57
00:59 Ven left 01:01 Ven joined 01:07 raiph left 01:08 uruwi left, leont left 01:11 Ven left 01:12 mr_ron left, mr_ron joined 01:13 Ven joined
zengargoyle i have a couple modules to add to the ecosystem hopefully in the next week-ish. 01:19
a clone-like of Search::Dict - simple fast-ish binary search on dict type files 01:20
Zoffix Awesome :) 01:21
zengargoyle and a NativeCall binding for libdatrie - a double-array Trie
cognominal I will have a filter to add T<> and K<> directives to a REPL session pasted to a Pod file 01:22
dalek href="https://modules.perl6.org:">modules.perl6.org: ae2dd75 | (Zoffix Znet)++ | web/lib/P6Project/Hosts/Github.pm:
Handle GitHub API Redirects

The API docs say any request can result in a redirect. Not handling this made us fail handling a couple of modules in the eco
cognominal so my question about scripts 01:23
01:23 yqt left 01:24 ollej joined 01:26 Ven left 01:29 Ven joined 01:41 Zoffix left, Ven left 01:44 Ven joined 01:46 sprocket left 01:48 rurban left
ugexe psch: i assure you this was fueled in part by 01:49
adhd
Ulti gist.github.com/MattOates/c5879a07b1ef2c013097 check out the difference in times on the bottom two comments
ugexe cognominal: zef will install bin scripts from your module 01:50
zef also works on jvm now
01:51 tokuhiro_ joined 01:54 Actualeyes joined 01:55 rangerprice left 01:56 tokuhiro_ left, raiph joined, Ven left 01:59 Ven joined 02:11 Ven left 02:12 Skarsnik left
lucs How do I get the equivalent of perl5's split('', "abc") ? (three elements; perl6 appears to have five) 02:13
02:13 Ven joined
zengargoyle m: 'abc'.comb 02:13
camelia ( no output )
zengargoyle m: say 'abc'.comb
camelia rakudo-moar 4988c7: OUTPUT«(a b c)␤»
lucs zengargoyle: Aha, thanks.
zengargoyle there's probably an option to split to drop empty elements or such. 02:14
lucs I didn't see any such in the docs, but comb() is just what I need (and, rereading the docs just now, comb() is mentioned, I had missed it) 02:17
ugexe net::http working on jvm as well 02:26
02:26 Ven left 02:27 Sgeo_ joined 02:29 Ven joined 02:30 Sgeo left
ugexe would be nice if travis allowed separate badges for different envs, ala separate badges for passes on moar and passes on jvm 02:31
mst create an extra repository? 02:32
I mean, some sort of crazy hack like that should work
ugexe yeah, it just wouldnt be *that* nice if i had to do that for multiple repos
mst absolutely 02:34
the alternative might be to have some sort of small script that pushes a second copy of the branch and do it via branch name
02:35 cognominal left 02:36 Ven left 02:41 PotatoGim left, Spot__ left, clkao left, zemmihates left 02:42 rangerprice joined 02:44 rangerprice left 02:45 ilbot3 left 02:46 ilbot3 joined 02:55 sprocket joined 03:00 raiph left 03:20 skids joined 03:30 rurban joined 03:31 Sgeo_ left, Sgeo joined 03:32 chenryn joined 03:42 ZoffixMobile joined, ZoffixMobile left
psch ugexe: oh. i was just playing of the cultural notion of ADHD for laughs, sorry if that was in any way insensitive or in bad taste 03:50
03:53 tokuhiro_ joined
TEttinger psch: ugexe: can confirm, ADHD does come with fun drugs 03:56
my 512 day commit streak coincides rather cleanly with about 500 days of ADHD medication 03:57
03:57 vendethiel left, tokuhiro_ left
TEttinger the wikipedia page on adderall is amazing, the studies that just recently came out that show increases in IQ and reductions in noted behavioral incidents in school after like 6 months on adderall, persisting longer than the 6 months the kids were on it 03:58
how many pills increase your IQ, seriously 03:59
it makes me sad that these meds can be abused because when they aren't abused they are so effective 04:00
04:02 rurban left
psch i don't have any therapeutic experience with amphetamines 04:02
only the dreaded abuse, which luckily subsided rather quickly after relocating
04:03 raiph joined
psch but yes, nootropics in general are pretty interesting 04:04
although i rather like watching them from a distance :)
TEttinger it's weird how closely chemically linked all these things are 04:05
decongestants can be used to make crystal meth, and crystal meth is similar but not identical to amphetamines used for AD(H)D treatment 04:06
what does clearing your mind have to do with clearing your nose?
psch TEttinger: you might want to read PiHKAL 04:07
TEttinger not to mention how badly people can screw up designer drugs to evade the law for just a bit longer...
all these tiny tweaks to chemicals, n-BOMe claims to be legal LSD but apparently people who take it frequently hallucinate violent images that make them stab themselves in the back 04:09
with whatever they can find, scissors, pencils
it's amazing and terrifying how easily the brain is altered
psch 2c-i gave me seizures :S
but that was back when it was legal, so... vOv 04:10
TEttinger it's more amazing that nature sometimes already takes advantage of how easily some brains are altered. like the emerald jewel wasp, which stabs a cockroach in just the right place so that it can't walk backwards, then leads it into a thin tunnel and leaves it there with eggs in it 04:11
it's a neurological injury that the wasp can perform effectively
04:13 sprocket left
psch yeah, zombie ants too 04:17
brains are definitely weird
04:18 kid51 left
zengargoyle m: my $s = "hello" but 12; say $s.Int; say +$s; 04:19
camelia rakudo-moar 4988c7: OUTPUT«12␤Cannot convert string to number: base-10 number must begin with valid digits or '.' in '7⏏5hello' (indicated by 7⏏)␤ in block <unit> at /tmp/t_7vSfgdtG:1␤␤Actually thrown at:␤ in block <unit> at /tmp/t_7vSfgdtG:1␤␤»
zengargoyle m: my $s = "hello" but 12; say $s.Int; 04:20
camelia rakudo-moar 4988c7: OUTPUT«12␤»
zengargoyle i though + and .Int did about the same numberwise
04:20 mr_ron left
psch m: my $s = "hello" but role { method Numeric { 12 } }; say +$s 04:20
camelia rakudo-moar 4988c7: OUTPUT«12␤»
zengargoyle ah 04:21
psch m: my $s = "hello" but role { method Numeric { 12 } }; say $s.Int # this still works too
camelia rakudo-moar 4988c7: OUTPUT«12␤»
zengargoyle is there a short version..
like but 12 for Int 04:22
psch i don't think so. Numeric is a role that's does'd by Int, Rat, Num
fwiw, the issue seems more in MMD but in "but" 04:23
s:1st/but/than/
as in, if you want a prefix:<+> that calls Int, there isn't one 04:24
zengargoyle doing a return $x but (12, True, "yes") would be nicer if it got +$x, ?$x, ~$x 04:25
but i need a more complex role anyways ATM so no biggie. 04:26
psch ye, prefix:<+> is somewhat overloaded relative to the others
04:26 mr_ron joined
psch although i suspect that at least ~ might get somewhat more ambiguous 04:26
but that's maybe misunderstanding what exactly is still missing on the Stringy bits 04:27
timotimo i wonder if it's a good idea to have the camelia as part of the spritesheet 04:28
as it forces the whole spritesheet to be pretty wide
and the program that creates the spritesheet doesn't put multiple things into the same row 04:29
psch m: my $s = 12 but Uni.new(65, 65, 65); say ~$s; say Uni.new(65, 65, 65).Str # same things with Stringy i guess?
camelia rakudo-moar 4988c7: OUTPUT«12␤AAA␤»
ugexe TEttinger: that fueled my streak as well heh 04:30
zengargoyle hrm, Uni... is there a thingy to check whether a char is in the 16bit range 04:32
i'm playing with a library who's idea of unicode is a uint32
04:33 chenryn left
zengargoyle so unicode, but in the not-so-great way 04:33
psch m: my $a = Uni.new; $a.of.say
camelia rakudo-moar 4988c7: OUTPUT«(uint32)␤»
psch what a library that must be... :P 04:34
zengargoyle i'm bluffing it at the moment and just assuming that my .ords are <= 16bit
oops, mean 32
maybe my brain broke.. is any unicode > 32bits.. i think i'm mixing up utf16/ucs 04:35
psch m: my uint32 $x = -1; say $x # this is still there though... :/
camelia rakudo-moar 4988c7: OUTPUT«-1␤»
04:42 weihan joined 04:46 rurban joined 04:47 cognominal joined, pochi_ joined 04:52 weihan_ joined 04:55 weihan_ left, weihan left 04:57 weihan joined 05:07 weihan left 05:11 weihan joined 05:14 mr_ron left 05:20 raiph left, weihan left 05:21 mr_ron joined 05:22 weihan joined 05:24 kaare_ joined 05:25 weihan left 05:31 weihan joined
timotimo .u 🔧 05:32
yoleaux U+1F527 WRENCH [So] (🔧)
timotimo .u star
yoleaux U+0001 START OF HEADING [Cc] (␁)
U+0002 START OF TEXT [Cc] (␂)
U+0086 START OF SELECTED AREA [Cc] (<control>)
timotimo no, not start m)
05:32 weihan left 05:33 weihan joined 05:36 weihan left, weihan joined 05:37 weihan left 05:39 weihan joined 05:40 AlexDaniel left 05:56 nys left 06:00 cognominal left 06:08 mr_ron left 06:09 mr_ron joined, weihan left 06:13 khw left 06:29 BenGoldberg left 06:31 rurban left 06:56 aborazmeh left 06:57 mr_ron left 06:58 aborazmeh joined, aborazmeh left, aborazmeh joined 07:07 CIAvash joined 07:35 aborazmeh left 07:40 xfix joined 07:43 CIAvash left
timotimo the reason why we can't slurp /proc/cpuinfo is our slurp implementation gets the file size from a stat call, which returns 0 for that file 07:50
so we read 0 bytes and close and consider ourselves finished
i'm not sure if i should put in a special case for 0-bytes-sized-files to just read until EOF or just read stuff until EOF anyway 07:51
as in, never rely on the size reported by stat
07:55 Begi1116 joined, TimToady left 07:57 TimToady joined 07:58 avalenn_ left
mst timotimo: st_size is only valid for something that's a regular file. surely /proc stuff, by definition, isn't (and surely there's some other way to determine that?) 07:59
timotimo mhm 08:01
i'm working on something else at the moment 08:10
which is that Blob.new: @values is ridiculously slow
mst timotimo: aha! 08:14
timotimo: at the C level, S_ISREG(st_mode) (POSIX macro) should allow you to detect regular file or not
only if that macro returns true can you use the st_size 08:15
or st_mode & S_IFREG
timotimo what do i do for non-linux?
mst what do you mean? this is all POSIX
08:15 zhmylove joined
timotimo oh, windows is happy about this, too? 08:15
mst windows has /proc/cpuinfo ?
timotimo no
zhmylove mst: why not?
timotimo does windows have S_ISREG?
mst more seriously 08:16
do you even use the stat() system call on windows?
timotimo no, we go through libuv
zhmylove mst: nope, only mmap() :p
mst ok, so, I have no idea
timotimo hehe
welcome to my world :)
mst I do know, however, that returning 0 for size if S_ISREG is false is probably wrong for a high level API on a *n?x 08:17
08:17 Begi1116 left 08:18 rindolf joined 08:22 skids left
mst timotimo: but, anyway, fixing a bug on *n?x shouldn't introduce one on win32 ... *crosses toes* 08:23
08:23 darutoko joined
timotimo hehe 08:23
right. with the other thing i've been working on for a few minutes blown up, i can have a look at that slurp thing again
mst bah. for some reason most of my 'help' in here turns out to be 'blowing up somebody's life' 08:24
at least I only managed to get larry to destroy his dev env oncr 08:25
timotimo haha, nah, it had nothing to do with you :)
just that i thought i could apply a certain optimization which wasn't applicable after all
mst nah, more, "that indicates a gaping bug in your slurp() code" in this case
timotimo oh 08:26
wel, i knew it wasn't right, you just pointed me at the exact wrongness
mst my superpower: realising I've forgotten how it works too and re-reading the man page until I can fake competence 08:27
08:28 telex left 08:30 telex joined
timotimo cache invalidation is one of the hardest problems in IT 08:30
so yeah, that's a good superpower
um ... 08:39
so why would S_ISREG give me 1 in this case?
the mode is 33060
is the file regular? 1 (33060) 08:41
fprintf(stderr, "is the file regular? %d (%d)\n", S_ISREG(req.statbuf.st_mode), req.statbuf.st_mode);
how can this be? :\ 08:42
aleggedly S_IFREG is 01000000
allegedly*
m: say 33060 +& 1000000
camelia rakudo-moar 4988c7: OUTPUT«0␤»
08:44 xenu left, mr-foobar left
timotimo that could be hexadecimal, though 08:44
m: say 33060 +& 0x1000000 08:45
camelia rakudo-moar 4988c7: OUTPUT«0␤»
timotimo or actually octal
m: say 33060 +& 0o1000000
camelia rakudo-moar 4988c7: OUTPUT«0␤»
timotimo m: say 0o1000000
camelia rakudo-moar 4988c7: OUTPUT«262144␤»
timotimo m: say 0o100000
camelia rakudo-moar 4988c7: OUTPUT«32768␤»
timotimo yeah, that's right
it *is* a regular file, according to the test
mst oh wow
08:45 xenu joined
timotimo and according to what is in the st_mode field 08:45
except
mst S_ISREG I suspect is just '& S_IFREG' 08:46
timotimo nah, it really should be that
yeah
it's supposed to be
and st_mode & S_IFREG is also true
mst how bizarre
[Tux] test 50000 22.776 22.663 08:47
test-t 50000 19.249 19.136
mst timotimo: I. er. er. dunno then.
[Tux] what happened that test got so much faster (and test-t didn't)?
timotimo well, now i'm just using an implementation that reach 4k chunks until it EOFs
[Tux] must be regex related
mst possibly the best balance would be to ignore a 0 and do a single read, to check you get eof
and then if not go 'oooooh' and do something better 08:48
timotimo "better"?
mst er, I mean, switch to the 4k chunk impl. or whatever 08:49
timotimo so, "if the size is nonzero, read exactly the size. if the size is zero, try a small read, if that succeeds, do 4k reads until you've reached EOF"?
08:51 tokuhiro_ joined
timotimo that seems to work well 08:55
08:55 tokuhiro_ left
dalek p: 3f074d4 | (Pawel Murias)++ | src/vm/js/nqp-runtime/reprs.js:
[js] Serialize the repr data for a VMArray.
08:58
p: 7ff5456 | (Pawel Murias)++ | src/vm/js/nqp-runtime/ (3 files):
[js] Implement nqp::objprimspec.
p: f5856f0 | (Pawel Murias)++ | t/nqp/93-oo-ops.t:
Test nqp::objprimspec.
mst something like that, or maybe it'll turn out to be better just to go for a 4k chunk to begin with if not regular file or size 0 08:59
the small read is probably pointless, a 4k read on an actual zero size file will fail just as nicely, no?
(all this is thinking out loud, no warranty, express or implied)
timotimo well, before we actually attempt the read, we do allocate two buffers of that exact size 09:00
so a smaller allocation - as long as it's a friendly size for the allocator implementation - will totally work
actually ... why do we malloc that instead of allocating it on stack?
Ulti so I'm having a hard time with .race() getting 290x faster since Sept 22nd what magic is this?
mst yeah. just a question of whether it's an optimization or a pessimization overall
09:00 Sqirrel left
timotimo Ulti: oh, whoops 09:00
mst IME attempts at micro-optimization like that often turn out to cost more in branches 09:01
timotimo the branch happens before the loop, so it'll not be very expensive
the whole "going through libuv" thing we're doing at the moment probably dwarfs the cost of that
09:03 pmurias joined
pmurias timotimo: unless we benchmark this just doing things the simplest way IMHO seems best 09:04
timotimo right
at least perl6-bench has no benchmark for slurping files
ah, neat, jnthn's "sync-without-uv" branch already sets chunksize if the file size is reported to be 0 09:06
but his chunksize is 32k
09:13 spider-mario joined 09:14 Fleurety left
mrf morning #perl6 09:16
09:20 Actualeyes left 09:33 Actualeyes joined 09:35 xinming_ joined 09:37 xinming left 09:45 RabidGravy joined 09:50 RabidGravy left 09:51 xfix left 09:52 RabidGravy joined, xfix joined 09:56 rurban joined 10:03 llfourn left 10:04 xfix left 10:28 abraxxa joined
RabidGravy boom! 10:30
10:32 abraxxa left
Ulti m: say (2 .. 100).race(batch => 25, degree => 4).grep({(2 .. truncate sqrt $^n).grep($^n %% *).elems == 0}); 10:38
camelia rakudo-moar 4988c7: OUTPUT«()␤»
Ulti m: say (2 .. 100).grep({(2 .. truncate sqrt $^n).grep($^n %% *).elems == 0});
camelia rakudo-moar 4988c7: OUTPUT«(2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97)␤»
Ulti :/
so much for faster it just doesn't execute really quickly 10:39
that used to work though
with a speed up for > first 2000 primes 10:40
m: say (2 .. 100).race().grep({(2 .. truncate sqrt $^n).grep($^n %% *).elems == 0}); 10:44
camelia rakudo-moar 4988c7: OUTPUT«()␤»
10:45 DarthGandalf joined
lizmat [Tux]: I sped up the Str.split(Regex) version by a factor of two yesterday 10:45
Ulti m: say (2 .. 100).hyper().grep({(2 .. truncate sqrt $^n).grep($^n %% *).elems == 0}); 10:46
camelia rakudo-moar 4988c7: OUTPUT«()␤»
10:47 abraxxa joined 10:52 tokuhiro_ joined 10:53 raoulvdberge joined
raoulvdberge can someone give me a few usecases for phasers? (besides exception handling) 10:54
lizmat m: LEAVE say "goodbye"
camelia rakudo-moar 4988c7: OUTPUT«goodbye␤»
lizmat m: LEAVE say "goodbye"; die 10:55
camelia rakudo-moar 4988c7: OUTPUT«goodbye␤Died␤ in block <unit> at /tmp/qfeKPRtBkb:1␤␤»
raoulvdberge well, usecases that are "useful" for a real world app :P
pink_mist raoulvdberge: if you want to print a table of rows/columns, you could have a first phaser that prints out the headers
in a for loop 10:56
though that's not really super useful, granted :P
Ulti BEGIN for doing things at compile time 10:57
moritz closing file handles or committing transactions is a good use case for LEAVE/KEEP phasaers
10:57 tokuhiro_ left
[Tux] lizmat, that is notable (and laudable!) 10:57
lizmat++
lizmat please note that it was not the regex itself that got speeded up, just the post matching handling in split
[Tux] measuring++
raoulvdberge thanks! 10:58
moritz fwiw Perl 5 even has a Scope::Guard module for emulating LEAVE phasers 10:59
11:00 ^elyse^ joined 11:01 leont joined 11:07 chenryn joined
dalek kudo/nom: 5a692f0 | lizmat++ | src/core/Str.pm:
Be more open minded, give more rope
11:07
11:10 pink_mist left, pink_mist joined 11:25 xfix joined 11:26 leont left 11:32 Joy joined 11:33 Joy left 11:36 kid51 joined 11:37 CIAvash joined, mr_ron joined 11:39 ^elyse^ left 11:40 xinming_ left 11:42 xinming joined, rindolf left 11:43 Ven_ joined, vendethiel joined 11:50 virtualsue joined
CIAvash In order to test a script, I want to replace an instance of a module which will be used in MAIN subs with a mock object. Is this possible? Or Is there some way to achieve this goal? 11:52
11:53 tokuhiro_ joined
moritz CIAvash: you can't mess with another compilation unit's symbol table; you have to use something like Dependency Injection 11:57
11:57 TEttinger left, tokuhiro_ left
moritz (at least not that I'm aware of; maybe somebody else has a better idea) 11:57
arnsholt Presumably you can do it somehow with dark forbidden magics 11:58
But there's probably a better way to do testing/mocking
11:59 Ven_ left
dalek p: a0bf15e | (Pawel Murias)++ | src/NQP/Compiler.nqp:
Make nqp accept a --custom-regex-lib command line flag.
12:00
p: 414563e | (Pawel Murias)++ | src/QAST/Var.nqp:
Fix a bug in dumping QAST::Var as AST.
12:01 Ven_ joined
CIAvash If everything was a class, injecting would be easy. But here it's a script with subroutines, how can I do something like that? 12:01
12:04 isBEKaml joined
dalek kudo/nom: dc5690c | lizmat++ | src/core/Str.pm:
Some more corner case fixes in Str.split()

  ++ for writing tests!
12:05
12:06 chenryn left 12:09 virtualsue left 12:13 Ven_ left 12:14 Ven_ joined
moritz CIAvash: you could use a dynamic variable, such as my $*HTTP_MODULE = LWP::UserAgent; sub MAIN($url) { $*HTTP_MODULE.new.get($url) } 12:20
12:20 ChoHag left
moritz CIAvash: and the in the test code, set the dynamic variable to a different value 12:20
12:25 mr_ron left, yqt joined
lizmat m: dd (", ", / ", " /, / ,\s /, / ,\s+ /) # seems this confuses the parser to no end 12:28
camelia rakudo-moar dc5690: OUTPUT«5===SORRY!5===␤Unrecognized regex metacharacter , (must be quoted to match literally)␤at /tmp/lBotfQJLiv:1␤------> 3dd (", ", / ", " /, / 7⏏5,\s /, / ,\s+ /) # seems this confuses␤Unrecognized regex metacharacter \ (must be quoted to ma…»
12:29 Ven_ left 12:30 Ven_ joined, isBEKaml left
lizmat m: / ,\s / # golfed 12:31
camelia rakudo-moar dc5690: OUTPUT«5===SORRY!5===␤Unrecognized regex metacharacter , (must be quoted to match literally)␤at /tmp/9MfCZyzS7U:1␤------> 3/ 7⏏5,\s / # golfed␤Unrecognized regex metacharacter \ (must be quoted to match literally)␤at /tmp/9MfCZyzS7U:1␤----…»
lizmat am I doing a P5ism ?
m: / , \s /
camelia rakudo-moar dc5690: OUTPUT«5===SORRY!5===␤Unrecognized regex metacharacter , (must be quoted to match literally)␤at /tmp/GYLIzjpajS:1␤------> 3/ 7⏏5, \s /␤Unrecognized regex metacharacter (must be quoted to match literally)␤at /tmp/GYLIzjpajS:1␤------> 3/ ,…»
lizmat m: / \s / 12:32
camelia rakudo-moar dc5690: OUTPUT«getlexrelcaller needs a context␤ in block <unit> at /tmp/EIgVvyOi3E:1␤␤»
lizmat m: say " " ~~ / \s /
camelia rakudo-moar dc5690: OUTPUT«「 」␤»
lizmat ah,,, duh
*sigh*
Read The Error Message, Stupid :-) 12:33
arnsholt Yeah, was about to say. Any non-alphanumeric is reserved =) 12:35
CIAvash moritz: will try it out, thanks 12:36
12:37 mr_ron joined, zacts left
bartolin_ 12:37
oops, sorry 12:38
12:38 clkao joined
RabidGravy CIAvash, the "dynamic variables" are discussed in docs.perl6.org/language/variables#The_*_Twigil for reference 12:43
12:44 pmurias left 12:45 Ven_ left, Ven__ joined
CIAvash RabidGravy: thanks 12:47
12:52 Spot__ joined, Skarsnik joined 12:53 Ven__ left
lizmat m: $_ = ""; /<null>/ # is this really a bug or a case of DIHWIDT ? 12:57
camelia rakudo-moar dc5690: OUTPUT«Method 'null' not found for invocant of class 'Cursor'␤ in block <unit> at /tmp/e3mqiCC4y8:1␤␤»
12:57 pmurias joined
lizmat m: $_ = ""; /<foobar>/ # null is not special 12:57
camelia rakudo-moar dc5690: OUTPUT«Method 'foobar' not found for invocant of class 'Cursor'␤ in block <unit> at /tmp/TkOWnAQcQO:1␤␤»
lizmat we seem to have a ticket for that: #124685
rt.perl.org/Public/Bug/Display.html?id=124685
feels to me the ticket is ENOTABUG 12:58
RabidGravy perhaps a slightly less than explanatory message however 12:59
12:59 bbkr joined 13:00 bbkr left 13:06 AlexDaniel joined
CIAvash moritz: How should I run the script in the test file? so that the dynamic variable can work. Maybe I misunderstood something. 13:07
moritz CIAvash: I don't know; how would you have run it contained a class? (which seems to have been your starting point) 13:14
arnsholt CIAvash: The usual way to make this kind of stuff test is to encapsulate the application logic as a module
Then the script itself only does argument parsing and calling into the library 13:15
moritz CIAvash: one thing I occasionally do is have a multi sub MAIN('test') { ... } that runs the test code
arnsholt And testing can be done on the APIs exposed by the library
moritz CIAvash: though arnsholt's option is more reliable and modular
13:17 CIAvash left 13:19 CIAvash joined, Zoffix joined 13:25 abraxxa left 13:26 zhi joined 13:27 zhi left
RabidGravy speaking of dynamic variables. is it bad form to do something like 13:27
m: PROCESS::<$FOO> = "bar"; say $*FOO 13:28
camelia rakudo-moar dc5690: OUTPUT«bar␤»
RabidGravy in a module?
13:28 CIAvash left
RabidGravy well the setting part 13:28
lizmat well, it's trampling and action at a distance
do you need it to be set outside of the module's scope ? 13:29
RabidGravy yeah
13:29 mr_ron left 13:30 CIAvash joined
RabidGravy I basically want one that has a sensible default but can be over-ridden by the use of the module 13:30
13:30 mr_ron joined
CIAvash moritz, arnsholt: Sorry I got disconnected. Well I am doing that. The script is only going to call the module and print the data it retrurns. But if the module works, it doesn't guarantee that the script is going to work as expected. Am I wrong? Or Am I going too far? 13:31
RabidGravy "user of the module"
moritz CIAvash: personally I'm fine with leaving four lines of code or so untested 13:32
lizmat RabidGravy: so the dynamic is for your module only ?
moritz CIAvash: and it sounds like you're not doing much more than use MyModule; sub MAIN(*@args) { print MyModule.new.doit(@args) }
lizmat RabidGravy: what's wrong with $*FOO // sensible default ? 13:33
m: say $*FOO // "foo"
camelia rakudo-moar dc5690: OUTPUT«foo␤»
moritz or more to the point, that's something that integration (not unit) tests can catch
RabidGravy lizmat, it's probably in need of more coffee but I can't see how "use Foo; exported-from-foo(); #use default; $*FOO = "otherwise"; exported-from-foo(); # use users value" will work 13:36
lizmat m: sub a { say $*FOO // "foo" }; a; my $*FOO = "bar"; a 13:37
camelia rakudo-moar dc5690: OUTPUT«foo␤bar␤»
lizmat m: sub a { say $*FOO // "foo" }; a; $*FOO = "bar"; a 13:38
camelia rakudo-moar dc5690: OUTPUT«foo␤Dynamic variable $*FOO not found␤ in block <unit> at /tmp/1z1hV1cE_u:1␤␤Actually thrown at:␤ in any at gen/moar/m-Metamodel.nqp:2864␤ in block <unit> at /tmp/1z1hV1cE_u:1␤␤»
lizmat if you want to allow the latter, then indeed you would need to prime PROCESS::<$FOO>
I think teaching developers to use a lexical dynamic, is the best way wrt to composability and scoping 13:39
RabidGravy actually I think I may have just confused myself 13:40
m: module Foo { sub foo() is export { my $foo = $*FOO // "foo" } }; import Foo; say foo(); my $*FOO = "bar"; say foo()
camelia rakudo-moar dc5690: OUTPUT«foo␤bar␤»
CIAvash moritz: The reason I wanted to inject a mock object was that I wanted to avoid sending requests to the web API the module uses. Maybe I should just forget about testing the script.
RabidGravy lizmat, so why doesn't the use of $*FOO in the sub blow up with not found, like it does outside? 13:42
this is the source of my misunderstanding I think
lizmat because you disarm the failure with //
RabidGravy ah, so "access to a non-defined * variable is a failure not fatal", gotcha 13:43
lizmat well, it's more general
m: fail // say "foo"
camelia rakudo-moar dc5690: OUTPUT«5===SORRY!5=== Error while compiling /tmp/q2OVF5ug6e␤Null regex not allowed␤at /tmp/q2OVF5ug6e:1␤------> 3fail //7⏏5 say "foo"␤»
lizmat m: fail "fbar" // say "foo"
camelia ( no output )
lizmat m: say fail "fbar" // "foo" 13:44
camelia ( no output )
lizmat hmmm....
m: say Failure.new("foo") // "bar"
camelia rakudo-moar dc5690: OUTPUT«bar␤»
lizmat ^^^ that's basically what's happening
RabidGravy yeah, it's runtime not compile time 13:45
all good
lizmat m: $*FOO.WHAT.say
camelia rakudo-moar dc5690: OUTPUT«(Failure)␤»
CIAvash moritz: Yeah, it's going to more than 4 lines of code :) I thought about that, but that way I have to handle the command line options myself, right? The MAIN sub is convenient. 13:46
13:47 zemmihates joined
moritz my $class = %*ENV<MYSCRIPT_BACKEND_CLASS> // 'DefaultClass'; require ::($class); print ::$(class).new.someaction(@args) 13:49
now you can test by setting an environment variable
13:51 PotatoGim joined
RabidGravy lizmat, somehow that entire feature of dynamic variables had escaped me, thanks for the enlightenment 13:51
13:54 tokuhiro_ joined 13:57 vendethiel left
lizmat RabidGravy: you're welcome :-) 13:58
13:58 rindolf joined, tokuhiro_ left 14:06 vendethiel joined
RabidGravy updates the variables.pod so he doesn't forget ;-) 14:06
lizmat, before I commit this does that failure thing only apply to '*' twigilled variables? I tested the others I know about and it seems so. 14:11
lizmat it applies to Failures in general
14:12 mr_ron left
RabidGravy er 14:12
lizmat anything that contains a Failure
m: my $a = fail "foo"; say $a // "bar"
camelia ( no output )
lizmat m: my $a = { fail "foo" }; say $a // "bar"
camelia rakudo-moar dc5690: OUTPUT«-> ;; $_? is raw { #`(Block|61490616) ... }␤»
14:12 man joined
lizmat hmmm.... 14:13
m: my $a = { fail "foo" }; say $a() // "bar"
camelia ( no output )
14:13 man is now known as Guest80846
lizmat hmmm... 14:13
m: my $a = Failure.new("foo"); say $a // "bar"
camelia rakudo-moar dc5690: OUTPUT«bar␤»
14:14 Guest80846 left
RabidGravy that bit I understand 14:14
but
lizmat m: sub a { fail "foo" }; say a // "bar"
camelia rakudo-moar dc5690: OUTPUT«5===SORRY!5=== Error while compiling /tmp/CqNuHqB2aF␤Null regex not allowed␤at /tmp/CqNuHqB2aF:1␤------> 3sub a { fail "foo" }; say a //7⏏5 "bar"␤»
RabidGravy m: say $a // "foo"
camelia rakudo-moar dc5690: OUTPUT«5===SORRY!5=== Error while compiling /tmp/CyGohhRAAz␤Variable '$a' is not declared␤at /tmp/CyGohhRAAz:1␤------> 3say 7⏏5$a // "foo"␤»
RabidGravy differs from
lizmat m: sub a { fail "foo" }; say a() // "bar"
camelia rakudo-moar dc5690: OUTPUT«bar␤»
RabidGravy m: say $*a // "foo";
camelia rakudo-moar dc5690: OUTPUT«foo␤»
lizmat well, the say $a is a compile time error 14:15
14:15 mr_ron joined
lizmat m: no strict; say $a // "foo" 14:15
camelia rakudo-moar dc5690: OUTPUT«foo␤»
lizmat although in that case, $a just contains Any 14:16
m: no strict; say $a
camelia rakudo-moar dc5690: OUTPUT«(Any)␤»
RabidGravy yes, but it isn;t in the case of $*a - my question was more are there any other types of variables where that is the case or disnctly dynamic variables
lizmat only dynamic variables
afaik
RabidGravy cool 14:17
CIAvash moritz: I'll try that, I think I need to take a break :) thanks for your help 14:20
14:32 raiph joined 14:34 smash_ is now known as smash 14:38 Begi1116 joined 14:41 Ven joined 14:42 raoulvdberge left 14:44 Ven left, Ven joined 14:55 [TuxCM] joined
dalek p: e84c552 | (Pawel Murias)++ | src/vm/js/QAST/Compiler.nqp:
[js] Implement sub foo(:$*dynamic_variable) {...}.
15:02
p: df42786 | (Pawel Murias)++ | t/nqp/21-contextual.t:
Test using a dynamic variable as a named parameter.
15:03 xpen joined, mr_ron left 15:04 Begi1116 left, Begi1116 joined 15:07 sprocket joined 15:14 Ven left
dalek ast: 7b87896 | lizmat++ | S32-str/split.t:
Re-do tests for Str.split/split()

This should exercise just about every nook and cranny of Str.split with all permutations of the new named parameters. Note that the number of tests has halved: that's because most of those tests are actually a subtest doing 41 tests. So we're really doing ~2K tests!
15:15
c: fbaf86a | RabidGravy++ | doc/Language/variables.pod:
Document the failure nature of undeclared dynvars
15:16
RabidGravy someone might want to check that as my understanding may differ from reality :) 15:19
15:20 Ven joined
lizmat RabidGravy: s/an undeclared dynamic variable/an uninitialized dynamic variable 15:20
hmmm... tricky
RabidGravy er, that's not how it appears 15:21
psch m: say $*FOO
camelia rakudo-moar dc5690: OUTPUT«Dynamic variable $*FOO not found␤ in block <unit> at /tmp/vZ6TqKdh5q:1␤␤Actually thrown at:␤ in block <unit> at /tmp/vZ6TqKdh5q:1␤␤»
RabidGravy m: $*g = 1
camelia rakudo-moar dc5690: OUTPUT«Dynamic variable $*g not found␤ in block <unit> at /tmp/43mq4k6Z6J:1␤␤Actually thrown at:␤ in any at gen/moar/m-Metamodel.nqp:2864␤ in block <unit> at /tmp/43mq4k6Z6J:1␤␤»
psch m: say $*FOO; CATCH { default { .perl.say } }
camelia rakudo-moar dc5690: OUTPUT«X::Dynamic::NotFound.new(name => "\$*FOO")␤»
psch m: say $bar; CATCH { default { .perl.say } }
camelia rakudo-moar dc5690: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Up5fdr_DTS␤Variable '$bar' is not declared␤at /tmp/Up5fdr_DTS:1␤------> 3say 7⏏5$bar; CATCH { default { .perl.say } }␤»
lizmat All tests successful. 15:22
Files=1071, Tests=49722, 228 wallclock secs (12.51 usr 3.71 sys + 1391.65 cusr 126.75 csys = 1534.62 CPU)
psch 76391ca9 was actually bogus, i notice now 15:23
i completely overlooked the bitneg_i...
RabidGravy whilst it may not be what is actually going on under the hood "undeclared" is closer to what the user sees
psch but i also have trouble reproducing the previous behavior anyway vOv
star-m: multi f(Int $a is rw) { "Int" }; multi f(int $a is rw) { "int" }; f 5 15:24
camelia ( no output )
psch star-m: multi f(Int $a is rw) { "Int" }; multi f(int $a is rw) { "int" }; say f 5
camelia star-m 2015.09: OUTPUT«int␤»
psch m: multi f(Int $a is rw) { "Int" }; multi f(int $a is rw) { "int" }; say f 5
camelia rakudo-moar dc5690: OUTPUT«int␤»
psch m: sub f($a is rw) { $a }; f 5
camelia rakudo-moar dc5690: OUTPUT«Parameter '$a' expected a writable container, but got Int value␤ in sub f at /tmp/OKNuqNqQfg:1␤ in block <unit> at /tmp/OKNuqNqQfg:1␤␤»
psch m: sub f($a is rw) { $a }; { f 5 } 15:25
camelia ( no output )
15:26 sprocket left
lizmat RabidGravy: perhaps TimToady or jnthn or masak will want to chime in later :-) 15:26
meanwhile, cycling again&
15:30 Ven left, Ven joined 15:40 pmurias left 15:42 ^elyse^ joined 15:45 Ven left, ^elyse^ left, Ven joined 15:49 yqt left
dalek c: d1c282c | RabidGravy++ | doc/Language/variables.pod:
That'll be spaces not tabs
15:53
15:53 lizmat left 15:54 khw joined 15:55 [TuxCM] left
raiph p6doc /language/variables#Sigils on List assignment: "Contrary to item assignment ... type of the variable on the left always stays [the same], ...". I think this is misleading and I intend to delete this sentence later today. Discussion of why, and what to say instead is welcome... 15:57
(doc.perl6.org/language/variables#It...ssignment) 15:58
15:58 yqt joined 16:00 Ven left
psch m: my $a = 1, 3; say $a.perl 16:00
camelia rakudo-moar dc5690: OUTPUT«WARNINGS:␤Useless use of constant integer 3 in sink context (line 1)␤1␤»
psch m: my $a = (1, 3); say $a.perl
camelia rakudo-moar dc5690: OUTPUT«$(1, 3)␤»
16:00 Ven joined 16:02 sprocket joined, xpen left
psch m: my Cool $a; $a = 5; $a.VAR.of.say; $a = "foo"; $a.VAR.of.say # the type of the variable stays the same in item assignment too, doesn't it..? 16:03
camelia rakudo-moar dc5690: OUTPUT«(Cool)␤(Cool)␤»
raiph psch: the type of an item *variable* is generally Scalar aiui 16:05
(Cool) or whatevs is the type of the current value
16:05 sprocket left
psch raiph: no, (Cool) in that case is the type constraint on the Scalar, afaiu 16:05
16:06 loren joined
raiph oops, yes, you're right 16:06
psch m: my Cool $a; $a = 5; say $a.WHAT; $a.VAR.of.say; $a = "foo"; $a.VAR.of.say; say $a.WHAT
camelia rakudo-moar dc5690: OUTPUT«(Int)␤(Cool)␤(Cool)␤(Str)␤»
loren evening, #perl6
psch raiph: so, yes, you're probably right that the variable stays a Scalar
("probably" because i often feel i don't really understand this well enough to be confident... :) )
dalek kudo/nom: 8b0d257 | peschwa++ | src/Perl6/Metamodel/BOOTSTRAP.nqp:
Revert "Refuse to compile-time bind subs with rw parameters."

This reverts commit 76391ca91b37e14b323dc729aec500e84c2362c3.
16:07
kudo/nom: b1a465c | peschwa++ | src/Perl6/ (2 files):
Properly refuse to trial bind and analyze subs and multis with RW Parameters.
16:07 sprocket joined
loren Somebody can help me add my module to ecosystem 16:07
moritz loren: what do you need help with? 16:09
Skarsnik Short answer: fork ecosystem on github, add your module to the rigth file and submit a pull request x)
16:10 mr_ron joined
moritz long answer: doc.perl6.org/language/modules#Dist...ng_Modules 16:11
loren OK, Skarsnik
thks
16:15 Ven left 16:16 Ven joined
dalek ast: 2fcc4cc | peschwa++ | S06-traits/misc.t:
Unfudge now passing test.
16:16
raiph m: my Cool $a; .say for $a.VAR.WHAT, $a.VAR.of, $a.WHAT 16:17
camelia rakudo-moar b1a465: OUTPUT«(Scalar)␤(Cool)␤(Cool)␤»
16:17 Begi1116 left 16:18 loren left 16:22 Ven left 16:26 loren joined 16:27 autarch joined
autarch is there anything like "perldoc perl" for perl6? 16:27
16:28 diakopter left
autarch also, is there anything that documents core modules? I see the core types, but I'm wondering if there's something like FindBin and lib, etc. 16:28
16:29 diakopter joined 16:30 llfourn joined
psch autarch: there's github.com/perl6/doc, which has p6doc for local use 16:30
pink_mist I think he specifically meant the `perldoc perl` perldoc page 16:31
psch oh
autarch yeah, I guess the best version of that is doc.perl6.org 16:32
and maybe there aren't really any core modules like in Perl 5?
pink_mist there are plenty :P
psch well, there's a CORE
i guess CORE modules are NativeCall and JSON::Tiny..?
and probably a few more, yeah
autarch how do I find a list of those? 16:33
pink_mist doc.perl6.org/type.html <-- these?
autarch well, I note that neither NativeCall nor JSON::Tiny show up there ;) 16:34
maybe I'll ask a simpler question - is there anything like "use lib" for p6?
and FindBin?
Zoffix autarch, check out doc.perl6.org/language/5to6-nutshell 16:35
autarch yep, been looking there
Zoffix autarch, there's also a couple of other P5->P6 tuts at the top of this page: doc.perl6.org/language.html
autarch saw those too ;)
16:35 Oatmeal left
Zoffix autarch, doc.perl6.org/language/5to6-nutshel...brary_path 16:35
16:35 vendethiel left
jdv79 JSON::Tiny is core? 16:35
Zoffix No idea about Findbin
autarch syntax and such I can figure out - but it's harder to answer questions of "how do I do X" when it's not a core language syntax thingy 16:36
psch m: use JSON::Tiny
camelia rakudo-moar b1a465: OUTPUT«===SORRY!===␤Could not find JSON::Tiny in any of:␤ file#/home/camelia/.perl6/2015.10-224-gb1a465c/lib␤ inst#/home/camelia/.perl6/2015.10-224-gb1a465c␤ file#/home/camelia/rakudo-m-inst-1/share/perl6/lib␤ file#/home/camelia/rakudo-m-inst-1/shar…»
psch jdv79: hm, apparently not :)
jdv79 i thought the core setting defined the core set - basically itself
Zoffix autarch, yeah, it takes getting used to
jdv79 once its all up and running
psch m: say &to-json
camelia rakudo-moar b1a465: OUTPUT«sub to-json ($, :$indent = { ... }, :$first = { ... }) { #`(Sub|55132912) ... }␤»
autarch ah, so there is a "use lib" but I do wonder where that sort of thing is documented outside the 5-to-6 tutorial?
jdv79 autarch: the code:)
autarch that's what I was afraid of ;) 16:37
jdv79 the modules handling code is serious flux though atm
Zoffix autarch, at this point "it's not documented yet" might be a viable answer for some things :)
psch m: say $*PROGRAM
camelia rakudo-moar b1a465: OUTPUT«"/tmp/qx5CMZraGR".IO␤»
jdv79 nine and liz and froggs might know more
autarch another question - I see that "sub MAIN" does getopt like things - let's say I want to make my CLI app a class - can I somehow move the CLI processing to a class easily?
like with MooseX::Getopt if anyone's familiar with that 16:38
psch m: say $?COMPILER
camelia rakudo-moar b1a465: OUTPUT«5===SORRY!5=== Error while compiling /tmp/iOPipi_7MM␤Variable '$?COMPILER' is not declared␤at /tmp/iOPipi_7MM:1␤------> 3say 7⏏5$?COMPILER␤»
psch ah, NYI
grondilu autarch: I think you can just put your sub MAIN in a class, if that's what you mean. 16:39
autarch grondilu: yep, that's what I mean
how do I call that from the CLI then?
jdv79 might have to export it or something
grondilu may make it our 16:40
our sub MAIN {...} might just work
psch m: sub MAIN() { say "main" }
camelia rakudo-moar b1a465: OUTPUT«main␤»
psch m: class A { our sub MAIN() { say "main" } }
camelia ( no output )
grondilu hum, apparently not
psch m: class A { sub MAIN() is export { say "main" } }; import A;
camelia rakudo-moar b1a465: OUTPUT«main␤»
psch that's kind of wonky :/
16:40 liztormato joined
jdv79 how? i think it looks in the "main" (whatever its called) scope for that symbol. 16:41
psch jdv79: just from an aesthetic point of view. it works fine
grondilu m: class A { our sub main { MAIN() } }; sub MAIN { say "hi" }; A::main(); 16:42
camelia rakudo-moar b1a465: OUTPUT«hi␤hi␤»
jdv79 not sure how you'd do it otherwise
16:42 liztormato left
grondilu m: class A { our &main = &MAIN }; sub MAIN { say "hi" }; 16:42
camelia rakudo-moar b1a465: OUTPUT«hi␤»
autarch sub MAIN() is export does make sense to me
jdv79 and it works! woohoo 16:43
RabidGravy to be honest that's now I would expect it to work
psch jdv79: right, but it still looks kind of weird to import the class you're declare after you declare, in the same file non the less... :S
but yes, it's probably how that has to be done
16:43 ^elyse^ joined
autarch is there any consensus on the relationship between modules, files, and individual classes? one class per file? related classes all in one module file? something else? 16:44
RabidGravy currently I'm going with if a class is typically used only by another class then stick it in the outer class in the same file 16:46
i.e "class A { class B { } }" if the user is never going to have to refer the class by name 16:47
autarch right, that makes sense
16:48 raiph left
dalek rl6-most-wanted: 93a847a | loren++ | most-wanted/modules.md:
Update modules.md

Add Ftp Module Net::Ftp
16:49
rl6-most-wanted: a9158c5 | RabidGravy++ | most-wanted/modules.md:
Merge pull request #7 from araraloren/master

Update modules.md
Zoffix 's OCD triggers on Net::Ftp 16:50
RabidGravy yeah
I actually thought there was a Net::FTP, but it appears not
jdv79 let it go:) 16:51
what's in a name anyway - its clear what it is
16:51 nowan_ joined
loren thks everyone, nice 16:52
Zoffix A rose by any name would transfer files just the same? :)
16:53 nowan left, Praise left
loren Night, #perl6 16:53
autarch I see this in the 5to6 docs but can't find anything that explains what it's doing - sub MAIN { ..., :file($data) = 'path.dat' } - what is ":file(...)" doing? is it a coercion of some sort?
16:54 Praise joined, Praise left, Praise joined
autarch aha, I see, it's an alternate name 16:55
psch autarch: it's a named parameter, which on the CLI are invoked with --file (in this case) usually 16:57
autarch yep, figured that out after I asked the question
16:58 loren left
psch note that that form doesn't alias, i.e. --data doesn't work 16:58
dalek href="https://modules.perl6.org/mojo-app:">modules.perl6.org/mojo-app: 32af11a | (Zoffix Znet)++ | mojo-app/t/01-model-dists.t:
Test suite for dist model
16:59
jdv79 that's just normal signature stuff right? 17:01
i haven't had a use yet
psch jdv79: for named parameters?
autarch given an IO::Handle containing a directory path, how do I append to that path to make a subdirectory?
do I just treat is as a string? seems a bit gross
jdv79 yeah
autarch there's also IO::Spec - how does that work with handles? 17:02
sorry, I meant IO::Path earlier, btw, not IO::Handle 17:03
flussence hah, modules.perl6.org's installdeps fails because one of the p5 modules depends on CGI.pm and didn't declare it :)
autarch these built-in type docs could _really_ use synopsis sections!
psch m: say IO::Handle.^can('child')
camelia rakudo-moar b1a465: OUTPUT«()␤»
psch m: say IO::Path.^can('child') #errr
camelia rakudo-moar b1a465: OUTPUT«()␤»
psch m: say IO::Path.can('child') #errr
camelia rakudo-moar b1a465: OUTPUT«()␤»
psch well
is that about type object vs instance..? 17:04
oh, yeah
IO::Path.child needs an instance, so i guess that means the type object can't do it
jdv79 autarch: you mean on doc.perl6.org or in the pod? 17:05
autarch jdv79: the former
jdv79 for some reason almost no pod6 is used anywhere
:(
dha was working on that i think 17:06
how do i check for a type obj again?
.defined isn't the same as :D, right?
17:07 andreoss joined
autarch m: say IO::Path.new('/etc').child('foo') 17:07
camelia rakudo-moar b1a465: OUTPUT«IO::Path is disallowed in restricted setting␤ in sub restricted at src/RESTRICTED.setting:1␤ in method new at src/RESTRICTED.setting:32␤ in block <unit> at /tmp/oimQLXRmlp:1␤␤»
autarch ok, it works on the CLI, but how would I know from the docs that this would work? 17:08
Zoffix flussence, we won't be using that module soon. 17:09
andreoss masak: consider my PRs
flussence hm, I'm getting more than one cpan thing failing to install. think I've got a messed up local::lib... 17:10
dalek href="https://modules.perl6.org:">modules.perl6.org: f4eee6f | (Zoffix Znet)++ | Build.PL:
Add CGI.pm to prereqs

It is used by HTML::Template whose author has not merged the PR to fix it yet
timotimo Zoffix: do you know if removing camelia from the list of images that get put into the spriteset would make it significantly smaller? it'd at least make the image only 1/8th as wide, but i imagine png compresses blank space somewhat efficiently? 17:11
Zoffix: oh, and there's still passing/failing/unknown images in there that aren't being used any more
Zoffix flussence, what's failing? You might need to apt-get install libpng12-dev to get the sprite thing to work
timotimo, there is where? 17:12
timotimo you know, the image that contains all the sprites?
flussence Zoffix: "Imager" module failing, sounds like what you describe.
17:13 liztormato joined
Zoffix
.oO( where did my "View background image" button go :S )
17:13
17:13 raiph joined
Zoffix timotimo, alright, I know what's going on. 17:13
17:14 _mg_ joined
Zoffix timotimo, and I'll see about the difference with/without camelia in the sprite 17:14
timotimo cool 17:15
17:16 Begi1116 joined
timotimo when making the web site slimmer, the text in the introductory textbox touches the bottom of that textbox quite closely 17:17
Zoffix Actually, I don't even need to check the size. Camelia needs to go, because there's a limit to how many pixels the image can be, and with her present each small item adds many additional pixels.
timotimo wha? why would there be a limit? 17:18
autarch where in the docs would I find documentation on defining types?
Zoffix Limit in how big an image a browser would display
timotimo autarch: "defining types" is just "making classes", really
Zoffix autarch, I found this guide quite handy: learnxinyminutes.com/docs/perl6/ 17:19
autarch I'm thinking about "where { ... }" type stuff - like how do I define a type inside a module using that syntax?
Zoffix For learning Perl 6 (and it does mention the subtypes)
RabidGravy oh
timotimo autarch: do you mean something like a subset type?
autarch timotimo: yes 17:20
timotimo ah
Zoffix autarch, here's an example. github.com/zoffixznet/perl6-Pasteb...ist.pm6#L8
not sure if it's documented anywhere
RabidGravy m: subtype Goo of Int where { * == 1 }; my Goo $a; $a = 9;
camelia rakudo-moar b1a465: OUTPUT«5===SORRY!5=== Error while compiling /tmp/zJwQ0UIYFB␤Two terms in a row␤at /tmp/zJwQ0UIYFB:1␤------> 3subtype Goo of Int7⏏5 where { * == 1 }; my Goo $a; $a = 9;␤ expecting any of:␤ infix␤ infix stopper␤ postf…»
Zoffix :S 17:21
RabidGravy or somthing like that
ugexe doc.perl6.org/type/Signature#Type_Constraints
andreoss m: subtype Goo of Int where -> { $^a == 1 }; my Goo $a; $a = 9;
camelia rakudo-moar b1a465: OUTPUT«5===SORRY!5=== Error while compiling /tmp/0YEI7ogipC␤Two terms in a row␤at /tmp/0YEI7ogipC:1␤------> 3subtype Goo of Int7⏏5 where -> { $^a == 1 }; my Goo $a; $a = ␤ expecting any of:␤ infix␤ infix stopper␤ po…»
autarch if I can find some tuits I'll try to work on these docs at some point
flussence Zoffix: huh, Imager is failing in t/t10ft2.t, that's freetype2 and nothing to do with pngs...
RabidGravy m: subtype Goo of Int where * == 1 ; my Goo $a; $a = 9;
camelia rakudo-moar b1a465: OUTPUT«5===SORRY!5=== Error while compiling /tmp/aiC5Xfx31e␤Two terms in a row␤at /tmp/aiC5Xfx31e:1␤------> 3subtype Goo of Int7⏏5 where * == 1 ; my Goo $a; $a = 9;␤ expecting any of:␤ infix␤ infix stopper␤ postfix…»
timotimo andreoss: don't -> and at the same time $^a 17:22
because "-> {" already defines a signature
RabidGravy m: subtype Goo of Int where { $_ == 1 }; my Goo $a; $a = 9;
camelia rakudo-moar b1a465: OUTPUT«5===SORRY!5=== Error while compiling /tmp/ztZLQ5GEbb␤Two terms in a row␤at /tmp/ztZLQ5GEbb:1␤------> 3subtype Goo of Int7⏏5 where { $_ == 1 }; my Goo $a; $a = 9;␤ expecting any of:␤ infix␤ infix stopper␤ pos…»
andreoss m: subtype Goo of Int where -> { $^x == 1 }; my Goo $a; $a = 9;
camelia rakudo-moar b1a465: OUTPUT«5===SORRY!5=== Error while compiling /tmp/CEvumU3E5g␤Two terms in a row␤at /tmp/CEvumU3E5g:1␤------> 3subtype Goo of Int7⏏5 where -> { $^x == 1 }; my Goo $a; $a = ␤ expecting any of:␤ infix␤ infix stopper␤ po…»
timotimo ... why would that be failing?
oh
m: subset Goo of Int where * == 1;
camelia ( no output )
timotimo it's not called subtype, it's called subset
Zoffix heh
RabidGravy duh 17:23
timotimo rakudo thinks you're trying to call a sub "subtype" that you'll declare later
RabidGravy m: subset Goo of Int where * == 1 ; my Goo $a; $a = 9;
camelia rakudo-moar b1a465: OUTPUT«Type check failed in assignment to $a; expected Goo but got Int␤ in block <unit> at /tmp/TlNBnkL_qN:1␤␤»
Zoffix flussence, ¯\_(ツ)_/¯ works for me
RabidGravy that's better
autarch gist.github.com/autarch/e07cfcd2a30eb384e6d6 - any idea what this error is telling me?
RabidGravy this is why
timotimo autarch: inside the where block you should refer to the "it" by $_ 17:24
17:24 culb left
flussence Zoffix: yeah, I just force-installed it in the end. not sure what's wrong but I'll find out the hard way if it matters :) 17:25
autarch timotimo: that doesn't change the error
ugexe because there is no root attribute in your class
RabidGravy autarch "has $!root" -> "has $.root"
17:25 nightfrog joined
timotimo autarch: so it's "has Dir $!root where { $_.d };" ? 17:25
autarch oh, doh, I meant to get rid of that, obviously
RabidGravy must be "public" to work from constructor like that 17:26
ugexe well , `$root` attribute rather
timotimo ah, yes. that, too.
BBIAB
17:26 _mg_ left
autarch ok, now I seem to be having a problem with MAIN wanting an IO::Handle - is there way to tell it to coerce the string passed on the CLI? 17:26
although even if I run the script without any args I get the same usage error 17:27
dalek href="https://modules.perl6.org:">modules.perl6.org: 5407f03 | (Anthony Parsons)++ | Build.PL:
File::Slurp and JSON need adding to deps
ugexe if you are wanting to pass a path string, why arent you taking IO::Path instead of IO::Handle? 17:28
autarch doh, cause I'm an idiot, apparently
dalek href="https://modules.perl6.org:">modules.perl6.org: 0d0e92b | (Zoffix Znet)++ | web/assets/css/style.css:
Add proper spacing to #about paras; timotimo++
RabidGravy yeah IO::Path ne IO::Handle :) 17:29
Zoffix Ehehe, both File::Slurp and JSON need to be tossed from the code base :P
autarch but that doesn't seem to help - I still just get the usage message when running the script, which I assume means it doesn't like the type of the thing I'm passing
RabidGravy I'd create another multi with Str :$root 17:30
ugexe thats not neccesary
autarch yeah, that would be gross if I had to do that - shouldn't I be able to tell it to coerce it somehow?
Zoffix flussence, are you working on anything significant on modules.perl6.org?
ugexe IO::Path already coerces via Str(Cool)
RabidGravy You meab 17:31
autarch the weird thing is that even if I run the script with no args I get the usage error - so it apparently doesn't like the default value either 17:32
RabidGravy m: sub foo(IO::Path() $f) { }; foo("ff");
camelia rakudo-moar b1a465: OUTPUT«Method 'IO::Path' not found for invocant of class 'Str'␤ in sub foo at /tmp/ROvSnSJh71:1␤ in block <unit> at /tmp/ROvSnSJh71:1␤␤»
ugexe i dont get the usage message
RabidGravy m: sub foo(IO() $f) { }; foo("ff");
camelia ( no output )
RabidGravy that works though
autarch This is perl6 version 2015.10-220-g4988c70 built on MoarVM version 2015.10-61-g624d504
flussence Zoffix: nothing major, just reading developer.mozilla.org/en-US/docs/W..._Integrity and thought I'd try adding it. wanted to test it properly locally first because I usually screw up :) 17:33
andreoss m: $*VM.perl.say 17:35
ugexe autarch: actually its not printing anything for me even if i do --help... strange
camelia rakudo-moar b1a465: OUTPUT«VM.new(config => ${:ar("ar"), :arflags("rcs"), :arout(""), :asm(".s"), :asmout("-o "), :asmswitch("-S"), :auxclean("\@:"), :be("0"), :bindir("/home/camelia/rakudo-m-inst-1/bin"), :can_unaligned_int32("1"), :can_unaligned_int64("1"), :can_unaligned_num64("1…»
RabidGravy so you'd want MAIN( IO() :$root = $*HOME.child('.insucalc') where { $_.d } ) is export
andreoss m: %*VM.perl.say
camelia rakudo-moar b1a465: OUTPUT«Failure.new(exception => X::Dynamic::NotFound.new(name => "\%*VM"), backtrace => Backtrace.new)␤»
autarch why "IO()" instead of "IO"
RabidGravy for coecrion
17:35 andreoss left
Zoffix flussence, keep in mind there was some argument against us using a CDN, but the conversation stalled github.com/perl6/perl6.org/issues/40 17:36
RabidGravy basically if the method is found on the arg it calls it
timotimo IO() is short for IO(Any) ... or IO(Cool)?
autarch so I don't see why my subset doesn't work the same way 17:37
liztormato IO(Any)
RabidGravy I don't think the coercion is that clever yet
it would want a Dir method on the arg 17:38
autarch although it now occurs to me that the dir may not exist, in which case my subset won't work anyway
dalek href="https://modules.perl6.org:">modules.perl6.org: cdf6396 | (Zoffix Znet)++ | web/build-project-list.pl:
Clean up image assets dir on each build

Otherwise old images remain and we still build them into the sprite. timotimo++
17:38 liztorma_ joined
Zoffix ummm... 17:39
dalek href="https://modules.perl6.org:">modules.perl6.org: 7f4cfd5 | (Zoffix Znet)++ | web/build-project-list.pl:
Revert "Clean up image assets dir on each build"

This reverts commit cdf6396194ad621712a2282ec3e31d839d2ffcd3.
17:41
17:41 liztorm__ joined 17:42 liztormato left
flussence Zoffix: fwiw I agree with what moritz says, but I'm seeing if we can have the cake and eat it too first :) 17:42
timotimo yeah, assets/ and images/ fully removed? that doesn't sound so good
17:42 [TuxCM] joined
Zoffix timotimo, it's just assets/images 17:42
timotimo oh 17:43
catdir, of course
Zoffix But... that will break if the $outputdir is ./ :)
17:44 liztorma_ left 17:45 liztorm__ is now known as liztormato
autarch is there a common idiom people use for lazy private attributes? 17:46
liztormato I usually do it with a custom BUILD 17:48
autarch that's not lazy 17:49
liztormato Yeah you're right
autarch I imagine I could write some sort of meta thing that let me write "has $!foo is lazy(build-foo)" or something, but I'll settle for something a little less complex ;) 17:50
liztormato Perhaps a Proxy?
Feels contrived
Well. Such a trait has been discussed and even implemented but also reverted 17:51
dalek href="https://modules.perl6.org:">modules.perl6.org: d43d8e8 | (Zoffix Znet)++ | / (2 files):
Clean up image assets dir for sprite on each build
17:52
17:53 skids joined
liztormato autarch: don't think there's an idiom for this atm 17:53
dalek href="https://modules.perl6.org:">modules.perl6.org: 5961d5d | (Anthony Parsons)++ | web/index.tmpl:
Make the jQuery include slightly safer

s/http:/https:/, added a Subresource Integrity hash, and a Cross-Origin attribute that (according to the docs) blocks 3rd-party cookies.
17:54
psch github.com/rakudo/rakudo/blob/nom/...nce.pm#L22 is what i usually saw recommended
autarch liztormato: ok, I can go non-lazy for now
psch for a lazy attribute 17:55
liztormato Perhaps a private method with the private attribute's name?
autarch psch: ah, that works
jdv79 is there a nice way to get the value type of a Positional or Associative thing? 17:56
moritz jdv79: .of
autarch wait, can I define both "has $!foo" and "method !foo" ?
liztormato method !foo { $!foo //= lazy code }
Yes you can
autarch ah, cool, that works perfectly 17:57
it'd be nice to have a trait for that in the future, I think
zengargoyle re: MAIN / coersion / subset... 17:58
jdv79 thanks
liztormato Note that private methods need to be called with ! Instead of .
zengargoyle subset File of Str where { $_.IO ~~ :e & :f };
flussence thought about doing s/http/https/ on a few more of the modules page links, turns out a lot of other people's servers are misconfigured (including github's own travis docs site!)
zengargoyle sub MAIN('test', File(File) :$datfile = $TEST-FILE) {
liztormato self!foo
autarch liztormato: yep, I'd figured that out 17:59
zengargoyle makes sure $datfile exists and makes the error message actually use 'File' instead of Str
autarch I'm like 1% of the way to writing my actual app!
ugexe zengargoyle: thats no good if you are giving it a file you want created 18:00
liztormato autarch++
autarch this is a good learning experience though - the actual app I'm writing is kind of dumb and I could write it in Perl 5 in maybe an hour or so
zengargoyle yeah, just an example of MAIN tomfoolery 18:01
liztormato ;-)
Cycling continues&
18:01 liztormato left, Actualeyes left
flussence ugexe: that's easy enough, subset WritableFile of Str where { $_.IO.parent ~~ :d & :w } 18:01
ugexe what if they give you an absolute path and it needs to create directories? 18:02
flussence hm, good point
dalek href="https://modules.perl6.org:">modules.perl6.org: 14bece2 | (Zoffix Znet)++ | web/ (3 files):
Do not include camelia in the sprite

Adding her introduces a lot of whitespace for each small image and browsers have a limit to how many pixels the image can be. timotimo++
18:03
18:03 adu joined 18:05 andreoss joined, sprocket left
zengargoyle sorta wish for something like: sub MAIN(…) does GetoptLong # fancier option handling 18:05
andreoss m: class Foo { has $!bar } ; class Fee is Foo { method get-bar { $!bar } };
camelia rakudo-moar b1a465: OUTPUT«5===SORRY!5=== Error while compiling /tmp/0LVw4O5DOQ␤Attribute $!bar not declared in class Fee␤at /tmp/0LVw4O5DOQ:1␤------> 3 Fee is Foo { method get-bar { $!bar } }7⏏5;␤ expecting any of:␤ horizontal whitespace␤ post…»
andreoss m: class Foo { has $!bar is export } ; class Fee is Foo { method get-bar { $!bar } }; 18:06
camelia rakudo-moar b1a465: OUTPUT«5===SORRY!5=== Error while compiling /tmp/atb5j5dRVM␤Can't use unknown trait 'is export' in an attribute declaration.␤at /tmp/atb5j5dRVM:1␤ expecting any of:␤ rw␤ readonly␤ box_target␤ leading_docs␤ …»
zengargoyle 'cause --arg=value annoys me.
andreoss how does one inherit private attributes? 18:07
Skarsnik well you mean how to make them inheritable? 18:08
andreoss yes
moritz by making them public 18:11
anyone can subclass your class, so it doesn't make sense to force somebody to subclass it just to get access a certain part of an API
18:13 espadrine joined, skids left 18:14 brrt joined
andreoss were the privates attributes inheritable before? 18:14
moritz what does "before" mean?
andreoss some time ago
18:15 Begi1116 left
brrt which time ago? 18:16
pink_mist "before" - "clarify" - "some time ago" <--- that's not helpful, andreoss :P
andreoss circa 2011 18:17
i was trying to make web work, but it uses this kind of inheritance of private attributes 18:18
dalek href="https://modules.perl6.org/mojo-app:">modules.perl6.org/mojo-app: b84b8e8 | (Zoffix Znet)++ | mojo-app/t/ (2 files):
Add Helper test class, so we do not duplicate our data in each test
andreoss web as in masak/web 18:19
18:23 yqt left 18:27 Begi1116 joined 18:30 mr-foobar joined 18:33 adu left 18:35 [TuxCM] left
andreoss m: multi trait_auxiliary:<is>(Int $a, $b) { say $a ; say $b } 18:35
camelia rakudo-moar b1a465: OUTPUT«5===SORRY!5=== Error while compiling /tmp/fFvZKRjpIi␤Cannot add tokens of category 'trait_auxiliary'␤at /tmp/fFvZKRjpIi:1␤------> 3multi trait_auxiliary:<is>7⏏5(Int $a, $b) { say $a ; say $b }␤»
andreoss m: multi trait_verb:<of>(Int $a, $b) { say $a ; say $b } 18:36
camelia rakudo-moar b1a465: OUTPUT«5===SORRY!5=== Error while compiling /tmp/0KQj4khUQu␤Cannot add tokens of category 'trait_verb'␤at /tmp/0KQj4khUQu:1␤------> 3multi trait_verb:<of>7⏏5(Int $a, $b) { say $a ; say $b }␤»
timotimo Zoffix: i'd still be interested to know what the filesize of "tiles with camelia" vs "tiles without camelia + camelia" is
18:38 [particle]1 joined
Zoffix timotimo, tiles with camelia are 10KB larger 18:42
At least as .png images (on the site we're base64ing it, which I'm guessing adds size)
18:44 hahainternet left, hahainternet joined, andreoss left
jdv79 what's the list constructor again? 18:45
raiph .List 18:46
jdv79 oh, (). forgot.
raiph (1,2)
jdv79 [] vs ()
thanks
raiph :) 18:47
dalek href="https://modules.perl6.org:">modules.perl6.org: c2e0183 | (Zoffix Znet)++ | web/assets/images/ (10 files):
PNGCrush image assets to shave off 10KB
18:50
href="https://modules.perl6.org/mojo-app:">modules.perl6.org/mojo-app: 10f0d67 | (Zoffix Znet)++ | mojo-app/t/ (3 files):
Inter
Zoffix Aw, crap
Didn't realize pushing will push both branches. I guess that makes sense.
geekosaur you can specify, I think 18:53
masak Zoffix: the pre-2.0 push.default in Git was "matching", where everything that had the same name on the remote side got pushed automatically.
Zoffix: 2.0 and onwards switches to "simple" pushing, where only the current branch is pushed to its upstream, and only if the names match. 18:54
Zoffix I'm on git version 1.7.9.5
masak all the above applies to "git push" without any further arguments. if you're more specific, you don't get the default behavior.
timotimo Zoffix: with the tiles image being 61 kB in size (perhaps post-base64ing), i'd call that significant 18:55
80 kB for camelia herself
18:55 brrt left
Zoffix I wouldn't. The extra HTTP request would likely give more latency, especially on mobile. 18:56
timotimo Zoffix: do we have an optipng step in there?
Zoffix My concern was us hitting the browser size limit really
timotimo, what is that?
timotimo twiddles the compression parameters around until it finds something smaller 18:57
Zoffix timotimo, you lost me :P
18:58 AlexDaniel left
timotimo you know how PNG uses basically zlib compression? 18:59
or something similar, at least
Zoffix timotimo, but what do you mean "do we have an option"...? In the code that builds the sprite? 19:00
19:00 yqt joined
timotimo i didn't say "do we have an option" :) 19:00
i said "do we have an optipng step"
Zoffix Right that :)
19:00 sprocket joined
Zoffix Where would we have that step? :P 19:00
19:00 vendethiel joined
timotimo after concatenating all the images into the tile png 19:00
and i forgot to say: the first thing optipng does is reduce the bit depth or even make a palette if it can do so losslessly 19:01
basically optipng makes png files as small as they can reasonably be
arnsholt optipng is similar to pngcrush, I think
timotimo that's right
Zoffix timotimo, don't think so: metacpan.org/source/JHTHORSEN/Mojo...tes.pm#L70
timotimo ah, right. that step would probably go between ->write(data ...) and building the checksum 19:02
moritz huh, are we having a discussion about a 61kb image?
Zoffix moritz, :)
timotimo, that would save us 3KB, based on my pngcrush results :) 19:03
19:03 lizmat joined
Zoffix (which is why it's not worth trying to implement that). 19:04
Zoffix ponders adding something like that to AssetPack in production mode 19:05
19:05 sprocket left, mr_ron left 19:06 mr_ron joined
moritz that's only worth it if you can cache it, and serve for 100+ requests 19:07
19:07 espadrine left
zengargoyle is actually tickled that modules have a logotype 19:07
Zoffix tickled? Are you excited or disappointed?
zengargoyle i like it 19:08
Zoffix As for the pic, well, if you play the devil's advocate, you could argue about less developed countries. Like FB devs deliberately limit their connection speed and use ancient phones for dev, just to get a feel for what sort of tech people use. 19:09
jdv79 so i created a type list attr but i can't construct it with the type obj
ah, and it delegates. maybe that's why its complicated ^H 19:10
zengargoyle maybe we could also have a :logotype(<base64>) modifier to objects and get a jumpstart on visual programming. :P
Zoffix :D
19:10 _mg_ joined
jdv79 how can a positional type obj's default constructor take named args 19:10
how do i even get that list of args? 19:11
19:12 telex left 19:13 lizmat_ joined
arnsholt jdv79: Could you elaborate? Not sure what you mean 19:14
19:14 lizmat left, telex joined
jdv79 i have something like: has Foo @.foos handles <list elems AT-POS EXISTS-POS>; 19:15
then teh type obj is Positional[Foo] - can one use that type obj to create an instancej?
19:16 zhmylove left
timotimo jdv79: without having looked, i expect the .new method takes positionals and calls bless with the appropriate nameds 19:16
arnsholt Should think so. @.foos .= new
jdv79 ah, so the error message my not be conveying what constructror its talking about 19:17
19:18 ShimmerFairy left
timotimo oh lord, blogs.perl.org 19:18
when zooming in, at every other zoom step the text in the uppermost menu jumps out of the little bar they're supposed to be in and hang half-way into the page itself 19:19
El_Che timotimo: not with FF on ubuntu
Zoffix Doesn't happen for me in Palemoon (though I do see it move a bit)
jdv79 timotimo: nope
timotimo weird! 19:20
jdv79 i'll just try to work around it then
timotimo and below 100% it's always wrong
19:20 Zoffix left
El_Che timotimo: wasn't there a grant request to look at that soft or replace it? 19:20
timotimo blogs.perl.org?
wow! i was about to complain about the lack of a feature, but i've just found it in an odd place 19:21
El_Che timotimo: news.perlfoundation.org/2015/10/mig...rst-p.html
By our own DrForr :) 19:22
timotimo oh no 19:23
aaw crap
so it turns out you can get an RSS feed of "answers to your comments" 19:25
which would be super helpful
if it weren't per blog on blogs.perl.org
so whenver i comment on a blog i've not yet commented on, i'd have to add another rss feed to my feed reader
19:27 zhmylove joined 19:28 raiph left
dalek href="https://modules.perl6.org:">modules.perl6.org: 7750ad1 | timotimo++ | web/index.tmpl:
give camelia an alt text and specify exact dimensions
19:30
RabidGravy yeah you want a sort of meta feed for that
19:31 lizmat joined, lizmat_ left
timotimo the template output for the project list is filled with very weird whitespace from all the <TMPL> tags that were thrown out 19:33
it's a tiny bit weird that the sprite.css is at the very end of the document 19:35
19:35 CIAvash left 19:37 pmurias joined
timotimo looking at the network tab, it seems like there's a noticable delay between "the css file finishes loading" and "the image comes in via the 'cache'" 19:38
19:43 Zoffix joined
autarch If I want something like List::Util's any from Perl 5 do I just use grep and it short circuits appropriately? 19:44
timotimo i think if you boolify the result of grep, it'll short-circuit, but there's also "first"
lizmat m: my $a = 42; say "foo" if $a == 1|2|42
camelia rakudo-moar b1a465: OUTPUT«foo␤»
lizmat m: my $a = 42; say "foo" if $a == 1|2|3
camelia ( no output )
lizmat ^^^ autarch 19:45
autarch I really mean "any", not "first"
lizmat is that what you had in mind ?
autarch no, this is more like "are any fields in this array not empty"
timotimo autarch: well, if there is a first at all, there's any.
autarch so I tried to write - @fields.any { $_ ne q{} }
actually, I guess just @fields.any would work, right?
timotimo that's right
but it gives you a junction, which is a very powerful thing
Zoffix timotimo, the TMPL stuff will be gone soon. 19:46
timotimo Zoffix: oh, cool. what template system are you going to use instead?
Zoffix: also, will we put the sprites css closer to the beginning?
autarch yeah, I'm vaguely familiar with junctions from Damian's talk about them in Perl 5 way back when
Zoffix timotimo, ep
lizmat m: my @a; @a[9] = "foo"; say ?@a.first: .chars 19:47
camelia rakudo-moar b1a465: OUTPUT«Method 'chars' not found for invocant of class 'Any'␤ in block <unit> at /tmp/knjsMXE6qH:1␤␤»
lizmat m: my @a; @a[9] = "foo"; say ?@a.first: .defined
camelia rakudo-moar b1a465: OUTPUT«False␤»
timotimo huh
lizmat m: my @a; @a[9] = "foo"; say ?@a.first: *.defined
camelia rakudo-moar b1a465: OUTPUT«True␤»
timotimo ah
lizmat either a whatever or a block :-)
timotimo BBIAB, dinner time
lizmat m: my @a; @a[9] = "foo"; say ?@a.any
camelia rakudo-moar b1a465: OUTPUT«True␤»
19:47 tokuhiro_ joined
lizmat m: my @a; @[9] = Any; say ?@a.any 19:48
camelia rakudo-moar b1a465: OUTPUT«False␤»
lizmat m: my @a; @[9] = 42; say ?@a.any
camelia rakudo-moar b1a465: OUTPUT«False␤»
Zoffix timotimo, that's an interesting choice for alt="" text for camelia. That attribute is meant for functional replacement of the image content, not a description of the image. Looks weird too: i.imgur.com/XwhiANW.png
lizmat m: my @a; @a[9] = 42; say ?@a.any
camelia rakudo-moar b1a465: OUTPUT«True␤»
lizmat m: my @a; @a[9] = Any; say ?@a.any
camelia rakudo-moar b1a465: OUTPUT«False␤»
lizmat I guess any works as well :-)
19:48 raiph joined
autarch if I want to include a space in a character class do I write it like this? <[ A .. Z \ ]> ? 19:49
or maybe it's easier to just write ... / <[ A .. Z ]> || ' ' / ? 19:50
moritz m: say so ' ' ~~ / <[ \c[SPACE] ]> /
camelia rakudo-moar b1a465: OUTPUT«True␤»
moritz autarch: that's what I'd use
autarch wfm
moritz autarch: though \ should also work
m: say so ' ' ~~ / <[ \ ]> /
camelia rakudo-moar b1a465: OUTPUT«True␤»
autarch huzzah, I think I've written a function Perl 6 program 19:51
19:52 tokuhiro_ left
moritz autarch: welcome to the club! 19:53
19:54 Amnez777 joined
autarch I'm really liking the error messages for the most part - but I wish my CLI programs would run a lot faster ;) 19:55
gist.github.com/autarch/da744699061efabb0dcc - is line 19 the idiomatic way to write that in Perl 6?
and generally speaking, are there other spots that could be more idiomatic? 19:56
vendethiel autarch: I'd join with ' ' instead (and same for split) 19:57
or just use .words, if it can be more than one
moritz autarch: if you don't care about preserving multiple spaces in a row, you can use .words instead of .split(' ')
autarch vendethiel: you mean ' ' instead of q{ } ?
19:58 geraud joined
moritz also /^ CAA || PPV $/ might or might not be a precedence bug 19:59
you really want "starting with CAA or ending in PPV"?
but that's the same as in p5, so I guess you do :-) 20:00
lizmat autarch: looking
autarch moritz: no, I don't, but I'm not remembering all my p5
dalek osystem: c5622af | retupmoca++ | META.list:
Add Web::RF

A(nother) web application routing framework that attempts to decouple URLs and your application code as much as possible, while leaving you to handle your own templating and data storage.
  github.com/retupmoca/P6-Web-RF
moritz autarch: if you want to test for equaltiy, $_ eq any(<CAA PPV>) 20:01
arnsholt In that case [CAA || PPV] is what you want
20:01 _mg_ left
moritz no need for a regex at all 20:01
arnsholt Or what moritz says, yeah
autarch ah, that's nice
arnsholt And in that regex, you probably just want | instead of ||
autarch arnsholt: the docs say || 20:02
doc.perl6.org/language/regexes#Alternation
arnsholt That's a doc-bug, definitely 20:03
There are two alternation operators: | and ||
20:03 sprocket joined
arnsholt || has the same semantics as | in Perl 5: try each alternative in sequence until something matches 20:03
| matches in parallel (not really in the implementation, but the semantics are the same), preferring the match that's more longer 20:04
moritz adds something to the docs
arnsholt s/more//
(Almost wrote more specific)
[Tux] I see Text::CSV in most wanted, and the link is still to the non-existing masak version 20:05
github.com/perl6/perl6-most-wanted...modules.md 20:06
FWIW, Text::CSV also deals with TSV
dalek c: ea0f0ef | moritz++ | doc/Language/regexes.pod:
Mention | in regexes

one could write so much more about that, though (hint, hint)
moritz arnsholt: maybe you want to add some of your own explanations to the docs? 20:07
arnsholt moritz: I can try. My LTM semantics are a bit rusty =)
But that's as good excuse as any to read the specs again =)
20:07 darutoko left 20:09 ifim joined
dalek kudo/nom: 058ea86 | lizmat++ | src/core/Str.pm:
Simplify Str.chomp now that \r\n is 1 grapheme
20:10
moritz is currently rewriting an old webapp from 2006/2007 20:11
dalek c: 8b842a5 | lizmat++ | doc/Type/Str.pod:
Document Str.chomp a bit better
moritz what annoys me most is that when I wrote the original website, I added every feature that I could think of or that sounded like cool tech, even if it was clear that it would never be used. 20:12
and now I'm stuff with either porting obscure features, or finding out what's actually used
Zoffix :) 20:13
moritz also back then, I wrote it with an "as static as possible" approach 20:15
zengargoyle you now *can* have whitespace with the '.'. akin to p5 ->
retupmoca .tell masak I PR'd HTML::Template to make some warnings go away: github.com/masak/html-template/pull/12
yoleaux retupmoca: I'll pass your message to masak.
moritz which meant including CGI scripts via SSI
and the other way too (CGI script output was parsed for SSIs again)
zengargoyle nevermind that, i wasn't caught up with backlog 20:16
dalek osystem: 827f96c | RabidGravy++ | META.list:
Add Test::META

  github.com/jonathanstowe/Test-META
RabidGravy Zoffix, ^ there you go :)
dalek kudo/nom: eba3116 | lizmat++ | src/core/Str.pm:
Further simplify Str.chomp, duh!
20:17
RabidGravy if anyone else has input on what could be tested please Issue/PR
Zoffix RabidGravy, great, you should list it on the README.md of the /ecosystem repo 20:18
moritz and on the language/modules page in perl6/doc
Zoffix RabidGravy, one thing it doesn't check for is the source-url value. And I doubt it should. Basically, the builder for modules.perl6.org doesn't handle: (a) git urls that don't end with .git (b) https urls that don't end with '/'; even though both work in the browser. Now, it's easy enough to fix on modules.perl6.org but would fixing that break panda and something else? 20:19
RabidGravy yeah, it's tricky as the source-url is "customary" but not specced and clearly it's not necessarily going to be required if some other installation mechanism comes along 20:21
moritz Zoffix: it's ecosystem/server that assembles the .json file that panda uses in the URL
Zoffix: so if you teach that one to normalize URLs, then you can be pretty sure that panda will accept them
Zoffix Alright. I'll take a look. 20:22
[Tux] if a variable is a Cool, I can use === 1 to see if it has the Int 1. Is there an op to check that is an Int and is smaller than 4? 20:24
if the Cool is a Str, $i < 4 barfs
RabidGravy try Int($i) < 4? 20:26
or something
[Tux] $i ~~ Int && $i < 4
works, but is rather ugly compared to ===
moritz m: say 'a' before 4
camelia rakudo-moar b1a465: OUTPUT«False␤»
moritz m: say 3.5 before 4 20:27
camelia rakudo-moar b1a465: OUTPUT«True␤»
moritz [Tux]: you can use a numeric comparison that doesn't barf when it's a Str (with infix:<before>)
20:27 rindolf left
moritz [Tux]: if you want to check for Int and smaller, you need two ops. 20:27
20:32 rindolf joined 20:33 Ven joined, raiph left, uruwi joined
dalek osystem: 5a348c4 | RabidGravy++ | README.md:
Mention Test::META in the ecosystem README
20:36
href="https://modules.perl6.org/mojo-app:">modules.perl6.org/mojo-app: a945e20 | (Zoffix Znet)++ | mojo-app/t/ (3 files):
Test suite for the home page
20:38
zengargoyle what's a good module name for a NativeCall wrapper around libdatrie. libdatrie is an implementation of a character Trie. 20:40
20:40 ShimmerFairy joined
Skarsnik DataTrie ? 20:41
RabidGravy I don't even know what that is
zengargoyle linux.thai.net/~thep/datrie/datrie.html
it's that thing that makes searching for completions fast and easy... 'p' -> 'ool', 'romise', 'rize', etc. 20:42
Skarsnik Well go for the libname DaTrie ?
RabidGravy if it's something that could be implemented in pure perl then I'd go something like Algorithm::Trie::Libdatrie 20:43
or something
20:43 raiph joined
arnsholt moritz: Expanding the alternation stuff now. I'm in "more words!" mode on my thesis, so I ended up expanding the docs a bit as well. Thanks for the prod =) 20:44
RabidGravy i.e. categorise at a top level, and distinguish how it is implemented at the lowest level
Skarsnik Look of CPAN for the perl5 name if it exists?
I like the Algorithm:: solution though x)
zengargoyle Algorithm::Trie::Libdatrie is a rather nice ida
RabidGravy yeah, it stops the top level getting cluttered, and doesn;'t close the door on someone trying a pure perl implementation 20:45
zengargoyle i think i looked on CPAN and didn't find anything quite the same, but worth a second look.
yeah, or a more substantial implementation. libdatrie has a few caveats: 255 indexing characters (although they can be disjoint and unicode) 20:46
Skarsnik maybe it could be worth defining 'base' place in module, like everything html related in a HTML:: or Web:: prefix? 20:47
lizmat zengargoyle: how would it deal with synthetics ?
zengargoyle though i think the standard camel-case of ::Libdatrie from libdatrie is yucky 20:48
RabidGravy I right a special Lucy tokeniser to do that a while back
dalek kudo/nom: f0221aa | lizmat++ | src/core/Supply.pm:
Simplify Supply.lines, now that \r\n is 1 grapheme
20:49
zengargoyle it somehow conflicts in my mind the the thing is 'libdatrie' but we're coing to call it 'Libdatrie' instead. 20:50
RabidGravy and someone wants to write an Apache Lucy binding - I didn't really get my head around that Charmoniser stuff 20:51
zengargoyle same with things like FTP -> Ftp or whatnot
RabidGravy well, FTP is an acronym
Skarsnik libDatrie? 20:52
RabidGravy there are no good names
Skarsnik for me it mark it has a C binding this way x)
zengargoyle One of the miseries of life is that everybody names things a little bit wrong. —- Richard P. Feynman
lizmat
.oO( wasn't that Feynmann ? :-)
20:53
timotimo Zoffix: thanks for the hint on the alt text, that makes a lot of sense
20:53 tokuhiro_ joined
RabidGravy yeah, but we'd spend all our time naming things and not making things 20:53
and we're not all TS Elliot so we can't make names for ourselves by naming cats 20:54
zengargoyle and then it should be libDATrie as it's a Dual-Array based Trie implementation
RabidGravy lower case initial letter in some part of the class name makes it seem *special* somehow to me
zengargoyle well special in that it's not Pure Perl and requires a installed libdatrie to work. 20:55
zengargoyle unless i also figure out bundling in the library ala Linenoise does. 20:56
RabidGravy maybe it's make Algorithm::Trie and make the libdatrie binding an internal default implementation with whatever name you want
but make it so someone can substitute a different implementation 20:57
zengargoyle making a top-level-ish Algorithm::Trie be dependent on a library seems sorta wrong.
20:58 tokuhiro_ left
RabidGravy yep 20:58
zengargoyle seems i've seen a few modules with ::NativeCall:: in their names somewhere... not a bad idea i think to mark things as not Pure Perl™ 20:59
Algorithm::Trie::NativeCall::libdatrie 21:00
Skarsnik <RabidGravy> but make it so someone can substitute a different implementation <- I have a similar discution with the author of HTML::Parser::XML because I bind a clib that parse html, and it could be good if it was easy to switch implementation of the same thing for the user 21:01
zengargoyle but then i hit the long-names-are-ugly point
DrForr I thought about Binding:". 21:02
Grr. ::
RabidGravy Skarsnik, HTML::Parser::Any :)
zengargoyle Algorithm::Trie::NC::libdatrie
21:02 Ven left, Ven_ joined
RabidGravy lots of precedent on CPAN for that malarkey 21:02
zengargoyle Algorithm::Trie::NCdatrie
21:03 ^elyse^ left, Ven_ left, kaare_ left, Ven joined
zengargoyle sorta like that, gets NativeCall and the library (modulo lib) 21:04
RabidGravy zengargoyle, at this point I'd go with making the thing, making it work then adjusting the name before releasing it ;-)
lizmat RabidGravy zengargoyle : please remember that wrt to naming, the name of the *auth* is really part of the module name
so that you have less to worry about trampling on a namespace 21:05
21:05 mr_ron left
zengargoyle oh, i've got it working, this is the make a distributable out of it part. 21:05
RabidGravy :)
lizmat, right now that's only *in theory* though right? 21:06
zengargoyle and pick a #*(&@ name
21:07 mr_ron joined
zengargoyle and then draw a logotype :) 21:08
zengargoyle and then write documentation
heh, priorities
timotimo Zoffix: so really the alt text should rather be empty like it was before? 21:10
Zoffix timotimo, I guess it could be "»ö«" :)
lizmat RabidGravy: yes 21:11
timotimo that's a good idea, actually :)
timotimo commits that
dalek href="https://modules.perl6.org:">modules.perl6.org: 1cd9db9 | timotimo++ | web/index.tmpl:
the alt text wasn't good. now it's the text version of camelia
21:12
zengargoyle so just jump on Algorithm::Trie:auth<zengargoyle> and not worry about it until later...
21:13 _mg_ joined
timotimo sprocket: hey, are you there? i fixed the slurp thing with /proc/cpuinfo and friends 21:14
rejoice!
21:14 rurban left
sprocket timotimo: ah! great! 21:14
what was the issue?
timotimo sprocket: we were fstating the file and using its size 21:15
sprocket was it on account of /proc/cpuinfo not being a real file?
aah, ok :)
timotimo welllllll, fstat says it's a regular file
sprocket yes, i suspected something like that might be happening
true :)
timotimo so now the code acts extra suspiciously when encountering a file that's "0 bytes big"
sprocket thanks! i’ll update my code to take advantage of the newly fixed slurp :) 21:16
timotimo it turns out a very similar fix had already been put into the branch that throws out libuv for the synchronous I/O stuff
i can't wait to see what the performance gain is from that branch :S 21:18
llfourn I get S17-supply/syntax.t hanging forever on test "Can only be in one whatever block at a time" sometimes 21:20
21:22 _mg_ left
RabidGravy sprocket, timotimo - be alove and patch Linux::Cpuinfo to that effect then :-* 21:22
21:22 _mg_ joined
llfourn if this thread github.com/perl6/roast/blob/master...tax.t#L353 starts before the lock below it it will hang 21:22
does that make sense to anyone
RabidGravy and Liniix::Fuser for that matter 21:23
Linux
I didn't RT it at the time 'cause I wasn't sure if it was supposed to work like that ;-) 21:24
psch m: multi foo(Int $x is rw) { say "writable" }; multi foo(Int $x) { "readonly" }; foo(42) # RT #74414 21:25
camelia rakudo-moar f0221a: OUTPUT«Parameter '$x' expected a writable container, but got Int value␤ in sub foo at /tmp/IXLz34XYeD:1␤ in block <unit> at /tmp/IXLz34XYeD:1␤␤»
psch that's still wrong, isn't it? as in, it should dispatch to the wider candidate if possible 21:26
RabidGravy it took me a few minutes to think why you might want to do that 21:27
but yeah
21:27 _mg_ left
dalek href="https://modules.perl6.org/mojo-app:">modules.perl6.org/mojo-app: d51bd8f | (Zoffix Znet)++ | mojo-app/t/0 (2 files):
Test suite for the non-JS search feature
21:27
21:31 Ven left 21:32 Ven joined 21:33 nys joined
dalek href="https://modules.perl6.org/mojo-app:">modules.perl6.org/mojo-app: 1f3db52 | (Zoffix Znet)++ | mojo-app/t/ (4 files):
Move db setup to the helper. Model gets its own temp db
21:33
21:37 eliasr joined
RabidGravy I know all the bits aren't there yet bit wouldn't it be a fairly strong aspiration to have all the perl6.org stuff y'know actually made in Perl 6? 21:37
Zoffix But why? 21:38
RabidGravy for me it's self evident
eat your own dog food and cause the yaks to be shaved 21:39
if we do it other people can
dalek kudo/nom: 1b3e467 | lizmat++ | docs/ChangeLog:
Put some stuff in da ChangeLog
21:40 Begi1116 left
Zoffix There's a lot of bits missing. 21:41
And the interpreter is in flux.
RabidGravy I'm not saying *now*, but making a list of the missing things would be a start
Zoffix wonders if blogs.perl.org still using a PHP CMS 21:42
RabidGravy these are the reasons I used the word "aspiration" 21:43
DrForr Not for much longer :)
21:43 zakharyas joined
timotimo Zoffix: why would you say "interpreter"? :) 21:45
RabidGravy but asking the question "why can't we do this in Perl 6", listing the missing parts, encouraging people to make those things and making it possible is a good thing right?
timotimo + + New Range.int-bounds returns first/last value for integer ranges 21:46
Zoffix ¯\_(ツ)_/¯ compiler? core? that things that makes the magic happen? :)
DrForr I'd love to run blogs.perl.org on perl 6 but I don't think it's the right time yet.
timotimo ^- lizmat, i think this has to make it a bit clearer that it's for integer type value ranges... i fail to express it, though
21:46 Ven left
timotimo Zoffix: yeah, the magicky parts! 21:46
RabidGravy I think people get bogged down in the monolithic things 21:47
raiph psch: "it should dispatch to the wider candidate if possible" <-- s/wider/narrower/
timotimo RabidGravy: what do you mean by that?
psch raiph: "is rw" is narrower, according to RT #74414 21:48
raiph: but that's what it wrongfully tries to dispatch to
(and then throws Parameter::RW)
RabidGravy in P5 the Catalyst, Mojo are monstrous frameworks, people fear to start implementing that size thing 21:49
DrForr *cough* Bailador?
jdv79 fear?
RabidGravy I think it's make a great kit of fabulous tiny parts
Zoffix RabidGravy, sure, which is why I think we shouldn't rush them out for the of making all perl6.org stuff in Perl 6 :) 21:50
s/the of/the sake of/;
pink_mist I'm not sure I'd call Mojo "Monstrous" :P
Zoffix It is if you consider how much polishing it undertook.
raiph psch: if mmd is supposed to (try to) dispatch to the narrowest candidate, and "is rw" narrows, then it *should* dispatch to the "is rw" candidate, right? 21:51
pink_mist ah, that's a fair point Zoffix =)
timotimo raiph: it should dispatch to the "is rw" candidate only if it's possible to call it
RabidGravy sorry I didn't mean to imply what you think I did
raiph oh, duh, gotchya 21:52
21:52 Ven joined
Zoffix Alright :) 21:52
psch fwiw, the fix for that looks scarily easy, which means i'm probably missing something... 21:53
psch waits for the spectest...
lizmat I'm not sure "is rw" actually partakes in mmd selection 21:54
psch lizmat: it didn't, no 21:55
RabidGravy I can explain why I think it should if you want :)
raiph ++psch
psch as in, !find_best_dispatchee doesn't yet pay attention to rwness of a given parameter
21:55 diana_olhovik_ joined
lizmat m: multi a($a) { say "foo" }; multi a($a is rw) { say "bar" }; a 42 # indeed 21:56
camelia rakudo-moar 1b3e46: OUTPUT«Parameter '$a' expected a writable container, but got Int value␤ in sub a at /tmp/JbH8e6IPD_:1␤ in block <unit> at /tmp/JbH8e6IPD_:1␤␤»
psch grr
lizmat oddly enough, that doesn't complain about having multiple candidates matching
21:56 Ven left
psch of course when i teach !find_best_dispatchee about rwness it starts throwing X::Multi::NoMatch for e.g. --"foo" 21:56
and not Parameter::RW
21:57 virtualsue joined
psch that's what i overlooked, i knew the patch can't be that simple :P 21:57
jdv79 lizmat: what was this amazing perf thing you did for Tux?
my backlogging has been spotty recetnly ^H
lizmat jdv79: basically Str.split(@needles)
jdv79 git hist on Str.pm tehn?
21:58 zakharyas left
lizmat Tux was using a rather complicated regex, which became real simple with the new Str.split candidate 21:59
m: dd "flabbergasted".split( <a e> )
camelia rakudo-moar 1b3e46: OUTPUT«List $var = $("fl", "bb", "rg", "st", "d")␤»
lizmat m: dd "flabbergasted".split(/a|e/) # before 22:00
camelia rakudo-moar 1b3e46: OUTPUT«List $var = $("fl", "bb", "rg", "st", "d")␤»
jdv79 nice
lizmat $ 6 'my @a = "words".IO.slurp.split("\r\n"); say +@a' 22:01
235887
real0m0.462s
$ 6 'my @a = "words".IO.slurp.split(/\r\n/); say +@a'
235887
real0m5.058s
22:01 bbkr joined
jdv79 the regex engine could use some work:) 22:02
lizmat yup, but we know that, and that's post 6.c
jdv79 in p5, in may cases, handing off as much as possible to the regex engine can boost perf
bbkr hi. do we have lazy attributes in P6 like in Mouse/Moose?
22:02 Ven joined
Zoffix That's second time asked today. 22:03
jdv79 classic wedge as much as possible into one dyn lang op optimization
flussence m: class A { has $.b = !!! }; given A.new { say 'alive'; say .b }
camelia rakudo-moar 1b3e46: OUTPUT«Stub code executed␤ in method at /tmp/hTOOpHohKL:1␤ in block <unit> at /tmp/hTOOpHohKL:1␤␤»
lizmat bbkr: the idiom really is: write your own method like: method foo { $!foo //= lazy code }
RabidGravy bbkr, not directly no
Zoffix bbkr, you can search the log for "lazy" :) irclog.perlgeek.de/perl6/2015-11-08 22:04
bbkr, here's one example: github.com/rakudo/rakudo/blob/nom/...nce.pm#L22
bbkr thanks, already found it
ah, do{} is lovely syntax in p6 :)
22:05 sprocket left
lizmat jdv: mind you, when using multiple matchers, the regex might win at some point: 22:06
$ 6 'my @a = "words".IO.slurp.split(("\r\n","\r","\n")); say +@a'
235887
real0m5.760s
timotimo Zoffix: will we be seeing a WIP of the new module app hosted somewhere before it lands on our server?
lizmat $ 6 'my @a = "words".IO.slurp.split(/\r\n|\r|\n/); say +@a'
235887
real0m8.231s
Zoffix timotimo, yeah. 22:07
timotimo, but Fallout 4 comes out the day after tomorrow...
:}
bbkr thinks that some attribute trait like "is('lazy')" should be built into P6 in the future 22:08
timotimo i expect you're going to make it before then!
Zoffix :D
jdv79 lizmat: did you happen to hit an optimized path?
or is it something else
timotimo bbkr: we had it built-in at one point, then it got thrown out again so that it could be implemented in module space
lizmat: is split using "simplematch"?
RabidGravy bbkr, nah - someone could make a module that does that 22:09
lizmat well, the multi Str needle approach just does a pure string search for all needles (seeing each char multiple times)
and then does some sorting/pointer algo to simulate LTM
timotimo: what is "simplematch" ? 22:10
timotimo lizmat: it's a method larry built that is a little bit cheaper than match
i don't know the exact details, but if it can be used there, perhaps it'll be a good thing 22:11
lizmat the Str.split(@needles) case uses nqp::index
it does not use the regex engine in any way, shape or form
jdv79 very nice
timotimo right
i meant the regex variant :)
lizmat once it's a regex, I consider it a black box inside Str.split 22:12
and just use .match on it
22:12 Ven left
timotimo is it a :g match? 22:13
actually
i have the code in front of me now
timotimo digs in
22:14 tardisx joined
timotimo right, i think for :g, simplematch doesn't help 22:14
22:15 mr_ron left 22:20 Ven joined, Ven left 22:24 xfix left 22:25 pmurias left 22:27 mr_ron joined
lizmat .tell jnthn when thinking about VM level chomping, I was thinking that chomp would be a VMIO attribute 22:27
yoleaux lizmat: I'll pass your message to jnthn.
lizmat .tell and that nqp::readlinefh would then just DTRT 22:28
yoleaux lizmat: I'll pass your message to and.
lizmat .tell jnthn is there a reason for not making chomp a VMIO level attribute ? 22:29
yoleaux lizmat: I'll pass your message to jnthn.
22:32 ifim left, diana_olhovik_ left 22:36 bbkr left
timotimo lizmat: we don't really have a faster way to get a bunch of Int objects from an array into a Buf, than to loop over indices and use bindpos_i with .AT-POS, right? 22:37
because Blob.new (and Buf.new) take a gigantic amount of time for this task
22:37 AlexDaniel joined
lizmat int array or Int array ? 22:38
ah, Int
f the Int array is reified, you could go over the $!reified list and use nqp::atpos ? 22:39
and nqp::unbox_i of course
timotimo: are you doing something there ? 22:40
I think I can make it faster, fwiw
22:47 cygx joined
cygx o/ 22:47
Camelia says hello as well: cygx.github.io/js-rgba/camelia.html 22:48
dalek c: 820d1c7 | raiph++ | doc/Language/variables.pod:
irclog.perlgeek.de/perl6/2015-11-08#i_11502289
22:50
timotimo lizmat: i tried to use nqp::splice instead, but of course that doesn't work for object arrays into int arrays 22:51
lizmat: in that case it's not even an "Int Array", though that doesn't make a difference when compared to "Any Array" i suppose 22:52
er ... well ... i mean, it's okay to try to unbox each entry as an int and assign it to the buf, because that's really what you'd expect that to do
so if that exact thing blows up, nobody would say "it's not doing what i'd hoped!"
22:54 tokuhiro_ joined 22:57 vendethiel left 22:58 autarch left 22:59 tokuhiro_ left
jdv79 how is a $h = {}; markedly different from a %h = (); type of deal? 23:00
i just moved the latter to the former and lost my "references" 23:01
ugexe {} can act weird sometimes, especially with trace where it then treats it like a block instead of a hash 23:02
23:02 virtualsue left, spider-mario left
jdv79 no, i had stuff wired up with binds and now i don't get where it went wrong 23:02
probably gonna be a slog. i guess my container fu is weaker than i thought. 23:03
lizmat when in doubt, decont! :-) 23:04
timotimo when know you don't, decont! 23:05
23:11 Skarsnik left 23:15 sprocket joined
RabidGravy if only all that was properly dumented 23:16
23:16 pochi_ left
RabidGravy eh? 23:16
documented 23:17
23:17 TEttinger joined
lizmat
.oO( we need dumentors :-)
23:18
RabidGravy or dimentos
llfourn dementors? 23:20
RabidGravy I'm going to bed now and then in the morning one of you is going to 'fess up to having written the best Perl 6 templating module which I need for what's next 23:21
okay?
llfourn kay
what are you templating? 23:22
RabidGravy Perl 6
llfourn you want to template perl6 in perl6?
RabidGravy yep
llfourn isn't that what macros are >.<
RabidGravy the reason for doing so will become apparent ;-) 23:23
llfourn is excited to discover the apparrentness
raiph m: say "tiny template system: { $*IN.slurp }"
camelia rakudo-moar 1b3e46: OUTPUT«Method 'slurp' not found for invocant of class 'IO::Handle'␤ in block <unit> at /tmp/etzFZ1Zj8Y:1␤␤»
raiph . O ( dumented dreaming ) 23:25
23:27 pochi joined 23:29 RabidGravy left
dalek kudo/nom: e7ebf6c | lizmat++ | src/core/IO/Handle.pm:
Make IO::Handle.get a bit faster
23:37
23:39 pippo joined
pippo m: my @a = <a a>; my @b = <b b>; say (@a.Slip, @b,Slip); say (@a, @b)>>.Slip; 23:41
camelia rakudo-moar 1b3e46: OUTPUT«(a a [b b] (Slip))␤((a a) (b b))␤»
pippo m: my @a = <a a>; my @b = <b b>; say (@a.Slip, @b.Slip); say (@a, @b)>>.Slip;
camelia rakudo-moar 1b3e46: OUTPUT«(a a b b)␤((a a) (b b))␤»
pippo Why they are not the same?
dalek kudo/nom: b60b2fe | (Lloyd Fournier)++ | src/Perl6/Metamodel/BUILDPLAN.nqp:
Attribute required check before build

fix #126436
kudo/nom: e31463d | lizmat++ | src/Perl6/Metamodel/BUILDPLAN.nqp:
Merge pull request #579 from LLFourn/is_required_fix

Attribute required check before build
pippo m: my @a = <a a>; my @b = <b b>; say (@a.Slip, @b.Slip); say (@a, @b)>>.Slip; say map { .Slip }, (@a, @b); 23:45
camelia rakudo-moar 1b3e46: OUTPUT«(a a b b)␤((a a) (b b))␤(a a b b)␤»
timotimo casual-effects.com/markdeep/ - this looks neat 23:47
23:47 Peter_R left
pippo Should'nt map { .Slip }, () be equivalent to ()>>.Slip ?? 23:47
timotimo not quite 23:49
hyper vs lazy semantics
23:49 skids joined
pippo timotimo: you mean from the result point of view? 23:49
timotimo from the way it's executed, i mean 23:50
i didn't actually look at the result you got there yet
i think the reason why you get ((a a) (b b)) from the hyperop is that hyperops try to retain the original layout as close as possible
m: say (((1, 2), 3, 4), 5, 6)>>++ 23:51
camelia rakudo-moar e31463: OUTPUT«Parameter '$a' expected a writable container, but got Int value␤ in block <unit> at /tmp/TspCUmwqsk:1␤␤»
timotimo er, yeah
m: say (((1, 2), 3, 4), 5, 6)>>.succ
camelia rakudo-moar e31463: OUTPUT«(((2 3) 4 5) 6 7)␤»
timotimo tthat would explain why it doesn't slip the elements into one list
pippo timotimo: Do you think it is a bug? 23:53
timotimo: I mean the .Slip behaviour. 23:54
timotimo not sure
i'm inclined to believe it's behavior as specced, but i didn't look at the spec closely enough 23:55
pippo timotimo: OK. TY. I leave with it then :-))
timotimo: have a good night.
23:55 pippo left
dalek kudo/nom: 460d89d | lizmat++ | src/core/Buf.pm:
Make Buf/Blob.new upto 20x faster for Iterables
23:56
lizmat timotimo: ^^^
timotimo lizmat: very good! 23:57
lizmat could you verify it works for you? I fear Bufs etc are a bit under covered in the spectest
timotimo oh 23:58
23:59 dayangkun joined, dayangkun left