»ö« 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. |
|||
AlexDaniel | at least that's how I see it :( | 00:00 | |
seeing “rakudo language” makes me want to flip the table though… | |||
zengargoyle | right, where does that leave Perl 6 on Erlang? | 00:01 | |
nadim | Do we have a tool for code coverage? | 00:03 | |
00:04
lichtkind left
|
|||
zengargoyle | i haven't heard of one (at least in the everybody knows to use this way). | 00:05 | |
zengargoyle wonders if you could run --profile on the tests and pull out callable names and check against callable names in the codebase. | 00:11 | ||
nadim: i think i ran into a problem once where perl 6 is so private that you can't test some sub because they are not exported into a namespace where you can get at them from a test. (unlike perl 5 where suitable magic always works) | 00:16 | ||
nadim | I found two blocks of code that were nver executed that had code that was wrong, and by wrong I mean that the call to functions didn't even ahve the right amout of arguments | ||
zengargoyle pretty much assumes nadim knows more than me. :) | 00:17 | ||
nadim | you probably assume wrong ;) | ||
I learned the minimum to make a dumper, that's it. Now that it is done, I need to find a new project where I may, or may not, learn something else. | 00:18 | ||
zengargoyle | dumper is impressive to me, i need to take a look at it. | 00:21 | |
00:22
g0d355__ left
00:24
mcsnolte left
|
|||
zengargoyle | nadim: maybe you write Test::Coverage next. :P | 00:25 | |
00:28
astj joined
00:32
Todd_ joined
00:33
astj left
|
|||
Todd_ | Hi all! Question: what is the delimiter for "use lib"? use lib '/usr/share/perl6/site/bin,/home/linuxutil'; does not workl. I have tried a space, a semicoln, and a full coln too | 00:33 | |
geekosaur | I expect it would be a comma *outside* the quote | 00:37 | |
m: use lib '/usr/share/perl6/site/bin','/home/linuxutil' | 00:42 | ||
camelia | ( no output ) | ||
zengargoyle | use lib 'path1', 'path2'; maybe use lib split(',',"path1,path2"); | ||
geekosaur | not that that can fully test since I doubt either one works on that host | ||
Todd_ | will test | ||
this worked | 00:43 | ||
use lib '/usr/share/perl6/site/bin', '/home/linuxutil'; | |||
Thank you! | |||
zengargoyle | why use lib '/usr/share/perl6/site/bin' ? | 00:44 | |
seems an odd thing to do. | 00:45 | ||
MasterDuke | nadim: there's the MVM_COVERAGE_LOG=cover.log option | ||
00:46
wamba left,
cog_ left
|
|||
MasterDuke | coverable6: say "asdf".comb.sort.join | 00:46 | |
coverable6 | MasterDuke, Seems like you forgot to specify a revision (will use “HEAD” instead of “say”) | ||
MasterDuke, gist.github.com/7cbab7fd334c5819ac...9c3c910c84 | 00:47 | ||
MasterDuke | nadim: that's what ^^^ uses | ||
Todd_ | It is because I am using an Anti-Kaisen OS (Scientific Linux 7.3, an RHEL Clone). All revisions and bugs are locked place. unfortately, that weird path is the only way I can get things to see themselves. I should ot complain too much. As soon as I can afford it, I am ditching RHEL and going to Fedroa. I have *** had it *** with all the frozen bugs for "reliability" | ||
zengargoyle | Todd_: cool. | 00:48 | |
Todd_ | RHEL won't even runb on C236 chipset motherboards. ANd RH won't fix it. C236 runs beautifully on Fedora. I have two Fedora serers out their. And I have to tell you, the frustratin factor between an anti-Kaisen OS and a Kaisen OS is about 10 to 1. RHEL is *** not *** more reliable than Fedora by any shake of the stick. | 00:51 | |
00:51
pharv joined
|
|||
skids | all I know is that RHEL/CENTOS seem to have a knack for choosing the most buggy revisions of FreeRADIUS possible, and then never backporting fixes. | 00:52 | |
nadim | zengargoyle: If I am not too chicken shit, I'll write next version of Asciio in P6 | 00:53 | |
MasterDuke++ | 00:54 | ||
00:55
Cabanossi left,
cpage_ left
|
|||
MasterDuke | i'm working on a patch to moarvm to allow some more fine-grained control of the coverage tracking | 00:55 | |
nadim | zengargoyle: dumper is here github.com/nkh/P6-Data-Dump-Tree or install with Zef | ||
zengargoyle chants burn RHEL burn! :) | |||
nadim | MasterDuke: that would be nice. | 00:56 | |
Todd_ | bye bye | ||
skids | o/ | ||
00:56
Todd_ left
|
|||
zengargoyle | nadim: yeah, i've seen chatter and looked at posts, just haven't gotten around to it yet. did look really cool though. | 00:56 | |
nadim | MasterDuke: and some kind of presentation layer. | ||
00:57
Cabanossi joined
|
|||
nadim | zengargoyle: dd is cool enough, ddt is readable that's the only difference | 00:57 | |
well, there may be other small differences too like filtering and diff, and dhtml but that's just because I have too much free time and that I wanted to at least do as much in P& as I did with my P5 module | 00:58 | ||
MasterDuke | heh. i'm no good at presentation. you seem better than i, i'll leave it up to you! | ||
nadim | haha! | ||
00:58
pharv left
|
|||
skids | nadim: You might want to check out Test::Screen in Proc::Screen for testing Asciio | 00:59 | |
nadim | MasterDuke: we make a data structure and let ddt display it, can make a few filters if necessary. and since it can generate, Yuge, dhtml, we could get that expandable | ||
zengargoyle | nadim: yeah, like that p5 module i don't remember that dumped thing really pretty with dump roles for classes to make objects pretty... i think i get the idea. | ||
nadim | skids: will look at it, testing is good | 01:00 | |
zengargoyle: as long as you dump small stuff then dd is very fast and redable enough, my limit is two lines, then I need something that does not use 100% of my brain to comprehend. imgur.com/alqOYOo | 01:04 | ||
01:04
go|dfish left
|
|||
nadim | skids: Test::Screen is not among the modules in module.p6.whatnot | 01:05 | |
skids | It's part of Proc::Screen | 01:06 | |
nadim | skids: maybe I should write a Proc::Tmux | ||
skids: ah! | |||
01:06
sufrostico left
|
|||
nadim | I see that you wrote it, maybe you should write Proc::Tmux ;) | 01:07 | |
the one thing that stops me from starting P6-Asciio is that I know it is quite some work and I am too lazy to do it myself. | |||
skids | It was a while ago but I think I remember looking at tmux and seeing some blockers. | 01:08 | |
nadim | I moved from screen 5 years ago, not going back | 01:09 | |
not that screen was bad, just tmux is better engineered and documented | 01:10 | ||
zengargoyle never got the tmux fever. :) | |||
nadim | I have even written a plugin to create a side window (in bash :( ) | 01:11 | |
skids | screen is cretinous, agreed, but tmux I think lacked some essential features for this purpose. | ||
nadim | what would they be, it's quite complete. | 01:12 | |
skids | I'll have to look at it again. I think screenshots might have been problematic or something. | ||
nadim | nah, it has an interface for that | 01:13 | |
and you can get the whole buffer written into a file | 01:14 | ||
I see that there are quite a few tmux related modules on cpan | 01:15 | ||
zengargoyle asciio looks neat. | 01:23 | ||
it is user driven correct? a UI tool for manual drawing? | 01:25 | ||
nadim | It's a gtk+ perl tool that looks like ascii drawing but it saved text files too | 01:26 | |
and the text is objects so you can move them around draw lines that connects them ans stay connected , etc.. | 01:27 | ||
zengargoyle | ah, so no ncurses non-gui... | ||
nadim | that's the plan with the next version | 01:28 | |
www.youtube.com/watch?v=0l9W84PhOyI | |||
zengargoyle | mix that with dot and grammar and constraint layout. :P | ||
nadim | you are welcome to join the effort ;) | ||
zengargoyle | hehe... | 01:29 | |
nadim | I'm writting an engine which write to a virtual screen, then that can translate to curses, gtk, html/JS or whatnot | ||
but some A* routing would be nice | 01:30 | ||
it's 10 years old, time to refresh it. And even if it does ascii, I will make it generate nice fluff for management | |||
zengargoyle has no artistic ability. like the "box1 -> box2" type thing that does magic for me. :) | 01:31 | ||
nadim | my artistic abilities stop at ascii boxes, nothing to boast about | ||
look from this time stamp youtu.be/0l9W84PhOyI?t=174 | 01:32 | ||
zengargoyle | i think like "=begin data :for<asciio> Input -> Output =end data" draw pretty picture for me. | 01:33 | |
zengargoyle lazy | |||
nadim | there was a scripting interface once, that's also planned to come back with a revenge | 01:35 | |
zengargoyle if only there were a program that could choose good variable names for me i would be much happier. :) | |||
nadim | but doing automatic routing is possible, in the worst case by using dot | ||
lol, I am sure you do fine. | |||
zengargoyle | yeah, have you read HOP? | 01:36 | |
Higher Order Perl by Dominus had a bit of "develop a constraint solver" for box layout.... | 01:37 | ||
but it's been years since i read HOP | |||
nadim | yes, not all of it, it's on a shelf somewhere, I'll dust it out | ||
but nothing beats putting the boxes by hand, takes seconds to draw something in asciio | 01:38 | ||
zengargoyle | there's the free ebook/pdf/text online if you don't want to sneeze from the dust. | ||
zengargoyle has translate HOP into p6 in back of my mind.... | 01:39 | ||
nadim | I like paper books too | 01:40 | |
zengargoyle | i think it would be very interesting to do HOP in p6 and see just what is magically no big deal. | ||
nadim | do it, do it | 01:41 | |
.tell Zoffix blogs.perl.org/users/zoffix_znet/20...art-1.html /me wants part 2 pretty please | 01:42 | ||
yoleaux | nadim: I'll pass your message to Zoffix. | ||
zengargoyle remembers i should solve that math question MJD wrote when he signed my HOP book. i'm so ashamed for not figuring out a simple group theory symmetry problem. | 01:46 | ||
01:46
mr-fooba_ joined,
ilbot3 left
|
|||
nadim | shame on you! | 01:48 | |
01:49
mr-foobar left
01:50
perlpilot left
01:52
ilbot3 joined,
ChanServ sets mode: +v ilbot3
|
|||
araraloren | good noon! | 01:52 | |
zengargoyle now thinks i should ask MJD if i can publish that and make a p6 solution somehow. | 01:53 | ||
zengargoyle really needs a blog :P | |||
01:55
nadim left,
Cabanossi left
|
|||
Geth | whateverable/master: 6 commits pushed by (Aleks-Daniel Jakimenko-Aleksejev)++ | 01:56 | |
01:56
Cabanossi joined
|
|||
AlexDaniel | … poof! | 01:57 | |
01:57
bisectable6 left,
unicodable6 left,
benchable6 left,
committable6 left,
bloatable6 left,
coverable6 left,
evalable6 left,
statisfiable6 left,
greppable6 left
02:06
andreoss left
|
|||
Geth | whateverable: bbc970fabc | (Aleks-Daniel Jakimenko-Aleksejev)++ | Sakefile Kill everybody before upgrading rakudo There are so many things that can be done better here (e.g. the build script may be running and so we should terminate it gracefully), but that's a quest for another day. Also, this does not work anyway. Why? Rakudobrew pulls rakudo from under the sake script, so it dies a horrible death. 💩 |
02:08 | |
02:11
bisectable6 joined,
ChanServ sets mode: +v bisectable6,
quotable6 joined,
ChanServ sets mode: +v quotable6,
unicodable6 joined,
bloatable6 joined,
committable6 joined,
coverable6 joined,
evalable6 joined,
ChanServ sets mode: +v unicodable6,
ChanServ sets mode: +v bloatable6,
ChanServ sets mode: +v committable6,
ChanServ sets mode: +v coverable6,
ChanServ sets mode: +v evalable6,
greppable6 joined,
ChanServ sets mode: +v greppable6,
benchable6 joined,
ChanServ sets mode: +v benchable6,
statisfiable6 joined,
ChanServ sets mode: +v statisfiable6
02:17
lizmat left,
noganex_ joined
02:20
noganex left
02:25
statisfiable6 left
02:27
basket joined
02:28
lizmat joined
02:31
Ptolemarch left
02:32
Ptolemarch joined
02:54
pharv joined
|
|||
pharv | are there any debugging tools for perl6 besides rakduo-debugger? i'm trying to detect a memory leak in a module, so i was wondering if there is a way to step through the code | 03:00 | |
Zoffix | . | 03:02 | |
yoleaux | 01:42Z <nadim> Zoffix: blogs.perl.org/users/zoffix_znet/20...art-1.html /me wants part 2 pretty please | ||
Zoffix | not in the near future | ||
pharv | do you have any suggestions for how to detect a memory leak then? | 03:04 | |
Zoffix | I was responding to nadim's message. | 03:05 | |
timotimo | how slowly does it leak? | ||
AlexDaniel | timotimo: I see you're an optimist | 03:06 | |
pharv | well, it's a a web app, and on each request, it leaks a significant amount of memory, even though it's rendering the same template each time, and the templates are in a reusable array | ||
AlexDaniel | pharv: what version of rakudo are you using? | 03:07 | |
pharv | 2017.07 | ||
timotimo | if it weren't 5am for me and i wasn't dead tired i'd ask for the script and have a look myself | 03:11 | |
pharv | i appreciate it... i'll look for you tomorrow then :) i'll try to isolate it until then | 03:14 | |
timotimo | that'd be nice | ||
03:14
Actualeyes left
|
|||
pharv | is there a way to access the running process so i can output the memory usage to the screen? | 03:20 | |
Zoffix | zengargoyle: nothing's branded as "Rakudo Perl 6" and there's no plan to brand anything with it. "Camelia"... "tweak"... you can throw it into the pile of hundreds of other name suggestions and there's little chance they'll take on without an official action. "Rakudo", on the other hand can, as it's already in use (users look for "rakudo" OS opackages; users don't load "Rakudo Star"; `perl6 -v` says "This is | ||
Rakudo..."). "Rakudo" can be forced into use if "management" decides not to extend the name at the time of 6.d release, and based on my observations since the publication of my post it can be done fairly easy. As you've noticed, the name isn't ideal, as it's the name of *an* implementation of the language. Its widespread use to refer to the language isn't desirable on the grand scheme of things and can be | |||
avoided if the "management" picks a different, official extension to the name. | |||
03:23
Cabanossi left
|
|||
Zoffix | s/don't load/load/; | 03:23 | |
03:25
Cabanossi joined
|
|||
geekosaur | pharv, on windows you use procmon (may need to get it from microsoft sysinternals); on unix, top. | 03:26 | |
if you are on a BSD or macOS, you can press control-T in the terminal window to get a very basic summary | |||
Geth | whateverable: f2d1d8c13e | (Aleks-Daniel Jakimenko-Aleksejev)++ | t/coverable.t Everyone loves performance improvements! Meanwhile, Coverable cries in the corner. |
03:27 | |
whateverable: 88412024cf | (Aleks-Daniel Jakimenko-Aleksejev)++ | Coverable.p6 How did we even get this piece of code here? Maybe it is faster, but that does not matter. |
|||
pharv | geekosaur: do i have access to it in perl6 code? | 03:30 | |
geekosaur | I don't think so. jnthn would know as it'd have to be moarvm level | ||
pharv | ok, thanks | 03:31 | |
03:34
hythm_ joined
|
|||
pharv | are there any IDEs that have decent perl6 support for things like autocomplete and Goto Declaration? i'm on ubuntu 16.04 and it looks like padre isn't supported, so i'm currently using atom | 03:34 | |
03:39
Ben_Goldberg joined,
BenGoldberg left,
Ben_Goldberg is now known as BenGoldberg
03:48
mr-fooba_ left
03:51
mr-foobar joined
|
|||
hythm_ | Hello, P6. | 03:53 | |
How to do loop inside template? here is gist of the code gist.github.com/hythm7/b21e05164a8...76065f41ac | |||
pharv | % for @rows -> %r { %r<id> % } | 03:57 | |
04:02
Actualeyes joined
04:08
Cabanossi left
04:10
Cabanossi joined
04:17
mr-fooba_ joined
04:18
mr-foobar left
04:22
mr-fooba_ left
|
|||
hythm_ | %r gives Invalid typename 'r'. Tried with % $r but still get same output, all rows printed in one line | 04:23 | |
pharv | %= %r<id> | 04:24 | |
04:32
zengargoyle left
04:34
go|dfish joined
04:36
jeromelanteri joined
|
|||
hythm_ | I'm still missing something, still getting the invalid type error. Also I Updated the gist with what I did | 04:36 | |
pharv | should $h<rows> be %h<rows> or does that not matter? | 04:38 | |
hythm_ | I think it doesn't matter | 04:40 | |
pharv | move the % r { to the line above and remove the space between % and r | ||
% for @rows -> %r { | |||
hythm_ | Tnat gave me different error: (error) Type check failed in binding to parameter '%r'; expected Associative but got Array ($["x", "z"]) | 04:43 | |
I think now the template syntax work, just need to figure out the type | |||
04:44
zengargoyle joined
|
|||
pharv | cool | 04:44 | |
hythm_ | Thanks pharv | 04:53 | |
pharv | np | ||
04:56
perlpilot_ left,
mr-foobar joined
|
|||
MasterDuke | pharv: you could try github.com/Skarsnik/p6-linux-proc-statm | 04:59 | |
pharv | oh, awesome, thanks! | 05:00 | |
MasterDuke | also, i've used heaptrack to monitor mem usage | 05:02 | |
pharv | i was trying to use that, couldn't figure out how to produce the output file | ||
you mean perl6 --profile=heap? | |||
MasterDuke | no, it's an external program | 05:03 | |
pharv | oh | ||
MasterDuke | github.com/KDE/heaptrack | ||
pharv | oh, that is great, thank you | ||
MasterDuke | fyi, if you do end up using heaptrack, you get slightly more useful info by calling the moarvm binary directly (and passing --full-cleanup). `perl6` is just a shell script, and that throws things off | 05:05 | |
pharv | ahh, thanks... i'm installing it now | 05:06 | |
05:12
xtreak joined
05:20
BenGoldberg left
05:23
Cabanossi left,
jeromelanteri left
05:25
Cabanossi joined
05:47
haha joined,
haha is now known as Guest24020
05:49
zengargoyle left,
zengargoyle joined
05:54
pecastro left
06:12
araraloren left
06:13
araraloren joined,
skids left
06:29
ChoHag joined
06:35
szabgab joined
|
|||
szabgab | pharv: regarding the memory leak, please see this: www.nntp.perl.org/group/perl.perl6....g4133.html | 06:39 | |
pharv | ok | 06:40 | |
Geth | ecosystem: noqisofon++ created pull request #358: Add App::Miroku |
06:41 | |
szabgab | I'll add a call to the templating system, without Bailador, as another case | ||
pharv | ok, cool | ||
the leak does not appear to be related to the template calls at least | 06:42 | ||
szabgab | In any case I have a feeling that even without modules Rakudo leaks memory | ||
pharv | if i call template in a for loop, the memory does not increase much... the biggest increase is just on the initial request | 06:43 | |
szabgab | I see, then maybe the leak is the routing system of Bailador? Maybe the regex engine of Rakudo? Or maybe I am just not measuring correctly. | 06:45 | |
I was hoping someone will look at my memory-usage measuring code and let me know if it looks reasonable | 06:46 | ||
Geth | ecosystem: 031fb495a5 | (ned rihine)++ | META.list Add App::Miroku |
06:47 | |
ecosystem: e35ef552af | lizmat++ (committed using GitHub Web editor) | META.list Merge pull request #358 from noqisofon/master Add App::Miroku |
|||
pharv | it would be easy to track down with a debugger, but when i tried to use the rakudo-debugger, it crashed with a broken promise error, so i'm just outputting the memory everywhere until i can find the spike | 06:49 | |
szabgab | how are you "outputting the memmory" ? | 06:50 | |
pharv | m: use Linux::Proc::Statm; $statm = get-statm(); $size = $statm<size>; say $size; | 06:51 | |
camelia | ===SORRY!=== Could not find Linux::Proc::Statm at line 1 in: /home/camelia/.perl6 /home/camelia/rakudo-m-inst-2/share/perl6/site /home/camelia/rakudo-m-inst-2/share/perl6/vendor /home/camelia/rakudo-m-inst-2/share/perl6 Co… |
||
pharv | m: zef install Linux::Proc::Statm | 06:52 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Undeclared routines: install used at line 1 zef used at line 1 |
||
06:54
wamba joined
|
|||
geekosaur | no, you can't install new modules in camelia | 06:55 | |
pharv | ah | ||
does bailador support cached responses? | |||
geekosaur | I have no idea, sorry | 06:56 | |
not everyone is a web programmer, oddly enough | |||
pharv | sorry, was asking szabgab | ||
szabgab | pharv: I think it caches the templates | ||
unless you run it in watch mode | |||
but I don't think it caches the responses | 06:57 | ||
pharv | ok | ||
szabgab | try to see if running regexes, even without bailador show any signs of memory leak. | 06:59 | |
06:59
benchable6 left
|
|||
pharv | ok | 07:01 | |
07:08
pilne left
07:18
araraloren left
07:21
hythm_ left
07:23
jameslenz left
07:36
ufobat joined
07:37
xtreak left
07:38
xtreak joined
07:40
TEttinger left
07:41
xtreak left,
xtreak joined
07:43
szabgab left
07:54
hythm_ joined
07:58
xtreak left
07:59
xtreak joined
08:01
ChoHag left
08:03
xtreak left
|
|||
moritz | thanks zengargoyle | 08:04 | |
yoleaux | 4 Aug 2017 23:00Z <zengargoyle> moritz: clicky clicky purchased dead tree. | ||
moritz | Perl 6 fundamentals is now ranked #6 in the "Perl" category on amazon, and four of the books before it have no Perl in the title :-) | 08:05 | |
08:11
parv joined
08:14
wamba left
08:15
ChoHag joined
08:18
araujo__ joined
08:22
araujo_ left
08:26
parv left
08:30
araraloren joined
08:31
jameslenz joined
08:37
hlorofils joined
08:38
hlorofils left
|
|||
hythm_ | Hello perl6, can someone explain to me why I need o call .list on an array to work properly in for loop? Without .list the loop takes all the array in first iteration | 08:40 | |
I have a small program to show that here: gist.github.com/hythm7/b21e05164a8...76065f41ac | |||
08:41
tzekid joined
08:44
darutoko joined
|
|||
zengargoyle | moritz: i think i skiped some of the blog posts from when it was by example and they didn't pique my interests at the time... but i'll try and read through with beginner mind and give review. :) | 08:45 | |
08:48
araraloren left,
araraloren joined
|
|||
zengargoyle | hythm_: what does your for loop look like? -- for @foo -> $f { ... } -- will do each item of @foo, -- for @foo, -> $f { ... } will treat @foo as one thing. | 08:49 | |
08:50
wamba joined,
AlexDaniel left
|
|||
hythm_ | zengargoyle The loop looks like % for $h<rows> -> $row { #and $h<rows> is an array | 08:50 | |
araraloren | hythm, you should force the variable to list context, for @($h<rows>) -> ... | 08:51 | |
08:51
xtreak joined
|
|||
zengargoyle | hythm_: there are places i think where the choice between treading @foo as a list of items or treating @foo as a single thing are a little bit odd just because it's nice to have it work one way or the other. | 08:51 | |
hythm_ | araraloren forcing to list context working | 08:53 | |
zengargoyle | yeah, @() or maybe for flat $h<row> ... or |$h<row> | ||
araraloren | m: my $a = 1, 2, 3; for $a -> $i { say " => ", $i; } | 08:54 | |
camelia | WARNINGS for <tmp>: Useless use of constant integer 2 in sink context (lines 1, 1) Useless use of constant integer 3 in sink context (lines 1, 1) => 1 |
||
araraloren | m: my $a = 1, 2, 3; for $a -> $i { say " -> ", $i; } | 08:55 | |
camelia | WARNINGS for <tmp>: Useless use of constant integer 2 in sink context (lines 1, 1) Useless use of constant integer 3 in sink context (lines 1, 1) -> 1 |
||
hythm_ | zengargoyle makes sense, sometimes its needed as single thing or multiple items. | ||
zengargoyle | there are a few options to make an item thing (single thing as array) poof out to list of individual items. | ||
araraloren | m: my $a = (1, 2, 3); for $a -> $i { say " -> ", $i; } | ||
camelia | -> (1 2 3) | ||
araraloren | m: my $a = (1, 2, 3); for @($a) -> $i { say " -> ", $i; } | ||
camelia | -> 1 -> 2 -> 3 |
||
araraloren | It's like a reference to an array or list | ||
zengargoyle | m: my $a = (1, 2, 3); for |$a -> $i { say " -> ", $i; } | 08:56 | |
camelia | -> 1 -> 2 -> 3 |
||
araraloren | m: my $a = (1, 2, 3); for $a.flat -> $i { say " -> ", $i; } | 08:57 | |
camelia | -> 1 -> 2 -> 3 |
||
08:57
dpk left
|
|||
zengargoyle | i don't fully get it, but the difference between $a and @a can make a difference. it gives perl 6 a hint of sorts of what you expect to happen. | 08:57 | |
araraloren | both work | ||
zengargoyle | m: my @a = (1, 2, 3); for @a -> $i { say " -> ", $i; } | 08:58 | |
camelia | -> 1 -> 2 -> 3 |
||
araraloren | Document not clear | ||
zengargoyle | araraloren: i believe it... but i haven't read docs in a while. :) | 08:59 | |
$ implies some sort of single item thingy. @ implies some sort of positional array like thing, % implies some sort of associative hash like thingy. | 09:00 | ||
araraloren | yeah, I think it should be something document in the section about `for` | ||
zengargoyle | when you put array in $x you have to do more hinting/work to make it like @x. | ||
09:01
nadim joined
|
|||
zengargoyle | when you put something in \x with no sigil, you really have to do some work sometimes. :) | 09:01 | |
hythm_ | checking documentations for that, I also saw it before changing type to Seq. it would be nice if can be controlled by $, @, % | 09:02 | |
zengargoyle | araraloren: yeah, doc is hard. | ||
i think @ is basically a Seq.cached (or is it clone or something...) | 09:03 | ||
09:04
edehont joined
|
|||
zengargoyle | Seq still hurts my brain. :P | 09:05 | |
09:08
Cabanossi left
|
|||
araraloren | zengargoyle, have you watch jnthn's video about concurrency | 09:08 | |
zengargoyle | araraloren: yes, but i need to do again. i sort of got lost in last bits... | 09:09 | |
araraloren | oh | ||
zengargoyle | short attention span :P | 09:10 | |
09:10
Cabanossi joined
|
|||
zengargoyle | and video sorta messed up a bit. | 09:10 | |
09:10
nadim left
|
|||
araraloren | haha | 09:11 | |
Seq is different from List Array, it can only be iterate once | 09:12 | ||
zengargoyle | hehe, yeah. there was just some bit where i went from understanding to a little bit of WAT? that i think would be fixed by a re-watch and looking at slides and not getting distracted. | ||
09:13
nadim joined
|
|||
zengargoyle | yeah, my problem is Seq poping up when you don't expect it to be a Seq and haven't prepared.... | 09:13 | |
more bad p5 everything is an array habit than actual problem. | |||
araraloren | yeah | 09:14 | |
nadim | zengargoyle: .Seq that have already been iterated, a dream! | ||
zengargoyle | my worst nightmare error that i see way too much! because me stupid that particular way. :) | 09:15 | |
nadim | Zoffix posted a "who ate my Seq" piece of code a few days ago that can be very useful. | ||
zengargoyle | yeah, i understand the Seq thing, i just don't notice it untill .... | 09:16 | |
nadim | it takes time to learn to work with Seqs, particularely when you generate them without thinking about them. I completely hated them, you'll get use don't wory :) | 09:17 | |
zengargoyle | i sorta need to change to expecting Seq and the Array is the weird thing. :) | ||
at least it's an error that "i know what that means". | 09:18 | ||
nadim | Zoffix's code if it can get you out of troubles: Seq.^lookup("iterator").wrap: sub (|) { say "touched in: "; for 3..20 { try say "\t -> {.name || <anon>} ({.file}:{.line})" with callframe($_).code }; put(); nextsame; }; | 09:19 | |
09:19
mr-foobar left
|
|||
nadim | also, if you use the right sigil you'll have less problems, put stuff in @arrays rather than transporting them around in $scalars | 09:20 | |
09:20
mr-foobar joined
|
|||
zengargoyle | how new is that article? (i usually do read Zoffix in my feed but that doesn't sound familiar), maybe i missed that. | 09:21 | |
yeah, i get and can now handle a Seq most of the time, it's just that i don't expect them because p5. | 09:22 | ||
lazy hasn't burned into my brain yet. | 09:23 | ||
09:26
Exodist left
09:27
Exodist joined
|
|||
zengargoyle | heh, and really it seems like $@%& are acually just new contexts.... that aren't context based on location but context based on the term involved..... | 09:29 | |
araraloren | yeah | ||
zengargoyle | it seems so slightly different from p5 that i don't quite know how to explain... :P | 09:30 | |
araraloren | docs.perl6.org/language/5to6-nutsh...e_creation | 09:31 | |
It should be `item context` mentioned here | 09:32 | ||
And next section Dereferencing is talk about @%$ () | 09:34 | ||
zengargoyle | i don't know, the whole reference/dereference thing is for p5 to p6 explaining. so it doesn't actually mean much. | 09:35 | |
it's all containers. | |||
and $@%& is *gah* like gender. they're all the same thing and the sigil is just some expected behavior. :) | 09:37 | ||
araraloren | And I guess it is same thing has different mean | 09:38 | |
in different location, as you said | |||
:< | |||
zengargoyle | yeah, i mean if you do the sigil-less my \x = ( 1, 2, 3 ) | ||
it won't behave like a list would if you named it $x, but if you gave it to something expecting a list, both would be the same. | 09:39 | ||
araraloren | yeah | 09:40 | |
zengargoyle | like IIRC... my \f = sub { say "hello" } doesn't do f() because that is & magic, but f.() works. | ||
my &f = sub { say "Hello" } works as just f or f() because the & describes expectations. | 09:41 | ||
araraloren | Then f is totally a reference here, yeah you are right | ||
09:42
lizmat left
|
|||
araraloren | m: my \f = (1, 2, 3); say "A" ~ $_ for f; | 09:42 | |
camelia | A1 A2 A3 |
||
zengargoyle | there are no real references i think.... everything is an object. a 'reference' is just an object in a scalar container. | ||
--ish | |||
references like C or perl 5 where it's a pointer like thing. | 09:43 | ||
araraloren | docs.perl6.org/language/variables#..._variables | 09:44 | |
zengargoyle | that's like the container thing... the magic is that a scalar container tries to be invisible so you never notice it. | ||
09:44
andreoss joined
|
|||
araraloren | I mean reference is like C# or JAVA | 09:44 | |
zengargoyle | ah, me no do C# or Jave. :) neverming... | 09:45 | |
araraloren | `Sigilless variables do not enforce context, so they can be used to pass something on as-is:` | 09:46 | |
This is tell the truth | 09:47 | ||
zengargoyle | yeah, i see that as like: $x -> scalar -> Int(2) is my $x = 2, my \x = 2 is x -> Int(2) | ||
araraloren | zengargoyle, ++ | 09:48 | |
zengargoyle | no container. using 'x' gets you the actual object. using $x does magic scalar hiding and gives you the object, but there's a box there if you look hard enougn. | 09:49 | |
araraloren | And sigil-less variable can not be modified, cause they don't know what context they be | 09:50 | |
zengargoyle | and list is ( Int, Int, Int ) like (read-only "it's an object darn it) and array is ( scalar->Int, scalar->Int) but you just don't notice. :) | ||
araraloren | Cool! | ||
zengargoyle | yeah... hehe, they be but are zen! | 09:51 | |
araraloren | haha | ||
zengargoyle | please note i could be totally wrong and nobody is here to tell me. :P | ||
araraloren | I know | 09:52 | |
Container is also something they help us understand language syntax | 09:53 | ||
It's no different | |||
09:56
pmurias joined
|
|||
pmurias | hi | 09:56 | |
araraloren | pmurias, hi | ||
09:56
edehont left
|
|||
basket | hi pmurias | 10:00 | |
zengargoyle | i need to check docs again, but i think i would be bad doc writer... | 10:01 | |
araraloren | :) me too | ||
zengargoyle | maybe one or two pages of the container and other key things and "just read this anyway" would make doc better in the end. | 10:02 | |
andreoss | m: constant Foo := Metamodel::ClassHOW.new_type( name => 'Foo' ); Foo.^compose(); class Foo::B is Foo {} | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> 'Foo::B' cannot inherit from 'Foo' because 'Foo' isn't composed yet (maybe it is stubbed) at <tmp>:1 |
||
zengargoyle | like axioms of math or something... :) | ||
10:02
hythm_ left
|
|||
zengargoyle | from these all things arise... (except for the few exceptions... ) | 10:03 | |
andreoss | is there a manual which explains it? | ||
zengargoyle | i don't know, i read docs long ago, but it's hard to go back and re-read because of "i already read this" or "this is easy". | 10:04 | |
and finding the "we finally documented this one thing" is hard. | |||
araraloren | m: constant Foo := Metamodel::ClassHOW.new_type( name => 'Foo' ); Foo.^compose(); say Foo.new; | ||
camelia | Foo.new | ||
araraloren | andreoss, I would guess Foo:B need Foo at compiler time | 10:05 | |
zengargoyle | i remember reading docs once upon a time and Synopses and then just watching IRC and catching explanations. | ||
araraloren | or something like that | ||
and Foo does not create yet | 10:06 | ||
zengargoyle | a wiser me woulc have saved everything good. :) | ||
andreoss | m: INIT {constant Foo := Metamodel::ClassHOW.new_type( name => 'Foo' ); Foo.^compose(); }; class Foo::B is Foo {} | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> 'Foo::B' cannot inherit from 'Foo' because 'Foo' isn't composed yet (maybe it is stubbed) at <tmp>:1 |
||
araraloren | Haha, we need a book :) | 10:07 | |
zengargoyle | m: BEGIN {constant Foo := Metamodel::ClassHOW.new_type( name => 'Foo' ); Foo.^compose(); }; class Foo::B is Foo {} | ||
camelia | ( no output ) | ||
xtreak | I have a program that makes CPU run at 100% but gives no output. pastebin.com/x7yVWRe4 | ||
andreoss | what does 'stubbed' mean? | 10:08 | |
zengargoyle | m: BEGIN {constant Foo := Metamodel::ClassHOW.new_type( name => 'Foo' ); Foo.^compose(); }; class Foo::B is Foo {}; Foo::B.new.^name.say | ||
camelia | Foo::B | ||
araraloren | andreoss, it's like a method only has declaration | ||
not implement | |||
xtreak | I am trying to match [1,2,3] and used the above regex. I don't know why it keeps running instead of failing or passing. I have also come across ~ to match '[' ~ ']' <numbers> | ||
araraloren | m: CHECK {constant Foo := Metamodel::ClassHOW.new_type( name => 'Foo' ); Foo.^compose(); }; class Foo::B is Foo {} | 10:09 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> 'Foo::B' cannot inherit from 'Foo' because 'Foo' isn't composed yet (maybe it is stubbed) at <tmp>:1 |
||
araraloren | INIT is happen at run time | 10:10 | |
docs.perl6.org/language/phasers#Execution_Order | |||
zengargoyle | /<numlist>/ not /<numbers> is first thing. | 10:12 | |
xtreak | Yes numlist doesn't match. So I tried <numbers>+ | 10:14 | |
araraloren | yeah, I faced a lot of `100% CPU` | ||
m: my rule numbers { <[0..9]>\,? }; my rule numlist { '[' ~ ']' <numbers> }; say "[1,12]" ~~ /<numbers>+/; | 10:15 | ||
camelia | 「1,」 numbers => 「1,」 |
||
zengargoyle | gist.github.com/8995cffb6a495f53d3...ce8c26f43f | ||
araraloren | m: my rule numbers { <[0..9]>\,? }; my rule numlist { '[' ~ ']' <numbers> }; say "[1,12]" ~~ /<numlist>+/; | ||
camelia | Nil | ||
zengargoyle | xtreak: ^^ try looking at that. | ||
araraloren | m: my rule numbers { <[0..9]> \,? }; my rule numlist { '[' ~ ']' <numbers>+ }; say "[1,12]" ~~ /<numlist>/; | 10:16 | |
camelia | Nil | ||
xtreak | zengargoyle: Thanks. Is there a reason why it causes 100% | ||
zengargoyle | yeah, i'm not sure about original code... just know maybe how to do the thing you seem to want. :) | 10:17 | |
wamba | m: my rule numbers { <[0..9]>+ }; my rule numlist { "[" ~ "]" <numbers>+ % "," }; say "[1,12]" ~~ /<numlist | 10:18 | |
>/; | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Unable to parse expression in metachar:sym<assert>; couldn't find final '>' at <tmp>:1 ------> 3ers>+ % "," }; say "[1,12]" ~~ /<numlist7⏏5<EOL> expecting any of: term |
||
zengargoyle | but you match numbers instead of numlist in the code.... | ||
wamba | my rule numbers { <[0..9]>+ }; my rule numlist { "[" ~ "]" <numbers>+ % "," }; say "[1,12]" ~~ /<numlist>/; | ||
m: my rule numbers { <[0..9]>+ }; my rule numlist { "[" ~ "]" <numbers>+ % "," }; say "[1,12]" ~~ /<numlist>/; | 10:19 | ||
camelia | 「[1,12]」 numlist => 「[1,12]」 numbers => 「1」 numbers => 「12」 |
||
10:19
colomon joined
|
|||
xtreak | Yes numlist doesn't match so I tried numbers with commas manually separating it. | 10:20 | |
10:20
ufobat left
|
|||
xtreak | Also why does the example need <[0..9]>* ? Then it has [<[0..9]>*]* . Could it be simplified as [<[0..9]>]* ? I am coming from Perl 5 so I might be wrong here | 10:21 | |
araraloren | m: my rule numbers { <[0..9]> \,? }; my rule numlist { "[" ~ "]" <numbers>+ }; say "[1,2]" ~~ /<numlist>/ | ||
camelia | 「[1,2]」 numlist => 「[1,2]」 numbers => 「1,」 numbers => 「2」 |
||
zengargoyle | <[0..9]>*\,? isn't going to match multiple times if you match <numbers> and not like <numbers>+ | ||
araraloren | m: my rule xxx { <[a..z]>*\,? }; say "xyz123" ~~ /<xxx>/; | 10:22 | |
camelia | 「」 xxx => 「」 |
||
zengargoyle | and * can match nothing, so always matches.... | ||
araraloren | m: my rule xxx { <[a..z]>*\,? }; say "x,y,z," ~~ /<xxx>/; | ||
camelia | 「x,」 xxx => 「x,」 |
||
araraloren | m: my rule xxx { <[a..z]>*\,? }; say "x,y,z," ~~ /<xxx>+/; | ||
zengargoyle | you probably at least want <[0..9]>+ | ||
camelia | (timeout) | ||
zengargoyle | (because * there matches any empty space..... | 10:23 | |
araraloren | m: my rule xxx { <[a..z]>*\,? }; say "x,y,z," ~~ rx:r/<xxx>+/; | ||
zengargoyle | over and over and over with backtracking i would guess.. | ||
camelia | (timeout) | ||
araraloren | If a regex is declared with the rule keyword, both the :sigspace and :ratchet adverbs are implied. | 10:24 | |
rule does not backtrack | |||
zengargoyle | m: my rule xxx { <[a..z]>+\,? }; say "x,y,z," ~~ rx:r/<xxx>+/; | ||
camelia | 「x,y,z,」 xxx => 「x,」 xxx => 「y,」 xxx => 「z,」 |
||
10:24
pharv left
|
|||
araraloren | I think this a bug. | 10:25 | |
;D | |||
xtreak | Thanks. I will take some more time to parse what you said and get back if there are any doubts. | ||
zengargoyle | it is unexpected, but trying to match 'nothing' with backtracing can take forever..... | 10:26 | |
m: my token xxx { <[a..z]>*\,? }; say "x,y,z," ~~ rx:r/<xxx>+/; | |||
camelia | (timeout) | 10:27 | |
zengargoyle | m: my regex xxx { <[a..z]>*\,? }; say "x,y,z," ~~ rx:r/<xxx>+/; | ||
well, maybe. :) | |||
10:27
colomon left
|
|||
camelia | (timeout) | 10:27 | |
zengargoyle | m: my token xxx { <[a..z]>*\,? }; say "x,y,z," ~~ rx/<xxx>+/; | ||
camelia | (timeout) | 10:28 | |
zengargoyle | i still sorta think that <[]>*\,? is pretty much a NULL pattern. zero matches and zero comma. | 10:29 | |
araraloren | m: say "x,y,z," ~~ rx/ [ <[a..z]>*\,? ]+/ | ||
camelia | (timeout) | ||
zengargoyle | it is true after everything.... "hey, i matched noting and no ," let's try again.... "hey, i matched nothing and no ," lets try again.... "hey..... | 10:30 | |
zengargoyle would ask moritz :) | 10:31 | ||
araraloren | And maybe he forgot go forward | 10:33 | |
zengargoyle | m: say 'x' ~~ /<[x]>*\,?/ | ||
camelia | 「x」 | ||
zengargoyle | bah humbug. | ||
10:34
colomon joined
|
|||
zengargoyle | m: say 'x,x' ~~ /<[x]>*\,?/ | 10:34 | |
camelia | 「x,」 | ||
zengargoyle whelp... | |||
araraloren | m: say 'x,x' ~~ /[ <[x]>*\,? ]+/ | 10:35 | |
m: say 'x,' ~~ /[ <[x]>*\,? ]+/ | |||
m: say 'x' ~~ /[ <[x]>*\,? ]+/ | |||
I think there are something wrong in regex | |||
m: say '' ~~ /[ <[x]>*\,? ]+/ | 10:36 | ||
camelia | (timeout) | ||
zengargoyle | yeah, match nothing multiple goes forever... | 10:37 | |
m: say '' ~~ /[ <[x]>*\,? ]*/ | |||
araraloren | Oh, again | ||
camelia | (timeout) | ||
zengargoyle | yeah, that +/* :) | ||
nadim | zengargoyle: the code I posted is not from an article but from this channel | ||
araraloren | m: say '' ~~ /[ <[x]>*\,? ]?/ | 10:38 | |
camelia | 「」 | ||
araraloren | m: say '' ~~ /[ <[x]>*\,? ]+?/ | ||
camelia | 「」 | ||
zengargoyle | nadim: i'm afraid i'm lost... | ||
nadim: i've forgotten what you are referencing. | 10:40 | ||
zengargoyle wonders if irssi has a ?something? thing to search backwadrs through history. | 10:42 | ||
10:42
Guest24020 left
|
|||
zengargoyle | nadim: "Zoffix's code if it can get you out of troubles..." ? | 10:45 | |
zengargoyle cut-n-pasted that into my file of things that might come in handy someday. | 10:46 | ||
nadim: oh, now i think i remember. i didn't miss a Zoffix article because it was chat. | 10:49 | ||
zengargoyle didn't think that much about it. :) | 10:50 | ||
10:50
espadrine joined
|
|||
nadim | zengargoyle: :) | 10:53 | |
zengargoyle follow the Z on twitter so i expect to eventually see stuff. (unless Z has blocked me :) ) but no worries. | 10:57 | ||
zengargoyle is also keeping a cut-n-paste of interesting chat things to maybe digest someday, but mostly to grep through because "i thought i saw that and it's interesting". | 10:59 | ||
11:19
mr-foobar left
11:20
rindolf joined,
mr-foobar joined,
g0d355__ joined
|
|||
zengargoyle goes to bed. | 11:20 | ||
11:23
ChoHag left
11:33
nadim left
11:38
sjoshi joined
11:40
dogbert2 joined
11:41
nadim joined
11:45
araraloren_ joined
11:47
araraloren left
11:56
sjoshi left
12:05
itaipu left
12:07
ChoHag joined
12:11
robertle joined
12:13
xtreak left
12:14
RockyBalboa joined
12:15
medfly joined,
medfly left
12:22
mingdao left
12:24
mingdao joined
12:25
tokomer_ left,
tokomer left
12:36
haha joined,
lichtkind joined,
haha is now known as Guest80930
12:37
Guest80930 is now known as haha_
12:39
Cabanossi left
12:40
Cabanossi joined
12:44
mr-fooba_ joined
|
|||
pmurias | should the rakudo.js webpack loader be called rakudo-loader or perl6-loader? | 12:46 | |
the same question can be asked about perl6-runtime vs rakudo-runtime | |||
12:46
mr-foobar left
12:52
RockyBalboa left
|
|||
moritz | rakudo imho | 12:53 | |
the "perl6" executable that rakudo generates is mostly for historical reasons | |||
pmurias | what where those reasons? | 12:54 | |
moritz | back in the parrot days, there was a language/ directory in the parrot repo, and rakudo happened to be the perl6 language implementation in the parrot tree | ||
and if I remember correctly, the name "rakudo" came up only after that | |||
and nobody ever bothered to change the executable name since then, and now stuff depends on it | |||
13:02
wamba left
13:04
ambs left
|
|||
Zoffix | nadim: err, I wouldn't say "@" is the right sigil for a Seq, as it's not Positional. My suggestion for you to use a @ was because you were getting consumed seq error, suggesting you were reusing your Seq and thus actually needing a List/Array instead of a Seq. Normally, you'd bind a Seq to a $ var so that when you iterate over it, the consumed values don't get cached anywhere | 13:15 | |
13:17
pmurias left
|
|||
Zoffix | Looks like this bug is recent rt.perl.org/Ticket/Display.html?id...et-history I recall trying `my $a := 1…∞; for $a {}` in the past and it wasn't leaking; now it does | 13:18 | |
nadim: but compare these two pieces of code. The first one eats up about 400MB of RAM per second. The second one keeps RAM at 170MB on my box and it doesn't grow. Why? The assignment to the @-sigiled var is caching it | 13:20 | ||
my @a := Seq.new: class :: does Iterator { method lazy (--> True) {}; method pull-one { 42 } }.new; for @a {} # 400MB/s growth | |||
my $a := Seq.new: class :: does Iterator { method lazy (--> True) {}; method pull-one { 42 } }.new; for $a {} # 170MB of RAM flat | |||
actually the first one should just be assignment, not binding.... Why doesn't it cry that I passed it non-positional? | |||
And that Seq can normally just be `1…∞` Seq, but there's some recent bug I mentioned above with gather/take leaking memory | 13:21 | ||
timotimo | Zoffix: maybe because it's the "positional bind failover"? | 13:22 | |
Zoffix | That's for parameters | ||
m: my @a := ().Seq | |||
^ and it works fine in this case (throws) | |||
timotimo | OK, so not just any bind | ||
camelia | Type check failed in binding; expected Positional but got Seq ($(().Seq)) in block <unit> at <tmp> line 1 |
13:23 | |
Zoffix | buggable: speed 4 | 13:24 | |
buggable | Zoffix, ▅█▁▁ data for 2017-08-04–2017-08-05; range: 3.660s–4.594s; 14% faster | ||
Zoffix | jnthn++ | ||
hm, looks like it's trying to consume the Seq before carping about it | 13:26 | ||
m: my @a := Seq.new: class :: does Iterator {method pull-one {IterationEnd}}.new; | |||
camelia | Type check failed in binding; expected Positional but got Seq ($(().Seq)) in block <unit> at <tmp> line 1 |
||
Zoffix | m: my @a := Seq.new: class :: does Iterator {method pull-one {42}}.new; # hang | ||
camelia | (timeout) | 13:27 | |
13:30
xinming left
|
|||
Zoffix | m: my @a := 1…∞; # but this one has `is-lazy` set | 13:31 | |
camelia | Type check failed in binding; expected Positional but got Seq (?) in block <unit> at <tmp> line 1 |
||
13:32
andrzejku joined
|
|||
araraloren_ | m: say Seq ~~ Positional | 13:32 | |
camelia | False | ||
Zoffix | Filed as rt.perl.org/Ticket/Display.html?id=131845 | 13:33 | |
13:35
xinming joined
13:36
BenGoldberg joined
13:38
Cabanossi left
13:40
Cabanossi joined
13:42
bioexpress joined
13:43
xinming_ joined,
xinming_ is now known as newcomer,
newcomer left,
andrzejku left
|
|||
rightfold | Does Perl 6 have diminutives? | 13:46 | |
bioexpress | Hello, is it safe to assume that a `subst` on a variable with a non-string value does stringify that value? | ||
rightfold | bioexpress: if it's Cool | 13:47 | |
bioexpress | rightfold: what does that mean? | ||
13:48
weabot joined
|
|||
bioexpress | It's a base class | 13:50 | |
13:52
ufobat joined
|
|||
BenGoldberg | m: say 1 ~~ Cool; | 13:52 | |
camelia | True | ||
BenGoldberg | m: say pi ~~ Cool; | ||
camelia | True | ||
BenGoldberg | m: say 'abc' ~~ Cool; | ||
camelia | True | ||
BenGoldberg | m: say [] ~~ Cool; | ||
camelia | True | ||
BenGoldberg | m: say {} ~~ Cool; | ||
camelia | True | ||
BenGoldberg | m: say sub {} ~~ Cool; | 13:53 | |
camelia | False | ||
bioexpress | evalbot usage: 'p6: my @a=[1,[1..4],'hello']; my $s = subst( /l/, "K", :g); say $s.WHAT' | ||
p6: my @a=[1,[1..4],'hello']; my $s = subst( /l/, "K", :g); say $s.WHAT; | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Undeclared routine: subst used at line 1. Did you mean 'substr'? |
||
bioexpress | 'p6: my @a=[1,[1..4],'hello']; my $s = subst( /l/, "K", :g); say $s.WHAT;' | ||
BenGoldberg | subst is a method. | ||
13:54
skids joined
|
|||
bioexpress | 'p6: my @a=[1,[1..4],'hello']; my $s = @a.subst( /l/, "K", :g); say $s.WHAT;' | 13:54 | |
'p6: my @a=(1,[1..4],'hello'); my $s = @a.subst( /l/, "K", :g); say $s.WHAT;' | |||
BenGoldberg | m: my @a = [ 1, [1..4], 'hello' ]; say @a.subst: /l/, "K", :g; | ||
camelia | 1 1 2 3 4 heKKo | ||
BenGoldberg | m: my @a = [ 1, [1..4], 'hello' ]; say @a.subst: /1/, "K", :g; | 13:55 | |
bioexpress | m: my @a=(1,[1..4],'hello'); my $s = @a.subst( /l/, "K", :g); say $s.WHAT; | ||
camelia | K K 2 3 4 hello | ||
(Str) | |||
bioexpress | Is this allowed? | ||
BenGoldberg | ? | ||
What do you mean? | |||
bioexpress | Can I rely on this stringification? | 13:56 | |
BenGoldberg | Yes. | ||
bioexpress | Thx! | ||
BenGoldberg | It's part of the specification, not a mere implementation detail. | ||
moritz | arrays always stringify by joining with a single blank | ||
bioexpress | m: my @a=(1,[1..4],'hello'); my $s = @a.subst( /Q/, "K", :g); say $s.WHAT; | 13:57 | |
camelia | (Str) | ||
bioexpress | m: my @a=(1,[1..4],'hello'); @a.=subst( /Q/, "K", :g); say @a.WHAT; | 13:59 | |
camelia | (Array) | ||
bioexpress | m: my @a=(1,[1..4],'hello'); @a.=subst( /Q/, "K", :g); say @a.perl; | 14:00 | |
camelia | ["1 1 2 3 4 hello"] | ||
araraloren_ | m: say 'x,x' ~~ /[ <[x]>*\,? ]+/ | 14:01 | |
14:02
BenGoldberg left
|
|||
araraloren_ | moritz, Is ^^ code has a bug on regex ? | 14:02 | |
camelia | (timeout) | ||
araraloren_ | m: say '' ~~ /[ <[x]>*\,? ]+/ | ||
even null string hang on | |||
camelia | (timeout) | 14:03 | |
timotimo | no | ||
moritz | araraloren_: did you mean x*%\, or so? | 14:04 | |
timotimo | you're matching a single zero-width string infinitely often | ||
moritz | don't quantify regexes that can match a zero-width string | ||
bioexpress | moritz: who in the code above did the joining of the array with a single blank? | 14:05 | |
timotimo | it's getting Str called on it | 14:06 | |
by Cool's subst method | |||
araraloren_ | moritz, No, I just found that hang on | ||
timotimo | m: .perl.say for Cool.^find_method("subst") | ||
camelia | method subst (Cool $: |c is raw) { #`(Method|27087000) ... } | ||
timotimo | s: Cool, "subst" | 14:07 | |
SourceBaby | timotimo, Sauce is at github.com/rakudo/rakudo/blob/abf1...ol.pm#L172 | ||
timotimo | okay it calls Stringy on itself | ||
bioexpress | Thx! | 14:08 | |
14:12
bioexpress left,
skids left
14:17
araraloren_ is now known as araraloren
14:21
nadim left
14:22
AlexDaniel joined
14:24
pilne joined
14:46
majensen joined,
nadim joined
14:49
majensen left
14:56
itaipu joined
15:20
nhywyll joined
15:26
wamba joined
15:36
andreoss left
15:48
andreoss joined
15:53
http_GK1wmSU joined
|
|||
araraloren | m: use NativeCall; sub rand_r(uint32 is rw) of int32 is native(Str) { * }; say &rand_r; | 15:54 | |
camelia | sub rand_r (uint32 $ is rw --> int32) { #`(Sub+{Callable[int32]}+{NativeCall::Native[Sub+{Callable[int32]},Str]}|108130800) ... } | ||
15:55
http_GK1wmSU left
|
|||
ufobat | :) | 16:02 | |
yoleaux | 2 Aug 2017 22:56Z <Zoffix> ufobat: some tips for your resources issue: irclog.perlgeek.de/perl6/2017-08-02#i_14960004 | ||
4 Aug 2017 22:44Z <Zoffix> ufobat: please report the bugs you find, so they could be fixed. I filed your 1 > 1 True as rt.perl.org/Ticket/Display.html?id=131842 | |||
ufobat | Zoffix, yeah. i wasn't sure if i wasn't doing something wrong | 16:03 | |
16:04
LeCamarade left
16:08
Cabanossi left
16:10
Cabanossi joined
16:14
geekosaur left
16:16
geekosaur joined
16:18
zakharyas joined
|
|||
ufobat | i noticed some ppl complained about installation issues with bailador. i think it is fixed now: blogs.perl.org/users/martin_barth/2...ocker.html | 16:19 | |
16:20
cdg joined
|
|||
MasterDuke | ufobat: cool. fyi, "espacially" | 16:21 | |
16:22
zakharyas left,
nhywyll left
|
|||
ufobat | fixed, thank you | 16:23 | |
16:31
itaipu left
|
|||
Geth | whateverable: be9c01a870 | (Aleks-Daniel Jakimenko-Aleksejev)++ | t/bisectable.t Everyone loves performance improvements! №2 See also f2d1d8c13e673da1080216873a70467062f8668f. You may think that tests with unbounded queries are taking more time because we simply have more commits now, but this does not matter given the logarithmic nature of the process. Also, even if we have one ... (13 more lines) |
16:34 | |
16:34
BenGoldberg joined
16:38
Cabanossi left
16:40
Cabanossi joined
|
|||
nadim | is there a way to write @very_long_var = @very_long_var.map {...} shorter? kinda @very_long_var .map= {...} | 16:48 | |
MasterDuke | @very_long_var .= map() should work, right? | 16:49 | |
nadim | I try | ||
nope | 16:50 | ||
andreoss | m: my @a = 1,2,3; @a.=map(* + 1).say | 16:51 | |
camelia | [2 3 4] | ||
nadim | Sorry, yes, did it wrong | ||
left the dot on the wrong side | 16:52 | ||
16:52
raschipi joined
16:54
Ven joined
|
|||
araraloren | m: my @a = 1, 2, 3; @a .= map(* + 2); say @a; | 16:55 | |
camelia | [3 4 5] | ||
16:55
Ven is now known as Guest18728
17:07
pharv joined
17:11
committable6 left,
benchable6 joined,
ChanServ sets mode: +v benchable6,
committable6 joined,
ChanServ sets mode: +v committable6,
statisfiable6 joined,
ChanServ sets mode: +v statisfiable6
17:17
tzekid left
17:19
pharv left
17:25
BenGoldberg left
|
|||
awwaiid | Hello peeps! I'm trying to work around a contest bug in the ICFP Contest, and need to call some fnctl stuff to turn my stdin/out from non-blocking back to blocking. Any pointers? | 17:26 | |
17:30
araraloren left
17:33
ChoHag left
17:34
ChoHag joined
17:38
Cabanossi left,
cdg_ joined,
cdg_ left,
cdg_ joined
17:39
cdg left
17:40
Cabanossi joined
17:46
nadim left
18:01
mr-fooba_ left
18:04
Guest18728 left,
nadim joined
18:11
raschipi left
18:30
andreoss left
18:43
haha_ left
18:44
haha joined,
anser joined,
haha is now known as Guest86037
18:53
Cabanossi left
18:55
Cabanossi joined
18:57
szabgab joined,
snarkyboojum joined
19:04
snarkyboojum left,
Ven joined
19:05
Ven is now known as Guest52379
19:07
wamba left
19:10
setty1 left
19:13
xinming left
19:15
Guest86037 left,
wamba joined
19:17
darutoko left
19:18
wamba left
19:24
anser left
|
|||
moritz | awwaiid: use nativecall? | 19:28 | |
19:34
dogbert2 left
|
|||
timotimo | awwaiid: stdin and stdout shouldn'- be nonblocking any more with recent rakudo | 19:36 | |
19:38
Cabanossi left
19:40
Cabanossi joined
|
|||
timotimo | awwaiid: at least strace -e fcntl only shows a getfd EBADF, setfd, cloexec, and getfl for rdonly|largefile | 19:40 | |
19:48
hythm_ joined
19:51
TEttinger joined
|
|||
awwaiid | timotimo: naw, this is an external program that invokes mine and sets it nonblocking on the other end | 19:53 | |
moritz: yeah, that appears to be the current answer. I see that in the most-wanted-modules list too | |||
hythm_ | perl5 has this syntax to create a helper to use in templates helper db => sub { $dbh };, how to do the same thing in perl6? I defined a sub in app.p6 but it is not recognized in templates | 19:54 | |
timotimo | ah! | ||
yeah, i'd say use nativecall to get at fcntl | 19:55 | ||
or open another instance of stdin from /dev/stdin or /dev/tty or whatever | |||
awwaiid | timotimo: yeah. It's a bit of a yak shave, so at this point I'm waiting for the contest organizers to patch it on their end :) | ||
timotimo | right | 19:56 | |
glad to hear you're using perl6 in a contest setting :) | |||
awwaiid | contest isn't over, ya'll can join :) | ||
icfpcontest2017.github.io/ | |||
This contest is _specifically_ to show off programming languages | |||
timotimo | well, yeah :) | 19:58 | |
20:07
szabgab left
20:08
haha joined
20:09
haha is now known as Guest18395
20:12
rindolf left,
Guest18395 left
20:13
cdg joined
20:14
haha_ joined
|
|||
Geth_ | perl6-examples: 09121546d1 | (David Warring)++ | 3 files GLRish fixes for 99-problems |
20:15 | |
perl6-examples: ffb8930ed4 | (David Warring)++ | 3 files IOish fixes for cookbook |
|||
20:16
rindolf joined
20:17
cdg_ left
20:21
Guest52379 left
20:28
Ven joined,
Ven is now known as Guest75975
20:35
dogbert11 joined
20:40
BenGoldberg joined
20:41
hythm_ left
20:42
hythm_ joined,
BenGoldberg left
20:43
BenGoldberg joined,
cdg left
|
|||
Geth_ | perl6-examples: 1e781e2161 | (David Warring)++ | t/categories/tutorial.t fix tutorial word-wrap test |
20:46 | |
20:50
colomon left
20:51
colomon joined
20:56
colomon left
21:00
colomon joined
21:07
channing1 joined
21:29
wamba joined
21:33
Guest75975 left
|
|||
domm | hythm_: no idea how to do that, but I do recommend to pass a DBH to a template - unless you want to re-implement PHP :-) | 21:33 | |
..I do NOT recommend.. | |||
in fact, calling any methods/functions from inside a template can only lead to tears | 21:34 | ||
21:37
semigloss joined
|
|||
Geth_ | perl6-examples: 530542e6c7 | (David Warring)++ | .travis.yml add travis test job for Rakudo 2017.07 |
21:39 | |
hythm_ | domm: makes sense, I wanted to try both to see what is best practice, at first I wanted to keep code related to each view in views directory on its own template (db connection, queries,...), but seems it will lead to errors | 21:45 | |
21:45
BenGoldberg left
21:48
d33pb00k-GK1wmSU joined
21:51
d33pb00k-GK1wmSU left
|
|||
domm | I prefer to prepare all data needed for a view in a model, and then pass that on for rendering | 21:53 | |
if it's a small one-person project, you might get away with passing a dbh to the template, but usually you don't want the designer/html-coder to have full access to the DB... | 21:54 | ||
21:56
ufobat left
22:02
eater[sha2017] joined
|
|||
eater[sha2017] | You guys may enjoy this: github.com/the-eater/shinit :) | 22:04 | |
an init system in perl6 :') | 22:05 | ||
MasterDuke | eater[sha2017]: heh. you should .tell lizmat about it, might make it into the perl 6 weekly | 22:11 | |
22:11
haha_ left
22:16
Ptolemarch left
22:18
tushar joined
22:19
tushar left
|
|||
nadim | I agree.' | 22:27 | |
22:38
Cabanossi left
22:40
Cabanossi joined
|
|||
eater[sha2017] | hmm | 22:52 | |
zt.je/4n1V0.png | |||
how does this happen | |||
hmm, only happens on ro filesystem | |||
22:53
rindolf left
|
|||
zengargoyle | moritz++ -- don't quantify regexes that can match a zero-width string -- DIHWIDT | 22:53 | |
zengargoyle surprised that is in spec glossary but not docs.perl6.org glossary... conscious choice? | 22:59 | ||
23:09
Cabanossi left
23:10
Cabanossi joined
|
|||
eater[sha2017] | .tell lizmat You may like this: github.com/the-eater/shinit | 23:10 | |
yoleaux | eater[sha2017]: I'll pass your message to lizmat. | ||
eater[sha2017] | :) | ||
23:10
eater[sha2017] left
23:11
nadim left
|
|||
zengargoyle lol at me, spent a minute wondering why the *** some glossary entries had a '§' marker and some didn't. grrr .hover links. :) | 23:13 | ||
23:14
wamba left
23:34
AlexDaniel left
23:37
Actualeyes left
23:45
basket left
|
|||
tbrowder | hi, #perl6 | 23:47 | |
23:47
espadrine left
|
|||
tbrowder | a couple of days ago i asked about using stdout and stderr with NativeCall. if i have a function that eiither writes to stdout or an explicit file, would using a pipe be a better choice than reading the redirected stdout or the explicit output file? | 23:50 | |
reading a file is more "natural" to me, but i'm open to using best practices. | 23:53 | ||
Geth | doc: 5b9f4c5dde | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/modules-core.pod6 s/Perl/Rakudo impl/; Most of these modules aren't standard Perl 6. (also, didn't we want to call them "standard" rather than "core"?) |
23:54 |