»ö« 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.
Geth doc: a381d7794f | (Alex Chen)++ | doc/Language/functions.pod6
Remove duplicate 'and'
02:10
synopsebot Link: doc.perl6.org/language/functions
thou .ask tbowder, maybe you're interested in this prior work (older, but might help you?) on pod tables inside rakudo: github.com/rakudo/rakudo/compare/pod-table 02:52
yoleaux thou: What kind of a name is "tbowder,"?!
thou .ask tbowder maybe you're interested in this prior work (older, but might help you?) on pod tables inside rakudo: github.com/rakudo/rakudo/compare/pod-table 02:53
yoleaux thou: I'll pass your message to tbowder.
thou .ask tbrowder maybe you're interested in this prior work (older, but might help you?) on pod tables inside rakudo: github.com/rakudo/rakudo/compare/pod-table
yoleaux thou: I'll pass your message to tbrowder.
thou yoleaux, please get the message to someone! 02:54
geekosaur "third time lucky" :p 02:55
tbrowder thou: tbrowder is my first initial and last name. i don’t like aliases and keeping the same id helps by uncomplicating my life around the various internet communities. 02:57
yoleaux 02:53Z <thou> tbrowder: maybe you're interested in this prior work (older, but might help you?) on pod tables inside rakudo: github.com/rakudo/rakudo/compare/pod-table
thou tbrowder, my name is Tim Smith, being generic enough that it's nearly always taken anywhere I want to sign up for something. :-) 02:59
tbrowder thou: that grammar looks interesting but i don’t see how tables with whitespace column separators can be defined.
geekosaur at least they didn't manage to bowdlerize you :p 03:00
thou Could be, I didn't dig into it.
tbrowder they rely on aligned columns over the set of rows that, imho, requires the complete set to analyse, and tables with visual column separators don’t mix with the other table type. 03:02
thou tbrowder, the untwine patch isn't all that large, but I've done very little rakudo hacking so may have just a bit of a curve before I can try it. Given that it's a few years old, I'm not sure the original author is active anymore? Is LLFourn around, looks not based on colabti.org/irclogger/irclogger_log...ck=checked 03:03
geekosaur irc is case independent 03:06
tbrowder i see llfourn as a member—probably the same person
geekosaur not especially active of late but definitely in here 03:07
tbrowder nite all...
thou .ask llfourn are you interested in getting your Untwine change merged? there are a few of us who would like to see it done, I'm willing to look at merging & testing if desired. github.com/rakudo/rakudo/pull/651/...2e74df8ceb 03:09
yoleaux thou: I'll pass your message to llfourn.
thou thanks geekosaur
Geth doc: fluca1978++ created pull request #1704:
Fix reference to Perl 5.
09:22
Geth doc: 003473bf18 | (Luca Ferrari)++ | doc/Language/regexes.pod6
Fix reference to Perl 5.

It seems the comment working on regexp was referencing the similar feature of Perl 5, not Perl 6.
09:27
synopsebot Link: doc.perl6.org/language/regexes
doc: b97a772b86 | (Juan Julián Merelo Guervós)++ (committed using GitHub Web editor) | doc/Language/regexes.pod6
Merge pull request #1704 from fluca1978/fix-comment-regexp

Fix reference to Perl 5. Thanks :-) Are you doing 24 pull requests? :-)
DrForr I was trying to extend the Test class before writing my Advent article. There are several problems with this approach, the first one being that it's not a class. Any thoughts on this? 09:35
tyil why is that a problem? 09:40
DrForr I'd prefer to be able to subclass in order to add functionality, what would you suggest instead? 09:47
tyil you could just make more subs? 09:48
DrForr Yeah, that was my next thought - 'sub Test::foo {} I'm always forgetting is an option. 09:49
DrForr Oh good, the CJKV and Roman numerals render correctly on FF at work. 10:44
Geth doc: fluca1978++ created pull request #1706:
Remove reference to Perl 5 in not 5-to-6 document.
10:50
DrForr Aand the advent posting so far tripled my pageviews. 10:51
tyil nice 10:52
araraloren o/ 10:54
DrForr Admittedly it doesn't take a *lot* to do that with what I get in general, but it's a good feeling. 11:01
moritz on day one, Zoffix++ got 5.7k views :-) 11:41
DrForr I'm not trying to set any records, I'm just checking out the traffic to my site from the p6 advent posting for the helluvit. 11:52
300 views already on the main site, woo and *hoo*. 11:55
tyil is there an op like =~= but for words/letters? 12:26
moritz no 12:27
tyil :(
moritz there are string difference modules: modules.perl6.org/search/?q=distance 12:29
mahafyi are there any resources for commercial perl6 support? 12:35
DrForr Not yet that I'm aware of, but I'm terribly excited by the fact that we have people deploying code live that we might be able to actually *talk* about instead of make vague statements about :) 12:37
mahafyi DrFprr, lol.
DrForr , typo 12:38
DrForr Oh. If you mean perl5 there are plenty of consultants out there, no real "Perl5 Inc." office though. 12:40
mahafyi well, I really meant I'd like to talk to folks in here to help me build many things (I originally was here on a borrowed nickname, kannan, and I havent yet gotten around to learning much perl6) but I am contrarian enough to risk it 12:41
DrForr Aha. 12:42
Most of us are already building stuff but happy to lend a hand, got a project in mind?
mahafyi for the record I fully intend to learn perl6 .. but i also want to pay for it when I use it
yes, I would like to bootstrap a startup, providing cloud telephony, as well as I have a highly specialized area for a particular product 12:43
DrForr Pay as in money? You can always contribute to the Perl6 development fund...
mahafyi DrForr, yes I surely will, but I'd like to have someone to actually help me build things. 12:44
so far the only money i spent has been on Learning Perl 6 Fundamentals, :) 12:45
DrForr While I haven't seen a Perl 6 consultancy service spring up yet, I'm sure people in this very channel will be willing to help out. 12:45
mahafyi thats great, i will jump on it 12:46
mahafyi and i believe i typed the title of Moritz Lenz's book wrong , oops 12:46
DrForr Careful, the author might just hear you :) 12:47
moritz does 12:48
mahafyi: pmichaud and a few others had the website rakudoconsulting.com; seems to be defunct now 12:49
mahafyi moritz : thanks
moritz fwiw I've been paid to give Perl 6 training before
(about a year ago)
DrForr I've been paid a few times myself, but not corporate clients.
mahafyi I am not a corporate client, I may even have to shuck a regular job. If i get funded, well, then its another ballgame, ha ha 12:51
moritz I've written my blog post for day 12, logged-in users can preview it here: perl6advent.wordpress.com/?p=6874&...eview=true 12:55
proof-reading and comments would be welcome
_ramix_ Hi! I like to publish a post in the Perl6 Advent Calendar: perl6advent.wordpress.com . How can I send a proposal? Thanks! 13:02
moritz _ramix_: the schedule is at github.com/perl6/mu/blob/master/mi...7/schedule and already quite full 13:05
_ramix_: but, there are still options
you could write a post for the 25th
or you could write a post, and hope that somebody doesn't write theirs in time, and we can swap it in
or somebody could give up their spot
DrForr (the latter has happened before, I know, I've done it :) (though my issue was network related more than anything.) 13:06
_ramix_ ook, thanks!
moritz _ramix_: what do you want to write about? 13:07
[Coke] hasn't announced a topic yet, so he might be a candidate for giving up a spot
mahafyi and I am back. Whenever one attempts to great good to the world (like build a new company with perl6) one faces many hurdles (like a power outage)
_ramix_ A post about HTTP and Concurrency (IO::Sockets:Async) 13:08
moritz _ramix_: nice :-)
DrForr Also a certain moritz has two posts there :) Not that I'm encouraging anyone to stop writing :)
_ramix_ this is the post: ramiroencinascom.wordpress.com/201...t-of-view/
moritz DrForr: yes, but I already wrote both, so I'm loath to throw one away :-) 13:09
DrForr Dude. You know what they say: Write one to throw away :)
Geth mu: c2a5c84218 | (Ramiro Encinas)++ (committed using GitHub Web editor) | misc/perl6advent-2017/schedule
Update schedule
13:12
moritz _ramix_: please /msg me your wordpress username or email address, then I can send you an invitation to the perl6advent wp blog 13:14
Geth mu: c0246309c5 | (Tom Browder)++ (committed using GitHub Web editor) | misc/perl6advent-2017/schedule
change title
13:32
lizmat moritz: no comments on blog post for 12th :-) 13:42
yoleaux 12:43Z <brrt> lizmat: jnthn nwc10 fixed
perlpilot tbrowder: I didn't count 4, you did. "Using got allowed me to easily set up all four repos." 14:24
tbrowder ah! i meant the two on git hub and two locally. works well for me. how do you use two? 14:25
perlpilot oh, then I just misunderstood. you're good :) 14:26
tbrowder ok, do you think i need to emphasize that? 14:27
perlpilot maybe? 14:28
tbrowder++ btw :)
tbrowder i added reference to the forks being on github
perlpilot tbrowder: maybe link to the PRs you mention in Success! so that your reader can see what you have wrought :-) 14:29
tbrowder good idea
tbrowder perlpilot: any more comments at the moment? i'm going to update the post on the site in a moment. btw, roast PR #361 hasn't been merged yet--waiting for samcv to see my answer to her question 14:49
tbrowder and i think the leading space on the code blocks will be gone 14:50
pmurias nqp: my $m := ("foo" ~~ /$<bar>=\w+/); nqp::say($m<bar> || '') 14:51
comborico1611 Does anyone know the difference between multiprogramming and time sharing? I've done a search on it and I'm still confused. The best answer I have is time sharing allows multiprogramming to be done in equal shares based on time limit. 15:21
mscha How do you specify that a sub returns a list of integers? 15:24
m: sub foo returns List { 1,2,3 }; say foo;
camelia (1 2 3)
mscha This works, but can I specify "of integers"? 15:25
tbrowder my 8 dec post is available for critique on wordpress--i would appreciate some other eyes on it (thnx to perlpilot for an earlier review). note that Zoffix's new highlighter still throws an exception so i'm using last year's version. 15:26
perlpilot comborico1611: en.wikipedia.org/wiki/Time-sharing :-) 15:28
mscha: why do you want "List of Int"? 15:29
moritz comborico1611: with multiple cores, you can have multiple programs run in parallel without time sharing 15:31
perlpilot mscha: you can probably do something like: subset ListOfInt of List where { all(@($_)) ~~ Int }; sub foo returns ListOfInt { 1, 2, 3 }
moritz comborico1611: or phrased differently, time sharing is an implementation of multiprogramming, but not the only one
sjn m: subset ListOfInt of List where .all ~~ Int; sub foo (--> ListOfInt) { 1, 2, 3 }; say foo(); 15:38
camelia (1 2 3)
sjn m: subset ListOfInt of List where .all ~~ Int; sub foo (--> ListOfInt) { 1, 2, 3.14 }; say foo();
camelia Type check failed for return value; expected ListOfInt but got List ($(1, 2, 3.14))
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
perlpilot forgets that all/any/one/none are methods apparently 15:39
sjn is it possible to add a custom error message to the subset? 15:41
sjn m: subset ListOfInt of List where .all ~~ Int || die "ohnoes!"; sub foo (--> ListOfInt) { 1, 2, 3.14 }; say foo(); 15:43
camelia ohnoes!
in sub foo at <tmp> line 1
in block <unit> at <tmp> line 1
sjn m: subset ListOfInt of List where .all ~~ Int || die "ohnoes!"; sub foo (--> ListOfInt) { 1, 2, 3 }; say foo();
camelia (1 2 3)
comborico1611 Moritz, I see. Thank you. 15:46
lizmat tbrowder: small nit: "Perl 6 Rakudo compiler" I usually phrase that as "Rakudo Perl 6 compiler" for SEO reasons 16:02
ilmari just like you'd say "GNU C Compiler", not "C GNU Compiler" 16:03
perigrin depends on how open certain people fee the C standard is 16:08
er feel
mscha Thanks for the tips, perlpilot, sjn. 16:10
tbrowder lizmat: i will correct it, thnx 16:14
[Coke] (advent spot) if someone is excited, I can cede my spot, yes. 16:19
lizmat tbrowder: perhaps elaborate a bit on what is possible now that wasn't before your pR's ?
[Coke] (though I'm spending next week travelling for work, so will have some time to devote to it) 16:22
tbrowder lizmat: ok! 16:34
DrForr _ramix_ (Ramiro Encinas) was the person to talk to. 16:38
buggable New CPAN upload: cro-core-0.7.2.tar.gz by JNTHN cpan.metacpan.org/authors/id/J/JN/...7.2.tar.gz 16:54
New CPAN upload: cro-http-0.7.2.tar.gz by JNTHN cpan.metacpan.org/authors/id/J/JN/...7.2.tar.gz
New CPAN upload: cro-tls-0.7.2.tar.gz by JNTHN cpan.metacpan.org/authors/id/J/JN/...7.2.tar.gz
New CPAN upload: cro-0.7.2.tar.gz by JNTHN cpan.metacpan.org/authors/id/J/JN/...7.2.tar.gz
New CPAN upload: cro-websocket-0.7.2.tar.gz by JNTHN cpan.metacpan.org/authors/id/J/JN/...7.2.tar.gz
New CPAN upload: cro-zeromq-0.7.2.tar.gz by JNTHN cpan.metacpan.org/authors/id/J/JN/...7.2.tar.gz
tbrowder lizmat: see changes incorporated now 17:09
wander m: sub () returns Array[Int] { Array[Int].new([1,2,3]) }() 17:15
camelia ( no output )
wander m: say sub () returns Array[Int] { Array[Int].new([1,2,3]) }()
camelia [1 2 3]
wander m: say Array[Int].ACCEPTS([1,2,3])
camelia False
wander m: say sub () returns Array[Int] { [1,2,3] }()
camelia Type check failed for return value; expected Array[Int] but got Array ($[1, 2, 3])
in sub at <tmp> line 1
in block <unit> at <tmp> line 1
tbrowder my advent post no longer fails with Zoffix's new highlighter, and the results are much nicer than using the old one! 17:16
.tell Zoffix thnx for the new highlighter!
yoleaux tbrowder: I'll pass your message to Zoffix.
wander tbrowder: cong.
tbrowder argh! my advent post has disappeared!! help!! 17:24
tbrowder is it really there or do i have to start over?? 17:24
tbrowder ok, i found it (WP sucks rocks) 17:25
poohman hello all - a quick question - in regex, how to negate a literal? !'>' or ^'>' or -'>' 18:23
TimToady <!before '>'> 18:24
note that it doesn't advance the cursor 18:25
poohman thanks anyway to advance cursor as well, if am not asking too much 18:26
TimToady well, how much? one character? the length of the literal? 18:27
just put a . to advance one char
kyan Hi! So I had a big .p6 file, and now I cut out part of it and pasted it into another file. How can I make the first file import it? 18:27
TimToady but if you're doing a single char, then <-[ > ]> will do that already 18:28
poohman {!before'<'.}* 18:29
kyan I tried putting "unit module EmParser;" at the beginning of the files, but it can't seem to find the class declared in other file. 18:29
poohman will that work?
TimToady no, you can't just change <> to {} like that 18:30
<-[<]>* will do that though
poohman great thanks - grinning wide - learning from Larry himself 18:31
TimToady kyan: you wanna use 'use' to pull in the other file
if your subfile is declaring a class, you probably want 'unit class' or so 18:32
kyan Um, what do I put after "use"? I tried "use parserSupport.p6", "use parserSupport", and "use EmParser" (EmParser being what I put in "unit module EmParser;") 18:35
geekosaur kyan, if it's in the current directory, run perl6 with -I. or put "use lib '.';" in the using module 18:36
kyan (they're all saying things like "Could not find parserSupport at line 9 in:")
TimToady you probably need some kind a 'use lib ".";" declaration or so, depending on where
what geekosaur said
geekosaur otherwise it looks in the module path, which does *not* contain the current directory by default
(current directory is kinda a bad default for that because now paths depend on where you ran the script from: it'll only work if you run it from where it is, not if you are somewhere else and reach it with a pathname) 18:37
...and if you change it to mean that, now you can't refer to the *other* version 18:38
geekosaur this is fine in C because once it's compiled it no longer matters. for perl (or python or ...) it's always going to be a bit ambiguous 18:39
kyan Hm, it still can't find it. Here's what I have at the moment: github.com/ethus3h/ember-informati...tations/p6 18:40
I'm running ./parser.p6 from Bash.
DrForr parserSupport has a package named SymbolTable, I'd recommend changing parserSupport to SymbolTable.pm6 an 'use SymbolTable;'. 18:42
kyan Aha! It worked! 18:44
DrForr You might also want to go to modules.perl6.org, choose a module name and look at how it's laid out.
kyan When I run ./tests.p6, though, it says 'use lib' may not be pre-compiled (since it tries to import parser)... 18:45
Yeah, I tried using github.com/zostay/p6-DOM-Tiny/blob...M/Tiny.pm6 as a model but couldn't make head nor tail of it 18:46
comborico1611 tbrowder, glad you found your article! I write my stuff on my local machine for that reason. 18:47
DrForr kyan: Same basic issue. grammar EM {}, so you probably should rename parser.pm6 to EM.p6 and then the same 'use lib...; use EM;'. 18:49
kyan DrForr: EM.p6 or EM.pm6? The former says it couldn't find EM; the latter says use lib may not be precompiled 18:50
ooh I have an idea 18:51
DrForr The latter, but don't let me tell you hat to do :) 18:52
kyan (just wondered since the SymbolTable got .pm6) 18:53
I tried getting rid of all the use lib; and use whatever; outside of the tests.p6 (now runTests.p6) file I'm running, and putting them all in it 18:55
kyan That seemed to make the "use lib may not be pre-compiled" issue go away, but it still bombs out with "Could not find EM" despite EM.p6 existing 18:57
DrForr Your files are kind of combinations of scripts and a more usual class, I'd try to separate those two. 19:00
kyan Separate them in what way?
Slayerk Hello p/ 19:01
kyan SymbolTable is a class, EM is a grammar, testSupport is a collection of subs, and runTests is a script...
Slayerk Does $a %% $n[^20].any check if the number $a is divisible by any number from 1 to 20 in the list $n? 19:02
DrForr Line 3 of EM.pm6 has code that creates a symbol table and *then* declares the grammar.
You can still initialize the symbol table, but I'd do that in a separate file, and include the grammar.
kyan ok, so have a file that's like, my $*ST = SymbolTable.new; use EM; 19:03
something feels weird about that 19:04
DrForr Yeah. It might seem redundant, but you can reuse the grammar with a different symbol table.
kyan oh, true
DrForr And once it's up on CPAN someone else can reuse your grammar. 19:06
kyan Hmm, it's back again with the Could not find grammarPrep thing...
DrForr: I mean I guess, I wasn't planning on posting it (I'm kind of learning while writing this, so it probably sucks / is of limited utility...) 19:07
DrForr grammarPrep doesn't have a class in it, so there's nothing to "include".
kyan DrForr: um...
timotimo "use blah" doesn't automatically re-export stuff 19:08
yoleaux 6 Dec 2017 23:10Z <tbrowder> timotimo: the old advent md2html from Zoffix seems to do fine.
DrForr Don't think of 'use' as a C #include directive, think of it as a Python import of a class.
kyan Ok, yeah, that's probably my problem, I don't "get" how Python does it either :P 19:09
kyan understands Bash and to some extent C and PHP. Not much of a programmer.
DrForr You're loading a class definition, not inlining a file. 19:10
kyan my small bits of Python have been thoroughly trial-and-error (mostly error)
DrForr (really you are under the hood, but it's better to know the "proper" way to use it before abusing it :)
kyan I guess "use" isn't necessarily what I want to use? I'm kinda confused, sorry... 19:11
DrForr No, you're just thinking about it differently.
kyan if it's just loading classes tho, how do I import stuff that's not classes? 19:12
kyan I don't just want to copy-paste my code everywhere, that always ends badly... 19:12
DrForr Put it in a class and use the 'is export' declaration. 19:12
kyan wait, put the "my $*ST = SymbolTable.new;" thing in a class, you mean? 19:13
Geth doc/master: 6 commits pushed by (Luca Ferrari)++, (Rafael Schipiura)++
DrForr No, put that in a script thhat does 'use SymbolTable; my $*ST = SymbolTable.new;'
kyan DrForr: Ok, but then how do I include *that* script? 19:14
DrForr Single driver script that imports your classes.
timotimo dynamic variables like $*ST are only available in things you call from the place it's declared, and a module that only declares a dynamic variable and calls nothing won't do much for you
kyan Initializing the SymbolTable and importing the grammar are kind of a single step from the perspective of the test runner. Is there a way to stick the symboltable initializer into the grammar's constructor? 19:15
kyan reads the docs and thinks maybe knows how to do that 19:17
DrForr I think you need to check out the :actions() adverb on the parser.
DrForr theperlfisher.blogspot.cz/2016/02/f...pt_28.html # look for 'Taking Action.' 19:18
kyan Thanks! 19:19
DrForr You can make code run when an identifier is parsed without playing with the constructor.
kyan "when an identifier is parsed" — by identifier, do you mean whatever I stick in the parens in EM.parse()? 19:20
DrForr Yep.
kyan Cool, thanks!
DrForr (I think, will look.)
DrForr A method would run whenever the 'identifier' token is parsed, and it gets what's atched at that point. 19:21
method identifier($/) { %.table{$/<escapedName>} = $/<parameterList>; } 19:22
(full disclosure - I'm the author of said article.)
raschipi Slayerk: ^20 is 0..19, not even 1..20, not sure what you mean... 19:25
m: .first.say, .end.say given ^20
camelia 0
19
Slayerk raschipi: Earlier on in my code I declare my $n := 2, 3 ... 100; 19:32
raschipi: So I thought that doing $n[^20] takes the first 20 terms 19:33
raschipi right, so $n[^20] youl be an Array containing 2..21 19:34
calling .any on it creates an any junction with those values
raschipi any(2..21) 19:34
kyan Ok, I've made a new version of it that uses a class attached to :actions(, but it's saying it can't find the new class... 19:35
raschipi Slayerk: You're trying to test $a divisible by any of 2 to 21? 19:37
DrForr You probably shouldn't be using the dynamic variable there.
And $/ is already a matched object, so you're probably doing things too early. 19:38
kyan Oh... I'm totally lost, sorry :P
moritz kyan: show some code, maybe?
I might have missed some context
DrForr github.com/ethus3h/ember-informati...Support.p6 19:39
kyan Five files right now: github.com/ethus3h/ember-informati...tations/p6
I started with a single big script that did everything, and i'm having trouble breaking it up into separate files
the entry point is ./runTests.p6 19:40
Slayerk Yeah
raschipi: Yeah
DrForr kyan: It's also nice to be able to do 'is-deeply $parser.parse( Q{int i;} ), { identifier => { i => 'int' } };'.
raschipi Slayerk: so, what's the problem? 19:41
kyan DrForr: Oh, I guess wrapping it in a new class breaks that... 19:42
that's awkward.
DrForr I was just looking at your test suite, and it's really more complex than it needs to be, IMO. 19:43
Slayerk raschipi: I have a loop, and an if statement inside of the loop to test if the numbers are divisible by any number from 2 to 21
Slayerk raschipi: But it comes back as all numbers being divisible by 2 to 21, even though I am looping to 1 million 19:43
kyan DrForr: That is very much on my to do list... trying to get this thing split up before I go back to working on it so it's less of a headache to scroll through and doesn't have a million levels of indentation 19:44
DrForr kyan: Here's a small module that might be inspiration - github.com/drforr/perl6-Grammar-Common
kyan inspiration for this specific refactoring problem, or for how grammars are put together in general? 19:46
DrForr The latter.
kyan cool, thanks! :D
[Coke] m: say (^1000).grep(* %% any(2..21)) 19:48
camelia (0 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 24 25 26 27 28 30 32 33 34 35 36 38 39 40 42 44 45 46 48 49 50 51 52 54 55 56 57 58 60 62 63 64 65 66 68 69 70 72 74 75 76 77 78 80 81 82 84 85 86 87 88 90 91 92 93 94 95 96 98 99 100 102 104 1…
DrForr It's a pluggable set of roles that do some simple parsing tasks, the test suite might especially be interesting.
kyan yeah, i'm looking at the tests ;)
much more orderly than mine, heh
timotimo m: say (^1000).grep(* %% none(2..21)) 19:49
camelia (1 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 3…
DrForr It's a little bit unusual in that I've got a grammar in the test suite, but that's because I'm testing how a role integrates into its parent grammar.
timotimo (much more interesting, imo)
raschipi m: say (^1000).grep(* %% any(2..21)).elems 19:50
camelia 830
raschipi Slayerk: Why do you say you get all numbers?
m: say (^1_000_000).grep(* %% any(2..21)).elems 19:51
camelia (timeout)
Slayerk raschipi: Well, I did a test where I add "say $a" into the code into the if function 19:53
[Coke] m: (^10000).grep(*.is-prime).rotor(2 => -1).grep({$_[1]==$_[0]+2}) # hey, twin primes
Slayerk raschipi: And it gives all the numbers 1 to a million
camelia ( no output )
[Coke] m: say (^10000).grep(*.is-prime).rotor(2 => -1).grep({$_[1]==$_[0]+2}) # hey, twin primes
camelia ((3 5) (5 7) (11 13) (17 19) (29 31) (41 43) (59 61) (71 73) (101 103) (107 109) (137 139) (149 151) (179 181) (191 193) (197 199) (227 229) (239 241) (269 271) (281 283) (311 313) (347 349) (419 421) (431 433) (461 463) (521 523) (569 571) (599 601) …
raschipi like timotimo put above, it should have skipped some: 1 23 29 31 37 41 43 47... 19:54
[Coke] raschipi: which code didn't skip? (my example earlier did...) 19:55
raschipi Slayerk says his code doesn't skip 19:59
say (^1_000_000).grep(* %% any(2..21)).elems returned 828979 for me 20:00
Slayerk raschipi: I could throw my code into a pastebin quickly? 20:02
raschipi sure
kyan I changed "if run-silenced {" to "if self.run-silenced {" at github.com/ethus3h/ember-informati...r.pm6#L64, and now it says "Strange text after block (missing semicolon or comma?)". What's wrong with this change? 20:05
Slayerk :D
AlexDaniel huggable: try
huggable AlexDaniel, f.perlbot.pl/#perl6 tio.run/#perl6 glot.io/new/perl6 ideone.com/
AlexDaniel ↑ paste thingies with p6 eval 20:05
timotimo kyan: "run-silenced { ... }" passes the block to the sub run-silenced
Slayerk pastebin.com/EZx1BhGB 20:05
timotimo kyan: but if you want to pass a block in a method call you have to use either a : or parenthesis around the block
kyan Ah, cool ,thanks! 20:06
Slayerk I slightly reduced the loop size so its runs faster 20:06
timotimo or perhaps you wanted the opposite and needed if run-silenced() { }
kyan Don't recall which now, tbh
timotimo m: sub test($a) { }; if test { say "oh" } 20:07
camelia 5===SORRY!5===
Function 'test' needs parens to avoid gobbling block
at <tmp>:1
------> 3sub test($a) { }; if test { say "oh" }7⏏5<EOL>
Missing block (apparently claimed by 'test')
at <tmp>:1
------> 3sub test($a) { }; if test { …
timotimo normally the error you get is like that
kyan hmm, haven't seen that one yet today
timotimo it happens rather often in code like this: 20:08
m: enum Foo <One Two>; given 1 { when Onne { say "one!" } }
camelia 5===SORRY!5===
Function 'Onne' needs parens to avoid gobbling block (or perhaps it's a class that's not declared or available in this scope?)
at <tmp>:1
------> 3Two>; given 1 { when Onne { say "one!" }7⏏5 }
Missing block (apparently…
kyan Aha, I think what I wanted is this: "if self.run-silenced({ EM.parse($code, :$rule) }) {"
timotimo you see i typo'd One as Onne and it interprets that as sub (but it sees the capital letter and suggests i probably typo'd a class or similar) 20:09
kyan Thanks!
(my previous problem was a space between "silenced (")
Oh, interesting
timotimo yeah, a space there makes a significant difference
kyan Yay, it runs now! More tests are failing than before, but I can probably sort that. Thanks all :D 20:12
raschipi @np.push[$a]; should be @np.push($a) glot.io/snippets/ew76grtopo 20:12
raschipi Slayerk: Do you see you have square brackets intead of parens? 20:20
kyan ok, no, I'm still mystified... starting to feel like going back to the single file -_-; 20:21
kyan (simply because the code isn't doing exactly what it did before, even though by my understanding it should) 20:23
kyan Ok, yeah, this is way over my head... thanks all :) 20:30
kyan will make a bash script to build the desired script from the chunks and then run that
DrForr Oof.
Slayerk raschipi: Thanks, but it still seems to be happening with () instead of [] :P 20:31
timotimo m: my @a; @a.push[99] 20:33
kyan I mean, I know bash, so at least I have some semblance of understanding how it works ;P
camelia ( no output )
timotimo i didn't know you could .push without arguments
m: my @a; @a.push(); say @a
camelia []
Slayerk raschipi: It works now! 20:34
raschipi: Thanks for all your help! :D 20:35
kyan Ok, that worked. :) Thanks all. :) 20:40
sorry I couldn't understand the modules.
DrForr No worries, it takes some time to get used to it. 20:41
kyan :P
Ty again, and thanks for the reusable grammar bits package 20:42
! :D
DrForr Quite welcome.
raschipi Slayerk: anytime 20:54
[Coke] ff 21:01
Marlik Hi guys, I can not put Rakudo, I have Ubuntu 16.04, I use the manual perl6.org/downloads/ 21:04
DrForr What did you try, and what happened? 21:05
moritz Marlik: I recommend github.com/nxadm/rakudo-pkg 21:10
Marlik I have no path to perl6, cd /home/marlik/opt and on manual do it. 21:11
moritz Marlik: I can't parse what you write 21:13
Marlik moritz: Sorry, i check your link. 21:14
moritz: Thanks.
timotimo stackoverflow.com/questions/477044...1_47704428 - lizmat, you want to take this? 23:29
lizmat yeah, will look at it tomorrow 23:30
but now first some sleep&
so goodnight!