»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
ParsonsNose Zoffix: Yeah, substr was the way to go, I just sorta forgot about it. I had that same thought about .= though 00:06
Zoffix Inheritance from core classes isn't yet polished. So above you'd need to make your own .new method to make it work 00:06
ParsonsNose tnx 00:08
Zoffix m: use nqp; class Inty is Int { method new ($v) { method !set-v ($v) { nqp::bindattr_i(self, Int, '$!value', $v); self }; self.bless!set-v: $v; }; method ho { self + 7 } } ; my Inty $hi .= new: 6 ; say $hi.ho 00:13
camelia 13
Zoffix No idea if there's a non-nqpish way to do it...
Zoffix ❗❗❗🌟🌟🌟❇️❇️❇️🌠🌠🌠🎉🎉🎉⚠️⚠️⚠️🚧🚧🚧🌈🌈🌈 00:16
PART 2: Upgrade Information for Changes Due to IO Grant Work: rakudo.org/2017/04/03/part-2-upgrad...rant-work/
❗❗❗🌟🌟🌟❇️❇️❇️🌠🌠🌠🎉🎉🎉⚠️⚠️⚠️🚧🚧🚧🌈🌈🌈
ParsonsNose m: role Inty { method Str { (self + 7).Str } } ; my $i = 4 does Inty ; say $i ; say $i + 1 00:21
camelia 11
5
ParsonsNose That seems like the nicest way to do it. Bonus evil point, I feel. 00:22
BenGoldberg u: 🌈 00:30
unicodable6 BenGoldberg, U+1F308 RAINBOW [So] (🌈)
BenGoldberg One of these days, I've got to switch to an irc client which supports color emoji, cause that looks like an elbow noodle to me. And the 🎉 makes me think of 🍕. 00:33
AlexDaniel mmm, 🍕 00:37
Geth doc: d050d4bb0a | (Zoffix Znet)++ | doc/Type/IO/Path.pod6
[io grant] Remove IO::Path.chdir prose

Will write new info after fixing up the method in Rakudo.
  - &chdir is vastly different and shouldn't be listed together
  - the prose is wrong, IO::Path.chdir doesn't use $*CWD
  - the prose mentions now-deprecated :test param
04:15
doc: 1d0e433c2a | (Zoffix Znet)++ | doc/Type/IO.pod6
[io grant] Document &chdir
04:32
Geth doc: 3fdc6dc413 | (Zoffix Znet)++ | doc/Type/IO.pod6
[io grant] Document &*chdir

Hoping there won't any be 'splosions due to the `&*` in the routine's name.
04:37
travis-ci Doc build errored. Zoffix Znet '[io grant] Document &chdir' 05:22
travis-ci.org/perl6/doc/builds/217941992 github.com/perl6/doc/compare/d050d...0e433c2af2
Geth doc: e1a299c1fd | (Zoffix Znet)++ | doc/Type/IO.pod6
[io grant] Reword "defined as" for &*chdir

To avoid suggestion that `sub &*foo` is valid syntax.
05:29
doc: e5225bed8a | (Zoffix Znet)++ | doc/Type/IO.pod6
[io grant] Fix URL to &*chdir
05:30
Geth doc: 8d4704b4c6 | (Zoffix Znet)++ | doc/Type/IO.pod6
Fix typo
05:30
Geth doc: 4fc5d43dbb | (Zoffix Znet)++ | doc/Type/IO.pod6
Fix typo

Copy-pasta is the root of all evil
05:31
llfourn is splice the only way to remove an array element? 10:19
jnthn There's pop and shift also, or .= grep(...) 10:21
But yes, if it's "index in the middle"
llfourn jnthn: cool thanks. 10:22
using python recently and have gotten used to list.remove 10:23
(though, in python if you use it while iterating over it it will totally screw you)
jnthn Using indexing, or an iteration over the values themselves? 10:24
jnthn guesses the latter 10:25
llfourn iterating over the values themselves 10:26
jnthn Yeah, I dunno how well that'll go in Perl 6 either, tbh :)
lizmat for @a.keys.eager should be save I guess ? 10:26
jnthn Sure, that will be, but that's not the values :) 10:27
lizmat for @a.values.eager ?
jnthn I just don't like writing code that mutates stuff it's iterating over, though.
lizmat for @a.eager for that matter I guess
jnthn I guess .eager is safe in that it snapshots
llfourn m: my @a = <one two three four>; for @a { @a.splice(2,1) when "two"; .say } # seems ok
camelia one
two
four
jnthn Yeah, for me it's not a matter of whether it's OK in the language, so much as I just find such code hard to reason about 10:28
Not at the point I write it...but a few months later when I have to change it :)
lizmat true: when written the smartest way possible :-)
it will bite you in maintenance as you need to be smarter still then :-) 10:29
pmurias is it ok if I add fudges for the js backend to roast? 10:37
tbrowder hi, #perl6! 10:37
pmurias tbrowder: hi
lizmat pmurias: yes, that's what backend specific fudges are for :-) 10:38
#?rakudo.js I presume?
or does that need infrastructure work before that does what we hope it does ?
tbrowder i just saw bdfoy's update and read about appveyer, but i don't see it mentioned on p6 sites 10:39
hi, pmurias
jnthn I think the compiler.backend thing was made general enough to handle new ones "naturally"
lizmat tbrowder: it will be in tonght's Perl 6 Weekly :-) 10:40
jnthn pmurias++ # being far enough along to start running spectests :)
tbrowder ah1 (appveyor), excellent news for the win people! 10:41
must be some big bucks for all those MS licenses 10:42
jnthn Could do with setting appveyor up for MoarVM...
jnthn Woulda caught the Windows build bustage we had recently 10:43
tbrowder is it ready enough to add info on win testing to modules docs?
jnthn 'fraid I haven't got any usage experience with it myself, but I think it's been around for a while 10:47
timotimo i was asked to do that, and maybe i can do it 10:54
tbrowder lizmat: i look forward to your excellent weekly p6 roundup, many kudos from the west side of the atlantic! 10:57
pmurias jnthn: I'll use rakudo.js, fudge can handle it without any changes the same way it does rakudo.jvm (the fugdges will be mostly the same as it's the same unicode issues jvm has I'm fudging around) 10:58
tbrowder question: can anyone explain diff between range operator (..) and sequence operator (...) other than seq can used for "backwards" iteration in for loops? 11:02
moritz tbrowder: the range operator just returns a Range object 11:03
tbrowder: and you can't just use it for iteration, but also for range checking, for example
m: say 1.5 ~~ 1..3
camelia True
tbrowder and seq doesn't return an object? 11:04
moritz tbrowder: well, it returns a Seq, which is only for iteration 11:05
tbrowder: and it's much more flexible; you can give it a callable, or it can deduce other sequences
tbrowder ah, so 1..3 really is the set of real numbers between 1 and 3
moritz m: say (1, 2, 4, 8 ... *).head(10)
camelia (1 2 4 8 16 32 64 128 256 512)
moritz m: say (1, 1, &[+] ... *).head(10)
camelia (1 1 2 3 5 8 13 21 34 55)
tbrowder so would you say a "best practice is to alwas use a seq oper in for loops? 11:06
jnthn I think better advice is "use .. when it's powerful enough, ... when it isn't" 11:07
.. is much simpler
tbrowder thanks, moritz and jnthn
lizmat hmmm... perhaps ... could revert to a simple Range when it can ? 11:10
jnthn Not really, because of the return type being different :) 11:11
jnthn May be that internally we can hand back a Seq that has whatever underlying iterator Range uses, though, if we ain't alrady doing that 11:12
lizmat but it could be a Seq running of a Range
exactly :-)
lizmat puts it on her list
Voldenet I didn't know perl can deduce sequences :o 11:19
m: say (1, 3, 9, 81 ... *).head(10)
camelia Unable to deduce arithmetic or geometric sequence from 3,9,81 (or did you really mean '..'?)
in block <unit> at <tmp> line 1
Voldenet m: say (1, 3, 9, 27 ... *).head(10)
camelia (1 3 9 27 81 243 729 2187 6561 19683)
lizmat m: say (1, 3, { $_ * $_ } ... *).head(10) # Voldenet 11:21
camelia (1 3 9 81 6561 43046721 1853020188851841 3433683820292512484657849089281 11790184577738583171520872861412518665678211592275841109096961 1390084523771447327649397867896613031142188508085291379916048244300360726297664359410017691541096095218116655405488994…
Voldenet m: say (0..10).map(3 ** *).head(10) 11:26
camelia (1 3 9 27 81 243 729 2187 6561 19683)
Voldenet m: say (1, 3, * * * ... *).head(10) 11:28
camelia (1 3 3 9 27 243 6561 1594323 10460353203 16677181699666569)
Voldenet oh, * * * in this context takes two previous elements
m: say (1, 1, * + * ... *).head(10)
camelia (1 1 2 3 5 8 13 21 34 55)
lizmat Voldenet: yeah, that's why 1, 3 * * * ... * wouldn't produce the result you wanted 11:36
m: say (1, 3, * * * ... *).head(10) 11:37
camelia (1 3 3 9 27 243 6561 1594323 10460353203 16677181699666569)
Voldenet btw, while I'm reinstalling zef packages again, should I use tinynoise or readline? 11:38
erm
linenoise*
lizmat I've had good experience with linenoise on my MBP 11:43
Voldenet I wish home/end worked on it though 11:47
lizmat perhaps a PR is on order then :-) 11:48
Voldenet it's funny, because even M-f M-b are working, but not home/end
lizmat perhaps you have some keymapping active that linenoise doesn't see ? 11:51
Voldenet oh, on regular xterm it does work 11:52
Voldenet the pesky case of ^[[H ^[[F vs ^[[1~ ^[[4~, eh 11:55
robertle anyone got some experience with file locks under perl6? I want lockf or so, and am wondering whether there is something built-in or a module 12:14
timotimo it's builtin
moritz uses sqlite for file locking :-) 12:15
timotimo huh, hold on
it's at least not documented
robertle couldn't find it eaither :)
timotimo but class IO::Handle totally has a lock and unlock method 12:16
not sure if it's part of the IO rework our grantee is currently doing
robertle ok, will look at that! who is that grantee btw? 12:17
robertle or who else can I talk to to find out more? 12:17
timotimo it's zoffix, you can find them over at #perl6-dev
lizmat IO::Handle.lock *is* part of the IO grant work 12:18
timotimo how's it going to change? 12:19
lizmat rakudo.org/2017/04/02/upgrade-infor...rant-work/ look for IO::Handle.lock
"IO::Handle.lock no longer takes an Int:D argument, but a pair of named arguments instead. By default, it makes an exclusive, blocking lock. Use :shared named argument to make a shared lock instead and :non-blocking to make the method fail instead of waiting for lock."
timotimo ah
yeah, that's a lot better
than an integer flag
robertle thanksright, but it still does not say what it actually does. e.g. around crashing without unlocking, NFS etc 12:20
is it just the fcntl? there is bound to be some platform-specific madness going on as well...
timotimo one sec.
on windows we lockFileEx 12:21
and on linux we fnctl
fcntl*
timotimo well, on anything-except-windows, of course 12:21
robertle this is in syncfile, right? 12:22
timotimo yup
robertle I am a noop and can never track down where stuff actually happens...
timotimo a tool could potentially be written that tracks down what exactly an nqp::foobar does 12:23
though it wouldn't necessarily be able to do the final step from "call lock on the REPR" to "these REPRs actually implement lock"
though perhaps it could
robertle I'm happy to do a lot of grepping, but frequently fail...
robertle either way, I'll cehck this out. thanks a lot! 12:24
tbrowder ref ranges: is it true that a range must be defined on numbers increasing monotonically? 12:39
lizmat m: dd "a" .. "z" 12:40
camelia "a".."z"
lizmat m: dd |("a" .. "z")
camelia "a"
"b"
"c"
"d"
"e"
"f"
"g"
"h"
"i"
"j"
"k"
"l"
"m"
"n"
"o"
"p"
"q"
"r"
"s"
"t"
"u"
"v"
"w"
"x"
"y"
"z"
lizmat increasing monotonically if iterated over, but not necessarily numbers
tbrowder ok, then increasing on whatever, gotcha
lizmat well, and then there's ranges you can't iterator over: 12:41
m: dd |(-Inf .. 0)
camelia (timeout) 12:41
lizmat m: dd |(-Inf .. 0).head(10)
camelia -Inf
-Inf
-Inf
-Inf
-Inf
-Inf
-Inf
-Inf
-Inf
-Inf
tbrowder okay, i'll stay in the simle p6 world for now, thanks, lizmat 12:42
Voldenet now I wonder 12:51
m: dd |(-Inf .. 0).reverse
camelia (timeout) 12:52
Voldenet uh... I broke it
m: dd ((-Inf .. 0).reverse).take(10) 12:53
camelia Too many positionals passed; expected 1 argument but got 2
in block <unit> at <tmp> line 1
Voldenet m: dd (-Inf .. 0).reverse().take(10)
camelia Too many positionals passed; expected 1 argument but got 2
in block <unit> at <tmp> line 1
Voldenet m: dd (-Inf .. 0).reverse().head(10)
camelia (0, -1, -2, -3, -4, -5, -6, -7, -8, -9).Seq
lizmat smart, innit :-) 12:56
Voldenet yeah, it's funny how most languages would fail on this though 12:57
Voldenet what's the perl6 version of "std::variant<int, string>", should I always use multi instead? 13:10
m: subset V of Any where { $_ ~~ Int or $_ ~~ Str }; my V $v = "ok"; 13:11
camelia ( no output )
Voldenet hm, moderately acceptable 13:13
jnthn m: subset V where Int|Str; my V $v = 42; say $v; $v = '42'; say $v; $v = 4.2; say $v 13:16
camelia 42
42
Type check failed in assignment to $v; expected V but got Rat (4.2)
in block <unit> at <tmp> line 1
jnthn That's a shorter way to write it :)
Voldenet makes sense 13:17
but hm, now I look at it, there's no real use case where multi isn't superior 13:18
[Coke] .seen pmurias 13:37
yoleaux I saw pmurias 10:58Z in #perl6: <pmurias> jnthn: I'll use rakudo.js, fudge can handle it without any changes the same way it does rakudo.jvm (the fugdges will be mostly the same as it's the same unicode issues jvm has I'm fudging around)
[Coke] waves from new $DAYJOB 13:38
timotimo greetings [Coke]
lizmat [Coke] o/ 13:52
moritz [Coke]: hey, what/where are you working now? 14:13
Geth doc: bf377c7702 | (Zoffix Znet)++ | doc/Type/IO.pod6
[io grant] Document &indir
14:26
Geth doc: 5aa614f364 | (Zoffix Znet)++ | doc/Language/5to6-perlfunc.pod6
[io grant] Improve suggestion for Perl 5's opendir
14:51
[Coke] moritz: I'm basically doing the exact same job for the same client out of the same office, except I am now getting paid by one of the "big 4" accounting firms instead of the client. (Thankfully. could have been a ton of layoffs here) 15:23
[Coke] (actual job is basically tax IT. webapps, devops around various in house (er, that changed as of today) tax apps) 15:26
Voldenet >tax apps 15:27
Voldenet runs away scared
Actually, I'm not that scared
[Coke] Voldenet: right there with ya. :|
"AIGH". "oh, wait, this isn't so bad."
Voldenet Got a question a propos supplies: Can I somehow make Supplier.emit stuff in a consumer's thread instead? 15:28
m: given Supplier.new -> $s { for ^3 -> $consumer { $s.Supply().tap( -> $val { sleep(.1); ($consumer, $val).say }) }; $s.emit($_) for ^3; }
camelia (0 0)
(1 0)
(2 0)
(0 1)
(1 1)
(2 1)
(0 2)
(1 2)
(2 2)
Geth doc: a53015ae49 | (Zoffix Znet)++ | doc/Type/IO/Path.pod6
[io grant] Clarify value of IO::Path.path
15:31
Geth doc: bdd18f14e8 | (Zoffix Znet)++ | doc/Type/IO/Path.pod6
[io grant] Fix desc of IO::Path.Str

The method is just an alias for $.path attribute, but the prose makes it sound you like get the complete path, which isn't true.
15:33
Geth doc: b78d4fd907 | (Zoffix Znet)++ | doc/Type/IO/Path.pod6
[io grant] Include type names in links to methods

Since links will list all the methods with such name, make it easier for reader to know which type was meant.
15:35
Voldenet The only solution I can think of would be starting a consuming values from a Supply and then dispatching them with a thread 15:51
but I hope there's more magical solution than that :) 15:52
jnthn Voldenet: Channels, not supplies, are the primarly mechanism for producer/consumer
Voldenet but when you need a mechanizm for multiple readers Supply is the one to use, right? 15:53
jnthn Competing? 15:54
Or publish/subscribe?
Voldenet Not competing, broadcasting
multiple reader with all of them receiving the same set
s/reader/readers/
jnthn OK, then supplies, and see the .schedule-on and .migrate methods
perlpilot one of these days, someone should write a cookbook for this sort of stuff.
Voldenet Ah. That tiny little line was the method I was looking for! :) 15:55
jnthn Probably you want schedule-on from the way you described things :)
perlpilot: Yeah, been thinking about that ;-)
jnthn wanders off to rest for a bit 15:56
travis-ci Doc build errored. Zoffix Znet '[io grant] Fix desc of IO::Path.Str 16:24
travis-ci.org/perl6/doc/builds/218119192 github.com/perl6/doc/compare/a5301...d18f14e820
RabidGravy boo! 18:39
timotimo yo gravy how's you? 18:41
lizmat starts with this weeks Perl 6 Weekly 18:42
AlexDaniel \o/ 18:44
vendethiel lizmat++ 18:45
[Coke] lizmat++ 18:56
Geth specs: 5a7a5aab85 | (Zoffix Znet)++ | v6d.pod
Add reminder to deprecate IO::Path.chdir in 6.d
dylanwh ^ because it can't work under the jvm?
(all sorts of wonderfully fun things can happen if you manage to call chdir() from the JVM) 18:57
AlexDaniel dylanwh: github.com/zoffixznet/IOwesomeness/issues/26 18:58
AlexDaniel “Rename IO::Handle.slurp-rest to just .slurp” hmmmm 19:02
dylanwh ah
AlexDaniel it feels there was some reason for that, hm 19:03
dylanwh I just know large parts of the JVM will not work right if you do a real chdir() 19:08
if that chdir is emulated, that should be safe
but actually changing the OS's idea of the current dir will break the JVM.
dylanwh (subtly break; some java APIs will not realize the cwd is different and return the old one, and in some cases involving dynamically loading bytecode will fail) 19:09
timotimo AlexDaniel: just because it didn't close the handle by default, which is something .slurp itself does ... technically speaking
dylanwh at least circa java 6ish
AlexDaniel timotimo: 🤷 19:11
timotimo: github.com/zoffixznet/IOwesomeness/issues/9
RabidGravy timotimo, I'm fabulous 19:14
dha Crazy question: Has anyone tried building rakudo in Ubuntu running under Crouton on a Chromebook? :-) 19:37
timotimo i haven't even heard of crouton yet 19:41
dha Allows you to install an actual linux dist on a chromebook. 19:42
timotimo ah, ok
like ubuntu-on-windows10 :P :P :P
RabidGravy I've got a computer called fromage if that counts
dha effectively allows you a dual boot with chromeos and (in most cases, I suspect) ubuntu.
timotimo appreciation of such computers comes from age.
dha RabidGravy - :-)
I was leaving the country and with all the shouting about the government searches of data at the border, I figured I should take something other than my main laptop. 19:44
But didn't want to spend a whole bunch of money on it. This was suggested as a solution, and has mostly worked well.
However, I'm now getting weird permission errors when trying to build rakudo 19:45
*probably* (I'm guessing) because I'm building it on the SD card I've put in it so I have a usable amount of storage. 19:46
dha I'm kind of tempted to just try it with sudo and see if that resolves the issue. 19:47
RabidGravy oh, is the SD formatted as native or fat32?
dha damn good question. I would think I would have formatted it as native, but I no longer remember. 19:48
dha now tries to remember how to determine this. 19:49
RabidGravy it's just on fat32 it might not be able to do somethings to file
mount should tell you 19:50
dha I'd have to unmount it first for that, though, right? 19:53
geekosaur 'mount' without arguments shows you what is currently mounted including fstype 19:54
dha ah.
geekosaur see also /proc/mounts on linux 19:55
dha This is the problem with using things like OS X. You rarely need to deal with this stuff on the command line. :-)
Hm. it's saying fuseblk, which I think means NTFS. :-/ 19:56
dha wonders if this means he is screwed. 19:57
RabidGravy I'm not sure I've got anything I can format to find out 20:00
dha I think, since there's nothing tremendously important on this machine, I may just try sudo and see if that makes the permission problems go away. maybe the sd card thinks I'm not supposed to do stuff with it in some contexts. :-/ 20:03
Yikes. the space in "SD Card" seems to be confusing something, as I'm getting an error that refers to "/var/host/media/removable/SD" 20:07
hobbs some software is stupid.
dha yep.
perlawhirl m: say so Bag(<A P>) ≼ Bag(<A T>) 20:37
camelia True
perlawhirl bisectable6: say so Bag(<A P>) ≼ Bag(<A T>)
bisectable6 perlawhirl, Bisecting by output (old=2015.12 new=cb27bce) because on both starting points the exit code is 0
perlawhirl, bisect log: gist.github.com/bdb03e47065afd5746...675d96d1cf
perlawhirl, (2017-04-03) github.com/rakudo/rakudo/commit/92...382e122777
perlawhirl .tell lizmat Baggy (<+)/(>+) Baggy commit is not working properly: irclog.perlgeek.de/perl6/2017-04-03#i_14370322 20:41
yoleaux perlawhirl: I'll pass your message to lizmat.
lizmat perlawhirl: will look at it after the P6W 20:42
yoleaux 20:41Z <perlawhirl> lizmat: Baggy (<+)/(>+) Baggy commit is not working properly: irclog.perlgeek.de/perl6/2017-04-03#i_14370322
lizmat meanwhile, adding some todoed tests to roast would be appreciated :-)
perlawhirl np
i'm actually really happy you're working on the set_operators... i actually had a commit in mind just shortly before you started your work 20:43
with regards to (elem) and (cont)
lizmat could you gist your idea ? 20:44
perlawhirl Bag's end up being coerced to a Set, which slows things down. could that be broadened to QuantHash?
lizmat that's actually on my list of things to look at 20:45
if we need Set semantics, we don't actually need to coerce Bags to Sets if we can look on the inside :-)
perlawhirl cool... thanks lizat++ 20:46
lizmat wow, a lot happened the past week 21:12
dha That's good in this context, right? 21:13
timotimo yup 21:15
dha whew.
timotimo liz is writing the weekly, so that means we got a good set of things to report
pmurias dylanwh: IO::Path.chdir is being deprecated because it doesn't do what you would expect it to do (it doesn't actually change anything) 21:24
dha In recent times, "a lot happened in the last week" has not been universally a good thing. :-/
lizmat dha: true, and a lot won't be mentioned on the P6W :-) 21:25
dha lizmat - And thank you for that. :-) 21:30
AlexDaniel moritz: hey. I'm trying to fetch IRC logs with :Accept<application/json>, but I am getting this as a response: {"ARRAY(0x34eb040)":"/perl6/ARRAY(0x34eb040)"} 21:34
moritz: something is not right…
AlexDaniel moritz: ah sorry, that's an error on my side 21:37
moritz: the responsy is still weird though…
lizmat and another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2017/04/03/...-advances/ 22:19
nicq Hello o/ 23:39
sammers hello 23:40
AlexDaniel moritz: and still, stuff is not parseable. Here is a gist from #perl6-dev 2017-03-17: gist.github.com/AlexDaniel/aff83ce...a330d0deb9 23:43
[[\"I\", \" \", \"❤\", \"️\", \" \", \"P\", \"e\", \"r\", \"l\", \" \", \"6\"], 10, 6]
»
JSON::Fast says “at 6525: I don't understand the escape sequence \"️” and JSON::Tiny says “Input (13231 characters) is not a valid JSON string” 23:44
not sure if both parsers are wrong or if clog should not output stuff like this 23:45
.tell moritz irclog.perlgeek.de/perl6/2017-04-03#i_14371056 23:46
yoleaux AlexDaniel: I'll pass your message to moritz.