»ö« 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.
tony-o m: (16/4).WHAT.say; 00:09
camelia (Rat)
tony-o m: say (16/4).narrow ~~ Int;
camelia True
Herby_ o/ 00:20
Zoffix \o 00:22
TimToady m: say <16/4>.narrow ~~ Int; 00:24
yoleaux 28 Dec 2017 20:29Z <Zoffix> TimToady: would you be able to clarify what is a ".list"? github.com/rakudo/rakudo/issues/1344
camelia True
TimToady that's the canonical way to write a Rat literal
Zoffix (same for complex: <42+42i>) 00:25
1344 was already clarified; unless you wanted to add anything
TimToady both were specifically added to avoid reliance on constant folding
rjbs . o O ( constant narrowing ) 00:42
perigrin Narrowing intensifies? 00:51
Zoffix Is there a way to apply executable stack once and have it be kept during moar's recompilation? github.com/nxadm/rakudo-pkg/blob/m..._windows10 01:33
Zoffix leont: stresstesting a fix for RT#131700 Pretty sure that fixes your prove6 issue too 02:02
synopsebot RT#131700 [new]: rt.perl.org/Ticket/Display.html?id=131700 [IO] prompt not working on bash-on-ubuntu on win10
Zoffix leont: untested, but probably fixed: github.com/perl6/tap-harness6/issu...-354524009 03:05
I mean, I tested the prompt() aka flushing TTY issue and I assume prove6 problem were the same 03:06
\o
Herby_ \o 05:52
moritz ZofBot: no need to use Ansible if you're not comfortable with it 10:50
yoleaux 29 Dec 2017 11:30Z <Zoffix> moritz: would be nice for perl6feed tweeter to retweet this: twitter.com/zoffix/status/946703693507907584
moritz my plans for Ansible world domination aren't that far along :-)
moritz travelling, and forgot the power supply for the laptop 10:51
so now i have ~1h of quality Internet time remaining for the next ~5 days 10:52
tadzik :( 10:53
TEttinger hooray nature time 10:54
pet cats
time to snuggle random cats
moritz no cats here, just raining cats and dogs :-) 10:55
tadzik this sounds like an adventure from which you come back with a meter-long beard and a changed man
moritz nah, just listing to a few audio books and reading "Working with Legacy Code" :) 10:56
but I did forget my electric shaver as well :D
tadzik :D
quick, if you had to choose between batteries for laptop and the shaver? ;) 10:57
moritz laptop :-) 10:58
afk again, saving power for emergencies :-)
tyil tadzik: you make nice booze :> 11:02
tadzik thanks :) But how do you know? :) 11:08
oh, Nalewkas :)
I started doing beer recently, but it wasn't very widely distributed 11:09
wictory[m] Hi! If I run .Str on a Match object. Is the data copied from the .orig string of the Match object, or is the new Str pointing to the same data? 11:27
lizmat copied, afaics 11:32
wictory[m] Str:s in perl6 are immutable. So if the .orig of a Match is a Str, it should be safe to point a .Str of match to the .orig . 11:38
lizmat yeah, but the .Str of a Match object is much more than just the .orig 11:40
wictory[m] Doesn't .Str of a Match return a string the same as the one that starts at .from and ends at .to from the .orig Str? 11:59
jnthn Exactly what happens depends on backend 12:05
You always get a new Str returned, but as to what's on the inside
MoarVM supports strands, and so it can represent a substring result by a start index and a reference to another string buffer 12:06
So it will point to the original buffer, generally. Not sure if it makes a "is this worth it" judgement though (sometimes it might be cheaper to just copy when the substring is smaller than the amount of space you'd need for the reference and start offset) 12:07
wictory[m] Ok! Thanks for the explanation! 12:17
tyil tadzik: I was at lizmat's place :> 13:15
tadzik tyil: ah, it all fits together now :)
I'm somewhat surprised they still have it after 1 year :D It... evaporates much faster in my place... 13:16
tyil also, general question for #perl6, I have App::Cpan6 to assist in making new modules, my main intent is that it will make me not have to touch the META6.json myself ever, it's at 0.18 now, but I was considering calling it assixt (because it has a six in the name), which name would you guys all think is more fitting? repo is here: github.com/scriptkitties/perl6-App-Cpan6 13:18
tyil tadzik: they have millions of bottles of booze :p 13:18
lizmat that's probably four 0's too many, but yeah :-) 13:34
geekosaur sounds like my parents. (me, I just don't bother accumulating what I'm not going to drink. but then I don't have much to do with the social aspect which iirc is how my parents ended up with so much booze despite barely drinking...) 13:36
lizmat well, generally it's the sign of an alcoholic: not having any alcohol in the house (because it will be drunk immediately) 13:37
that's why we hardly ever have any chocolate at home :-)
lelf why “zef search” ≠ modules.p.o result? 13:38
lizmat because of a bug? 13:39
geekosaur or because the metadata in something on modules is wrong, possibly 13:40
so zef skips it
lelf …and the proceed to install it just fine? ;) 13:42
geekosaur metadata's about finding, not installing. if you point it directly at something then it doesn't need to find it. or if you list then it needs more information than just a path and dependencies (it doesn't, for example, need to care much about the author; but if you're running list, you might care) 13:44
lelf just occured to me that “zef list ” seems to do match modules.p.o 13:51
well, zef list | grep
user100500 ;; in signatures how does it work? Can you give an example? 14:43
MasterDuke user100500: i don't know much about it, but it is used in some core Rakudo code. see github.com/rakudo/rakudo/blob/mast...r.pm#L1413 and the next couple .split multis for an example 14:53
user100500 MasterDuke: docs.perl6.org/type/Signature#inde...Long_Names here is an example, but I do not understand how it works. 15:00
geekosaur I am trying to figure out if you actually mean 'how it works', or 'what it does' 15:03
"how it works" is the dispatcher just doesn't pay attention to parameters following that one for deciding which multi candidate to use 15:04
geekosaur and what it does is basically say that the following parameters can be used to "fine tune" behavior, but not to pick which implementation / candidate to use. this is not quite the same thing as the parameter being optional, as some kinds of "fine tuning" might simply not apply in some cases, but you don't want to error out if they are present so that all the forms of some function/method are basically compatible 15:06
or because you know they might or might not be there, but they're always acceptable and there's no point slowing down dispatch to check for a bunch of optional stuff that shouldn't make a difference in which candidate is called 15:07
MasterDuke m: multi sub a(Int $a;; Int $b) { say "Int multi" }; multi sub a(Int $a;; Str $b) { say "Str multi" }; a(1, 3) 15:10
camelia Ambiguous call to 'a(Int, Int)'; these signatures all match:
:(Int $a;; Int $b)
:(Int $a;; Str $b)
in block <unit> at <tmp> line 1
MasterDuke user100500: ^^^ that's not a great example, but you can see that it's an ambiguous call, even though the `$b` parameter is an Int, not a Str 15:12
user100500 m: multi sub f(Int $i, Str $s;; :$b) { say "$i, $s, {$b.perl}" }; multi sub f(Int $i, Str $s, :$b) { say "$i, $s, {$b.perl}" }; f(10, 'answer'); f(10, 'answer', :b(100)); 15:13
camelia 10, answer, Any
10, answer, 100
manchicken Okay, I messed something up: modules.perl6.org/search/?q=fcntl 15:21
It's showing up twice. 15:22
And I screwed up the meta.
timotimo no problem, just kick it out of the perl6/ecosystem META.list 15:25
manchicken It's OK, I also found some pretty big misses. 15:30
S_ISREG() and its kin are all missing. 15:31
Gonna have to use NativeCall for those.
manchicken Is there any place where we document the way NativeCall handles file handles? 15:46
timotimo file handles are just integers 15:48
well, usually
jnthn Indeed, and call .native-descriptor on a Perl 6 file handle to get the value to pass 15:51
Herby_ Whats a quick way to print out the keys in a hash, just to see whats in there? 17:13
jnthn dd %hash.keys
Herby_ thanks :) 17:14
Herby_ pastebin.com/6mVBgy7p 17:25
I think I'm missing a basic principle when it comes to arrays 17:26
geekosaur no, your're just missing a level 17:27
hm, no
Herby_ I keep missing whatever it is every time I deal with a json response
timotimo i bet it's the list assignment to @repo_dicts
geekosaur but in the first oine you are assigning an item of some kind containing a 30-element list
timotimo needs to have a .list on the RHS, or be @($response_dict<items>) 17:28
geekosaur and in the second you are seeing exactly that one item
[] after the [0] might work too?
timotimo or using binding instead of assignment (if it's okay that both are now the exact same object) 17:29
Herby_ adding .list to the RHS did work
i've been banging my head on that for a while 17:30
that principle
geekosaur: adding [] after [0] returned 72, oddly enough 17:31
geekosaur huh 17:32
Herby_ @repo_dicts = $response_dict<items>[0][]
Perl6 Hi all 17:35
Herby_ o/ 17:36
Perl6 I have a problem where I have a loop which loops through an array, and a loop inside of that loop which further loops inside the array. I want the values from the second loop to get multipled together and taken outside all loops, but I can't get this to work? 17:37
Perl6 Sorry if that was confusing :P 17:40
lizmat
.oO( Loop di Loop )
17:45
Perl6: could you gist an example ?
Perl6 lizmat: Sure, I can post the code but I'll need a bit of time to clean it up 17:49
lizmat that would allow us to help you better :-)
Perl6 pastebin.com/eaXgN6eV 17:56
By the way, this is my attempt at Project Euler problem 11. I counted that, to go 4 numbers down, you go down 20 each time, so the loop does that 4 times. If this works, I will be adding more loops, to loop 21 forward to get the diagonals 17:58
lizmat well, one problem is that you do "my $somme" both inside as well as outside of the inner loop 17:59
so it won't actually add it up outside of the loop
Perl6 Oh, but I thought doing *= would multiple the existing value by the value after *= 18:02
lizmat just remove the "my" in the inner loop 18:04
lizmat same for the "my @tableau_de_nombre_final.push($somme);" in the outer loop 18:05
MasterDuke Perl6: not addressing your problem here, but FYI, your first six lines could probably be shortened to `my @numéro_nouvelle = slurp("DIR").words.map(+*)` 18:06
Perl6 lizmat: Ah, of course, I'm redeclaring the variables every time it runs 18:10
lizmat yup 18:11
since they are in different scopes, you don't get a warning for nit
*it
Perl6 MasterDuke: Maybe for the future. I like to at least understand my code a bit :D
Okay guys, I'll work more on this code and report back the results later. Thanks lizmat! 18:12
manchicken Well poop. I have to implement some of POSIX in order to get Fcntl done fully. 18:32
Namely, `stat`.
MasterDuke .ask manchicken have you seen the nqp::stat op? github.com/perl6/nqp/blob/master/d...kdown#stat 20:28
yoleaux MasterDuke: I'll pass your message to manchicken.
Zoffix .tell manchicken but note that there's no user support for nqp. It can be changed without notice. And stat op in particular is aching to be changed to a more performance friendly alternative (tho that still might come out in a form of a separate op) 20:59
yoleaux Zoffix: I'll pass your message to manchicken.
jstuder hey fellow 6ers, i'm writing some tests and have a quick question 21:22
is there a not-isa-ok? 21:23
jstuder or should I use nok in conjunction with .isa or ~~ ? 21:23
not sure what the idiomatic way to do it is
Zoffix m: use Test; cmp-ok 42, '~~', Num 21:24
camelia not ok 1 -
# Failed test at <tmp> line 1
# expected: Num
# matcher: 'infix:<~~>'
# got: 42
Zoffix m: use Test; cmp-ok 42, '!~~', Num
camelia ok 1 -
Zoffix m: use Test; cmp-ok 42, '!~~', Int
camelia not ok 1 -
# Failed test at <tmp> line 1
# expected: Int
# matcher: 'infix:<!~~>'
# got: 42
Zoffix That's how I'd write it
(the last two, with `!~~` as matcher)
jstuder ok sounds good
thanks
there are a lot of options 21:25
Zoffix m: use Test; cmp-ok 42.WHAT, '!~~', Int
camelia not ok 1 -
# Failed test at <tmp> line 1
# expected: Int
# matcher: 'infix:<!~~>'
# got: Int
Zoffix ^ or maybe that; this way it shows you what it `got` more clearly 21:26
Zoffix Not ideal still, since you have to make an extra step of parsing that matcher is a negated op, but IMO better than just a `nok` test that gives you a Pass/Fail without telling you what you got 21:27
jstuder yeah that's true
much better to know why you failed
thanks 21:28
manchicken So yeah, `Fcntl` that I released yesterday is just the constants. 21:29
yoleaux 20:28Z <MasterDuke> manchicken: have you seen the nqp::stat op? github.com/perl6/nqp/blob/master/d...kdown#stat
20:59Z <Zoffix> manchicken: but note that there's no user support for nqp. It can be changed without notice. And stat op in particular is aching to be changed to a more performance friendly alternative (tho that still might come out in a form of a separate op)
manchicken MasterDuke, I hadn't seen that. 21:30
Do you know if that stuff is POSIX-compliant? 21:31
MasterDuke not sure. i would guess pretty close at least 21:33
i think it uses libuv under the hood 21:34
manchicken When I see "Fcntl" and "POSIX" on the wishlist, I interpret that as meaning that we want them to be full implementations of those in an idiomatically correct manner. That _seems_ to me that we should make them compatible for the most part. 21:41
Zoffix FWIW, there's already a module named POSIX, although it provides just a couple of routines 21:42
manchicken The `stat()` NQP opcode seems to require you to make multiple calls to get the full stat.
Zoffix eco: POSIX
buggable Zoffix, POSIX 'POSIX - Perl interface to IEEE Std 1003.1': github.com/cspencer/perl6-posix 2 other matching results: modules.perl6.org/s/
Zoffix manchicken: yes, that's why I mentioned it might get changed
manchicken Well poo. Why can't people update the wishlist then? 21:43
Well, do we even think that the Fcntl implementation was useful?
Zoffix manchicken: but any self-respecting module wouldn't be using nqp, because there's no support for it
manchicken Cool.
Zoffix (I'm a hypocrite in my own modules, just because I think I'm in-the-loop with respect to nqp changes :P)
greppable6: 'use nqp' 21:44
greppable6 Zoffix, No! It wasn't me! It was the one-armed man! Backtrace: gist.github.com/9ea6363da06d3f8e80...8c53e610c9
Zoffix greppable6: 'use MONKEY-GUTS'
greppable6 Zoffix, No! It wasn't me! It was the one-armed man! Backtrace: gist.github.com/6265fc43cb7211747e...025a1a69c7
AlexDaniel uhhh
manchicken So it sounds like I need to stop making my own `POSIX`, should instead extend cspencer's module, and then make the `Fcntl` module depend on it. No?
AlexDaniel ahh I see
Zoffix manchicken: sounds like a plan 21:45
manchicken Since there's no more built-in `stat()` function, it seems like the only course of action is to use the one offered by `POSIX`.
Does anybody have cause to suggest I _shouldn't_ do it that way? 21:46
These lower-level modules have a lot of reading involved.
I'm happy to do them, but if there's a better use of my time I'd love to shift focus. 21:47
manchicken Either way, I'd like to get a new version of `Fcntl` out there since I screwed up the docs. 21:47
Geth perl6-most-wanted: 51883945c5 | (Michael D. Stemle, Jr)++ | most-wanted/modules.md
Adding WIP for POSIX
21:50
manchicken Added the POSIX module as WIP since it seems like it's already there.
manchicken Is cspencer someone who frequents here? 21:56
manchicken This module is 2 years old... 21:58
MasterDuke manchicken: last seen here by that nick in 2012, irclog.perlgeek.de/perl6/search/?n...cer&q= 22:29
manchicken Oof
OK.
Well, I shot an email.
doesn't seem like this module is actually a WIP anymore.
manchicken It has something, though, and something being infinitely better than nothing means I'll start adding to it rather than starting over. 22:30
user100500 Socket (UDP) - how to get a response from the server to the client? 22:32
alenasz hi 23:15
where is perl 6 document in pdf ? 23:16
MasterDuke .tell alenasz i thought it was already available somewhere, but don't remember where. anyway, you could download docs.perl6.org/perl6.xhtml (all docs in one page) and then use a PDF converter on in 23:21
yoleaux MasterDuke: I'll pass your message to alenasz.
AlexDaniel why :S 23:37
whenever someone wants a PDF version of something I just hit “Print…” button in any browser
that just created 613 pages of stuff for the perl6.xhtml page 23:38
timotimo wow, that's a lot of stuff in total 23:56
how many pages are dead weight?