»ö« 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.
00:09 kurahaupo_ joined 00:10 kurahaupo left 00:14 lambd0x joined 00:18 lambd0x left 00:23 freezerburnV joined 00:36 pierrot left 00:38 jameslenz joined, jameslenz left 00:46 cyphase joined 01:11 zacts left 01:12 Actualeyes joined
dalek Heuristic branch merge: pushed 826 commits to doc/rb-nutshell by awwaiid 01:13
01:18 araujo_ joined 01:20 kalkin-_ joined, kalkin- left, kalkin-_ is now known as kalkin- 01:22 araujo left 01:25 cdg left
dalek c: d55ec68 | (Brock Wilcox)++ | doc/Language/rb-nutshell.pod:
Initial rb-nutshell, WIP
01:32
c: 84aa6a0 | (Brock Wilcox)++ | doc/Language/rb-nutshell.pod:
Document basic object orientation

Document sub form of make()
01:32 dalek left 01:33 dalek joined, ChanServ sets mode: +v dalek 01:45 Actualeyes left 02:04 kid51 left 02:07 lizmat joined, Actualeyes joined 02:14 noganex_ joined 02:15 woolfy joined 02:17 noganex left, ssotka left 02:27 Bodger1234 left, sufrostico joined 02:38 freezerburnV left 02:45 cyphase left 02:49 cyphase joined 02:51 sufrostico left 02:58 Zoffix joined
Zoffix What exactly is WHO for? I'm trying to understand what this line does: $cur_GLOBALish.WHO.merge-symbols($comp_unit.handle.globalish-package.WHO); 02:59
The docs just say "Package supporting blah blah" but I don't get it...
The $cur_GLOBALish.WHO gives GLOBAL... I don't see a GLOBAL file anywhere in rakudo. How would I find where .merge-symbols is defined? 03:01
And why use WHO instead of just calling $cur_GLOBALish.merge-symbols($comp_unit.handle.globalish-package);
Zoffix said WHO too much and now it became a meaningless word :o 03:02
Hm, I think I know where to get that info: github.com/edumentab/rakudo-and-nq...p;q=global 03:04
03:17 cyphase left 03:22 cyphase joined, [Sno] left, [Sno] joined 03:24 tadzik left, tadzik joined 03:26 erdic left 03:27 erdic joined
jdv79 what is this cow method? 03:29
Zoffix Copy on Write 03:31
jdv79 i know what cow is in general but isn't that the wrong layer to do that at? 03:32
lizmat jdv79: on what layer should that be done then? 03:36
geekosaur no, because it has to be done at the layer that knows what parts must be CoW and what parts must remain private. (for example, in a hash, you would CoW the keys and values, but CoW-ing the hash table itself or its buckets will generally cost you more than any benefit)
...that example assumes a perl 5-style hash, I don't know the implementation details offhand for perl6 03:37
03:39 huggable left 03:40 huggable joined 03:42 TakinOver left
jdv79 i would have thought the vm level would be better apt to do that sort of thing cause cow is a mem mgmt technique 03:45
geekosaur similarly, copy on write is common in filesystems, but it's only done with data blocks, not metadata (on unix this is indirect blocks, the inode, ACLs, etc.) because the overhead isn't worth it. some RAID configurations "push this down a layer" but changing the metadata is a well known source of performance bottlenecks
03:45 mohae left
geekosaur even though "in theory" it's best done at that lower layer 03:46
(this is massive oversimplification, esp. since RAID is not used for COW, just duplication; many of the issues are the same though) 03:52
03:55 perl6472 joined
lizmat whether it should be called .cow or not, it is a intermediate form between binding and assigning 03:57
which can be useful when doing functional programming
specifically if you don't really want to copy large chunks of data 03:58
geekosaur right. in the FP context, if you treat *all* data values as pure then you can push CoW down to the memory management layer; mutability introduces complications, which are a PITA to deal with at that layer. since the upper layer in perl 6 is OO, it makes sense to deal with mutability at that layer instead 03:59
04:00 perl6472 left
geekosaur for example, mutable arrays get special treatment so they don't cause extra copying (instead of handling either the whole array or individual values, each of which has different pathological overhead, CoW is done in segments --- and now the lower layer has to know about mutable arrays and track that extra information for them) 04:02
uh, I'm using ghc (Haskell) as the example for that example, not trying to say what p6 does. 04:05
04:07 ssotka joined
geekosaur actually I got that wrong, it's the immutable arrays that have the most pathological behavior if you treat them the same as other immutable data 04:09
04:09 mohae joined, mohae left 04:14 mohae joined 04:24 _28_ria left 05:01 Cabanossi left 05:04 Cabanossi joined 05:06 cyphase_eviltwin joined 05:08 cyphase left, cyphase_eviltwin is now known as cyphase 05:14 skids left 05:17 kerframil left 05:29 cyphase left 05:47 araujo_ left, araujo joined 05:50 ssotka left 05:53 CIAvash joined 06:08 mr-foobar left 06:09 cyphase joined, mr-foobar joined 06:14 _mg_ joined 06:16 cyphase left
nine Zoffix: GLOBAL is a Stash. There you will find merge-symbols 06:23
06:25 [Sno] left 06:26 sno joined
nine Zoffix: "git grep merge-symbols" could have answered your question 06:27
06:33 domidumont joined 06:34 darutoko joined 06:36 abraxxa joined 06:37 cyphase joined 06:38 domidumont left 06:41 abraxxa left 06:42 abraxxa joined 06:50 domidumont joined, brrt joined 06:52 domidumont left 06:54 domidumont joined
sammers good afternoon from Japan 07:09
07:11 brrt left
moritz good morning sammers :-) 07:13
sammers morning moritz
I've been watching the new YAPC NA talks 07:14
everytime I see one of these p6 talks I think about how clunky my p6 code is. 07:15
07:15 brrt joined, brrt left
moritz sammers: that happens to me too 07:16
sammers ha, really liking p6 though 07:17
moritz speakers tend to polish their code a lot before putting it on the slides
not just to show off, and to make it easier for the audience, but also because it just sucks to present a wall of code
07:18 zakharyas joined
sammers yeah, I am glad they do it too. do you know if anyone is working on a "style guide" for p6 that focuses on one paradigm or another? I know there are many ways to do different things, but I would like to read more about preferences of some of the people who have worked closest to p6. 07:19
moritz sammers: not really. masak++ and I have started collecting some practises, but it's not much yet, and more PBP-style than style guide: github.com/moritz/perl6-wtop 07:21
sammers ooh, this is cool..
07:22 cyphase left
sammers I will keep it bookmarked 07:22
moritz also, the question has come up at least once before in the past week 07:23
maybe it's time to add some more stuff
07:23 Actualeyes left
sammers I think it would really help in drawing more people to p6 07:23
07:23 maddingu1 is now known as maddingue 07:26 cyphase joined 07:29 sno left, RabidGravy joined 07:31 domidumont left 07:32 domidumont joined 07:34 cyphase left 07:36 Actualeyes joined 07:38 cyphase joined 07:39 huggable left 07:40 huggable joined 07:51 lizmat left 07:54 lizmat joined
sammers anyone here familiar with Proc::Async? 07:54
moritz a bit 07:56
07:57 mr-foobar left, dakkar joined
sammers ok, is it safe to do something like: Proc::Async $p .= new: $?FILE; 07:58
what I am trying to do is spawn a new process of the same script
moritz well, you have to take care that you don't run into infinite recursion 07:59
and it needs to be executable, have a shebang etc.
otherwise, I don't see a problem
sammers yeah, got that part taken care of... it is spawning a Bailador app 08:00
are there better/other ways to spawn another process/thread of the same script / module? 08:02
maybe without loading everything in a completely separate process 08:03
nine sammers: I wonder what you actually need that process for? 08:04
sammers ok, so I am working on a simple static site generator, part of it uses a Supply to watch directories for changes, and another part loads a web server to watch the static build directory. 08:05
when the files change I reload the Bailador process 08:06
so the process is like: watch directory for changed, detect changes, re-render static files from mustache templates, restart static web server 08:08
anyway, it works using Proc::Async just fine.
bailador's baile blocks so I can use it inside of my Supply / react 08:09
so I just created a simple module that wraps / creates a bailador app and starts baile 08:10
08:10 Actualeyes left
sammers it would be nice if bailador had a way to tell it to refresh its files without restarting the process 08:11
or some async way to restart it 08:12
moritz I don't think we have a way to reload modules inside the process 08:13
sammers is there anyway to initialize a module as a separate thread?
gfldex sammers: yes, but expect segfaults (for now) 08:14
let me find you a link
sammers: github.com/gfldex/pod-to-bigpage/b...age.p6#L51 08:15
sammers thanks
gfldex sammers: and that's a much an implementation detail as they get 08:16
08:17 rindolf joined 08:19 TEttinger left
tadzik so I have a code that seems to have broken overnight 08:20
gist.github.com/tadzik/1f0d9ac127f...8fa0cd7d56
m: gist.github.com/tadzik/1f0d9ac127f...8fa0cd7d56
camelia rakudo-moar 4b257a: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤ in method new at <tmp> line 5␤ in block <unit> at <tmp> line 10␤␤»
tadzik any ideas?
(overnight being: about 2-3 weeks)
moritz bisectable: class User { has $.username is required; method new(*%args) { my $obj = self.bless(*, |%args); return $obj; } }; User.new(username => 'foo'); 08:21
tadzik \o/
moritz bisect: class User { has $.username is required; method new(*%args) { my $obj = self.bless(*, |%args); return $obj; } }; User.new(username => 'foo');
tadzik moritz++
bisectable moritz: (2016-06-12) github.com/rakudo/rakudo/commit/4179bdc
tadzik //o\
I even guesstimated the date correctly 08:22
so, I assume my code is perfectly fine, and perhaps we need a spectest for this so it doesn't get broken by accident?
sammers gfldex: ok, thanks. I will play around with it.
08:22 sno joined
moritz still works on 2016.05-6-g2c45068 08:23
m: class User { has $.username is required; method new(*%args) { my $obj = self.bless(*, |%args); return $obj; } }; User.new(username => 'foo');
where have all the botlets gone, long time pahahasing...
camelia rakudo-moar 4b257a: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤ in method new at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
tadzik after all this years, I finally found a proper use for my own tool: I need a "production" rakudo installation in rakudobrew that won't break my stuff :) 08:24
moritz tadzik: just remove the *, from the bless call 08:25
tadzik moritz: that gave me a segfault,iirc
moritz tadzik: that wasn't necessary for about two years now, and only continued working by accident
m: class User { has $.username is required; method new(*%args) { my $obj = self.bless(|%args); return $obj; } }; User.new(username => 'foo'); 08:26
tadzik ah
camelia ( no output )
08:26 Actualeyes joined
tadzik hrm 08:26
my segfault must be somewhere else, the isolated case works indeed 08:27
no, it's in that bless() call 08:28
moritz that's weird. 08:31
(I guess you know that if it doesn't contain more logic, the new method is useless)
tadzik I'll see if I can debug further
yes, yes 08:33
it does contain in the real-world example :)
08:33 mrf joined, mrf left
tadzik gist.github.com/tadzik/6eaf3d7181f...9d41736d64 here's the properly segfaulting example 08:33
08:36 zxd joined 08:41 cognominal joined 08:44 araujo_ joined 08:46 araujo_ left 08:47 araujo_ joined 08:48 araujo left
zxd perl 6 is not written in C ? I am confused about perl6.org/compilers/ that says 'Perl 6 is a language specification' 08:48
08:48 araujo_ left 08:49 araujo_ joined
nine zxd: Rakudo Perl 6 is mostly written in Perl 6. Partly also in a subset of Perl 6 called NQP and tiny bits of C code. 08:49
DrForr_ zxd: You're confusing the map for the terrain. Perl 6 is a language spec, perl6 is the compiler. Yes, having a spec before implementation is a departure from Perl 5. 08:50
cognominal There is also the MoarVM backend which is written in C
zxd why does it run on a virtual machine? 08:54
moritz it needs something that manages its memory, for example
it's a "virtual machine" in the same sense that JVM is one, not in the VMWare/Virtualbox/KVM-Sense 08:55
08:55 araujo_ left
zxd like erlang? 08:56
nine zxd: there are actually only few languages in use that don't run on a virtual machine. Perl 5, Python, Javascript, Java, C#, Haskell and many more run on VMs. You notice it when the compiler's output is not an executable.
moritz yes
zxd but from java experience running on virtual machines is always slower
than C interpreter compiled into machine code directly 08:57
no?
moritz no
if you compiled Perl 6 code to C, it'd still have to do all the things that the VM does now
like garbage collection 08:58
compiling to C doesn't make the problems go away that the VM solves
nine zxd: also even Java can be very fast. It's just that most Java code is written in a way that makes it hard for the VM to optimize. 08:59
konobi even the machine code will tend to be ganerated from JIT 09:00
moritz another factor that contributes to Java's perceived slowness is the startup time 09:01
which MoarVM doesn't suffer from
for example NQP is a very simplistic Perl 6 implementation used for bootstrapping, and it also uses MoarVM. It starts in 35ms on my machine 09:02
konobi well that and setting up the JVM is a secret black art in itself 09:03
moritz and calling moar directly with no argument takes about 2ms
(though that only produces an error message, so dunno how interesting that case is)
konobi moritz: oh! queue.acm.org/detail.cfm?id=2927301
support on other platforms is improving a lot 09:05
09:42 pmurias joined
pmurias moritz: isn't Java actually really fast but it's just the startup time (and AFAIR slow UI libraries in the past) that makes a bad impression? 09:43
jast in my experience, startup time and memory usage (which, sometimes, implies significant GC overhead) 09:50
side note, one advantage of a VM-based language implementation is that the VM, in theory, can optimize the code at runtime using information that would not be available at compile time, e.g. call tree statistics 09:52
pmurias jast: VM-based as opposed to directly-to-native code one? 09:58
10:00 g4 joined 10:06 andreoss joined 10:08 iH2O joined 10:09 iH2O left 10:15 mr-foobar joined
jast pmurias: yes. it's one of the arguments I've seen a lot for why VMs have potential of actually being better than direct-to-native 10:18
I'm not sure there's a real understanding of where the limits of each approach are, but it's a decent argument at the very least 10:19
10:28 kid51 joined
pmurias jast: being (significantly) better for C++/C is the thing that's in the future, they are already better for JavaScript 10:31
jast javascript doesn't lend itself to too much knowledge at "compile time", I guess 10:32
10:37 bjz joined
Zoffix nine, yeah, that was my original strategy. Actually now I think I confused myself with looking at merge_globals (that merge-symbols calls) and wondering how .WHO can return two values. 10:37
I guess debugging at midnight isn't such a good idea. Regretting staying up that late now for sure :( (6:30AM and I gotta go to work) 10:38
andreoss is there a way to make rakudo configure stripts honor variables like CC, AR, MAKE etc.? 10:41
nine Zoffix: I've learned that lesson the hard way, too :( 10:42
10:44 melezhik joined
melezhik Hi folks! 10:45
A question concering modules.perl6.org/ updates
I have a perl6 module get listed here, and wonder how often it's update from gthub source code
10:45 daxim left 10:46 kaare_ joined
melezhik I have made some commits today into github.com/melezhik/sparrowdo 10:46
llfourn melezhik: I think our module system pulls directly from GH
moritz that's correct
gfldex it does, in fact there is no other place to store them right now
melezhik Ahh , I see!
Zoffix melezhik, IIRC panda fetches from the repo directly and zef has its own copy, tho not sure of often it's updated. ugexe would know
timotimo correct, modules.perl6.org only updates based on the META.list
melezhik now it is ok 10:47
thanks
jnthn jast: Optimizing code based on information available at runtime is exactly how MoarVM's optimization works, fwiw. :-) See jnthn.net/papers/2014-yapceu-performance.pdf from slide 37 on
jast good to hear :}
10:48 bjz_ joined 10:49 bjz left 10:50 abruanese left
Zoffix And modules.perl6.org website data itself updates about every ~2 hours You can see build progress at modules.perl6.org/update.log 10:52
With cron set to run at 20m and 40m (aborting if the previous job is still running)
10:53 abruanese joined
melezhik Zoffix: - thanks! 10:53
llfourn melezhik: sparrow looks cool. 10:55
I am actually developing something similar in p6
melezhik llfourn: thanks , interesting, want to cooperate? ;)) 10:56
llfourn melezhik: I will certainly let you know when I have something demo-able :)
melezhik llforun: here is some exmaples - just to take it for a spin - github.com/melezhik/sparrowdo-test 10:57
llfourn: sure
;)
llfourn I will do thant. Cheers.
10:59 _mg_ left 11:00 dvinciguerra_ joined 11:01 darutoko left 11:02 daxim joined 11:10 telex left, darutoko joined 11:12 tlvb| joined, telex joined
Roamer` jnthn, I guess you may've had this already, but just out of curiosity: why did you write an /etc/passwd and /etc/group parser, when you knew that they might not be authoritative / full? :) (you even mention that in the Unix::Groups docs :)) 11:13
was there some kind of performance problem with getpwent()/getgrent()?
11:20 yqt joined 11:31 abruanese left 11:32 abruanese joined 11:34 kurahaupo_ left 11:39 huggable left 11:40 huggable joined
jnthn Roamer`: Um, I've written plenty of parsers but I don't recall writing one fo rthat... 11:41
Roamer`: Maybe you're confusing me the author of github.com/jonathanstowe/Unix-Groups ? :) 11:42
*with the
(Who goes as RabidGravy on this channel)
RabidGravy wah
sorry a bit sidetracked by poltical events for the last two days 11:44
moritz do you live in the UK?
RabidGravy yeah 11:45
moritz my condolences
11:45 kid51 left
RabidGravy well you know that old saying "may you live in interesting times" 11:46
gfldex for the next 2 years not much will happen
11:46 _mg_ joined
moritz I'm not so sure 11:46
already the MP has resigned 11:47
there will be a new one
gfldex in 3 months
moritz Scotland will act on its own
gfldex the Scots believe their parliament got a veto right on the leave vote
moritz and if English politians don't want to leave, and want to save their face, they could use that veto as a pretence 11:48
11:48 KillBill joined
gfldex indeed 11:48
andreoss `gld: ./libmoar.so: dlopen: invalid version 3 (max 0)` 11:49
gfldex RabidGravy: besides, there is still time to smuggly you out. see: i.chzbgr.com/full/8810837760/hCC5CFAE1/
11:49 bjz joined
andreoss it almost compiled 11:49
RabidGravy Roamer, the reason I made that like that was because I wanted something really quite quickly as a PoC for Object::Permissions and I reviewed the getgrent stuff across POSIX/Linux/BSD and concluded that it would require a C wrapper to make it useful and anticipated that someone would do that sooner than they have :)
11:51 bjz_ left
gfldex moritz: what Enlglish polititians don't want does matter. The City of London doesn't want to UK to leave, so it's not gonna happen. 11:51
11:51 KillBill left
RabidGravy gfldex, if I wasn't personally quite upset by the result, this would be an entertaining political and social drama 11:51
moritz gfldex: I'm curious how it'll play out. I don't know eough about the power structure to trust that statement either way 11:53
andreoss i see MoarVM has solaris option for --os, does it mean that MoarVM should build on solaris? 11:54
RabidGravy what with the opposition party completely imploding in internal fighting that has been going on for years, the tory party still divided along the europe axis, third actors outside partliament
hahainternet so, picking the last element of a long but finite sequence seems to result in the full sequence being iterated
RabidGravy truly gripping stuff if one enjoys watching politics
hahainternet but for all of these sequences, the generation could easily be reversed
and the final elements picked off efficiently 11:55
am i wrong here? or should i try and make my first pull request (in about 8 months when i find time!)
psch hahainternet: i'm not sure every sequence is generatable in reverse 11:57
i mean, maybe it works for arithmetic and geometric ones, but even for those i'm not really confident in my math to say it does 11:58
add to that the fact that the end point might well a be a thunk, which means you don't even have an actual end point value to start from... 11:59
m: my @a = 1, 2, { $^a + ($a.is-prime ?? 1 !! $^b) } ... * > 100; say @a
camelia rakudo-moar 4b257a: OUTPUT«[1 2 3 3 4 4 8 12 20 32 52 84 136]␤»
Roamer` jnthn, RabidGravy, yeah, really sorry for the names confusion! 12:00
hahainternet psch: even without the endpoint, you have a bound you can begin from and i think the ones i looked at were doable
i'll double check :)
psch m: my @a = 1, 2, { $^a + ($a.is-prime ?? 1 !! $^b ** 100) } ... * > 100; say @a 12:01
camelia rakudo-moar 4b257a: OUTPUT«[1 2 1267650600228229401496703205377]␤»
psch what's the bound..? :S
12:01 vike1 left
hahainternet psch: i was talking about block-less sequences, sorry i didn't make that clear 12:01
psch hahainternet: maybe Ranges? i.e. infix:<..>, not infix:<...>? 12:02
hahainternet psch: nah geometric sequences for example
Roamer` RabidGravy, yeah, I guess I'm so used to the idea that getgr* and getpw* are in the POSIX module that I didn't bother to check whether they were there when you wrote that
hahainternet ranges are already a solved problem i believe
psch hahainternet: alright, yeah. as i said, my math doesn't lend itself to a confident statement about geometric and arithmetic sequences
Roamer` RabidGravy, but then I have a really deep, pervasive, and stubborn background as a POSIX C programmer that I'm used, nay, addicted, to the low-level stuff that most people find awkward :) 12:03
psch hahainternet: although that narrow an optimization makes me kind of wary, i.e. "why is infix:<...> so slow when i tell it what exactly to do?"
Roamer` RabidGravy, and, yeah, I know that this is a problem :)
hahainternet psch: it's already slow under the same cases though, this is just an optimisation for a specific case
psch hahainternet: right. i'm not generally opposed :) 12:04
hahainternet it's nothing of any major importance, but maybe i can actually be helpful for once
12:07 vike1 joined, andreoss left 12:19 mohae left 12:28 skids joined, Bodger1234 joined 12:31 skids left, g4 left 12:34 rindolf left
RabidGravy Roamer, sorry I was just composing a diatribe about the collapse of the parliamentary opposition in the UK. Yeah, please feel free to implement a Unix::Groups::POSIX or something (or add this to the POSIX module or something :) 12:34
12:34 perlpilot joined 12:39 zxd left, zxd_ joined 12:41 rgrinberg joined
awwaiid yay! The nutshell guide for Rubyists->Perl6istas is online! doc.perl6.org/language/rb-nutshell . I like how now that I see it IRL there are a ton of changes to make. 12:45
12:46 colomon left 12:47 Sgeo_ left 12:48 colomon joined 12:54 sufrostico joined 12:57 pmurias left 12:59 pmurias joined 13:04 melezhik left 13:09 pierrot joined
hahainternet awwaiid: looks good, i've passed it around a little 13:09
13:13 abraxxa left
tlvb| is this installation method outdated?: rakudo.org/how-to-get-rakudo/#Insta...Rakudobrew ...at first (when panda install Task::Star) got an error regarding ssl, which I got past by manually installing IO::Socket::SSL, however now I get an error about panda not finding Mast::Frame 13:16
13:17 tlvb joined
timotimo can you paste your log? Mast::Frame isn't something you should be able to get errors about 13:18
and by paste i mean onto a pasting website, of course
13:20 g4 joined 13:21 Actualeyes left
tlvb| timotimo: console output: pastebin.com/raw/mkKx6Knv 13:22
timotimo this isn't the jvm backend for rakudo, is it? 13:23
the "expected MAST::Frame, but didn't get one" error comes from inside the compiler 13:24
13:24 abraxxa joined
timotimo as in, something's triggering a bug in the compiler 13:25
13:26 jmark joined 13:27 g4 left
tlvb| I haven't consciously configured anything to choose anything specific, just git-cloned github.com/tadzik/rakudobrew...rakudobrew build moar...rakudobrew build panda 13:27
timotimo OK, that's not jvm, then 13:28
i can't reproduce the error locally, sadly
13:29 ZoffixMobile joined
ZoffixMobile tlvb|, just to be clear: Task::Star is simply a collection of modules (and in my personal opinion a horrible one). You don't need its successfull instalation to "get perl 6". Simply install individual modules as you need them. 13:31
timotimo that's right
13:31 Sgeo_ joined 13:33 abraxxa left, abraxxa joined
tlvb| huh, I got the impression that there would be some good-to-have-tools as well 13:36
allright, thanks for the help 13:37
masak awwaiid: "If you leave out the quotes, then Perl 6 expects $methodname to contain a `Routine` object, rather than the simple string name of the method."
ZoffixMobile tlvb|, you can install whatever you need individually. Here're the Task::Star contents: github.com/tadzik/Task-Star/blob/m.../META.info 13:38
masak awwaiid: says "Method", should be "Routine"
ZoffixMobile just run panda install one-of-the-dist-names-from-depends-section
masak m: my $say-negative = sub($n) { say -$n }; 42.$say-negative() 13:39
camelia rakudo-moar 4b257a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$n' is not declared␤at <tmp>:1␤------> 3my $say-negative = sub(7⏏5$n) { say -$n }; 42.$say-negative()␤»
masak m: my $say-negative = sub ($n) { say -$n }; 42.$say-negative()
camelia rakudo-moar 4b257a: OUTPUT«-42␤»
masak awwaiid: ^
psch masak: isn't that what the text says? $say-negative is a Routine, but if you put "" around it has to be the name of a method 13:40
timotimo it thinks you're calling "sub" there
psch masak: ooh, what you pasted is the correction, isn't it
masak yes
13:40 colomon left
masak sorry, that was confusing :) 13:40
I'm a bit tired
13:41 Actualeyes joined
ZoffixMobile m: 42.(0 - *)().say 13:41
camelia rakudo-moar 4b257a: OUTPUT«No such method 'CALL-ME' for invocant of type 'Int'␤ in block <unit> at <tmp> line 1␤␤»
ZoffixMobile :(
psch m: 42.&(0 - *).say 13:42
camelia rakudo-moar 4b257a: OUTPUT«-42␤»
timotimo m: 42.&(0 - *)().say
camelia rakudo-moar 4b257a: OUTPUT«-42␤»
timotimo yeah
psch is fast! :)
ZoffixMobile :)
psch m: (&(0 - *) 42:).say # :S 13:43
camelia rakudo-moar 4b257a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3(&(0 - *)7⏏5 42:).say # :S␤ expecting any of:␤ infix␤ infix stopper␤ statement end␤ statement modifier␤ stat…»
psch can't have the colon everywhere!
13:43 mcmillhj joined 13:45 domidumont left, ZoffixMobile left 13:46 domidumont joined, BrokenRobot joined
tbrowder re docs/p6 site: I found a copy of Camelia.svg AlexDaniel wants but where should it be placed? I can't find the html generator code in doc for using it. 13:48
13:50 andreoss joined 13:51 andreoss left, andreoss joined
andreoss m: for 'a'..'z' { .say if /c/ ff /f/ } 13:51
camelia rakudo-moar 4b257a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3for 'a'..'z' { .say if /c/7⏏5 ff /f/ }␤ expecting any of:␤ infix␤ infix stopper␤»
psch m: say uniname "ff"
camelia rakudo-moar 4b257a: OUTPUT«LATIN SMALL LIGATURE FF␤»
13:52 ZoffixMobile2 joined
ZoffixMobile2 tbrowder, it's in template/header.html 13:53
BrokenRobot github.com/perl6/doc/blob/master/t...er.html#L3 13:55
tbrowder roger--thanks 13:57
BrokenRobot is reminded that the SVG Camelia has annoying holes in the wings 13:58
13:58 jluis joined
BrokenRobot FWIW, I updated the copy in marketing repo to be without holes just now: github.com/perl6/marketing/tree/master/LOGOs 14:01
If you already used the with-holes version, it's probably fine for the site. I only noticed them when I poped it open in Illustrator. 14:02
14:03 ZoffixMobile2 left
BrokenRobot We need a definitive guide on how to use X<> in the docs pods :) 14:07
14:09 mr-foobar left 14:10 colomon joined, tharkun left 14:12 tharkun joined
BrokenRobot Does anyone know the default value of ws token? 14:17
m: grammar Foo {}; say Foo.^methods 14:18
camelia rakudo-moar 4b257a: OUTPUT«Method 'gist' not found for invocant of class 'NQPRoutine'␤ in block <unit> at <tmp> line 1␤␤»
profan lol/win 15
err, woops
tbrowder please consider PR github.com/perl6/doc/pull/647
psch BrokenRobot: github.com/rakudo/rakudo/blob/nom/...r.nqp#L581 14:19
BrokenRobot: note that's a bit tricky with the marking, _ws is what it matches - if it hasn't matched before
BrokenRobot: luckily that's right below :) 14:20
dalek c: 6c54d2c | (Tom Browder)++ | html/images/Camelia.svg:
add svg version of Camelia
c: 938bc3f | (Tom Browder)++ | template/header.html:
use svg version
c: 9ea03d7 | (Zoffix Znet)++ | / (2 files):
Merge pull request #647 from tbrowder/camelia-svg

use Camelia svg instead of png
BrokenRobot Thanks. That looks pretty scarry :| 14:21
psch well, in essence it's just LTM between linebreak, horizontal whitespace, unspace 14:22
plus some bookkeeping so we don't get stuck 14:23
BrokenRobot And heredocs?
I see "| [\r\n || \v] <.heredoc>"
14:23 Hor|zon left
psch right 14:23
well, heredoc is "if @heredoc_queue { ... } else { self }" 14:24
*herestub_queue
so <.heredoc> always matches nothing iff we don't have an outstanding heredoc 14:25
if we do have one we do the switch-to-qlang-cursor dance there
14:26 mcsnolte joined 14:30 CIAvash left 14:32 jluis left
dalek c: d215859 | (Zoffix Znet)++ | doc/Language/grammars.pod:
Document special grammar tokens
14:35
14:36 andreoss left
psch m: grammar G { regex TOP { .+ } }; say G.parse("foo") 14:36
camelia rakudo-moar 4b257a: OUTPUT«「foo」␤»
dalek c: fe0de16 | (Zoffix Znet)++ | doc/Language/grammars.pod:
Mention unspaces in default ws
14:37
c: e10161c | (Zoffix Znet)++ | doc/Language/grammars.pod:
Mention regex TOP too psch++
c: 11c956e | (Zoffix Znet)++ | doc/Language/grammars.pod:
Remove explicit anchors, since we are calling .parse in the example
14:39
c: 532fcad | (Zoffix Znet)++ | template/header.html:
Remove 'px': per spec, attribute values are integers.
14:42
14:49 jkramer joined
jkramer Ahoy! 14:49
BrokenRobot \o\
14:49 buharin left
timotimo greetings 14:50
14:50 rindolf joined
jkramer I have a method with an optional parameter, however if it's given it should be > 0. Is there a way to check this? Something like "Int :$foo where * > 0 or Int:U"? 14:52
14:52 ptolemarch joined
tbrowder Zoffix: ref yr latest blog, I assume can P6 be made safer, any plans to do so? 14:52
timotimo m: sub blubb(Int :$foo where any(* > 0, !*.defined)) { say "is it foo? $foo" }; blubb(10); blubb(); blubb(-99) 14:53
camelia rakudo-moar 4b257a: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤ in sub blubb at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
timotimo m: sub blubb(Int :$foo where any(* > 0, !*.defined)) { say "is it foo? $foo" }; blubb(:10foo); blubb(); blubb(:foo(-99))
camelia rakudo-moar 4b257a: OUTPUT«is it foo? 10␤Invocant requires an instance of type Int, but a type object was passed. Did you forget a .new?␤ in sub blubb at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
timotimo huh, that's strange 14:54
BrokenRobot tbrowder: none the I'm aware of. Note the article is really "How to add sideeffects to code outside your module" with a sensational clickbaity title attached to it. Based on the premise of the article, nothing stops me from shipping the entire drive to somewhere online
14:54 Xliff_ joined
psch where blocks always do their thing, no? 14:54
BrokenRobot tbrowder: and it's not just Perl 6 but many other langs, JS/node, Perl 5, Ruby (many more, I'm sure, I've just not used them to know for 100%) 14:55
Yes, they do
14:55 Xliff left
BrokenRobot jkramer: take a look at modules.perl6.org/repo/Subset::Helper either use it itself or see how it avoids the issue of where on optional params 14:55
tbrowder well, I was thinking of something like restricting the types of mods you mentioned unless the importing code uses some kind of fancy adverb 14:56
14:56 abraxxa left
psch m: class A { multi method m { "no i" }; multi method m(:$i! where * > 0) { "$i" } }; say A.m; say A.m: :1i; say A.m: :i(-1) 14:56
camelia rakudo-moar 4b257a: OUTPUT«no i␤1␤no i␤»
psch jkramer: i'd do that via MMD, tbh ^^^
jkramer: note that it also dispatches to the i-less candidate with a non-matching value, but you can introduce a candidate that dies for that case 14:57
jkramer timotimo: Yours seems to work when you turn the checks around. any(!*.defined, * > 0)
timotimo ooooh
of course it would
BrokenRobot tbrowder: I think there's little point in doing that.
timotimo but i'm not sure junctions will guarantee execution order 14:58
BrokenRobot tbrowder: or at least, not programmatically. I'd expect some sort of a Trusted Modules repository or something
14:59 pmurias left
psch m: class A { proto method m(|c) { if c<i>:exists && c<i> < 1 { die } else { {*} } }; multi method m() { "no i" }; multi method m(:$i!) { "$i" } }; say A.m; say A.m: :1i; say A.m: :i(-1) # or die in the proto vOv 14:59
camelia rakudo-moar 4b257a: OUTPUT«no i␤1␤Died␤ in method m at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
jkramer Ah, actually I just found out I can just use a default value in this particular case, no need to check for definedness :)
timotimo good
BrokenRobot :) 15:00
jkramer Thanks though!
15:00 FROGGS joined
tbrowder well I hope some security-smart folks are looking at the p6 modules 15:00
timotimo in as few words as possible, our security is currently kind of weak 15:01
psch maybe we need a module that at BEGIN time checks if anyone has been mucking around with mixins 15:02
so we can all trust that one module
timotimo what if anyone then goes ahead and mucks around with mixins after compile time? 15:03
psch then you probably already noticed that something isn't precompiling and checked it out already..? 15:04
honestly, i got nothing :S
15:06 _mg_ left 15:09 john51 joined 15:13 john51_ left
tony-o m: sub r($x where * > 0) { $x.say; }; r($_) for (-1..1).reverse; #jkramer 15:16
camelia rakudo-moar 4b257a: OUTPUT«1␤Constraint type check failed for parameter '$x'␤ in sub r at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
15:16 pmurias joined
tony-o m: sub r($x? where * > 0) { $x.say; }; r($_) for (-1..1).reverse; #jkramer - works with optional params too 15:17
camelia rakudo-moar 4b257a: OUTPUT«1␤Constraint type check failed for parameter '$x'␤ in sub r at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
dogbert17 o/ #perl6
hoelzro o/ dogbert17
dogbert17 hello hoelzro :)
does anyone have a moment to look at a documentation gist for Range.minmax? gist.github.com/dogbert17/f3ebc0f4...3466f12bc6 15:18
tony-o dogbert17: what about it? 15:22
15:24 ssotka joined
tony-o anyone here use a CLI email client? 15:24
dogbert17 tony-o: just wanted to know if it is ok for inclusion in the docs? 15:25
tony-o: any obvious bugs etc 15:26
tony-o without double checking accuracy of the statements, it reads well
perlpilot dogbert17: Looks good to me. Having links for is-int, excludes-min, excludes-max are a must.
15:27 woolfy left
dogbert17 thanks both of you, will commit after a run through htmlify.p6 15:27
15:28 domidumont left
perlpilot dogbert17: something I just thought of ... you might add the appropriate excludes-min/excludes-max to the comment on the examples. 15:28
dogbert17: just to indicate a little more when they apply 15:29
dogbert17 perlpilot: will do 15:30
perlpilot maybe is-int too since you mention it in the text
15:39 huggable left
jkramer What exactly happens when I do this: my ('foo') = self!some-method-that-returns-some-strings; 15:43
15:43 pmurias_ joined
lizmat and yet another quick one from Orlando: p6weekly.wordpress.com/2016/06/27/...m-orlando/ 15:43
jkramer Does it pattern match and crash if the first string is not 'foo'?
lizmat (aka the Perl 6 Weekly)
15:44 lizmat left
timotimo i don't actually think it'll work with =, but it could with := maybe? 15:44
psch m: my ('foo') = -> { "bar" }();
camelia ( no output )
jkramer Well it compiles and runs, I just don't know what it does :)
psch i don't even know what that lhs means
timotimo hehe.
perlpilot I don't get it either. 15:45
jnthn You'd need := to get it to pattern match
15:46 pmurias left
nine m: my ("foo") := -> { ("bar",) }(); 15:46
camelia rakudo-moar 4b257a: OUTPUT«Constraint type check failed for parameter '<anon>'␤ in block <unit> at <tmp> line 1␤␤»
jkramer So what it does with only = is some kind of undefined behavior? :)
nine m: my ("foo") := -> { ("foo",) }(); 15:47
camelia ( no output )
15:47 yqt left
timotimo m: say (my ('foo')).WHAT 15:47
camelia rakudo-moar 4b257a: OUTPUT«(List)␤»
timotimo m: say (my ('foo')).DUMP
camelia rakudo-moar 4b257a: OUTPUT«MVMArray: Can't shift from an empty array␤ in block <unit> at <tmp> line 1␤␤»
timotimo m: say (my ('foo')).perl
camelia rakudo-moar 4b257a: OUTPUT«(Any,)␤»
jkramer m: sub foo { ('foo', 'bar') }; my ('asd') = foo;
camelia ( no output )
timotimo m: say (my ('foo'))[0].VAR.WHAT 15:48
camelia rakudo-moar 4b257a: OUTPUT«(Scalar)␤»
jkramer In my console perl6 this gives me '(foo)'
timotimo it seems like the my is doing nothing at all here
well, it does add a scalar container
but it doesn't seem to declare a variable
15:49 Actualeyes left
timotimo so you end up with a list that has a scalar container in it, and you assign the list of strings into that list that has the one scalar container 15:49
that's how i interpret the behavior
psch oh that parses as fakesig doesn't it 15:50
dalek c: 518aadc | (Jan-Olof Hendig)++ | doc/Type/Range.pod:
Added docs fro Range.minmax. tony-o++ & perlpilot++
dogbert17 hopes I didn't overdo the examples 15:51
15:52 pmurias_ left
tony-o dogbert17: looks good, examples like that are really helpful for beginners 15:52
tbrowder dogbert17: I have rarely seen too many examples (e.g., many *nix man pages have none!) 15:53
tony-o xargs could use a few
tbrowder ZoffixNet: is yr pod partial fix a branch in the rakudo repo? 15:54
gfldex m: class A { multi method f(Int $i) { dd $i } }; class B is A { only method f(Str $s) { dd $s} }; B.new.f(42); 16:01
camelia rakudo-moar 4b257a: OUTPUT«Type check failed in binding $s; expected Str but got Int (42)␤ in method f at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
gfldex m: class A { multi method f(Int $i) { dd $i } }; class B is A { method f(Str $s) { dd $s} }; B.new.f(42); 16:02
camelia rakudo-moar 4b257a: OUTPUT«Type check failed in binding $s; expected Str but got Int (42)␤ in method f at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
16:03 Actualeyes joined
BrokenRobot tbrowder: no, and I may have deleted it too. I think pmichaud was gonna work on the fix when they find time. 16:03
16:03 kurahaupo joined
tbrowder T'anks 16:04
BrokenRobot (the full diff is in that comment where I commented tho) 16:10
dogbert17 m: say (1^..5).in-range(1.4) # is this correct? 16:14
camelia rakudo-moar 4b257a: OUTPUT«True␤»
BrokenRobot Sure, the range is 1..5, excluding 1 16:15
dogbert17 BrokenRobot: it's the excluding 1 part that interests me 16:16
16:17 mohae joined
dogbert17 BrokenRobot: but I think I get it after having looked at it for a while 16:17
m: say (1^..5).in-range(1..000001)
camelia rakudo-moar 4b257a: OUTPUT«Potential difficulties:␤ Leading 0 does not indicate octal in Perl 6.␤ Please use 0o00001 if you mean that.␤ at <tmp>:1␤ ------> 3say (1^..5).in-range(1..0000017⏏5)␤Value out of range. Is: 1, should be in 1^..5␤ in block <uni…»
dogbert17 m: say (1^..5).in-range(1.000001) 16:18
camelia rakudo-moar 4b257a: OUTPUT«True␤»
BrokenRobot m: say (1^..5).min
camelia rakudo-moar 4b257a: OUTPUT«1␤»
perlpilot Where it starts to look really strange is when you use ~~
m: say so 1.4 ~~ 1^..5
camelia rakudo-moar 4b257a: OUTPUT«True␤»
BrokenRobot in-range uses ACCEPTS :) so it's the same thing :)
16:19 cdg joined 16:20 zakharyas left
BrokenRobot dogbert17: it really is 1 < $what < 5 and $what != 1 in that case 16:21
16:22 jevin left 16:23 jevin joined
BrokenRobot m: say (-∞..∞).in-range: τ 16:23
camelia rakudo-moar 4b257a: OUTPUT«True␤»
BrokenRobot m: say (-∞..∞).in-range: τ+2i
camelia rakudo-moar 4b257a: OUTPUT«True␤»
BrokenRobot m: say (-∞^..^∞).in-range: τ+2i
camelia rakudo-moar 4b257a: OUTPUT«True␤»
BrokenRobot Perl6++
16:24 mr-foobar joined
BrokenRobot m: say (-∞^..^∞).in-range: 0/0 16:24
camelia rakudo-moar 4b257a: OUTPUT«True␤»
BrokenRobot :D
llfourn m: (0..10).in-range(τ+2i).say
camelia rakudo-moar 4b257a: OUTPUT«True␤»
llfourn doesn't know enough about complex numbers to know if that's correct
BrokenRobot thinks it is :) 16:25
Not that I know anything about them either :)
m: (0+3i..10+3i).in-range(τ+2i).say
camelia rakudo-moar 4b257a: OUTPUT«Complex objects are not valid endpoints for Ranges␤ in block <unit> at <tmp> line 1␤␤»
BrokenRobot :(
llfourn m: say 1+∞i
camelia rakudo-moar 4b257a: OUTPUT«1+Inf\i␤»
BrokenRobot You'd think doing a range for real part combined with range for imaginary part would make sense 16:26
llfourn m: say (0..10).in-range(1+∞i).say
camelia rakudo-moar 4b257a: OUTPUT«True␤True␤»
llfourn o.o
oh two says
kurahaupo BrokenRobot: or a circle centered on the median
16:36 lizmat joined, skids joined, rork left 16:40 dakkar left 16:46 dha joined 16:48 molaf joined 16:50 sno left
moritz a range in the complex plane is fundementally two-dimensional 16:52
but Range is a one-dimensional data type
what would iterating over a complex range even yield?
also, there's more than the Cartesian view on the complex plane 16:53
dha I'm going to guess that iterating over a complex range would rip a hole in the spacetime continuum. 16:54
timotimo it's hard to iterate over things that are real-values :)
BrokenRobot Make it a two-dimentional range? ¯\_(ツ)_/¯ 16:55
.oO( it's easy to offer suggestions when you've no clue what you're talking about )
timotimo you can iterate over all coordinates that have no fractional part in the real nor imaginary part, and then you can iterate over all those in a spiral 16:56
that's very possible
BrokenRobot spiral?
timotimo sure
or in a diamond shape 16:57
not diamond, er ...
<> <- like this
BrokenRobot I kinda see this range as a 4-corner shape
Like the shaded region here is a range from 1+5i to 6+2i: i.imgur.com/hVLFWaT.png 16:59
timotimo oh, hmm 17:00
llfourn Zoffix: isn't the damian conway talk on today?
timotimo that's kind of weird to me :)
BrokenRobot So, given a complex number, you just check if the real part is in range, then calculate if the imaginary part is in range at that point
17:01 ramillies joined
BrokenRobot timotimo: it's worth noting that I have zero knowledge of the complex numbers :) 17:01
llfourn: yes, at 7PM EST
Are you gonna be there?
llfourn no but I heard that there will be a livestream
BrokenRobot Yeah
dha Damian's doing a talk?
llfourn in toronto 17:02
BrokenRobot Two, today and tomorrow.
dha just spent a good deal of time watching damian talk *last* week, but...
BrokenRobot Toda's: www.meetup.com/Toronto-Perl-Monger...231418224/
dha ah.
BrokenRobot Tomorro'ws (this one happened on the TPC too, I think): www.meetup.com/Toronto-Perl-Monger...231418278/
dha yeah, saw that one. 17:03
BrokenRobot And the live feed will be posted in the comments on those pages, usually. If not, DM twitter.com/meraxes he's the organizer
llfourn BrokenRobot: cheers
17:04 rgrinberg left 17:08 setty2 joined 17:10 rgrinberg joined
Woodi so, .cow isn't in v6c, how to use it in 2016.07 ? experimental(cow); ? 17:12
ramillies Hello everybody. Could you please help me with using hyper-operation on method calls, like this?:
m: ((1,2,3) >>.Str).perl.say 17:13
camelia rakudo-moar 4b257a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing << or >>␤at <tmp>:1␤------> 3((1,2,3) >>.7⏏5Str).perl.say␤»
lizmat Woodi: .cow is just out there as a concept...
psch m: ((1,2,3)>>.Str).perl.say
camelia rakudo-moar 4b257a: OUTPUT«("1", "2", "3")␤»
psch ramillies: can't space there without unspace
m: ((1,2,3)\ >>.Str).perl.say
camelia rakudo-moar 4b257a: OUTPUT«("1", "2", "3")␤»
Woodi lizmat: so module ?
ramillies Okay, thank you.
lizmat I'd really like to see TimToady's opinion about it before pursuing it further ?
well, it *could* be a module, but then it would be a module with nqp in it 17:14
and personally, I'd rather not put modules out there that have nqp in it if I can help it
my experiences with Data::Alias (and others with Coro) spring to mind :-) 17:15
BrokenRobot m: ((1,2,3). >>.Str).perl.say
camelia rakudo-moar 4b257a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of . to concatenate strings; in Perl 6 please use ~␤at <tmp>:1␤------> 3((1,2,3). 7⏏5>>.Str).perl.say␤»
BrokenRobot LTA error IMO
ramillies psch: By the way, is there any easy rule as to where to put the spaces with the hyper-operators?
tbrowder ref docs: "Types" and "Routines": was it decided to rearrange the first two columns or not?
BrokenRobot m: ((1,2,3). &Str).perl.say
camelia rakudo-moar 4b257a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of . to concatenate strings; in Perl 6 please use ~␤at <tmp>:1␤------> 3((1,2,3).7⏏5 &Str).perl.say␤»
ramillies For example, this fails because of confusion with hash indexing. 17:16
m: (1,2,3)<<+>>(1,2,3)
camelia rakudo-moar 4b257a: OUTPUT«Type List does not support associative indexing.␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤»
psch ramillies: well, if it's a methodop, don't put spaces. if it's a metaop, but spaces between the operator and operands
BrokenRobot oh, nm.. I thought it'd say "can't detach blah blah"
psch ramillies: same as with other methodops and infixes, really
BrokenRobot ramillies: those ones you can use spaces and looks like should
psch s/but/pu/
...put
17:16 firstdayonthejob joined
timotimo well, we allow methods with spaces in front of the . nowadays 17:17
psch well, except someone had to go and allow spaces before the . methodop some time ago
ramillies Thanks for the explanation.
BrokenRobot timotimo: only alphabetic.
m: 42 .^methods
camelia rakudo-moar 4b257a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed postfix call (only alphabetic methods may be detached)␤at <tmp>:1␤------> 0342 .7⏏5^methods␤»
psch m: "foo" .&say
camelia rakudo-moar 4b257a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed postfix call (only alphabetic methods may be detached)␤at <tmp>:1␤------> 3"foo" .7⏏5&say␤»
timotimo ah, that's a good hint!
psch m: "foo" .*say
camelia rakudo-moar 4b257a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed postfix call (only alphabetic methods may be detached)␤at <tmp>:1␤------> 3"foo" .7⏏5*say␤»
psch that's also somewhat LTA imo 17:18
"only the basic method invocation dot may be detached"..?
m: "foo".*say
camelia rakudo-moar 4b257a: OUTPUT«foo␤»
psch 'cause that's not a non-alpha method
dalek osystem: 0c8af2c | (Peter Pentchev)++ | META.list:
Add Shell::Capture to the ecosystem.

Execute a command and capture its exit code and output.
See github.com/ppentchev/Shell-Capture
17:23
osystem: b4d92f2 | Altai-man++ | META.list:
Merge pull request #221 from ppentchev/ppentchev-add-shell-capture

Add Shell::Capture to the ecosystem.
jdv79 not using nqp in moduleland is a real thing? 17:24
lizmat jdv79: I was just saying that *I* don't want to do that 17:25
17:25 Bodger1234 left
jdv79 oh cool 17:26
17:27 Bodger1234 joined 17:30 espadrine joined 17:33 fhorck joined 17:34 sno joined 17:35 acrussell joined 17:43 firstdayonthejob left 17:46 cpage_ left, domidumont joined 17:48 grondilu joined 17:49 tharkun left, tharkun joined, acrussell left 17:51 Bodger1234 left
grondilu How can I simply test if an Int is a power of 2? 17:51
m: say .base(2).comb.one == 1 given 6 17:52
camelia rakudo-moar 4b257a: OUTPUT«one(True, True, False)␤»
grondilu m: say so .base(2).comb.one == 1 given 6
camelia rakudo-moar 4b257a: OUTPUT«False␤»
grondilu m: say so .base(2).comb.one == 1 given 1024
camelia rakudo-moar 4b257a: OUTPUT«True␤»
grondilu I guess that will do
timotimo why not .starts-with("1")?
grondilu oh yeay 17:53
psch m: say so "101".starts-with("1")
camelia rakudo-moar 4b257a: OUTPUT«True␤»
timotimo ah!
hehe.
BBIAB
grondilu lol that's a thing?
m: say so .base(2) ~~ /^^1/ given 1024
camelia rakudo-moar 4b257a: OUTPUT«True␤»
grondilu m: say so .base(2) ~~ /^^1/ given 1025 17:54
camelia rakudo-moar 4b257a: OUTPUT«True␤»
psch m: say so [+] .base(2).comb == 1 given 6
camelia rakudo-moar 4b257a: OUTPUT«False␤»
grondilu duh
silly me
starts-with("1") can't work
17:54 yqt joined
psch /1 0 ** * / probably, but the junction looks a bit cuter 17:54
well, + anchor
grondilu m: say so .polymod(2 xx *).one == 1 given 1025 17:55
camelia rakudo-moar 4b257a: OUTPUT«False␤»
grondilu m: say so .polymod(2 xx *).one == 1 given 1024
camelia rakudo-moar 4b257a: OUTPUT«True␤»
psch m: say .polymod(2 xx *) given 1024
camelia rakudo-moar 4b257a: OUTPUT«(0 0 0 0 0 0 0 0 0 0 1)␤»
nine m: log(1024)/log(2) %% 1
camelia rakudo-moar 4b257a: OUTPUT«WARNINGS for <tmp>:␤Useless use of "%%" in expression "/log(2) %% 1" in sink context (line 1)␤»
nine m: say log(1024)/log(2) %% 1
camelia rakudo-moar 4b257a: OUTPUT«True␤»
nine m: say log(1023)/log(2) %% 1
camelia rakudo-moar 4b257a: OUTPUT«False␤»
nine Math FTW
BrokenRobot :)
psch /o\
dha I believe C<$x == 1 || $x %% 2;> would tell you if something is a power of 2. :-)
BrokenRobot m: 2.log(2) ~~ Int 17:56
camelia ( no output )
BrokenRobot m: say 2.log(2) ~~ Int
camelia rakudo-moar 4b257a: OUTPUT«False␤»
dha Granted, that doesn't generalize...
psch m: say $_ == 1 | $_ %% 2 given 6
camelia rakudo-moar 4b257a: OUTPUT«any(False, False)␤»
BrokenRobot runs away
psch m: say $_ == 1 || $_ %% 2 given 6
grondilu hang on. You can use %% 1 to test integerness?
camelia rakudo-moar 4b257a: OUTPUT«True␤»
17:56 Bodger1234 joined
gfldex m: constant pot = (2, 4, 8 ... 2**64).any; say 6 ~~ pot; 17:56
camelia rakudo-moar 4b257a: OUTPUT«False␤»
grondilu m: say pi %% 1
camelia rakudo-moar 4b257a: OUTPUT«False␤»
dha m: say $_
camelia rakudo-moar 4b257a: OUTPUT«(Any)␤»
dha yeah, Any isn't a power of 2. :-)
BrokenRobot m: say 2.log(2) %% 1 17:57
camelia rakudo-moar 4b257a: OUTPUT«True␤»
BrokenRobot m: say 1024.log(2) %% 1
camelia rakudo-moar 4b257a: OUTPUT«True␤»
BrokenRobot m: say 1023.log(2) %% 1
camelia rakudo-moar 4b257a: OUTPUT«False␤»
grondilu m: say tau %% pi
camelia rakudo-moar 4b257a: OUTPUT«True␤»
BrokenRobot Neat. nine++
grondilu m: say tau %% sqrt(2)
camelia rakudo-moar 4b257a: OUTPUT«False␤»
grondilu that's a neat use of %%
BrokenRobot m: say 1024.lsb == 0 17:59
camelia rakudo-moar 4b257a: OUTPUT«False␤»
gfldex m: constant pot = (2, 4, 8 ... 2**64).one; say 6 +& pot;
camelia rakudo-moar 4b257a: OUTPUT«one(2, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)␤»
gfldex m: constant pot = (2, 4, 8 ... 2**64).one; say 8 +& pot;
camelia rakudo-moar 4b257a: OUTPUT«one(0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)␤»
BrokenRobot m: say 1024.msb == 0
camelia rakudo-moar 4b257a: OUTPUT«False␤»
BrokenRobot :(
grondilu m: subet Dyadic or Rational where *.denominator.log(2) %% 1; say $_ ~~ Dyadic for 1/3, 5/8
camelia rakudo-moar 4b257a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3subet Dyadic or Rational7⏏5 where *.denominator.log(2) %% 1; say $_␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ …»
grondilu m: subset Dyadic or Rational where *.denominator.log(2) %% 1; say $_ ~~ Dyadic for 1/3, 5/8
camelia rakudo-moar 4b257a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3subset Dyadic or Rational7⏏5 where *.denominator.log(2) %% 1; say $_␤ expecting any of:␤ infix␤ infix stopper␤ statement end…»
psch grondilu: "of", not "or"
grondilu m: subset Dyadic of Rational where *.denominator.log(2) %% 1; say $_ ~~ Dyadic for 1/3, 5/8
camelia rakudo-moar 4b257a: OUTPUT«False␤True␤»
grondilu nice 18:00
grondilu was looking at the HN entry about surreal numbers
18:02 cdg left
gfldex m: constant pot = (2, 4, 8 ... 2**64).one; my $i; ($i = 8 +& pot) for 1..500000; say $i; say now - BEGIN now; 18:03
camelia rakudo-moar 4b257a: OUTPUT«one(0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)␤0.1229766␤»
gfldex m: constant pot = (2, 4, 8 ... 2**64).one; my $i; ($i = 2**32 +& pot) for 1..500000; say $i; say now - BEGIN now;
camelia rakudo-moar 4b257a: OUTPUT«one(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4294967296, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)␤0.1205328␤»
nine ugexe: finally I'm able to install panda and Inline::Perl5 with this fix: github.com/rakudo/rakudo/commit/0a...dc58ce0304
psch m: constant pot = set(2, 4, 8 ... 2**64); my $i; ($i = 8 (elem) pot) for 1..500000; say $i; say now - BEGIN now; 18:04
camelia rakudo-moar 4b257a: OUTPUT«True␤0.1180567␤»
grondilu can we do recursive subsets? I mean using a subset as a way to define a recursive data type? 18:05
psch subsets are compile time i think? 18:06
i'm not completely sure that excludes that possibility, but i have a hunch it does... :)
BrokenRobot I don't think they're compile time 18:07
m: my $x = 42; subset Foo where * == $x; my Foo $y = 42
camelia ( no output )
BrokenRobot m: my $x = 42; subset Foo where * == $x; my Foo $y = 43
camelia rakudo-moar 4b257a: OUTPUT«Type check failed in assignment to $y; expected Foo but got Int (43)␤ in block <unit> at <tmp> line 1␤␤»
grondilu subset Foo of Rat where *.numerator %% 2 or *.denominator ~~ Foo;
m: subset Foo of Rat where *.numerator %% 2 or *.denominator ~~ Foo;
camelia ( no output )
grondilu m: subset Foo of Rat where *.numerator %% 2 or *.denominator ~~ Foo; say 1/2 %% Foo;
camelia rakudo-moar 4b257a: OUTPUT«Attempt to divide 0.5 by zero using infix:<%%>␤ in block <unit> at <tmp> line 1␤␤Actually thrown at:␤ in block <unit> at <tmp> line 1␤␤» 18:08
BrokenRobot grondilu: you can't do that. The second star is the second arg
Use the { $_ ... } form
grondilu m: subset Foo of Rat where { .numerator %% 2 or .denominator ~~ Foo }; say 1/2 %% Foo;
camelia rakudo-moar 4b257a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Illegally post-declared type:␤ Foo used at line 1␤␤»
grondilu here you go, can't do it.
m: subset Foo of Rat where { .numerator %% 2 or .denominator/1 ~~ Foo }; say 1/2 %% Foo;
camelia rakudo-moar 4b257a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Illegally post-declared type:␤ Foo used at line 1␤␤»
BrokenRobot Probably can do it with a recursing sub, won't you? 18:09
Like, you don't need to actually refer to Foo in there
m: subset Foo of Rat where sub meow { .numerator %% 2 or meow .denominator }; 18:10
camelia ( no output )
grondilu not in that example but it was just an attempt at recursion.
BrokenRobot m: subset Foo of Rat where sub meow { .numerator %% 2 or meow .denominator }; say 1/2 ~~ Foo
camelia rakudo-moar 4b257a: OUTPUT«Method 'numerator' not found for invocant of class 'Any'␤ in sub meow at <tmp> line 1␤ in any accepts_type at gen/moar/m-Metamodel.nqp line 3431␤ in block <unit> at <tmp> line 1␤␤»
BrokenRobot
.oO( Any?? )
Oh
psch m: subset Foo of Rat where sub meow { $^a.numerator %% 2 or meow $a.denominator }; say 1/2 ~~ Foo 18:11
camelia rakudo-moar 4b257a: OUTPUT«Method 'numerator' not found for invocant of class 'Int'␤ in sub meow at <tmp> line 1␤ in sub meow at <tmp> line 1␤ in any accepts_type at gen/moar/m-Metamodel.nqp line 3431␤ in block <unit> at <tmp> line 1␤␤»
BrokenRobot m: subset Foo of Rat where sub meow ( (Rat) $v) { $v.numerator %% 2 or meow $v.denominator }; say 1/2 ~~ Foo
camelia rakudo-moar 4b257a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed parameter␤at <tmp>:1␤------> 3subset Foo of Rat where sub meow ( (Rat)7⏏5 $v) { $v.numerator %% 2 or meow $v.deno␤ expecting any of:␤ constraint␤»
psch m: subset Foo of Rat where sub meow { $^a.say; $a.numerator %% 2 or meow $a.denominator }; say 1/2 ~~ Foo
camelia rakudo-moar 4b257a: OUTPUT«0.5␤2␤Method 'numerator' not found for invocant of class 'Int'␤ in sub meow at <tmp> line 1␤ in sub meow at <tmp> line 1␤ in any accepts_type at gen/moar/m-Metamodel.nqp line 3431␤ in block <unit> at <tmp> line 1␤␤»
grondilu you need to divide by 1
psch m: subset Foo of Rat where sub meow { $^a.numerator %% 2 or meow ($a/1).denominator }; say 1/2 ~~ Foo 18:12
camelia rakudo-moar 4b257a: OUTPUT«Method 'numerator' not found for invocant of class 'Int'␤ in sub meow at <tmp> line 1␤ in sub meow at <tmp> line 1␤ in any accepts_type at gen/moar/m-Metamodel.nqp line 3431␤ in block <unit> at <tmp> line 1␤␤»
BrokenRobot Just coerce to Rat :/ More obvious
psch too hard math /o\
grondilu m: subset Foo of Rat where sub meow ( (Rat) $v) { $v.numerator %% 2 or meow $v.denominator/1 }; say 1/2 ~~ Foo
camelia rakudo-moar 4b257a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed parameter␤at <tmp>:1␤------> 3subset Foo of Rat where sub meow ( (Rat)7⏏5 $v) { $v.numerator %% 2 or meow $v.deno␤ expecting any of:␤ constraint␤»
grondilu m: subset Foo of Rat where sub meow ( $v) { $v.numerator %% 2 or meow $v.denominator/1 }; say 1/2 ~~ Foo
camelia rakudo-moar 4b257a: OUTPUT«True␤»
psch Rat(Cool) probably
18:12 firstdayonthejob joined
psch well, Rat(Numeric) maybe, actually 18:13
BrokenRobot m: subset Foo of Rat where sub meow { .Rat.numerator %% 2 or meow .Rat.denominator }; say 1/2 ~~ Foo
camelia rakudo-moar 4b257a: OUTPUT«Method 'Rat' not found for invocant of class 'Any'␤ in sub meow at <tmp> line 1␤ in any accepts_type at gen/moar/m-Metamodel.nqp line 3431␤ in block <unit> at <tmp> line 1␤␤»
BrokenRobot /o\
I don't get where that Any is coming from.
grondilu m: sub (Rat(Numeric)) {}(1)
camelia ( no output )
BrokenRobot m: say 2.Rat.denominator
camelia rakudo-moar 4b257a: OUTPUT«1␤»
grondilu m: sub (Rat(Int)) {}(1) 18:14
camelia ( no output )
18:14 jevin_ joined, jevin left, cpage_ joined
BrokenRobot Oh, duh, it's not the $_ 18:17
psch m: (sub f { .say })(1)
camelia rakudo-moar 4b257a: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤ in sub f at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
BrokenRobot m: subset Foo of Rat where sub meow { $^a.Rat.numerator %% 2 or meow $^a.Rat.denominator }; say $_ ~~ Foo for 1/2, 1/4, 1/3 18:18
Infinite loop weeek
tony-o lol what
camelia rakudo-moar 4b257a: OUTPUT«(timeout)True␤True␤»
BrokenRobot grondilu: ^ well, there you go. Recursive types :) 18:19
grondilu that's cheating ;)
BrokenRobot :)
18:19 rgrinberg left 18:20 rgrinberg joined
grondilu or maybe not 18:20
I guess you can always define a subset in the form subset Foo of Bar where sub ($ --> Bool) {...}
and you then define a recursive subset with a recursive sub
18:21 fhorck left, cpage_ left
grondilu so there's some kind of equivalence I guess 18:21
18:23 fhorck joined 18:24 addison joined
BrokenRobot What was the syntax to name a sub but for that name to be only available within that sub? 18:24
grondilu I'm not sure that's really what you're looking for. Rather use &?BLOCK 18:26
or &?SUBROUTINE or some like that 18:27
BrokenRobot No, not that.
It was specific name given by the coder.
Saw it in the docs a day or two ago
18:28 woolfy joined
BrokenRobot Unless I'm confusing this with Rust, but I don't see that listed in Rust docs either 18:30
ETOOMUCHLEARNING
m: subset Power2 of Int where sub meow { $^a == 0 or $^a div 2 and meow $^a mod 2 }; say $_ ~~ Power2 for 2, 4, 8, 1023, 1024
camelia rakudo-moar 4b257a: OUTPUT«True␤True␤True␤False␤True␤»
BrokenRobot \o/ 18:31
grondilu I vaguely recall something like that but I think it was in an other language indeed. Maybe javascript.
BrokenRobot Jesus, 37 people going to Damian's talk. Just 1 female. 18:32
m: say 1/38 * 100
camelia rakudo-moar 4b257a: OUTPUT«2.631579␤»
BrokenRobot shakes head
grondilu which talk are you refering to?
BrokenRobot www.meetup.com/Toronto-Perl-Monger...231418224/
dha Sadly, not surprising. 18:33
BrokenRobot There were none the last two times I gave talks there :| 18:34
grondilu programming is mostly a young white man thing, isn't it?
BrokenRobot grondilu: that's the most represented demographic, sure, but I doubt it's that demographic's "thing" 18:35
I wouldn't be surprised if the under-represented groups wouldn't want to join a group of 37 dudes. 18:36
Just weird. 18:37
dha I'm certainly not "young"...
18:37 TEttinger joined
BrokenRobot is always young :P 18:37
dha lucky you. :-)
gfldex what is the biggest age group? 18:38
BrokenRobot Based on titles of pages in a google results page: "The Average Programmer: 28.9 Years Old, Male And Writes Javascript" 18:39
18:39 lizmat left
gfldex with time the demographics will change 18:39
BrokenRobot 25-29 based on SO: stackoverflow.com/research/developer-survey-2015 18:40
18:40 woolfy left
BrokenRobot 30.3 in Canada. I'm 1 month away from being the most average Canadian developer :P 18:41
gfldex if you gift your daughters with dolls, you shall burn in hell ofc :)
dha Why? What's wrong with dolls?
gfldex boys get mechano, girls get dolls. What profession will they pick? 18:42
mspo girls like dolls
BrokenRobot That's too simplistic a view IMO. 18:43
mspo okay
my daughter likes dolls
dha why can't boys and girls have dolls and mechano? And other things as well?
gfldex it's simplified for sure, but social conditioning starts at a very early age
BrokenRobot mspo: I meant the give a doll and the girl won't turn up a mechanic
DrForr_ Some girls like Meccano too, but you'd never know that if they weren't offered it.
gfldex and if girls don't get computers and a role model, they are much less likely to become programmers 18:44
timotimo has never heard of meccano
or mechano
mspo from my observations of one girl: she *really* likes dolls and just kind of likes other stuff
timotimo: I am inferring a meaning ;)
dha The actual problem is that we have that division between "boy's toys" and "girl's toys" at all which is foolish.
timotimo me, too
DrForr_ timotimo: Erector but doesn't suck.
mspo I thought it was foolish until I had kids
BrokenRobot The only reason I got into computers is because I was too late to sign up for a cooking college :) 18:45
mspo and see that they like different stuff even as babies
gfldex meccano is a british thing (mostly)
mspo my son, as a tiny baby, *loves* things with wheels and cares very little for dolls of any sort
timotimo asset-9.soupcdn.com/asset/16067/2427_957c.jpeg
BrokenRobot Erector.... 18:46
BrokenRobot giggles
dha timotimo++
timotimo i haven't heard of Erector yet either
i know lego and k'nex
DrForr_ BrokenRobot: Yes, I know, but it's an apt comparison. You can make wireframe'ish models with some internal gearing using Erector, Meccano lets you build working 5-speed slip-differential transmissions. 18:47
gfldex you may be a tad to young for the old fashion metal stuff
timotimo that's probably the problem 18:48
dha I have actually heard of most of these. since Uri's lightning talk last week, I've even heard of k'nex now.
tony-o *suddenly wants whatever meccano is*
i used to play with the erector stuff until my fingernails would bleed
mspo en.wikipedia.org/wiki/Meccano 18:49
BrokenRobot Are you sure you don't want some internal gearing with Erector? XD
tony-o meccano looks like the erector sets i had a kid
perlpilot tony-o: you mean you only played with them for a few seconds before the sharp metal edges cut your fingers? ;)
tony-o perlpilot: haha 18:50
Woodi that girl from Residence Evil was *realy* educated in typical boys ways... and, IMO, it failed miserably... :>
timotimo i know there's some metal-based children's toy kit thingie that i remembermust have been a thing before my childhood
DrForr_ www.youtube.com/watch?v=KL_wy-CxBP8 # Go ahead, do that with Erector.
timotimo but for the life of me i can't remember what it was called 18:51
18:51 brrt joined
mspo milla jovovich? 18:51
18:51 ramillies left
Woodi yes, her words 18:52
mspo "multipass"
timotimo she has all the words. she has the best words. 18:53
18:54 Actualeyes left
perlpilot might buy some meccano for his kids now 18:54
DrForr_ www.youtube.com/watch?v=r3t3iohwYxc
Roamer` hmm, now I feel bad for interrupting a conversation that IMHO serves a purpose... but is it, well, guaranteed that gather { take 1; say "oof"; take 2; }[0] shall *not* say "oof"? 18:56
tbrowder DrForr: I did get an Erector set in 3rd grade that did have a motor, a gear box, and could make some neat stuff. Could have done lots more with lots more parts but big set and extra parts were pricey in 1952, and I was lucky to have the starter set.
Roamer` that is, is it guaranteed that the VM shall take heed of the [0] and stop execution after the first value is produced? 18:57
BrokenRobot m: gather { take 1; say "oof"; take 2; }[0]
camelia ( no output )
Roamer` (yes, I know the docs say that the execution is lazy, so my question is whether the [0] is enough)
BrokenRobot m: say gather { take 1; say "oof"; take 2; }[0]
camelia rakudo-moar 5a4963: OUTPUT«1␤»
BrokenRobot m: say (eager gather { take 1; say "oof"; take 2; })[0] 18:58
camelia rakudo-moar 5a4963: OUTPUT«oof␤1␤»
Roamer` BrokenRobot, yep, I know it works for me, the question is dare I really use it :)
BrokenRobot Roamer`: yeah
Roamer` BrokenRobot, thanks!
BrokenRobot m: Inf .grep(*.is-prime).map(*+2)[1..3].say 18:59
camelia rakudo-moar 5a4963: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing infix inside []␤at <tmp>:1␤------> 3Inf .grep(*.is-prime).map(*+2)[7⏏051..3].say␤ expecting any of:␤ bracketed infix␤ infix␤ infix stopper␤»
BrokenRobot m: ^Inf .grep(*.is-prime).map(*+2)[1..3].say
camelia rakudo-moar 5a4963: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing infix inside []␤at <tmp>:1␤------> 3^Inf .grep(*.is-prime).map(*+2)[7⏏051..3].say␤ expecting any of:␤ bracketed infix␤ infix␤ infix stopper␤»
BrokenRobot well, if you type that right it'll work and not take infinite amount of time :)
Roamer` :)
BrokenRobot m: (^∞).grep(*.is-prime).map(*+2)[1..3].say 19:00
camelia rakudo-moar 5a4963: OUTPUT«(5 7 9)␤»
BrokenRobot the detached chain didn't like the [1..3] on it... very LTA erro message :/ 19:01
DrForr_ www.youtube.com/watch?v=7t6P4ezNGT0 # Meccano powered by live steam.
timotimo oh, interesting find
but with a .[1..3] it does work?
BrokenRobot Nope
Gives "Malformed postfix call" 19:02
timotimo huh!
DrForr_ has som p6 code he could be asking about as well :)
19:05 girafe joined 19:06 jjido joined 19:07 addison left
Roamer` ok, style question... gather { ... take False; ... take True }[0] or gather { ...; take False; ... }[0] // True; ? 1.. 2... 3... Fight! :) 19:11
Roamer` leans towards the explicit take True at the end
19:12 adu joined
grondilu how do I defined a Set of things with a given type? 19:12
19:12 Bodger1234 left
grondilu *define 19:12
19:12 brrt left
grondilu I mean I can define say an Hash with Int keys and string values like that: my Str %h{Int}; how do I do something similar with sets? 19:13
m: my Set $ of Str;
camelia rakudo-moar 5a4963: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Str not allowed here; variable list already declared with type Set␤at <tmp>:1␤------> 3my Set $ of Str7⏏5;␤ expecting any of:␤ constraint␤»
Roamer` grondilu, hmm, I think that there are some things that may not be typed (but I guess you figured that out already)... I stumbled upon the fact that I can't do List[Str] some time ago 19:14
19:15 domidumont left 19:20 fhorck_ joined, darutoko left 19:23 fhorck left 19:24 jmark left
DrForr_ In order to make amends for sidetracking things, I have access to a Perl6::Actions object. Is it too late at this stage to subclass it, or create a proxy object that lets me "listen in" on what it's doing? I.E. if I wanted to intercept and monitor a method call that was being made? 19:25
BrokenRobot m: class IntSet is Set { method new (+@args) { all(@args) ~~ Int or die "All must be ints!"; nextsame } }; my IntSet $x .= new: 2, 3, 4; say $x ~~ Set 19:27
camelia rakudo-moar 5a4963: OUTPUT«True␤»
BrokenRobot m: class IntSet is Set { method new (+@args) { all(@args) ~~ Int or die "All must be ints!"; nextsame } }; my IntSet $x .= new: 2, 3, 5.5; say $x ~~ Set
camelia rakudo-moar 5a4963: OUTPUT«All must be ints!␤ in method new at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
19:27 zxd_ left
Roamer` hmm, for the past 20 minutes I've been trying to come up with a syntax for a subset of Set that only accepts ints 19:30
ok, well, 15 minutes, obviously, since grondilu's question
the closest I got was this:
m: use v6.c; subset Moo of Set where (* »~~» Int).all; my Moo $foo = Set(1, 2, 3);
camelia rakudo-moar 5a4963: OUTPUT«Cannot modify an immutable Set␤ in whatevercode at <tmp> line 1␤ in any accepts_type at gen/moar/m-Metamodel.nqp line 3431␤ in block <unit> at <tmp> line 1␤␤» 19:31
Roamer` and I really don't understand the error message :)
is ~~ considered modification of the left-hand value?
19:31 kerframil joined
BrokenRobot m: my $x = "foo"; $x.^can("uc")[0].wrap: method ($x:) { say "Someone is trying to `$x`"; nextsame }; $x.uc.say 19:32
camelia rakudo-moar 5a4963: OUTPUT«Someone is trying to `foo`␤FOO␤»
BrokenRobot DrForr_: ^ maybe something like that?
Roamer` yeah, even without the whatevercode: 19:33
m: use v6.c; my Set $whee = Set(1, 2, 3); say so ($whee »~~» Int).all
camelia rakudo-moar 5a4963: OUTPUT«Cannot modify an immutable Set␤ in block <unit> at <tmp> line 1␤␤»
DrForr_ BrokenRobot: That's roughly the idea, the problem is it's a nqp object.
BrokenRobot *shrug*
Roamer` m: use v6.c; my List $whee = (1, 2, 3); say so ($whee »~~» Int).all
camelia rakudo-moar 5a4963: OUTPUT«True␤»
19:33 espadrine left
grondilu can't remember. What's correct: for @a X @b -> ($a, $b) {...} or for @a X @b -> $a, $b {...} ? 19:34
19:34 Xliff_ is now known as Xliff
Xliff kicks NickServ 19:34
BrokenRobot The former, but it's easy to try :P
DrForr_ BrokenRobot: Thanks though. I'll keep playing.
Xliff m: $s = <a b c d>; say so ($s »~~» Str).all 19:35
camelia rakudo-moar 5a4963: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$s' is not declared␤at <tmp>:1␤------> 3<BOL>7⏏5$s = <a b c d>; say so ($s »~~» Str).all␤»
Xliff m: my $s = <a b c d>; say so ($s »~~» Str).all
camelia rakudo-moar 5a4963: OUTPUT«True␤»
Xliff m: my $s = (1, 2, 3, 'a'); say so ($s »~~» Str).all
camelia rakudo-moar 5a4963: OUTPUT«False␤»
BrokenRobot m: subset Moo of Set where { .all ~~ Int }; my Moo $foo = set(1, 2, 3);
camelia rakudo-moar 5a4963: OUTPUT«Type check failed in assignment to $foo; expected Moo but got Set (set(3,1,2))␤ in block <unit> at <tmp> line 1␤␤»
Xliff Ooh! I like that syntax
DrForr_ Really I'm just glad that it's re\"entrant.
Xliff is '»~~»' new? 19:36
BrokenRobot No
It's a hyperop
docs.perl6.org/language/operators#..._Operators
Xliff Yeah. I'm just getting familiar with single ». How does that double » work?
BrokenRobot Applies the given op to items in the two lists with the direction of the arrow indicating what to do when list is exhausted 19:37
In this case, it's using ~~ as the op
19:37 abruanese left
BrokenRobot m: subset Moo of Set where { all(.keys) ~~ Int }; my Moo $foo = set(1, 2, 3); 19:38
camelia ( no output )
BrokenRobot m: subset Moo of Set where { all(.keys) ~~ Int }; my Moo $foo = set(1, 2, 3.5);
camelia rakudo-moar 5a4963: OUTPUT«Type check failed in assignment to $foo; expected Moo but got Set (set(1,2,3.5))␤ in block <unit> at <tmp> line 1␤␤»
BrokenRobot Roamer`: the .all (or >>~~>>) iterates over Pairs there. 19:39
Xliff m: Class We { }; my $say = (We.new xx 3); put so ($say »~~» We).all
camelia rakudo-moar 5a4963: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared names:␤ Class used at line 1␤ We used at line 1␤␤»
BrokenRobot m: class We { }; my $say = (We.new xx 3); put so ($say »~~» We).all
camelia rakudo-moar 5a4963: OUTPUT«True␤»
19:40 huggable joined
Xliff BrokenRobot++ 19:40
19:40 cpage_ joined
Xliff I had to get my sci-fi geek in. 19:40
I must remember that idiom for the future. 19:41
Roamer` BrokenRobot, ahhhhh! I forgot that a Set is actually a key/value store... thanks!
now even my next try: my subset IntSet of Set where (*.keys».isa(Int)).all; - even that works 19:43
19:44 addison joined 19:45 acrussell joined
jdv79 DrForr_: have you done anything with prancer? 19:49
"for real" i mean
dogbert17 watches interesting football game 19:50
Xliff dogbert: s/football/soccer/ ?
dha If so, I question the "interesting" part
Xliff heh 19:51
DrForr_ jdv79: Work keeps intervening, but I'm going to finish up the wiki.
dogbert17 :), yes soccer
jdv79 nice
Xliff meh. If you want interesting... s/football/rugby/
jdv79 wasn't the name soccer created by the british? 19:52
dogbert17 halftime, England 1, Iceland 2
hoelzro do we have any tools for figuring out why a program using S17 stuff might be locking up? integration/advent2013-day14.t locks up on my machine at home and I spent a good chunk of time last night trying to figure out why
jdv79 what did you try? 19:53
hoelzro jdv79: I've tried a bit of printf-debugging
it seems to me that the problem is in Channel.Supply 19:54
jdv79 i think i've tried strace and gdb before but i'm not very good but i think i found the issue at the time.
hoelzro but I can't quite figure out how to fix it
TEttinger dogbert17: shocker!
hoelzro since Channel.Supply relies on supplies, I have to basically trust that it's not occurring at a lower layer =/ 19:55
rindolf jdv79: hi, sup?
hoelzro: hi.
jdv79 rindolf: i'm ok. think i damaged my shoulder recently but besides that i'm good. you?
hoelzro hello rindolf
dogbert17 TEttinger: I had not expected that tbh
rindolf jdv79: I'm fine - recently applied some optimisations to Freecell Solver that made it about 9.5 percent faster - so pretty significant. 19:56
jdv79 very nice
rindolf jdv79: and I went on two walks today - in the sun.
hoelzro: sup?
jdv79 rindolf: the sun has been pretty intense here lately. i'm been hiding. 19:57
hoelzro rindolf: nothing much, just working
tony-o where about?
rindolf jdv79: ah.
tony-o it got down to almost 80º here last night
jdv79 F?
i would hope
nyc area. the temp is ok - mid to upper 80s. but the sun just kills me. 19:58
not to mention the humidity. anyway.
dha I've been inside for a few hours, but it didn't seem *that* humid earlier. 19:59
jdv79 hoelzro: good luck with that:) is it at least repro'able?
rindolf jdv79: I hope your shoulder will feel better soon. 20:00
hoelzro jdv79: yes, thankfully
jdv79 rindolf: thanks. besides that...i attempted to fix a couple bugs in moarvm and got some way there so that was nice since i'm terrible at C. 20:03
rindolf hoelzro: what is your work about?
jdv79: ah.
hoelzro rindolf: oh, just my day job 20:04
rindolf hoelzro: ah. 20:05
20:18 _mg_ joined 20:28 frobisher joined 20:29 dha left, kaare_ left, _mg_ left 20:30 frobisher is now known as dha 20:32 adu left
konobi mst: here's a fun little service that might come in useful... mktmp.io/ 20:35
dalek c: 7a6db6c | (Jan-Olof Hendig)++ | doc/Type/Thread.pod:
Added docs for Thread.name
20:36 bbkr joined
bbkr method foo ( Str:D $in ) returns Int $out { } - what do you think about allowing to declare returned variable in signature and return it at the end of the block automatically? this will save a lot of error prone typing such as "method foo () returns Int { my Int $x; ...; return $x}". and will be symmetrical to input params declaration. 20:42
20:43 pmurias joined
hoelzro bbkr: that's actually a spec'd (but NYI) feature 20:43
design.perl6.org/S06.html#Signatures 20:44
bbkr damn :) 20:45
moritz aka "patches welcome" :-)
hoelzro more specifically: design.perl6.org/S06.html#line_699
I think I started a test for it in roast
yup, S06-signature/definite-return.t 20:47
dogbert17 Iceland wins 2-1, England is out 20:50
tony-o of the EU? 20:51
dogbert17 tony-o: (EU)ropean Championship 20:52
TEttinger is this iceland's first time in the final 16, 8, and now 4 of UEFA?
geekosaur they liked brexit so much they did it again :p
Xliff Precomiling for medium to large sized projects is slow. 20:53
cognominal French papers loudly hope they will pull what the French government which sitted on the result of the 2005 referendum
dha Oops, I Brexit Again. 20:54
Xliff dha++ # LOL
Has precompilation been optimized at all, yet?
20:55 spider-mario joined
timotimo what parts of it? 20:56
Xliff LOL! That shows how much I know. I am speaking of it like a monolithic thing.
timotimo a month or so ago diakopter pushed an optimization that makes serialization a wee bit faster by caching a particular often-needed value for ... things 20:57
Xliff timotimo: Well, I know that if I change a module, when I run a script that depends on that module takes a long time for that script to run.
Ala, longer than it takes to precompile and run the script if no module changes were made.
But, I guess that is to be expected.
If a module is precompiled, does that trigger recompilation of an modules that depend on it? 20:58
timotimo yes
has to
jnthn I wonder if England is going for the record of how many European things they can leave in the space of a week... :P 20:59
TEttinger next up: the hague
the queen is going to eat some endangered animals
and then children
and with no membership in the international court, who can stop her? 21:00
21:01 lizmat joined
Xliff timotimo: OK. That explains things. 21:04
stmuk is 25% Welch :P 21:05
errr Welsh 21:06
dha After the last couple of weeks, I may be 25% bbq.
Zoffix Xliff, are you using bleed or 2016.04? I noticed 30% speed increase in parsing between those two 21:07
21:08 mcmillhj left
timotimo right, loading dependencies happens during stage parse 21:09
Xliff Zoffix, bleed 21:10
Zoffix :(
Xliff :/ 21:11
'tis what it tis.
timotimo sorry about it :(
Xliff No worries. I knew what I was getting into when I started.
Hopefully things get better. 21:12
Just out of curiosity, why doesn't precompilation have a method for indirect resolution so that precompilation cascades aren't necessary?
(if sensitive subject, please ignore. I want not step on mines) 21:13
Zoffix What do you mean indirect resolution?
Module X, used by Y, can affect how Y is parsed.
So if X needs to be recompiled, Y needs to be too
Xliff Ah! True! I forgot Grammars and Slang.
Zoffix Also custom terms and ops 21:14
Xliff Right.
Zoffix points at Pretty::Topic
Xliff forgets how meta Perl6 can get.
Zoffix :)
jnthn It's also simpler things. Suppose module X has a role, and module Y has a class that composes the role. Composition is at compile time, so a change in the role will affect the compilation of the class (which may, for example, lead to an error should the role change introduce a conflict) 21:15
Xliff Right
So the meta part of perl6 is awesome, but we pay for it at precompilation time.
jnthn Sure, though there's still a lot of room for improvement in our parse/compile times. 21:16
Zoffix Well, with 22-core CPUs already on the market, I hope soon this won't be a problem :)
Zoffix dreams of a 1000-core CPU under the desk
Perl 6 made me realize just how weak our computers are :) 21:17
Zoffix departs to Toronto
21:17 sdo joined
jnthn Happy travels :) 21:18
21:18 FROGGS left
timotimo we can still get moar and others to become faster 21:19
dha Do we have six million dollars? 21:20
sdo hello 21:22
timotimo that might be our six million dollars right there
dha Oh, apparently now we need $33,391,764.71
sdo I would like to join the group Perl6 on github how do I do.
hello
Xliff ....annnd.... now a SEGV
But it happens in libxml2 so... 21:23
timotimo what do we need that for?
oh, the 1000 core machine?
Xliff I read about that.
21:23 jjido left
Xliff bgr.com/2016/06/21/most-powerful-pr...kilo-core/ 21:24
I disagree with the author's baseless assertion about how "[I] don't need a 1000-core processor" 21:25
21:25 raiph left
Xliff That's like saying... "640kb should be enough for everyone" 21:25
timotimo people did good things using the big amount of "cores" you can find on a GPU 21:26
21:26 jjido joined, woolfy joined 21:29 rindolf left
timotimo and that's with the strong limitation of having to run the same code on all those "cores" 21:29
sdo masak I would like to join Perl 6 group on github
hello masak: I would like to join Perl 6 group on github 21:30
timotimo what's your github username? have you gotten some pull requests in yet? :) 21:32
21:33 raiph joined
sdo github username: doreys 21:33
I did once but I think press once the wrong button
timotimo god damn it, i cannot handle this terribly laggy and inconsistent internet access ;( 21:34
21:34 raiph left 21:35 raiph joined 21:36 [particle] left
timotimo github doesn't show anything for you, potentially not registered the email address you used with your git commits in the past or something like that 21:36
sdo my email is [email@hidden.address] my id on github is doreys 21:37
timotimo i bet masak'll know what you've done and make you a member :)
sdo I put [email@hidden.address] as primary is it ok with you? 21:39
timotimo i don't get to decide if that's ok or not :D
sdo ok
21:40 cyphase left 21:43 [particle] joined 21:44 cyphase joined 21:49 setty2 left 21:50 raiph left, [particle] left, sdo left, raiph joined
grondilu well, defining those surreal numbers was actually straightforward: 21:54
github.com/grondilu/surreal/blob/m...urreal.pm6
I'll see later how hard defining arithmetics is.
Roamer` wow... Zoffix mentioned Pretty::Topic earlier, its implementation is... unexpectedly straightforward :) 21:57
21:58 kid51 joined 22:00 [particle] joined 22:02 dvinciguerra_ left 22:03 acrussell left, jjido left 22:07 cognominal left 22:08 grondilu left 22:10 jjido joined 22:13 rgrinberg left 22:15 rgrinberg joined 22:19 rgrinberg left 22:20 rgrinberg joined
tony-o overwatch works, now, with 6c if anyone was using it and it broke - 22:22
modules.zef.pm/modules/github:tony-o/Overwatch 22:23
22:24 jjido left 22:25 jjido joined, rgrinberg left 22:26 dha left 22:27 [particle] left, pmurias left
[Coke] hurm. my naive attemp to pod6 everything in the perl6 doc repo is causing precomp to geenerate warnings. 22:31
22:32 jjido left
[Coke] is probably using an old p6. 22:32
22:33 dvinciguerra_ joined 22:34 cyphase left 22:35 jjido joined
Xliff What's the best way to determine SEGV problems with a NativeCall aware P6 script? 22:36
[Coke] yup, that fixed it 22:37
Xliff [Coke]++
timotimo i think the only good way to do that is to run gdb or lldb 22:38
and using "print MVM_dump_stacktrace(tc)" and such
22:39 cyphase joined
Xliff Thanks 22:39
22:39 RabidGravy left 22:41 ZoffixLappy joined
ZoffixLappy waves from Toronto Perl Mongers 22:41
Xliff "no MVM_dump_stacktrace in current context"
ZoffixLappy Damian Conway shook my hand and said he enjoys my blogs :D
timotimo the name might be wrong
maybe it's _print_
Xliff I "up"'d until I was in an MVM frame
Nope 22:42
Not _print_
22:42 ptolemarch left
Xliff And I get another SEGV when calling MVM_dump_backtrace(tc) 22:43
/o\
┬─┬ ︵ /(.□. \) 22:44
ZoffixLappy Oh, shit. I lied. These talks won't be broadcasted: "We will not be broadcasting these talks as Damian's Talks belong to Damian, not us. :)" 22:45
Xliff "The revolution will not be televised"
ZoffixLappy :)
Xliff =)
Glad someone got that. 22:46
[Coke] would damian consider putting them up somewhere where we could pay to see them? 22:47
barring that, I'll try to catch him the next time he's the NE of the US.
timotimo it's MVM_dump_backtrace
ZoffixLappy [Coke], well, one of them I think is already up. It's the "On the shoulder of giants"
The concurrency one... I'll try to ask when it's questions time. 22:48
timotimo i didn't realize you'd have to be inside a stack frame belonging to libmoar.so to use it
but you'll need to be in a frame that has a tc anyway, which is really only mvm-related frames
ZoffixLappy God. These meetings make me realize just how weird I am lol... They're all talking about stuff and laughing :)
(it's still 12m till start)
22:49 [particle] joined
[Coke] is down to 3%, later, sixes. 22:50
ZoffixLappy bye 22:52
22:53 [particle] left
timotimo 3% is half a six percent 22:56
ZoffixLappy And Damian said tomorrow's talk On The Shoulder's of Giants will be the extended version of the YAPC/YouTube version of it. 22:57
Xliff timotimo: I got a SEGV when doing "call MVM_dump_backtrace(tc)"
timotimo OK, but it won't show you where exactly that crashes?
does print tc give sensible results?
Xliff $1 = 1.4616321449683623412809166386416848
Is that sensible? 22:58
timotimo wat. 22:59
are you sure that tc is actually an MVMThreadContext * ?
23:01 spider-mario left, girafe left 23:05 cdg joined 23:13 raiph left, raiph joined
ZoffixLappy jnthn++ you got major props from Damian here :) 23:15
23:16 jjido left 23:18 jjido joined 23:20 [particle] joined 23:24 bjz left, [particle] left 23:26 firstdayonthejob left 23:28 tlvb| left 23:30 jjido left, jjido joined 23:32 cdg left 23:33 cdg joined 23:35 cpage_ left 23:38 kid511 joined, lizmat left 23:39 lizmat joined, woolfy left, cpage_ joined, lizmat left, kid51 left, huggable left 23:40 huggable joined 23:46 aries_liuxueyang left
tbrowder jnthn: I'm looking at yr NQP course and you mention NQP doesn't have flattening and then later you say it does. 23:47
dalek ecs: 6c58595 | util++ | S03-operators.pod:
Change nbsp to space in "Perl Hacker".
23:48
timotimo can you point me at the particular place that happens? 23:49
23:51 [particle] joined
tbrowder slide 21 vs. slide 29 23:52
23:53 jjido left, jjido joined
Xliff timotimo: How can I check that tc is the right type in gdb? 23:53
I was assuming that tc would be proper when I got into an MVM_* frame 23:54
timotimo when i print tc, i just get (MVMThreadContext *) 0x...
23:55 cyphase left
Xliff Yeah. So looks like something in the rakudo internals got corrupted. 23:55
23:55 [particle] left
Xliff I'm using perl6-gdb-m BTW 23:55
timotimo oh
tbrowder: that was from a time before the GLR, where lists tended to flatten "on their own" 23:56
that kind of flattening doesn't happen in nqp
the | for "flattening" argument lists could also be called "interpolating"
that's probably less confusing terminology-wise
Xliff timotimo: I can go up as far as I can and I still get the same thing I got earlier for tc 23:57
:(
timotimo do you have no debug symbols? o_O
Xliff Prolly not.
timotimo well, that makes it difficult :)
23:57 kurahaupo left
Xliff I will need to recompile rakudo and libxml2 with -g 23:57
*sigh* 23:58
timotimo that probably also means you can't just print (MVMThreadContext *) tc
no, not rakudo with -g
just moarvm
Xliff OK.
timotimo and libxml2 doesn't have to be recompiled; you can just install the -dbg or whatever it's called
23:58 yqt left, jjido left
timotimo on fedora it's done using the "debuginfo-install" or something tool 23:58