Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-02-18

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 AlexDaniel b7j0c: generally, I think the current behavior is much better. You don't want your keys to change suddenly if you introduce a constant, right? :)
00:01 IOninja ... or some module imports it into your namespace
00:06 TimToady in particular, as soon as you start lining up a bunch of => lines, and some of them are autoquoted, people will assume they all are
00:06 timotimo oh! i didn't even know about unix domain sockets in the "abstract namespace"
00:12 AlexDaniel m: my $p = Perl => 6; say $p
00:12 camelia rakudo-moar ffae3f: OUTPUT«Perl => 6␤»
00:12 AlexDaniel m: my $p = (Perl) => 6; say $p
00:12 camelia rakudo-moar ffae3f: OUTPUT«(Perl) => 6␤»
00:12 AlexDaniel :P
00:12 timotimo whoa.
00:13 timotimo i would have expected parens to prevent stringifying there
00:13 AlexDaniel huh?
00:13 AlexDaniel :P
00:13 geekosaur so would I
00:13 IOninja They are
00:14 AlexDaniel are you guys kidding me? XD
00:14 IOninja You get the Perl typeobject that stringifies to (Perl)
00:14 geekosaur erm...
00:14 geekosaur m: Perl.WHAT.say
00:14 camelia rakudo-moar ffae3f: OUTPUT«(Perl)␤»
00:14 IOninja *gistifies
00:14 geekosaur was afraid of that
00:14 timotimo turns out writing a gobby plugin or client or something requires you to handle C with GObject
00:14 geekosaur it's a type object, parenthesized
00:14 timotimo i do not have the patience for that.
00:21 AlexDaniel commit: 906a46e5b^,906a46e5b,HEAD my @x = 1, 3, … *
00:21 committable6 AlexDaniel, https://gist.github.com/d4d9​5966198a465b180704312b4096c1
00:22 timotimo some had a newline, others didn't?
00:22 AlexDaniel there's ‘*’ on a separate line
00:22 AlexDaniel commit: 906a46e5b^,906a46e5b,HEAD my @x = 1, 3, … * < 5
00:22 committable6 AlexDaniel, https://gist.github.com/1db4​a30fac8f0705829e4eed5b0e0e58
00:22 IOninja That's cause it parses … as the sub, which calls fail with *
00:22 IOninja m: fail *
00:22 camelia rakudo-moar ffae3f: OUTPUT«*␤  in block <unit> at <tmp> line 1␤␤»
00:23 IOninja (* being the Whatever)
00:23 IOninja s/sub/stub/;
00:23 timotimo ooooh
00:23 AlexDaniel interesting
00:24 timotimo well, the error message should remove the part about "use fail instead of ..."
00:24 timotimo or does … also work as "stub code executed"?
00:24 timotimo m: sub test { … }; test
00:24 camelia rakudo-moar ffae3f: OUTPUT«Stub code executed␤  in sub test at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
00:24 timotimo ah, ok, it also works
00:24 timotimo oh!
00:24 timotimo i didn't see that output correctly
00:25 timotimo right, we used to explode, now we go through with the compile and run it, but we do warn
00:26 cpage_ joined #perl6
00:26 AlexDaniel m: my @x = 1, 3 … *; say @x.flat
00:26 camelia rakudo-moar ffae3f: OUTPUT«(...)␤»
00:26 AlexDaniel m: my @x = 1, 3 … *; say @x.flat.flat
00:26 camelia rakudo-moar ffae3f: OUTPUT«(...)␤»
00:26 AlexDaniel bisect: old=HEAD~200 my @x = 1, 3 … *; say @x.flat.flat
00:26 bisectable6 AlexDaniel, Bisecting by output (old=HEAD~200 new=ffae3ff) because on both starting points the exit code is 0
00:27 bisectable6 AlexDaniel, bisect log: https://gist.github.com/35fa​ccfbec05aa1b62ded7a7db1bf909
00:27 bisectable6 AlexDaniel, (2017-02-07) https://github.com/rakudo/rakudo/commit/​51b0aba8e8f3d40839f5f477520c8031029fa1f0
00:29 cpage_ joined #perl6
00:29 timotimo so, we have an apache file listing for rakudo.perl6.org, right?
00:29 timotimo we can style the heck out of that if i'm not mistaken?
00:29 timotimo and i believe we should.
00:31 bjz joined #perl6
00:31 IOninja Don't think you'd be able to get the same effect as http://rakudo.org/downloads/star/ with "Latest release" sections.
00:32 AlexDaniel Geth: hey?
00:32 IOninja ummm
00:33 IOninja wonder if enabling https on its web endpoint screwed it ovedr
00:33 timotimo you think not?
00:34 IOninja timotimo: is that the "I've done it" you think so?
00:34 timotimo no, sadly not
00:34 timotimo i don't know how to find out how it was configured to be so pretty
00:34 IOninja timotimo: on rakudo?
00:34 IOninja *rakudo.org?
00:35 timotimo yup
00:35 timotimo that's the place where it is pretty
00:35 timotimo the place where it is not pretty is rakudo.perl6.org/download
00:35 IOninja I wrote a php script: https://github.com/perl6/web-rakudo
00:35 AlexDaniel IOninja: well, currently it redirects to https
00:35 AlexDaniel IOninja: so perhaps github does not follow redirects?
00:35 IOninja And I'd think we don't want to run php on rakudo.perl6.org, so: port to pleasant things
00:36 timotimo we can surely port it to bash
00:37 IOninja AlexDaniel: prolly that. The hook errors say got 301
00:37 timotimo that's not php, it's got fat arrows!
00:37 AlexDaniel huggable: geth
00:37 huggable AlexDaniel, nothing found
00:37 mr-foobar joined #perl6
00:37 timotimo gotta go to bed now, though. and tomorrow will be a lot of driving
00:37 AlexDaniel instructions have to be changed too then
00:37 AlexDaniel but for now you probably want to get rid of the redirection…
00:38 IOninja Yeah, that's what I'll do.
00:38 IOninja Once I figure out how...
00:39 AlexDaniel IOninja: while you're figuring it out, here's a question!
00:39 AlexDaniel m: my @x = 1, 3 … *; say @x.flat
00:39 camelia rakudo-moar ffae3f: OUTPUT«(...)␤»
00:39 AlexDaniel m: my @x = 1, 3 … *; say flat @x
00:39 camelia rakudo-moar ffae3f: OUTPUT«(1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73 75 77 79 81 83 85 87 89 91 93 95 97 99 101 103 105 107 109 111 113 115 117 119 121 123 125 127 129 131 133 135 137 139 141 143 145 147 149 151 153 15…»
00:39 AlexDaniel is it a bug?
00:40 IOninja 1 sec
00:41 jraglin joined #perl6
00:41 IOninja man, how do I undo the SSL thing
00:41 AlexDaniel … don't undo it?
00:41 AlexDaniel just don't redirect
00:42 AlexDaniel I've already changed whateverable hook to use https…
00:43 IOninja And it works?
00:43 IOninja I didn't add the redirect; the script did. No idea where it is tho
00:44 AlexDaniel well, i don't know if it works
00:44 AlexDaniel but I hope it does :D
00:45 itcharlie1 joined #perl6
00:45 Geth ¦ doc: 72d3a7b4b7 | (Will "Coke" Coleda)++ | doc/Language/control.pod6
00:45 Geth ¦ doc: remove trailing whitespace
00:45 Geth ¦ doc: review: https://github.com/perl6/doc/commit/72d3a7b4b7
00:45 Geth ¦ doc: a92b7604d1 | (Will "Coke" Coleda)++ | xt/code.pws
00:45 Geth ¦ doc: learn new code words
00:45 Geth ¦ doc: review: https://github.com/perl6/doc/commit/a92b7604d1
00:45 Geth ¦ doc: 99aa1b7065 | (Will "Coke" Coleda)++ | doc/Type/Str.pod6
00:45 Geth ¦ doc: fix examples
00:46 Geth ¦ doc: review: https://github.com/perl6/doc/commit/99aa1b7065
00:46 IOninja The answer is yes....
00:48 IOninja Well, I guess there's the other side of the coin to being superpainlessly install SSL cert: no idea where the hell the configuration to do the redirect is
00:50 IOninja Not how I planned to spend a Friday night -_-
00:50 AlexDaniel what are you using there? Apache?
00:52 Geth ¦ doc: 1122a88012 | (Tom Browder)++ | doc/Language/control.pod6
00:52 Geth ¦ doc: add format chars
00:52 Geth ¦ doc: review: https://github.com/perl6/doc/commit/1122a88012
00:52 IOninja There. Fixed forever
00:54 Geth joined #perl6
00:55 IOninja And the config was in the config for the site, I just skimmed through the rules without paying attention -_-
00:55 AlexDaniel \o/
00:55 AlexDaniel IOninja: flat?
00:56 cpage_ joined #perl6
00:56 IOninja AlexDaniel: aha. Yeah, flat needs some loving. Adding another candidate that just takes one Iterable. That way the laziness flag will stay with it. Right now it's being lost due to the **@foo slurpie
00:57 IOninja So it is a bug that I have listed in my notes/TODO files :}
00:57 IOninja (as opposed to a ticket)
00:57 IOninja I'm selfish. I have a private stash of bugs :P
00:59 TimToady me too :)
00:59 AlexDaniel pfft, you just saved me 3 minutes of my life :)
00:59 TimToady just one line of it is: fix %*LANG, $*ACTIONS, %*PRAGMAS
00:59 TimToady which is exactly what the braids branch does
01:01 TimToady when I do a recursive grep for PRAGMAS, that file is the only thing it finds :)
01:02 kurahaupo_ joined #perl6
01:05 TimToady just had a random failure in S32-io/other.t though, but pretty sure that's not my fault...
01:09 aborazmeh joined #perl6
01:09 aborazmeh joined #perl6
01:13 llfourn joined #perl6
01:14 TimToady ran it five times without error, but failed after test 8 in the spectest
01:32 holyghost joined #perl6
01:35 Actualeyes joined #perl6
01:38 agentzh joined #perl6
01:55 araraloren joined #perl6
02:00 aborazmeh joined #perl6
02:00 aborazmeh joined #perl6
02:18 agentzh joined #perl6
02:22 llfourn joined #perl6
02:24 itcharlie1 left #perl6
02:39 tbrowder IOninja: having certbot probs?
02:40 tbrowder I feel yr pain...
02:47 ilbot3 joined #perl6
02:47 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
02:55 Tonik joined #perl6
02:59 Actualeyes joined #perl6
03:10 gdonald joined #perl6
03:17 IOninja Not any more.
03:24 adu joined #perl6
03:34 noganex joined #perl6
03:53 ggoebel joined #perl6
04:28 Cabanoss- joined #perl6
04:49 inokenty joined #perl6
04:59 araraloren m: class Op { }; my $x = Op; say $x.?name;
04:59 camelia rakudo-moar ffae3f: OUTPUT«Nil␤»
04:59 araraloren m: class Op { has $.name; }; my $x = Op; say $x.?name;
04:59 camelia rakudo-moar ffae3f: OUTPUT«Cannot look up attributes in a Op type object␤  in block <unit> at <tmp> line 1␤␤»
05:00 araraloren Why ? Is this has a problem with `.?` ?
05:01 geekosaur m: class Op { has $.name; }; my $x = Op; say $x.name;
05:01 camelia rakudo-moar ffae3f: OUTPUT«Cannot look up attributes in a Op type object␤  in block <unit> at <tmp> line 1␤␤»
05:03 geekosaur .? only detects whether a method exists or not; it does not detect whether method invocation fails
05:03 geekosaur which it does in this case because the method looks up an instance variable, and the type object has no instance variables
05:03 geekosaur ("attributes")
05:06 araraloren Hm, sound like you are right..
05:08 araraloren So `.?` is not fully safe, it's a trap ..
05:17 llfourn joined #perl6
05:17 araraloren Maybe I misunderstand it, it's different from optional menchanism in other language
05:18 pyrimidine joined #perl6
05:35 masak m: class Op { has $.name; }; my $x = Op; say $x.^name
05:35 camelia rakudo-moar ffae3f: OUTPUT«Op␤»
05:35 masak :)
05:36 geekosaur araraloren, it's not optional like std::optional or Haskell's Maybe
05:36 geekosaur it's a way to call a method that might not exist. "optional" values are handled differently
05:37 masak right, the semantics isn't "only call the method if the *invocant* is defined", it's "only call the method if the method *exists*"
05:39 masak m: class C { has $.foo = 42 }; for C.new, C -> $c { say ($c // Nil).foo }
05:39 camelia rakudo-moar ffae3f: OUTPUT«42␤Nil␤»
05:39 masak perhaps the above is the closest thing to "only call the method if the *invocant* is defined" semantics in Perl 6
05:40 masak (Nil conceptually pretends to have all methods, and they all return Nil)
05:43 llfourn m: class Op { has $.name; }; my $x = Op; say ($x andthen .name) # this is what I do
05:43 camelia rakudo-moar ffae3f: OUTPUT«()␤»
05:49 geekosaur with?
05:49 llfourn yeah with works too :)
05:49 araraloren llfourn, geekosaur thanks, I got it.
05:53 jeffythedragonsl joined #perl6
05:53 jeffythedragonsl hey
05:53 araraloren hey .
05:54 jeffythedragonsl so I've been using perl 5 for a few weeks now
05:55 jeffythedragonsl I can see why you all are trying to modernize the language
05:56 jeffythedragonsl no offense but I think the ranking is Perl 5 < Python < Perl 6
05:56 perlpilo1 "trying"?  Are we not succeeding?  :)
05:56 araraloren It's easy to use and uderstand , more human
05:57 masak jeffythedragonsl: would that be Python2 or Python3, incidentally? ;)
05:57 perlpilo1 jeffythedragonsl: Python doesn't quite grok scope or closures well enough yet, so  Python < Perl 5 < Perl 6
05:57 jeffythedragonsl both :)
05:57 perlpilo1 jeffythedragonsl: or unicode
05:57 agentzh joined #perl6
05:58 araraloren I think python3 is good than perl5 in some respects, not all
05:58 jeffythedragonsl the more I read about p6 the more I realize it's the language I've been looking for for so long
05:59 ugexe https://gist.github.com/ugexe/9​1ae37b94e57c78a2c5b893eaff32063 # gist demonstrating easy remote module access and installation through github http api
05:59 araraloren When you want make a one-liner, you wonder how to make code work in python2/3 ..
05:59 llfourn ugexe: nice
06:01 masak jeffythedragonsl: do you have an example?
06:01 jeffythedragonsl math that works
06:01 jeffythedragonsl gradual typing
06:01 bwisti joined #perl6
06:02 jeffythedragonsl unicode
06:02 jeffythedragonsl lazy evaluation
06:02 jeffythedragonsl so many cool things
06:02 perlpilot_ jeffythedragonsl: Have you tried Haskell?  ;)
06:03 jeffythedragonsl several years ago
06:03 jeffythedragonsl haskell will bend your mind a little bit
06:04 TEttinger haskell would be faster than perl6, but that's uh... if it works at all. I've had serious compatibility issues with haskell as a whole on windows
06:04 TEttinger so even if perl6 is slow, slow is better than "takes as much time as it takes for the haskell devs to fix their windows support"
06:05 jeffythedragonsl meh
06:05 TEttinger I like a lot of stuff about haskell, the ecosystem is very  lacking
06:05 masak TEttinger: have you considered running a VMWare machine or something? maybe you'd get more things done than on Windows :P
06:05 TEttinger I have in the past
06:05 TEttinger it's a hassle, eh
06:06 araraloren Perl 6 need more optimize, there is dialect of Perl 6 called Fanlang, seem like it's faster than rakudo
06:06 TEttinger most of the stuff I do is meant for games, so 98% of users are on windows
06:06 jeffythedragonsl Windows is still good for a lot of software but I'm a *nix supremacist
06:06 TEttinger can't ignore the market
06:06 TEttinger araraloren: heh, agentzh comes in here often
06:07 TEttinger Fanlang is faster but does not seem to support a lot of features that perl6 has had to really work on to achieve in the current form
06:08 wamba joined #perl6
06:08 araraloren Oh ..
06:08 llfourn araraloren: where is the src for fanlang?
06:09 araraloren llfourn, seem like it's not open source now
06:09 llfourn ohhh that explains it :)
06:10 masak I can easily believe it's easy-ish to create a *subset* of Rakudo's feature set that's faster, yes
06:10 masak for example, a subset that can be translated straightforwardly into C code
06:11 llfourn I wonder is it using rakudo to parse fanlang code?
06:11 araraloren so many features in Perl 6 ..
06:13 jeffythedragonsl I read about them and then when doing perl 5 at work I want to use them :/
06:14 masak jeffythedragonsl: I'm curious -- have you heard of Inline::Perl5?
06:14 jeffythedragonsl yes
06:14 masak good, cool
06:15 masak makes it a whole lot easier to achieve nice things without compromising
06:15 jeffythedragonsl I can't just replace the complier on everyone though
06:17 masak I don't see why you would have to
06:18 araraloren Hm, simple say is better
06:18 araraloren s/say/way/
06:20 jeffythedragonsl oh, I thought you were suggesting I use rakudo and feed all the perl 5 stuff into it
06:20 masak no, I mean when you want to build something new using Perl 6 but find some modules from CPAN are not in place yet
06:21 jeffythedragonsl ah yes
06:22 perlpilot_ yes, nine++
06:36 Woodi hallo #perl6 :)
06:36 Woodi m: my $v = 1; sub a() { say $v; $v++ }; sub b() { say $v; $v = 0 }; a; b; a; a
06:36 camelia rakudo-moar ffae3f: OUTPUT«1␤2␤0␤1␤»
06:36 Woodi are a() and b() a clousures ?
06:37 moritz yes
06:37 Woodi moritz: thanx :)  just wondering about Perl6 clousure features...
06:38 Woodi but example above, acording to wikipedia, means Perl6 is not pure functional language, right ?
06:39 jeffythedragonsl not like haskell
06:39 Woodi also no "referential transparency" ?
06:40 Woodi just highly functional features ;)
06:40 jeffythedragonsl lol
06:40 hobbs perl6 isn't pure anything.
06:41 hobbs purely impure, maybe
06:43 masak "the example above means Perl 6 is not a pure functional language" -- hahahahaha
06:43 masak I'm sorry, but that's just extremely funny :D
06:43 Woodi masak: why ?
06:44 masak the presence of *the assignment operator* means Perl 6 is not a pure functional language
06:44 masak the fact that *variables vary* means Perl 6 is not a pure functional language
06:45 masak not everything being immutable values means Perl 6 is not a pure functional language
06:45 Woodi everyone need to start somewhere...
06:45 masak what do you have to go and build two subs `a` and `b` for? it's so silly.
06:45 masak just look at it! it's not pure functional! :D
06:46 Woodi masak: I wasn't rogue blogging... just asking.
06:46 hobbs ... blogging?
06:47 masak Woodi: by the way, a() and b() are closures, because both of them make use of $v but neither of them declares it.
06:47 masak Woodi: but again, you can look at the bit that says `$v = 1` and go "aha! not pure functional". you can skip the rest, including the closures.
06:47 Woodi hobbs: ppls screem bad things via blogs or fb or reddit :)
06:48 Woodi masak: I'm pretty convinced now. thanx
06:49 masak Woodi: apologies if I'm making light of what might simply be curiosity on your part
06:49 masak Woodi: those are important concepts you're investigating. keep at it ;)
06:49 darutoko joined #perl6
06:51 mr_ron joined #perl6
06:53 samcv good *
06:56 Woodi hi samcv :)
06:57 samcv hello
06:59 jeffythedragonsl joined #perl6
06:59 jeffythedragonsl so guys
07:00 jeffythedragonsl I did convince people to let me use perl6 at work but we need to get rakudo installed first
07:00 masak nice!
07:05 mr_ron joined #perl6
07:24 samcv fun!
07:28 wamba joined #perl6
07:37 jeffythedragonsl joined #perl6
07:52 pyrimidine joined #perl6
07:56 mr-foobar joined #perl6
07:56 rsaarelm joined #perl6
07:58 Tonik joined #perl6
08:02 CIAvash joined #perl6
08:09 llfourn joined #perl6
08:12 cpage_ joined #perl6
08:14 wamba joined #perl6
08:14 wamba left #perl6
08:15 wamba joined #perl6
08:15 wamba left #perl6
08:32 RabidGravy joined #perl6
08:37 bjz_ joined #perl6
08:38 llfourn joined #perl6
08:38 wamba joined #perl6
08:40 wamba joined #perl6
08:46 rsaarelm Well this is weird. I had "set relativenumber" on my .vimrc and that made moving the cursor lag terribly in perl6 syntax mode. Never saw that in any other syntax.
08:46 wamba joined #perl6
08:48 wamba left #perl6
08:50 wamba1 joined #perl6
08:53 rsaarelm Maybe it redraws all the lines and reruns the syntax highlighting and p6 highlight is slower than other langs. I can also see visible lag when doing pageup/pagedown.
08:54 samcv hmm
08:54 samcv i noticed the perl 6 highlighting is slow with big files
08:54 samcv for sure
08:55 samcv i find Atom to be more comfortable experience though I often use vim for a quick edit
08:55 samcv plus i get all the classes/routines/methods in a panel on the right i can just click and it will go to it
08:56 parv joined #perl6
08:56 samcv oh rsaarelm wana see my vim config. there's one setting i know really sped mine up
08:57 samcv rsaarelm, see this section https://github.com/samcv/dot-fi​les/blob/master/.vimrc#L17-L23
08:58 samcv if you use that, obv you can remove my themes, but if it's a 256 color terminal then it likely supports those other features and is good to use them. and won't affect using raw tty
08:58 samcv let me know if that helps you out
08:58 rindolf joined #perl6
09:06 rsaarelm samcv: Lazyredraw looks useful, I guess that helps when you're doing something like 500 repeats of a macro on a big file and have to wait on on the screen flashing by?
09:06 samcv seemed to help a bit even when not using macros
09:06 rsaarelm Trying out those, thanks.
09:07 samcv those settings screw up linux basic tty so you have to have it be conditional
09:08 rsaarelm I'm writing a script and want to add unit tests to it, but it looks like the standard operating procedure is to write a module, write a t/ subdirectory for the module, put the tests there and have the script use the module. I want to keep the p6 stuff in a single file since it's basically a one-off tool, so I guess I'll just hack up my own subroutine that prints assert results when you call it ...
09:08 rsaarelm ... with --test.
09:10 samcv since you want it all in one file? yeah that seems fine
09:11 pyrimidine joined #perl6
09:11 samcv rsaarelm, what other languages do you know?
09:12 rsaarelm Was just wondering if there was an established TAP-friendly idiom for this since I'd guess one-off single-file tools are a common usecase.
09:13 samcv well having a routine that does testing seems fine to me
09:22 pyrimidine joined #perl6
09:35 eroux joined #perl6
09:49 gfldex m: sub test { use Test; plan 1; ok True, 'All is well!' }; test
09:49 camelia rakudo-moar ffae3f: OUTPUT«1..1␤ok 1 - All is well!␤»
09:49 gfldex rsaarelm: ^^^ even `use Test` is lexically scoped
09:54 Lucas_One joined #perl6
09:59 agentzh joined #perl6
10:03 kaare_ joined #perl6
10:07 rsaarelm Yeah, I'm doing that, seems to work great.
10:17 jeek
10:23 pyrimidine joined #perl6
10:35 robertle joined #perl6
10:36 Geth ¦ perl6.org: d01c397561 | (Naoum Hankache)++ | source/downloads/index.html
10:36 Geth ¦ perl6.org: s/ http://rakudo.org / https://rakudo.perl6.org
10:36 Geth ¦ perl6.org:
10:36 Geth ¦ perl6.org: commit 258664b Updated the link but forgot to update the text.
10:36 Geth ¦ perl6.org: review: https://github.com/perl6/p​erl6.org/commit/d01c397561
10:39 RabidGravy speaking of Test I'm always somewhat disappointed I can't do:
10:39 RabidGravy m: use Test; my &👍= &ok.assuming(True); 👍
10:39 camelia rakudo-moar ffae3f: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Name must begin with alphabetic character␤at <tmp>:1␤------> 3use Test; my &7⏏5👍= &ok.assuming(True); 👍␤    expecting any of:␤        constraint␤        infix␤        infix stopper␤…»
10:40 gfldex m: use Test; constant term:<👍> = &ok.assuming(True); 👍
10:40 camelia rakudo-moar ffae3f: ( no output )
10:40 gfldex RabidGravy: ^^^
10:40 sena_kun joined #perl6
10:41 gfldex m: use Test; plan 1; constant term:<👍> = &ok.assuming(True); 👍()
10:41 camelia rakudo-moar ffae3f: OUTPUT«1..1␤ok 1 - ␤»
10:41 gfldex m: use Test; plan 1; constant &term:<👍> = &ok.assuming(True); 👍
10:41 camelia rakudo-moar ffae3f: OUTPUT«1..1␤ok 1 - ␤»
10:42 gfldex there you go
10:42 * gfldex .oO( Perl 6 does support madness. )
10:43 RabidGravy this is why I love it
10:50 Geth ¦ doc: e8aec11d92 | (Wenzel P. P. Peppmeyer)++ | doc/Language/syntax.pod6
10:50 Geth ¦ doc: better example for term:<>
10:50 Geth ¦ doc: review: https://github.com/perl6/doc/commit/e8aec11d92
10:50 Geth ¦ doc: d94962a005 | (Wenzel P. P. Peppmeyer)++ | type-groups.json
10:50 Geth ¦ doc: categorise more types
10:50 Geth ¦ doc: review: https://github.com/perl6/doc/commit/d94962a005
10:52 sena_kun gfldex, you probably should use ": «" form in the comment.
10:55 Geth ¦ doc: e3e194e1f6 | (Wenzel P. P. Peppmeyer)++ | doc/Language/syntax.pod6
10:55 Geth ¦ doc: fix output
10:55 Geth ¦ doc: review: https://github.com/perl6/doc/commit/e3e194e1f6
10:59 Geth ¦ evalbot/gfldex-doc-sync: a4c5cbab43 | (Wenzel P. P. Peppmeyer)++ | evalbot.pl
10:59 Geth ¦ evalbot/gfldex-doc-sync: sync OUTPUT with style in docs
10:59 Geth ¦ evalbot/gfldex-doc-sync: review: https://github.com/perl6/evalbot/commit/a4c5cbab43
10:59 Geth ¦ evalbot: gfldex++ created pull request #9: sync OUTPUT with style in docs
10:59 Geth ¦ evalbot: review: https://github.com/perl6/evalbot/pull/9
11:15 Geth ¦ doc: ecd98a589d | (Wenzel P. P. Peppmeyer)++ | doc/Type/Uni.pod6
11:15 Geth ¦ doc: test for tagging class files
11:15 Geth ¦ doc: review: https://github.com/perl6/doc/commit/ecd98a589d
11:16 mr-foobar joined #perl6
11:22 espadrine_ joined #perl6
11:25 espadrine joined #perl6
11:27 mawkish__ joined #perl6
11:31 lukaramu joined #perl6
12:01 bjz joined #perl6
12:08 bjz joined #perl6
12:27 dotness joined #perl6
12:36 rsaarelm How do I say "if $mystring parses cleanly into a base-10 integer"? First I was happy that it seemed like I could just say "if $mystring.parse-base(10)", but then I realized what happens when the string is "0".
12:36 timotimo m: say "hello".parse-base(10)
12:36 camelia rakudo-moar ffae3f: OUTPUT«Cannot convert string to number: malformed base-10 number in '3⏏5hello' (indicated by ⏏)␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
12:36 timotimo since it'll either parse cleanly or throw an exception, you probably don't want if anyway
12:37 timotimo but for your use case, the "with" keyword has been introduced
12:37 timotimo m: with "0".parse-base(10) { "$_ is my number".say }
12:37 camelia rakudo-moar ffae3f: OUTPUT«0 is my number␤»
12:37 rsaarelm I'm doing an elsif chain where one branch starts if the string is an integer.
12:37 gfldex m: say "hello".parse-base(10); CATCH { default { say .^name, ' ', .Str } }
12:37 camelia rakudo-moar ffae3f: OUTPUT«X::Str::Numeric Cannot convert string to number: malformed base-10 number in '3⏏5hello' (indicated by ⏏)␤»
12:38 timotimo btw, prefix the variable with +, that's shorter than .parse-base(10)
12:38 timotimo m: if False { say "not this one" } orwith +"0" { say "$_ is my number" }
12:38 camelia rakudo-moar ffae3f: OUTPUT«0 is my number␤»
12:38 timotimo orwith is basically elsif but with with instead of if
12:38 rsaarelm So this is the else branch that should get evaled if the string parses into an integer and skipped to the next else branch if it's not. Exception-handlers are an awkward fit here.
12:38 gfldex rsaarelm: it depend what you do. In most cases you do input validation with a rx as early as possible to fail before you do any lengthy computation.
12:40 rsaarelm Looks like "orwith +$mystr {" might work. Thanks.
12:41 timotimo nice :)
12:41 timotimo m: with try +"hello" { say "this is my number: $_" } else { say "not my number!" }
12:41 camelia rakudo-moar ffae3f: OUTPUT«not my number!␤»
12:41 timotimo ^- that's how you get that with exception handling, btw
12:42 timotimo without making it too awkward
12:42 timotimo m: with try +"999" { say "this is my number: $_" } else { say "not my number!" }
12:42 camelia rakudo-moar ffae3f: OUTPUT«this is my number: 999␤»
12:44 fhain joined #perl6
12:44 rsaarelm Was wondering what the equivalent of Python's 'in' is. Now I find out it's ∈. Not sure if disgusted or impressed.
12:45 timotimo don't have to spell it like that
12:45 timotimo there's also (elem)
12:45 rsaarelm I don't have a good system for typing unicode but having it in the source might actually be a good idea for readability.
12:45 timotimo https://docs.perl6.org/language/unicode_entry - seen this?
12:46 rsaarelm Well I'm not going to start memorizing the hex codes.
12:47 rsaarelm Though I did have a widget in my Vim that lets me type latex and unicode that.
12:47 timotimo a widget in vim? vim already has a functionality built-in that lets you type unicode stuff
12:47 mr_ron joined #perl6
12:47 timotimo ∈(-22088712ELEMENT OF
12:48 timotimo well, that pasted spectacularly badly
12:48 timotimo you press ctrl-k, then ( - and it'll give you the elem sign
12:48 rsaarelm This is a plugin that lets me do C-l and then type \in to get the set membership thing.
12:48 timotimo oh, latex-based
12:48 rsaarelm Hm, didn't know the C-k thing.
12:48 Geth ¦ doc: 6d341b8fe0 | (Wenzel P. P. Peppmeyer)++ | doc/Language/exceptions.pod6
12:48 Geth ¦ doc: show that try provides a return value
12:48 Geth ¦ doc: review: https://github.com/perl6/doc/commit/6d341b8fe0
12:49 gfldex timotimo++
12:49 timotimo it literally mentions the ^K right in the Vim section, though
12:49 timotimo perhaps it has to stand out a bit more
12:49 timotimo like, the "you can enter hex characters" should be moved downwards
12:49 timotimo and be mentioned as "in the worst case"
12:49 rsaarelm Yeah.
12:49 timotimo and the digraph one should be put up top
12:50 rsaarelm That's pretty neat actually, the digraphs are sorta mnemonic, so you could learn the mathy ones eventually.
12:50 timotimo yup
12:50 timotimo i wouldn't have pointed it out if i didn't think it's cool
12:52 ZzZombo joined #perl6
12:53 Guest78862 p6: say "I'm back!"
12:53 camelia rakudo-moar ffae3f: OUTPUT«I'm back!␤»
12:53 Guest78862 joined #perl6
12:53 timotimo ohai zzzombo
12:53 ZzZombo stfu NickServ
12:53 ZzZombo yea, hello #perl6
12:55 rsaarelm Ugh. I can escape literal <, > in a <word list> with a backslash in front, but the Vim syntax mode doesn't understand it and messes up the highlighting in the rest of my file.
12:58 ZzZombo So, unless I'm blinder than I'd give myself credit, where is the docs for Perl slangs? In particular, for creation of one.
13:01 timotimo might not have anything in doc.perl6.org
13:01 timotimo but there's example slangs
13:02 ZzZombo "Note: Slangs are NYI in Rakudo."
13:02 ZzZombo ugh
13:03 ZzZombo fine?
13:03 timotimo oh, huh
13:03 timotimo where is that from?
13:04 ZzZombo https://docs.perl6.org/language/variables#The_~_Twigil
13:04 gfldex ZzZombo: see https://mouq.github.io/slangs.html
13:04 timotimo ah
13:05 ZzZombo gfldex: will take a look. Thanks a lot.
13:07 sjohnson joined #perl6
13:08 ZzZombo In the meantime, are they implemented or not, is that quote a leftover?
13:08 timotimo the quote is ... inaccurate
13:09 timotimo the ~ twigil isn't useful at the moment, if i understand correctly
13:09 timotimo but you can build slangs with a slightly more low-level approach, such as the slangs we have in the ecosystem show
13:09 timotimo moudles.perl6.org - search for "Slang"
13:17 ggherdov__ joined #perl6
13:17 ggherdov__ joined #perl6
13:20 Ulti I have a bit of a silly one here too https://github.com/MattOates/Bio​Info/blob/master/lib/BioInfo.pm6
13:25 bjz_ joined #perl6
13:27 ZzZombo "What actions classes to is create an AST" -- is there supposed to be "do" instead of "to"?
13:27 ZzZombo gfldex ^
13:27 timotimo yup
13:28 timotimo .seen mouq
13:28 yoleaux I saw Mouq 7 Jan 2016 04:12Z in #perl6: <Mouq> Juerd++ regardless :) even reading good code sucks
13:28 timotimo wow, that's long ago
13:31 lukiramu joined #perl6
13:32 setty1 joined #perl6
13:48 espadrine joined #perl6
13:48 AlexDaniel joined #perl6
14:01 agentzh joined #perl6
14:05 skids joined #perl6
14:21 coloseau joined #perl6
14:24 coloseau left #perl6
14:30 cale2 joined #perl6
14:33 kurahaupo joined #perl6
14:36 Geth ¦ evalbot: a4c5cbab43 | (Wenzel P. P. Peppmeyer)++ | evalbot.pl
14:36 Geth ¦ evalbot: sync OUTPUT with style in docs
14:36 Geth ¦ evalbot: review: https://github.com/perl6/evalbot/commit/a4c5cbab43
14:36 Geth ¦ evalbot: af1d88a495 | (Zoffix Znet)++ | evalbot.pl
14:36 Geth ¦ evalbot: Merge pull request #9 from perl6/gfldex-doc-sync
14:36 Geth ¦ evalbot:
14:36 Geth ¦ evalbot: sync OUTPUT with style in docs
14:36 Geth ¦ evalbot: review: https://github.com/perl6/evalbot/commit/af1d88a495
14:36 cale2 Hey, how can I speed up this program? I don't have a background in CS, so I'm unsure of how to do things like "don't re-evaluate a long list on every iteration" https://glot.io/snippets/en8z8gqgkx
14:37 camelia joined #perl6
14:38 IOninja for one you can avoid append in loop and just `do for`
14:38 newbie1 joined #perl6
14:38 IOninja m: my @stuff = do for ^3 { rand }; say @stuff
14:38 camelia rakudo-moar ffae3f: OUTPUT: «[0.21669180321733 0.035343624204734 0.9542705172299]␤»
14:38 IOninja m: my @stuff = flat do for ^3 { (rand, rand) }; say @stuff
14:38 camelia rakudo-moar ffae3f: OUTPUT: «[0.718103630275985 0.238012063018444 0.117576807813873 0.698080171615648 0.911101333174519 0.0544951428357265]␤»
14:40 cale2 IOninja: how does `do for` replace append though? I need to append it to the main list
14:41 AlexDaniel removing constraints might help also
14:41 IOninja IOninja │ for one you can avoid append ***im loop***
14:42 AlexDaniel m: my Int @pairs.push: 0;
14:42 camelia rakudo-moar ffae3f: ( no output )
14:42 AlexDaniel m: my Int @pairs.push: 0; say @pairs
14:42 camelia rakudo-moar ffae3f: OUTPUT: «[0]␤»
14:42 AlexDaniel heh… interesting…
14:42 AlexDaniel m: my Int @pairs = 0; say @pairs
14:42 camelia rakudo-moar ffae3f: OUTPUT: «[0]␤»
14:42 espadrine_ joined #perl6
14:44 cale2 Isn't the program slow because of the way it is iterating through the long list though?
14:45 cale2 I recall a word like "memoize" applying in a situation such as this lol
14:45 IOninja Which is a way of saying "cache yer stuff in a hash"
14:47 gfldex cale2: you could try @pairs»++;
14:47 cale2 IOninja: So like saving the length of the list in the hash and then only calculating the difference
14:47 cale2 gfldex: great idea
14:51 IOninja doubt the lenth of the list is a very expensive operation.
14:52 IOninja m: use experimental :cached; sub foo ($x) is cached { sleep 1; $x² }; say foo(42) xx 100
14:52 camelia rakudo-moar ffae3f: OUTPUT: «(1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 1764 176…»
14:53 cale2 Same. Is there an article about optimizing code?
14:53 IOninja ¯\_(ツ)_/¯  profile, replace slowest parts with faster parts. Repeat until you get bored.
14:53 IOninja perl6 has --profile switch
14:54 cale2 https://docs.perl6.org/language/performance
14:54 sammers joined #perl6
15:00 AlexDaniel well, generally you just try different stuff and try to measure the difference
15:00 AlexDaniel you can try --profile first
15:05 zakharyas joined #perl6
15:05 cale2 @pairs>>.++ was actually slower than a normal map lol
15:05 cale2 the profile data was hard to make sense of
15:08 AlexDaniel oh, you may also try native ints
15:08 IOninja m: my @a = 1..10; @a[^*] += 1 xx @a
15:08 camelia rakudo-moar ffae3f: OUTPUT: «Cannot assign to an immutable value␤  in block <unit> at <tmp> line 1␤␤»
15:08 IOninja :(
15:09 IOninja mc: my @a = 1..10; @a[^*] += 1 xx @a
15:09 committable6 IOninja, ¦«2015.12»:
15:09 AlexDaniel it will either make it significantly faster or significantly slower
15:09 IOninja mc: my @a = 1..10; @a[^*] += 1 xx @a; say @a
15:09 committable6 IOninja, ¦«2015.12»: [20 (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any) (Any)]
15:09 IOninja heh
15:11 cale2 I just think my algorithm is bad. On the haskell version, it was really really slow as well. But then someone suggested one little change in the evaluation of the lists, and it was lightning fast
15:12 AlexDaniel IOninja: I don't understand what's happening here
15:13 AlexDaniel m: my @a = 1..10; @a[^*] X= 5; say @a
15:13 camelia rakudo-moar ffae3f: OUTPUT: «[5 5 5 5 5 5 5 5 5 5]␤»
15:13 AlexDaniel ah… right
15:13 DrForr Speaking of optimizations, the code I removed (and maybe the reorganization I did) cut the runtime of the Perl6::Parser tests from 180+ down to 77 seconds.
15:14 AlexDaniel well, at the moment rakudo is extremely sensitive to how you write your stuff
15:15 AlexDaniel change method to a sub and boom you get a 2x boost
15:15 lizmat joined #perl6
15:15 AlexDaniel Here's one of these cases: https://github.com/perl6/whateverable​/blob/master/Unicodable.p6#L101-L104
15:16 AlexDaniel any other way of writing the same thing will be noticeably slower
15:16 DrForr Yeah, I don't doubt. It's one of the reasons I don't worry (yet) about optimization. But eventually it'll be worthwhile.
15:17 AlexDaniel and I was able to make it just a little bit faster by using nqp
15:19 AlexDaniel another interesting case: https://github.com/MasterDuke17/Text-Diff-Sift4/​commit/524f98cdc95c3dc0d982c0ce0782406c61e4a772
15:20 DrForr I've just been refactoring purely to cut down on the amount of code I have to dig through to find problems.
15:25 bwisti joined #perl6
15:26 itcharlie1 joined #perl6
15:37 mspo isn't using nqp kind of bad practice?
15:38 IOninja heh
15:43 AlexDaniel mspo: sure. But what's the alternative?
15:45 DrForr Perl6::Parser relies on it.
15:46 DrForr But that's not meant as an endorsement. In my case there's simply no API exposed that does what I need.
16:21 pyrimidine joined #perl6
16:42 IOninja .ask jnthn seems $foo.WHAT === Code doesn't detect thunks? Here's my version of infix:<orelse> but it still returns a thunk instead of executed thunk. Am I doing it wrong? https://gist.github.com/zoffixznet​/82ef0cfb76ef1cbb6717555fab557427
16:42 yoleaux IOninja: I'll pass your message to jnthn.
16:43 IOninja oh crap. Now that I read it on github I see the error of my ways -_-
16:43 Penguiniator joined #perl6
16:43 IOninja Oh wait no
16:43 moritz $foo ~~ Callable?
16:44 IOninja Line 12 is checking for thunk and evals it before returning..
16:44 IOninja moritz: but that would call even user Callables
16:49 IOninja hm, it tells me the .WHAT is a Block
16:49 IOninja Maybe I'm misunderstanding the thunk stuff...
16:49 IOninja gonna try moritz's suggestion
16:50 nowan joined #perl6
16:51 Geth ¦ doc: efa768cca4 | (Will "Coke" Coleda)++ | doc/Language/exceptions.pod6
16:51 Geth ¦ doc: remove trailing whitespace
16:51 Geth ¦ doc: review: https://github.com/perl6/doc/commit/efa768cca4
16:53 IOninja .tell jnthn nevermind, I've got Blocks not Code
16:53 yoleaux IOninja: I'll pass your message to jnthn.
16:55 IOninja wooo I fixed it \o/
16:55 IOninja m: my $stuff = ({say "hi"} orelse 42); say $stuff
16:55 camelia rakudo-moar 673f06: OUTPUT: «-> ;; $_? is raw { #`(Block|39889504) ... }␤»
16:56 IOninja But my version executes that codeblock :/
16:58 moritz that's not a thunk
16:58 moritz it's a block
16:59 IOninja OK
16:59 IOninja m: note (Nil andthen "foo" orelse Nil orelse "bar");
16:59 camelia rakudo-moar 673f06: OUTPUT: «-> ;; $_ is raw { #`(Block|70957784) ... }␤»
16:59 IOninja Is that also not a thunk but a block?
17:00 IOninja Should it be a thunk?
17:00 khw joined #perl6
17:02 IOninja What's the .b and .t stuff? "block" and "thunk"? https://github.com/rakudo/rakudo/blob/​nom/src/Perl6/Grammar.nqp#L3838-L3840
17:03 * IOninja tries those with .t
17:05 IOninja it worked! :P
17:05 moritz \o7
17:05 moritz erm
17:05 moritz \o/
17:06 IOninja lol... there's a gazillion spectest failures tho :P
17:08 cdg joined #perl6
17:11 cdg joined #perl6
17:13 IOninja Well, I'm out of ideas for now.
17:13 * IOninja untakes https://rt.perl.org/Ticket/Display.html?id=130798
17:14 mr_ron joined #perl6
17:14 Tonik joined #perl6
17:20 Geth ¦ doc: d992946f5f | (Wenzel P. P. Peppmeyer)++ | doc/Type/Uni.pod6
17:20 Geth ¦ doc: Revert "test for tagging class files"
17:20 Geth ¦ doc:
17:20 Geth ¦ doc: This reverts commit ecd98a589d824f4fa25f120e60d25965ba3f291c.
17:20 Geth ¦ doc: review: https://github.com/perl6/doc/commit/d992946f5f
17:26 IOninja oh snap. MoarVM has already been released :)
17:26 IOninja I'm sittin' and waiting here lol
17:28 itcharlie1 left #perl6
17:43 Penguiniator_ joined #perl6
17:48 mawkish__ joined #perl6
17:50 ggoebel joined #perl6
17:53 NeuralAnomaly joined #perl6
18:02 agentzh joined #perl6
18:03 eroux joined #perl6
18:03 gdonald joined #perl6
18:15 arnsholt Gah. Porting Python to Perl is occasionally tricky
18:16 arnsholt Some of the code relies on being able to store defaults in a class variable and then later overriding it with an instance variable
18:16 geekosaur ...who do they think they are, ruby?
18:18 timotimo oh hey arnsholt
18:18 arnsholt It's a pretty straightforward consequence of Python's lookup semantics, but doesn't map very well to other languages
18:18 timotimo can you do some trickery with // there?
18:18 IOninja :/ https://github.com/agwind/perl6-csv-grammar/co​mmit/4887c7f682df5bf5d9b6f6852ef508f0279046f3
18:18 IOninja Looks like I need to up my name swapping game.
18:19 arnsholt timotimo: Possibly. I think I'll probably just let it be a normal instance variable with a default value
18:19 timotimo oh, you mean the shared default isn't meant to be changed and have a global impact?
18:19 arnsholt (Until some jerk decides that it's a good idea to change the class variable too. In which case I'll throw my laptop out the window)
18:19 arnsholt I *think* it's not really supposed to be mutated
18:21 timotimo so isn't that really just a default variable for an attribute?
18:23 arnsholt Yeah. I'm pretty sure that's how it's intended
18:23 arnsholt But the semantics don't map 100%
18:24 timotimo OK
18:24 arnsholt And for a first pass I'm trying to keep it pretty close
18:24 arnsholt On the principle of better to refactor something that already works than trying to refactor *and* port at the same time
18:24 IOninja You're converting it to Perl 6?
18:24 arnsholt Perl 5
18:25 IOninja ah
18:25 timotimo don't talk to me or my programming language ever again! :P
18:25 arnsholt With Moo and other nice things to make it closer to Perl 6, but still 5
18:25 arnsholt (mst++ for making me aware of several of these nice things, incidentally)
18:26 * IOninja uses Mew :)
18:27 timotimo huh, i have a feeling that when fudgeandrun runs syncthing is like "hey, these files just changed! better transfer them over!"
18:34 agentzh joined #perl6
18:38 jjido joined #perl6
18:48 cpage_ joined #perl6
18:58 eyck joined #perl6
19:05 NeuralAnomaly joined #perl6
19:07 jjido joined #perl6
19:13 andrzejku joined #perl6
19:21 kent\n joined #perl6
19:24 Geth ¦ ecosystem: f17d11680e | (Steve Mynott)++ | META.list
19:24 Geth ¦ ecosystem: Leont's prove packaged for Rakudo Star
19:24 Geth ¦ ecosystem: review: https://github.com/perl6/e​cosystem/commit/f17d11680e
19:26 devmikey joined #perl6
19:30 labster joined #perl6
19:32 Voldenet joined #perl6
19:32 Voldenet hello
19:33 Voldenet I'm trying to use a "grammar", but I can't figure out how to split that into more understandable rules: { .*? '.txt' }
19:35 jjido joined #perl6
19:36 Voldenet What I did so far is that: grammar File { rule TOP { <name> '.txt' } token name { .*? } }
19:36 IOninja Seems simple enough as it is
19:36 Voldenet but it doesn't seem to match anything at all, so I must've misunderstood something
19:36 IOninja Prolly 'cause tokens don't backtrack
19:36 moritz IOninja: the release announcement still points to rakudo.org for downloads
19:36 IOninja m: grammar File { rule TOP { <name> '.txt' } token name { .*? } }.parse('foo.txt').say
19:36 camelia rakudo-moar 20c899: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Strange text after block (missing semicolon or comma?)␤at <tmp>:1␤------> 3rammar File { rule TOP { <name> '.txt' }7⏏5 token name { .*? } }.parse('foo.txt').s␤    expecting any of:␤        in…»
19:36 moritz IOninja: can you pleaes change that for the next one?
19:36 IOninja m: grammar File { rule TOP { <name> '.txt' }; token name { .*? } }.parse('foo.txt').say
19:36 camelia rakudo-moar 20c899: OUTPUT: «Nil␤»
19:37 IOninja m: grammar File { rule TOP { <name> '.txt' }; regex name { .*? } }.parse('foo.txt').say
19:37 camelia rakudo-moar 20c899: OUTPUT: «「foo.txt」␤ name => 「foo」␤»
19:37 IOninja Yeah
19:37 IOninja moritz: on purpose. I wanna make the download page as clear and pretty as the old one first.
19:38 IOninja Voldenet: so basically backtracking. `regex` instead of `token` works, but backtracking in grammars is a smell, so you should rethink your rules to do stuff without backtracking
19:38 moritz IOninja: oh, I hadn't actually seen the pretty version
19:39 moritz IOninja: how is that done on the older server?
19:39 IOninja moritz: with a PHP script: https://github.com/perl6/web-rakudo
19:39 IOninja but I figure we can run something better on the new site
19:39 moritz IOninja: we could statically generate them after each upload
19:40 Voldenet IOninja: well sure, but for such general things as filenames you pretty much have to backtrack to get an extension, unless you started parsing reversed name, which makes sense
19:40 Voldenet but is insane
19:41 moritz but I wouldn't even use a grammar for that, just plain .split
19:43 Voldenet Well, true. I'm just playing around with grammars so far, it's a nice shiny feature I don't really know how to use
19:43 IOninja m: grammar File { token TOP { <name> '.txt' }; token name { [ . <!before 'txt'> ]+  } }.parse('foo.txt').say
19:43 camelia rakudo-moar 20c899: OUTPUT: «「foo.txt」␤ name => 「foo」␤»
19:43 IOninja Well, don't have to...
19:43 IOninja Voldenet: it's for doing a good bit of parsing, not to split a filename with extension :)
19:44 Voldenet Yeah, I thought it's a "nice drop-in replacement for perl5's regex mess"
19:45 IOninja m: "foo.txt" ~~ /$<name>=.+ $<ext> = '.txt'/; say $/
19:45 camelia rakudo-moar 20c899: OUTPUT: «「foo.txt」␤ name => 「foo」␤ ext => 「.txt」␤»
19:45 IOninja Don't need a grammar :)
19:47 IOninja FYI: "if you have any code that depends on %*PRAGMAS or $*ACTIONS, it'll break"
19:47 IOninja Soon. We're marging improvements and stuff.
19:47 IOninja *mergin
19:48 Voldenet Well, that's a slow progress ;)
19:49 zakharyas joined #perl6
19:49 pyrimidine joined #perl6
19:50 IOninja moritz: yeah, static should work. As long as release managers remember to run it after upload :)
19:50 moritz IOninja: that's what the guides are for, no? :-)
19:50 moritz IOninja: or could be run by cron job also
19:51 IOninja :)
19:53 TEttinger joined #perl6
19:55 lucs Um, what am doing here?:
19:55 lucs m: .say for '04'..'16'
19:55 camelia rakudo-moar 20c899: OUTPUT: «04␤05␤06␤14␤15␤16␤»
19:55 lucs m: .say for '07'..'11'
19:55 camelia rakudo-moar 20c899: OUTPUT: «07␤06␤05␤04␤03␤02␤01␤17␤16␤15␤14␤13␤12␤11␤»
19:58 IOninja lucs: making a character range
19:58 lucs I don't get it :/
19:58 IOninja 0 rises to 1; 7 decreases to 1
19:58 IOninja 0 rises to 1; 4 rises to 6
19:59 lucs Oooh...
20:00 lucs How do I get strings for example from '03' to '12' (03 04 05 ⋯ 09 10 11 12) ?
20:00 gdonald left #perl6
20:00 IOninja m: say eager '03', *.succ … '12'
20:00 camelia rakudo-moar 20c899: OUTPUT: «(03 04 05 06 07 08 09 10 11 12)␤»
20:01 lucs Hmm... Okay :)
20:01 lucs Thanks
20:04 rindolf lucs: hi! Long time! How are you?
20:05 jjido joined #perl6
20:05 espadrine joined #perl6
20:05 lucs Good, thanks. Enjoying Perl a lot.
20:06 IOninja m: .say for '03', *.succ … '12'
20:06 camelia rakudo-moar 20c899: OUTPUT: «03␤04␤05␤06␤07␤08␤09␤10␤11␤12␤»
20:06 IOninja (just to clarify `eager` wasn't part of making it)
20:07 lucs IOninja: Yep, I had that figured out, thanks.
20:08 ugexe no need to `zef update` before installing to get the latest module index anymore. unless you manually disable auto-update anyway
20:09 Voldenet m: .fmt('%02d').say for 3..12
20:09 camelia rakudo-moar 20c899: OUTPUT: «03␤04␤05␤06␤07␤08␤09␤10␤11␤12␤»
20:09 Voldenet wow, it actually worked
20:09 regnarg joined #perl6
20:09 Voldenet that might be insane of me, but can a regex within a grammar pass a transformed regex into some sub-regex?
20:12 Voldenet grammar ReverseGrammarIfA { rule TOP { <a> <b> } regex a { 'a' .*? - .* } regex b { 'b' .*? - .* } regex result { .*? - .* } }
20:12 Voldenet but then a should pass \1 as \2 and \2 as \1, while b should just call result
20:12 Voldenet hm, actually, can be simplified
20:13 Voldenet grammar ReverseGrammarIfA { rule TOP { <a> | <result> } regex a { 'a' .*? - .* } regex result { $<first> = [.*?] - $<second> = [.*] } }
20:15 Voldenet meh, nevermind, my question is gibberish
20:18 ugexe `$<name>=<.known-header> ':' <.OWS> {} $<value>=<::($<name>)>` you can dynamically choose a rule name based on the previous match's value
20:20 Voldenet basically, I want to parse 'aSecond - First' and 'bFirst - Second' as ['First', 'Second'], but named groups won't do - "First" and "Second" are subregexes
20:22 ugexe the capture is so it can use its value as the name of the subregex or whatever
20:22 ugexe <::($<name>)
20:22 regnarg Hi, I have a NativeCall struct like this: class args_t is repr('CStruct') { has int32 $.argc is rw; has CArray[Str] $.argv is rw; }
20:22 regnarg I currently find myself unable to write to the array
20:23 Voldenet It looks like a good answer, now I just need to understand it :-)
20:24 regnarg p6: use NativeCall; class args_t is repr('CStruct') { has int32 $.argc is rw; has CArray[Str] $.argv is rw; }; my args_t $args .= new; $args.argv = CArray[Str].new(["a"]);
20:24 camelia rakudo-moar e1df52: OUTPUT: «Cannot modify an immutable NativeCall::Types::CArray[Str]␤  in block <unit> at <tmp> line 1␤␤»
20:24 regnarg p6: use NativeCall; class args_t is repr('CStruct') { has int32 $.argc is rw; has CArray[Str] $.argv is rw; }; my args_t $args .= new( :argv(CArray[Str].new(["a"])) );
20:24 camelia rakudo-moar e1df52: OUTPUT: «Cannot modify an immutable NativeCall::Types::CArray[Str]␤  in block <unit> at <tmp> line 1␤␤»
20:25 ugexe p6: say $*VM.version
20:25 camelia rakudo-moar e1df52: OUTPUT: «v2017.02␤»
20:25 regnarg p6: use NativeCall; class args_t is repr('CStruct') { has int32 $.argc is rw; has CArray[Str] $.argv is rw; }; my args_t $args .= new; $args.argv.push("a");
20:25 camelia rakudo-moar e1df52: OUTPUT: «Cannot modify an immutable NativeCall::Types::CArray[Str]␤  in block <unit> at <tmp> line 1␤␤»
20:26 regnarg The docs say that we should use := instead of =. But that cannot be done from the outside. It works when I define a custom setter.
20:27 regnarg p6: use NativeCall; class args_t is repr('CStruct') { has int32 $.argc is rw; has CArray[Str] $.argv is rw; method set(CArray[Str] $val) { $!argv := $val; } }; my args_t $args .= new; $args.set(CArray[Str].new(["a"]));
20:27 camelia rakudo-moar e1df52: ( no output )
20:28 regnarg This works but is kinda ugly. Is there another way? (perhaps some magic trait instead of is rw)
20:31 jjido joined #perl6
20:33 labster joined #perl6
20:38 Rawriful joined #perl6
20:40 Lucas_One left #perl6
21:06 mawkish__ joined #perl6
21:17 jeffythedragonsl joined #perl6
21:20 Khisanth joined #perl6
21:34 rindolf joined #perl6
21:40 mawkish__ joined #perl6
21:49 Voldenet p6: say "abc def ghi" ~~ m:global{\w+}
21:49 camelia rakudo-moar e1df52: OUTPUT: «(「abc」 「def」 「ghi」)␤»
21:49 Voldenet very weird
21:49 Voldenet for me it outputs "False"
21:50 AlexDaniel 6c: say "abc def ghi" ~~ m:global{\w+}
21:50 committable6 AlexDaniel, ¦«2015.12,2016.02,2016.03,2016.04,2016.​05,2016.06,2016.07.1,2016.08.1,2016.09,​2016.10,2016.11,2016.12,2017.01,HEAD»: (「abc」 「def」 「ghi」)
21:50 AlexDaniel Voldenet: what's your rakudo version?
21:50 AlexDaniel committable6: all say "abc def ghi" ~~ m:global{\w+}
21:50 Voldenet it's debian stable, so... erm, ancient
21:50 AlexDaniel Voldenet: well, there's your answer
21:50 committable6 AlexDaniel, https://gist.github.com/b0c0​5edf8e1b11678042efdef245a865
21:51 AlexDaniel Voldenet: anything older than 2015.12 is worth upgrading
21:51 Voldenet 2014.07, lol
21:51 AlexDaniel Voldenet: according to the bot your version is <2014.11
21:51 AlexDaniel yes
21:51 AlexDaniel ok
21:51 Voldenet i can't believe it's the newest one in the repo
21:51 AlexDaniel right, you have debian jessie
21:52 AlexDaniel I thought we were just about to see a new debian release…
21:52 Voldenet there's no good repo for pre-compiled "daily" debian snapshots?
21:52 AlexDaniel huggable: deb
21:52 huggable AlexDaniel, CentOS and Debian Rakudo packages: https://github.com/nxadm/rakudo-pkg/releases
21:52 Voldenet Thanks.
21:53 AlexDaniel Voldenet: not a repo, but you can get a deb package there ↑
21:53 Voldenet Well, it's good enough. I can make a repo out of it. :-)
21:53 AlexDaniel 2017-02-05: Full freeze
21:54 mawkish__ joined #perl6
21:55 AlexDaniel so debian stretch will end up having rakudo 2016.12
21:55 AlexDaniel not too bad!
21:56 AlexDaniel … yet nothing for package management
21:56 AlexDaniel (s/package/module/ ?)
21:58 bolangi joined #perl6
22:09 Voldenet Hm, regexes seem a lot more different than in perl5, how do I do this in perl6: print $1 if "[abc]def" =~ /\[([^]]+)\]/?
22:11 Voldenet p6: say "[abc]def" ~~ / '[' <[.] - [\]]>+ ']' /
22:11 camelia rakudo-moar e1df52: OUTPUT: «Nil␤»
22:14 timotimo . inside [ ] doesn't mean "anything"
22:14 timotimo it means "a dot"
22:14 Voldenet Yeah, but then dot is invalid
22:14 timotimo say "[abc]def" ~~ / '[' <-[\]]>+ ']' /
22:14 timotimo m: say "[abc]def" ~~ / '[' <-[\]]>+ ']' /
22:14 camelia rakudo-moar e1df52: OUTPUT: «「[abc]」␤»
22:14 Voldenet makes a spectacular sense
22:15 timotimo :) :)
22:15 AlexDaniel hm, I wonder…
22:15 AlexDaniel m: say "[abc]def" ~~ / ‘[’ (<-[‘]’>+) ‘]’ /
22:15 camelia rakudo-moar e1df52: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in metachar:sym<assert>; couldn't find final '>' ␤at <tmp>:1␤------> 3say "[abc]def" ~~ / ‘[’ (<-[‘]7⏏5’>+) ‘]’ /␤»
22:15 AlexDaniel m: say "[abc]def" ~~ / ‘[’ (<-[‘]’]>+) ‘]’ /
22:15 camelia rakudo-moar e1df52: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in metachar:sym<assert>; couldn't find final '>' ␤at <tmp>:1␤------> 3say "[abc]def" ~~ / ‘[’ (<-[‘]7⏏5’]>+) ‘]’ /␤»
22:16 AlexDaniel ok-ok…
22:17 AlexDaniel m: say "[abc]def" ~~ / ‘[’ ~ ‘]’ (.+) /
22:17 camelia rakudo-moar e1df52: OUTPUT: «「[abc]」␤ 0 => 「abc」␤»
22:17 AlexDaniel Voldenet: maybe this makes more sense?
22:18 IOninja Last one is wrong.
22:18 AlexDaniel why?
22:18 IOninja m: say "[abc]d]e]f" ~~ / ‘[’ ~ ‘]’ (.+) /
22:18 camelia rakudo-moar e1df52: OUTPUT: «「[abc]d]e]」␤ 0 => 「abc]d]e」␤»
22:18 timotimo yeah, it goes to the last one
22:18 timotimo the other one goes to the first one
22:19 timotimo easy to fix, though
22:19 timotimo m: say "[abc]d]e]f" ~~ / ‘[’ ~ ‘]’ (.+?) /
22:19 camelia rakudo-moar e1df52: OUTPUT: «「[abc]」␤ 0 => 「abc」␤»
22:19 AlexDaniel ah yeah
22:25 Voldenet what does ~ actually mean?
22:26 timotimo "these two around the following thing"
22:38 AlexDaniel (not documented yet: https://github.com/perl6/doc/issues/853 )
22:38 mawkish__ joined #perl6
22:41 Voldenet joined #perl6
22:41 Voldenet joined #perl6
22:43 moritz the grammar chapter of https://leanpub.com/perl6 talks about ~ too
22:43 moritz and how you can use it to generate good error messages from a failed parse
22:43 moritz </plug>
22:46 timotimo :)
22:47 sena_kun there is a PR that "should" document it, but not yet ready.
22:53 cdg joined #perl6
23:02 mawkish__ joined #perl6
23:05 llfourn joined #perl6
23:10 mawkish__ joined #perl6
23:12 mr_ron joined #perl6
23:26 mawkish__ joined #perl6
23:29 kalkin- joined #perl6
23:32 mawkish__ joined #perl6
23:33 hartenfels joined #perl6
23:34 itaipu joined #perl6
23:41 lep-delete joined #perl6
23:42 mawkish__ joined #perl6
23:46 mawkish__ joined #perl6
23:50 mawkish__ joined #perl6
23:54 mawkish__ joined #perl6
23:58 itcharlie joined #perl6

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo