Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-05-05

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:14 mcmillhj joined #perl6
00:19 alphah_ joined #perl6
00:21 asdfgh joined #perl6
00:23 alphah_ samcv: it worked for me, I merged the pull request.
00:29 haxmeister hello perl6
00:30 mcmillhj joined #perl6
00:31 Cabanossi joined #perl6
00:33 pierre_ joined #perl6
00:52 sammers hello
01:01 BenGoldberg joined #perl6
01:01 haxmeister hello
01:11 haxmeister how can I get line 35 to be concatenated onto line 34? https://pastebin.com/eZtqasPY
01:12 pierre_ joined #perl6
01:16 Cabanossi joined #perl6
01:16 MIKE998 joined #perl6
01:17 MIKE998 Ahoy!
01:17 MIKE998 What's the good tutorial for sub MAIN?
01:17 haxmeister finding good tutorials has been a struggle for me..lol
01:19 MIKE998 *crickets*
01:19 MIKE998 Perl is dead, eh?
01:19 haxmeister nope
01:19 haxmeister I'm loving this shit
01:20 haxmeister but they are more talkative about 4hrs prior to now
01:37 poohman joined #perl6
01:38 labster joined #perl6
01:39 MasterDuke_ MIKE998: a lot of people have come here from http://perl6intro.com/, have you looked at it yet?
01:47 MIKE998 MasterDuke_: don't see MAIN in there
01:47 MasterDuke_ i see one or two mentions here https://learnxinyminutes.com/docs/perl6/, but i'm not aware of anything that goes into great depth on MAIN
01:48 ilbot3 joined #perl6
01:48 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!
01:50 MasterDuke_ MIKE998: here's something http://linuxtot.com/parsing-command-line-arguments-in-perl-6/
01:51 MIKE998 Yey!
01:51 MIKE998 MasterDuke_++ thanks
01:52 MasterDuke_ np
01:53 raschipi joined #perl6
01:53 Actualeyes joined #perl6
01:53 MIKE998 I'm gonna learn all the stuff now!
01:54 colomon The article is a little sloppy and incomplete, but does seem to have the basics pretty well.
01:56 colomon For instance, he left out that the Perl 6 script is run like normal BEFORE calling MAIN.  So if you have code which isn’t encapsulated in a sub or whatever, that will be executed just like MAIN wasn’t there.  Then once that is done, MAIN is called.
01:57 raschipi Yep, MAIN at the end.
01:57 colomon and MAIN can be a multi sub
01:58 * colomon wonders what other tricks he’s forgetting
01:58 raschipi m: say 'a'; sub MAIN { say 'b' }; say 'c';
01:58 camelia rakudo-moar f2af3d: OUTPUT: «a␤c␤b␤»
01:59 cpage_ joined #perl6
02:00 colomon there’s a way to specify alternate spellings of options, but it always seemed really fiddly to me
02:01 Cabanossi joined #perl6
02:01 colomon (like -v versus —verbose)
02:02 raschipi At that point, I think it's better to get getopt out.
02:03 haxmeister \o/
02:03 haxmeister made my first simple class and object in perl6 today :-D
02:04 colomon haxmeister++
02:04 MasterDuke_ colomon: you mean for generic named arguments, like `sub ( :color(:colour($c)) ) { } `, or something specific to MAIN?
02:05 colomon MasterDuke_: that looks right to me?
02:05 MasterDuke_ heh, i copied it from the docs
02:05 colomon I just got a headache every time I tried to do that, and eventurally I gave up.
02:06 haxmeister looks like greek to me.. and I did lisp and scheme fairly well a year go
02:07 haxmeister so what is the difference between a module and a package?
02:07 raschipi m: sub f (:arg(:argu($c))) {say $c}; f(:arg('a')); f(:argu('b'))
02:07 camelia rakudo-moar f2af3d: OUTPUT: «a␤b␤»
02:09 haxmeister oh thank you thank you thank you for making that syntax possible
02:09 haxmeister Foo::Bar::<$baz>
02:10 * haxmeister loves the little things
02:11 raschipi haxmeister: a module is one kind of package.
02:11 haxmeister trudging through https://docs.perl6.org/language/packages
02:16 tharkun joined #perl6
02:18 raschipi haxmeister: I think that's has too much detail to start.
02:19 raschipi A package is something that says where a variable declared with 'our' will be created.
02:20 raschipi 'our' creates a variable in the current package.
02:20 raschipi So, a package is one kind of namespace.
02:24 haxmeister I need to just make one.. maybe make one in a script I already have.. but even better, one in a separate file
02:24 haxmeister but this page I'm reading doesn't tell me how.. it's just a reference page really
02:25 raschipi Other types of namespaces are the lexical scope, the dynamic scope and method resolution.
02:26 raschipi You want to make a module?
02:29 raschipi haxmeister: Here's a tool that automates it for you: https://github.com/gfldex/perl6-meta6-bin
02:33 mr-foobar joined #perl6
02:47 haxmeister sorry raschipi I need to hand code one so it will stick
02:50 raschipi Have you seen https://docs.perl6.org/language/modules.html ?
02:57 haxmeister can't get the page up.. I guess my router is glitching or something
03:01 haxmeister but I can get this one: http://perl6intro.com/#_perl_6_modules
03:02 haxmeister only thing is I can't use zef
03:04 haxmeister well that was a let down
03:04 haxmeister we need more tuts guys
03:04 raschipi That one is about using them, not what you want.
03:04 haxmeister yeah
03:05 haxmeister I can't get that page you linked
03:05 haxmeister in fact docs.perl6.org is down
03:06 haxmeister ah man.. I only got an hour left tops
03:08 haxmeister perl6.org is down completely
03:14 zengargoyle joined #perl6
03:16 haxmeister perl6maven.com is up though
03:16 raschipi Works for me.
03:18 haxmeister still no bones
03:19 haxmeister modules section at perl6maven is incomplete
03:29 aborazmeh joined #perl6
03:29 aborazmeh joined #perl6
03:30 Cabanossi joined #perl6
03:35 xtreak joined #perl6
03:40 AlexDaniel joined #perl6
03:44 TreyHarris joined #perl6
03:46 * skids forgets if there is a single-item ".map" method, like .first for .grep
03:56 TreyHarris skids: map in lazy context should work fine:
03:56 TreyHarris m: my $counter = 0; my @f = 1..20; say (@f.map({$counter++; $_ * 2})).min; say $counter; $counter = 0; say (@f.map({$counter++; $_ * 2}))[0]; say $counter
03:56 camelia rakudo-moar f2af3d: OUTPUT: «2␤20␤2␤1␤»
03:57 TreyHarris skids: that's what you need, right?
03:59 skids I'm wondering if there's a way to not involve a Seq when I need to append generated code the the end of a value to process it.
04:00 TreyHarris skids: example? first involves a Seq too
04:01 skids so "chunk of code" ~ '.map({' ~ $other_chunk_of_code ~ '})' is what I'm using, but I really just want to call the second chunk of code.
04:02 skids Ah.
04:02 skids m: 4.&{$_ + 1}.say
04:02 camelia rakudo-moar f2af3d: OUTPUT: «5␤»
04:02 skids That does it.
04:03 TreyHarris skids: oh, on a scalar. I thought, like first, you meant on a sequence of some sort.
04:04 TreyHarris m: {$_ + 1}(4).say
04:04 camelia rakudo-moar f2af3d: OUTPUT: «5␤»
04:04 TreyHarris skids: ^^ nicer syntax I think.
04:05 skids Right but I can only append.
04:05 TreyHarris though if it's in a chain it might not be possible
04:05 skids Which was the problem.
04:05 TreyHarris oh, literally append generated code, like... eval'ing?
04:05 TreyHarris not even Callables?
04:06 skids Yeah, generating Perl6 code. Eventually I'll refactor the crap and eliminate that.
04:06 TreyHarris oh. then yeah. I assumed you meant "append" in a hand-wavy AST sort of manner.
04:06 TreyHarris sorry
04:07 TreyHarris I would've given you .&{} right off the bat in that case
04:07 TreyHarris there is a slightly conciser way with whatever though:
04:08 TreyHarris m: 4.&(* + 1).say
04:08 camelia rakudo-moar f2af3d: OUTPUT: «5␤»
04:08 TreyHarris (parens, not braces, because it's a Whatever)
04:08 TreyHarris skids: follow?
04:08 skids Yeah the code could get complex enough to bury the ownership of the Whatever star.
04:12 TreyHarris docs.perl6.org is down for me
04:12 skids here too
04:13 TreyHarris I'd argue that if star is confusing, you should probably skip $_ and just use named placeholders to give you even better control and debuggability.
04:14 TreyHarris (Not knowing your use case, but imagining it, I mean. Like if you have an iterator of some sort you could use ($^it-1x, $^it-1y), ($^it-2x, $^it-2y), etc.
04:15 TreyHarris erm.... $^it1-x, etc. I meant. You can't have a \d to the right of a hyphen in an identifier.
04:19 TreyHarris (er, actually, you *can*, but if you do, you take the risk of arithmetic rules taking precedence and seeing a subtraction, so I think itt's best to just pretend you can't.)
04:20 skids Never been much of a fan of the hyphenization trend.  Especially for allcaps.
04:21 skids Anway, placeholders do offer some deconfliction beyond $_, but it's a margnal gain compared to how easy it is  to confuse *.
04:21 TreyHarris skids: if you're writing a translator, style is te change underscores to hyphens, because underscores are supposed to indicate "beware, this may be somewhat magical"
04:21 TreyHarris s/change/change Perl 5/
04:22 skids Yeah I know.  It's something I more tolerate about Perl6 than like, though.
04:23 TreyHarris not saying you have to follow that. just be aware that connotation is out there.
04:24 TreyHarris Perl 6 identifiers are actually subject to precedence-busting in quite a few edge cases, particularly if you play with sigilless variables or with quoting constructs.
04:25 TreyHarris m: my $isn't = False; say "It is $isn't."
04:25 camelia rakudo-moar f2af3d: OUTPUT: «It is False.␤»
04:25 TreyHarris m: my $isn't = False; say q'It is $isn't.'
04:25 camelia rakudo-moar f2af3d: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in single quotes; couldn't find final "'" ␤at <tmp>:1␤------> 3my $isn't = False; say q'It is $isn't.'7⏏5<EOL>␤    expecting any of:␤        dotty method or postfix…»
04:25 TreyHarris m: my $isn't = False; say q'It is {$isn't}.'
04:25 camelia rakudo-moar f2af3d: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in single quotes; couldn't find final "'" ␤at <tmp>:1␤------> 3y $isn't = False; say q'It is {$isn't}.'7⏏5<EOL>␤    expecting any of:␤        dotty method or postfi…»
04:25 * skids recalls something with grammar rule names not liking them.
04:26 TreyHarris (I'm not actually sure there's any way to use an apostrophe-containing identifier inside a single-quoted interpolating construct.)
04:26 skids Oh maye it was `
04:26 skids erm '
04:27 TreyHarris grammar rules not liking "them" == "identifiers with non alphaunderscorenumerics"?
04:27 TreyHarris I haven't seen that
04:28 skids may be fixed.
04:29 skids I remember working around it in Grammar::ABNF.  Maybe should go un-work-around it.
04:29 TreyHarris it's just that quoting and arithmetic operators--which can cause ambiguity with identifiers--are higher in precedence.
04:30 Cabanossi joined #perl6
04:31 jdv79 joined #perl6
04:32 TreyHarris I've learned a lot by running perl6 --target=ast.
04:32 skids Hrm maybe Grammar::ABNF wasn't where I ran into that.  Just confusing with a similar problem.
04:33 alphah_ joined #perl6
04:34 * TreyHarris chuckles
04:34 TreyHarris Guido would be very, very unhappy with this lexical ambiguity business :-)
04:34 Actualeyes joined #perl6
04:35 skids Obviously need to go to bed.  Just spent 5 minutes figuring out I had a test file with plan 63 and no tests, that actually had no tests, and wasn't crashing silently before running them.
04:35 TreyHarris skids: nighty night
04:35 curan joined #perl6
04:38 lookatme joined #perl6
04:40 samcv o/ all
04:44 lookatme o/
04:45 samcv hey lookatme
04:45 samcv how is your grammar going?
04:45 * TreyHarris looks at samcv
04:46 samcv hehe
04:47 mniip joined #perl6
04:49 sjn joined #perl6
04:51 TreyHarris what is the 'xt' test dir for?
04:53 samcv xt?
04:53 TreyHarris oh, author tests.
04:56 samcv https://design.perl6.org/S22.html site is down
04:57 samcv xt folder isn't in the design specs
04:59 sammers I think modules.perl6.org is down...
05:00 samcv everybody panic!
05:00 * samcv runs around screaming
05:00 Cabanossi joined #perl6
05:08 TreyHarris *.perl6.org has been sporadic for a few hours now.
05:09 ugexe TreyHarris: i dont understand the second half of your issue
05:09 TreyHarris ugexe: what issue?
05:10 ugexe zef
05:10 TreyHarris oh, with zef? Probably an editing issue, as I only had one. Let me look
05:10 ugexe you were talking about a url library, and the -u flag defaulting to true
05:10 TreyHarris oh... `homebrew browse` opens the browser onto the URL. `homebrew browse -u` just prints the URL the browse would have been opened to
05:11 TreyHarris I don't see a portable browser-opening lib in ecosystem, so I was suggesting to default to the -u behavior for now.
05:11 ugexe oh not open source, now i understand
05:12 TreyHarris ah-hah. yes. I'll edit.
05:12 TreyHarris done.
05:13 ugexe the long way is `zef info zef|grep bugtracker`
05:14 itsame joined #perl6
05:16 TreyHarris are the synopses on GitHub, since design.perl6.org is down?
05:17 TreyHarris I thought they were in doc, but apparently not
05:18 TreyHarris ah. "specs"
05:18 aborazmeh joined #perl6
05:18 aborazmeh joined #perl6
05:20 TreyHarris ugexe: oh, interesting. S22 doesn't provide a homepage attribute (I thought I saw one), just source and bugtracker, both of which can be used to derive a GitHub homepage, but won't work if there's a dedicated project domain. Is that intentional?
05:21 wamba joined #perl6
05:21 ugexe "possible" names are: ...
05:22 ugexe its just listing things that make sense
05:23 TreyHarris ugexe: oh, I see. I read that like "possible states of an electrical charge are positive and negative"
05:23 TreyHarris i.e., things not listed there are not possile
05:23 ugexe yeah, thats probably what it meant, but im saying theres a loophole
05:24 ugexe realistically there is no reason for support to be defined in s22
05:25 ugexe other than as a suggestion
05:27 TreyHarris since many/most projects won't fill-in "phone", I think it's understood as not being a list of required fields. but it does read as an exhaustive list of fields to me. I'd say either add a "project homepage", or explicitly specify, "s/possible names are/possible names may include/"
05:28 TreyHarris and since I think homepage, like source, are likely to be programmatically useful (as I've given an example), I'd prefer it be specified.
05:28 TreyHarris but it needn't be mandatory any more than phone.
05:29 Resol joined #perl6
05:30 Cabanossi joined #perl6
05:31 ugexe not just phone! A fully qualified phone number (with potential cost indication)
05:31 TreyHarris :-)
05:35 samcv TreyHarris, what's the windows api?
05:35 samcv on linux it's xdg-open or whatever
05:35 samcv not sure on mac
05:36 TreyHarris samcv: dunno. on mac it's just "open". you can type a URL into Run: and it opens a browser, so it may just be cmd.exe, but I'd have to test and my Win machine's currently updating
05:39 TreyHarris if I have a class Foo { has Tup2 $.x... } where Tup2 is a 2-ple, can I do "handles" so that .fst delegates to $!x[0] and .snd delegates to $![1], or do I need explicit methods for that?
05:40 ugexe powershell -Command Start-Process https://google.com
05:41 anton_p joined #perl6
05:42 lowbro joined #perl6
05:42 lowbro joined #perl6
05:42 lookatme samcv, oh, fine. Current I make a terminal table module, it will be available soon .
05:42 samcv ok :)
05:47 lookatme I took a afternoon nap just now .
05:47 TreyHarris Ah, in this case, I can do handles <fst first> and handles <snd tail> because there are unary methods for the first and last elements of a tuple, but what if it were a 3-tuple and I wanted <fst snd thd>?
05:51 poohman_ joined #perl6
05:54 TreyHarris did y'all just get a rash of racist privmsgs, too?
05:55 poohman joined #perl6
05:58 domidumont joined #perl6
06:00 TreyHarris okay, time for bed. &
06:02 lookatme :)
06:04 domidumont joined #perl6
06:14 pierre_ joined #perl6
06:17 Cabanossi joined #perl6
06:20 domidumont joined #perl6
06:29 xtreak joined #perl6
06:36 darutoko joined #perl6
06:41 dct joined #perl6
06:41 moritz just seen on twitter: "I hate fractals. They are so full of themselves." :-)
06:58 lookatme joined #perl6
07:04 poohman joined #perl6
07:32 Cabanossi joined #perl6
07:32 Geth ¦ perl6.org: 5026b1922c | (Steve Mynott)++ | source/downloads/index.html
07:32 Geth ¦ perl6.org: How to build 2017.04 R* on Raspbian
07:32 Geth ¦ perl6.org: review: https://github.com/perl6/perl6.org/commit/5026b1922c
07:42 moritz FYI I've rebooted www.p6c.org (which also runs perl6.org) because it hung up during the night
07:45 pierre_ joined #perl6
07:51 g4 joined #perl6
07:51 g4 joined #perl6
07:56 tokomer joined #perl6
08:00 mr-foobar joined #perl6
08:01 Cabanossi joined #perl6
08:05 parv joined #perl6
08:06 wamba joined #perl6
08:08 zakharyas joined #perl6
08:11 samcv cool
08:29 rindolf joined #perl6
08:31 Cabanossi joined #perl6
08:37 robertle joined #perl6
08:44 cgfbee joined #perl6
09:16 Cabanossi joined #perl6
09:21 abraxxa joined #perl6
09:22 pmurias joined #perl6
09:24 bjz joined #perl6
09:27 bjz joined #perl6
09:30 xtreak joined #perl6
09:44 zakharyas joined #perl6
10:01 moray` joined #perl6
10:11 mr-foobar joined #perl6
10:12 MorayJ joined #perl6
10:16 Cabanossi joined #perl6
10:16 anton_p joined #perl6
10:33 xtreak joined #perl6
10:34 lowbro joined #perl6
10:34 lowbro joined #perl6
10:35 Geth ¦ whateverable: 0ff5de677d | (Aleks-Daniel Jakimenko-Aleksejev)++ | Evalable.p6
10:35 Geth ¦ whateverable: Don't search for camelia if no space after m:
10:35 Geth ¦ whateverable:
10:35 Geth ¦ whateverable: Camelia does not answer on “m:say 42” anyway, no need to check if
10:35 Geth ¦ whateverable: camelia is present.
10:35 Geth ¦ whateverable: review: https://github.com/perl6/whateverable/commit/0ff5de677d
10:35 Geth ¦ whateverable: 31bc4c8515 | (Aleks-Daniel Jakimenko-Aleksejev)++ | Evalable.p6
10:35 Geth ¦ whateverable: Detect messages starting with “say” and answer sometimes
10:35 Geth ¦ whateverable:
10:35 Geth ¦ whateverable: This change has been there for a while, I simply forgot to commit
10:35 Geth ¦ whateverable: it. It seems that there was at least one time it answered
10:35 Geth ¦ whateverable: unnecessarily, so perhaps the regex can be improved.
10:35 Geth ¦ whateverable:
10:35 Geth ¦ whateverable: But generally, the idea is really nice. If it becomes annoyng for some
10:35 Geth ¦ whateverable: reason, I can always make the regex more strict.
10:35 Geth ¦ whateverable: review: https://github.com/perl6/whateverable/commit/31bc4c8515
10:36 AlexDaniel joined #perl6
10:49 dogbert11 joined #perl6
10:57 pmurias joined #perl6
11:00 sena_kun joined #perl6
11:02 geekosaur joined #perl6
11:09 geekosaur joined #perl6
11:23 wigner joined #perl6
11:26 bjz joined #perl6
11:32 Cabanossi joined #perl6
11:33 ggoebel joined #perl6
11:36 poohman_ joined #perl6
11:50 masak harsh lesson of the day: do not expect Perl 5 subs to take a lexical closure of a surrounding while loop iteration... :/
11:50 masak the little things you start taking for granted...
11:50 masak (hi, #perl6)
11:50 timotimo hi masak
11:52 masak $ perl -Mstrict -wE'my $c = 2; while ($c) { my $d = $c--; sub foo { say $d }; foo() }'
11:52 masak 2
11:52 masak 2
11:52 masak there we have it, exhibited
11:53 masak m: my $c = 2; while $c { my $d = $c--; sub foo { say $d }; foo() }
11:53 camelia rakudo-moar f2af3d: OUTPUT: «2␤1␤»
11:53 * masak sobs happily
11:58 jnthn masak: What if you put an explicit my on the sub?
12:02 Cabanossi joined #perl6
12:02 Juerd 1;0 juerd@cxien:~$ perl -Mexperimental=lexical_subs -Mstrict -wE'my $c = 2; while ($c) { my $d = $c--; my sub foo { say $d }; foo() }'
12:02 Juerd 2
12:02 Juerd 1
12:03 Juerd I'm amazed there's no warning for putting a non-lexical sub in a while loop
12:03 xtreak joined #perl6
12:04 xtreak joined #perl6
12:05 moritz I'm sure somebody on p5p suggested doing that, and somebody else cited a semi-valid use case that prevented the warning from getting in
12:08 bjz_ joined #perl6
12:13 Actualeyes joined #perl6
12:14 masak jnthn: that would work from 5.18 and onwards, but the code I'm writing (for reasons outside of my control) needs to be 5.14-compatible.
12:14 timotimo hah, ouch
12:14 jnthn masak: Ah, fair enough
12:14 timotimo 5.14 isn't ridiculously old, is it?
12:22 colomon 2011
12:26 timotimo not that bad
12:30 pmurias joined #perl6
12:31 Sound joined #perl6
12:31 Sound joined #perl6
12:32 pat_js joined #perl6
12:37 itsame joined #perl6
12:38 wamba joined #perl6
12:40 bjz joined #perl6
12:53 darutoko- joined #perl6
12:54 perlpilot_ joined #perl6
12:54 imcsk8_ joined #perl6
12:55 aindilis` joined #perl6
12:56 wamba joined #perl6
12:56 mcmillhj joined #perl6
12:57 itaylor57_ joined #perl6
12:58 nowan joined #perl6
13:00 eviltwin_b joined #perl6
13:01 mniip_ joined #perl6
13:03 cpage_ joined #perl6
13:09 sena_kun joined #perl6
13:09 dct joined #perl6
13:09 g4 joined #perl6
13:10 ggoebel joined #perl6
13:10 TreyHarris joined #perl6
13:14 nine LOL I just discovered that there's an actual /usr/bin/[ command
13:14 stmuk joined #perl6
13:14 hoelzro joined #perl6
13:15 Juerd Syntactic sugar is bad for you :)
13:16 nine Btw. from the backlog. The actual Perl 5ish way is: nine@sphinx:~> perl -Mstrict -wE'my $c = 2; while ($c) { my $d = $c--; my $foo = sub { say $d }; $foo->() }'
13:16 nine 2
13:16 nine 1
13:26 hoelzro joined #perl6
13:26 stmuk joined #perl6
13:32 pmurias joined #perl6
13:34 itsame joined #perl6
13:37 Juerd nine: Or "use experimental qw(lexical_subs);" :)
13:38 skids joined #perl6
13:38 pierre_ joined #perl6
14:02 rindolf joined #perl6
14:18 wamba joined #perl6
14:25 mcmillhj joined #perl6
14:29 ugexe timotimo: didn't you disable telemeh by default? rakudo appveyor tests have kept failing with telemeh
14:34 timotimo i did, yes
14:35 timotimo i don't think rakudo appveyor pulls in moar-HEAD
14:36 samcv src\profiler\telemeh.c(23) : warning C4391: 'unsigned int __rdtscp(unsigned int *)' : incorrect return type for intrinsic function, expected 'unsigned __int64'
14:36 samcv hmm
14:37 samcv intrisic function cannot be defined it says
14:37 samcv after that
14:37 timotimo i think i fixed that
14:37 samcv https://msdn.microsoft.com/en-us/library/s85a3w4b.aspx
14:37 samcv ah
14:39 samcv timotimo, can you get jnthn to enable appveyor for moarvm?
14:39 timotimo do you know how we could put it under moarvm/moarvm on appveyor?
14:39 timotimo rather than timo/moarvm or samcv/moarvm?
14:39 samcv i do not
14:39 samcv but any appveyor better than none
14:41 araraloren joined #perl6
14:45 cpage_ joined #perl6
14:52 Ulti so if I wanted to read a file line by line what's the way thats going to be the best P6 can pull off right now?
14:52 Ulti perf wise
14:53 jnthn Ulti: Quite possibly the obvious one (for $fh.lines { })
14:53 jnthn Ulti: In so far as it's been optimized a bunch
14:53 Ulti okedoke, currently comparing that to the P5 near equivalent while($line = <$fh>) {}
14:54 Ulti so far its not the best story
14:54 jnthn You may find doing a while loop that calls .get is faster, but it might equally be slower because lines can avoid various checks
14:54 Ulti yeah thats what I was wondering is it the iteration and the overhead of all the fancy nice things in P6 that is slow vs the raw IO
14:55 Ulti guess I can profile this :S
14:55 timotimo you should also try if slurp + lines is any faster
14:55 Ulti this is a 9GB SQL file
14:55 jnthn Also, decoding/NFG ain't free
14:55 timotimo oh, not slurp, then :)
14:55 Ulti yeah exactly this is more an actual real world test
14:56 Ulti because Im noticing most things are fast enough but whenever I hit files of an order I work on from minute to minute its just not really possible yet
14:56 Ulti jnthn: yeah maybe buf would be better
14:56 Ulti so like a binary version of lines
14:56 Ulti .records
14:56 jnthn Well, you can :env<ascii> on opening if you know that's what you have
14:56 Ulti *shrug*
14:56 jnthn uh, enc
14:56 jnthn or latin-1
14:56 Ulti I have bytes jnthn :3
14:57 Ulti its obviously bytes I can see them
14:57 Ulti but yeah most SQL dumps are about a million encodings at once in my experience
14:57 jnthn hah :)
14:58 timotimo if you go with :enc<latin1> you'll get almost what you had as bytes, but we do turn \r\n into a single grapheme
14:58 Ulti P5 0m28.867s   vs   P6 7m16.588s
14:58 Ulti I'll go with the encoding specified
14:59 Ulti 14x isnt the worst
15:00 Ulti given this is on the bigger end of the scale
15:00 Ulti it was defo like an order of magnitude or more worse a couple of years ago
15:01 MasterDuke_ i just ran another perf record of `for $fh.lines {}' on a 1m line file, 20% in MVM_string_utf8_decodestream, 11% in find_separator.isra.6
15:02 Ulti I mean thats 14x on Perl 5 which has super optimal IO
15:04 MasterDuke_ if i do `for $fh.lines(:enc<latin1>) {}' it's 15% in find_separator.isra.6 and 11% in MVM_string_latin1_decodestream
15:06 Ulti 4m53.429s with latin1 set
15:11 lichtkind joined #perl6
15:12 lichtkind m: 10 % -3
15:12 camelia rakudo-moar 5e6b38: OUTPUT: «WARNINGS for <tmp>:␤Useless use of "%" in expression "10 % -" in sink context (line 1)␤»
15:13 lichtkind m: say 10 % -3
15:13 camelia rakudo-moar 5e6b38: OUTPUT: «-2␤»
15:13 lichtkind why?
15:13 khw joined #perl6
15:13 lichtkind cheers khw
15:14 lichtkind why has perl 6 sam modulo bug as in perl 5?
15:14 cosimo -win 18
15:15 timotimo lichtkind: and python
15:15 lichtkind this shouldnt be an argument :)
15:16 lichtkind perl 5 took the shitty oo from python 2 and regretted it since too
15:16 timotimo i didn't know they did that
15:16 lichtkind in old interview larry said at least so
15:16 lichtkind not sure it was a pun
15:16 timotimo OK
15:17 lichtkind so i have to define my own?
15:17 Cabanossi joined #perl6
15:18 lichtkind if i understeand you correctly it was very intentional?
15:18 Zoffix joined #perl6
15:18 lichtkind even mathematically wrong
15:19 Zoffix lichtkind: it's not a bug. There's more than one right answer and many langs do different things
15:19 araraloren Yeah, it not only one answer
15:19 lichtkind it long socks style of math
15:19 lichtkind its
15:20 * Zoffix points to the table on the right on https://en.wikipedia.org/wiki/Modulo_operation#Remainder_calculation_for_the_modulo_operation
15:21 haxmeister I always loved perl5.. it was my first love.. perl6 is a step above all other interpreted languages.. very good work guys
15:22 timotimo lichtkind: i think you mean "longstocking"
15:22 lichtkind we all love perl, except when we dont :)
15:22 lichtkind timotimo you got it
15:23 Zoffix haxmeister: not sure if you got an answer but: you can do it as `say "Surface footage at 12224 RPM = {$mill.calc-sfm :rpm(12224)}";` or `say "Surface footage at 12224 RPM = $mill.calc-sfm(:rpm(12224))"` or `say "Surface footage at 12224 RPM = $mill.calc-sfm(:12224rpm)";`
15:23 Zoffix TIL $o.meth :named(arg) is valid syntax :D
15:23 Zoffix s/:D/:S/;
15:24 timotimo of course it is ;(
15:24 timotimo because we don't want to force commas between colonpair named arguments
15:24 haxmeister yes Zoffix I figured it out shortly after asking.. but I managed it like this: say "Surface footage at 12224 RPM = " ~ ($mill.calc-sfm :rpm(12224));
15:24 Zoffix I always wrote $o.meth: :foo(42)
15:24 timotimo oh, does that actually attach the named argument to the method call?
15:24 Zoffix timotimo: but I meant there's no () or : after the method.
15:25 timotimo i'm afraid you might fall on your nose in some circumstances
15:25 Zoffix m: class Foo { meth (:$bar) { dd $bar } }.meth :42bar
15:25 camelia rakudo-moar 5e6b38: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Variable '$bar' is not declared␤at <tmp>:1␤------> 3class Foo { meth (:7⏏5$bar) { dd $bar } }.meth :42bar␤»
15:25 Zoffix wat
15:25 timotimo "meth" :)
15:25 Zoffix ah
15:25 haxmeister thank you for an answer though, I do have irssi running in screen from a server and I am able to see messages from when I was away
15:25 Zoffix m: class Foo { method meth (:$bar) { dd $bar } }.meth :42bar
15:25 camelia rakudo-moar 5e6b38: OUTPUT: «Int $bar = 42␤»
15:25 Zoffix m: class Foo { method meth (:$bar, :$meow) { dd [ $bar, $meow ] } }.meth :42bar :72meow
15:25 camelia rakudo-moar 5e6b38: OUTPUT: «[42, 72]␤»
15:25 Zoffix meat
15:26 timotimo m: class Foo { method meth (:$bar) { dd $bar } }; say Foo.meth :42bar, Foo.meth :99bar
15:26 camelia rakudo-moar 5e6b38: OUTPUT: «Int $bar = 42␤Int $bar = 99␤Unexpected named argument 'bar' passed␤  in block <unit> at <tmp> line 1␤␤»
15:26 Zoffix *neat
15:26 Zoffix It went into `say`
15:26 timotimo okay that's just a bug
15:26 timotimo no, it went into Foo.meth *and* into `say`
15:26 Zoffix m: class Foo { method meth (:$bar) { dd $bar } }; say Foo.meth: :42bar, Foo.meth: :99bar
15:26 camelia rakudo-moar 5e6b38: OUTPUT: «Int $bar = 99␤Too many positionals passed; expected 1 argument but got 2␤  in method meth at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
15:26 jnthn And in today's edition of "surprising upshots of adverbs being parsed as infixes and then we lie about it"... :)
15:26 Zoffix m: class Foo { method meth (:$bar) { dd $bar } }; say Foo.meth(:42bar), Foo.meth: :99bar
15:26 camelia rakudo-moar 5e6b38: OUTPUT: «Int $bar = 42␤Int $bar = 99␤NilNil␤»
15:26 Zoffix :)
15:29 Zoffix Ulti: what P6 version are you on?
15:31 Ulti Rakudo version 2017.04.3-172-gf2af3db16 built on MoarVM version 2017.04-56-g8ad18b84 so HEAD or close to it
15:32 Zoffix ok; that'll have all the recent IO perf improvements :/
15:32 Ulti :/
15:33 Ulti I mean there will have been a lot of memory pressure given my laptop is complete cack at work for everything I have to do
15:33 Ulti but its still like for like with respect to P5
15:34 Zoffix P6 IO::Path.lines with a for loop is 25x slower than P5 while (readline) on my box...
15:34 * Zoffix tries bare nqp
15:40 Zoffix Basically just 8x slower
15:40 Zoffix For a 5-meg file. `time perl6 -e 'use nqp; my $fh := nqp::open("foo", "r"); nqp::while(($_ := nqp::readlinechompfh($fh)), nqp::null)` vs `time perl -wlE 'open my $fh, "<", "foo"; while (<$fh>) {}'`
15:42 jnthn Zoffix: And if you get Perl 5 to do utf-8 decoding too?
15:43 araraloren perl6 25x slower, nqp 8x slower .
15:44 Zoffix Oh right.
15:45 Zoffix jnthn: then bare-nqp version is 4.4x slower than perl -wlE 'open my $fh, "<:encoding(UTF-8)", "foo"; while (<$fh>) {}'
15:45 Zoffix Pretty good!
15:46 jnthn Some room for improvement still, though. :-)
15:46 Zoffix And perl6-only version is 13x slower
15:47 timotimo that's almost 2x faster than the 25x slower version
15:47 lowbro joined #perl6
15:47 lowbro joined #perl6
15:47 Zoffix timotimo: well yeah, perl5 with unicode decoding is like 2x slower
15:48 timotimo the thing is that even when we do latin1 decoding, we'll generate synthetic graphemes for \n and \r\n (and maybe also \r?)
15:48 Zoffix And actually if you go to IO::Handle.lines directly, it's only 9.25x slower
15:48 timotimo or ... only for \r\n?
15:49 Zoffix Which is weird :S
15:49 Zoffix s: "foo".IO, 'lines', \()
15:49 Zoffix Right. no robot. But IIRC it's just delegates to IO::Handle
15:50 Zoffix Ah. It's IO::Handle.lines vs IO::Handle.lines(:close)
15:50 Zoffix My close-iterator sucks, I guess :|
15:50 araraloren Why Perl6 slower than nqp . The parser ?
15:51 Zoffix araraloren: it does more things
15:51 Zoffix araraloren: you get a proper Seq + phasers + IO::Path + choosing mode etc etdc
15:54 araraloren The gap is bigger than I thought
15:56 itaylor57 joined #perl6
15:57 Zoffix araraloren: there's still a ton of work to be done to make the gap smaller :)
15:58 araraloren Em, thanks all the developer.
15:59 araraloren Perl 6 will be faster and more faster in the future.
16:01 alphah Hi, Is there difference between thiese two definitions for this token:
16:02 alphah token star-core{ '-' <([ 'x86_64' | 'i386' ])> }
16:02 alphah and:
16:02 alphah roto token star-core { * }
16:02 alphah proto token star-core { * }
16:02 alphah token star-core:sym<x86_64>{ '-' <(<sym>)> }
16:02 alphah token star-core:sym<i386>{ '-' <(<sym>)> }
16:03 Zoffix alphah: don't think so. Why?
16:03 alphah any difference of any kind that can make first one match and second one thrwos NQPMu error, when parseed against '-x8_64' ?
16:03 araraloren no, I think
16:03 Zoffix alphah: what's your Perl 6 version?
16:04 alphah Zoffix: This is Rakudo version 2017.04.3-47-gf0414c468 built on MoarVM version 2017.04-44-gf0db8822
16:04 alphah implementing Perl 6.c.
16:04 Zoffix m: grammar { proto token star-core  { * }; token star-core:sym<x86_64> { '-' <(<sym>)> }; token star-core:sym<i386>  { '-' <(<sym>)> } }.parse: :rule<star-core>, '-x8_64'
16:04 camelia rakudo-moar 5e6b38: ( no output )
16:04 Zoffix alphah: what's the NQP error?
16:04 Zoffix m: say grammar { proto token star-core  { * }; token star-core:sym<x86_64> { '-' <(<sym>)> }; token star-core:sym<i386>  { '-' <(<sym>)> } }.parse: :rule<star-core>, '-x8_64'
16:04 camelia rakudo-moar 5e6b38: OUTPUT: «Nil␤»
16:05 alphah No such method 'perl' for invocant of type 'NQPMu'
16:05 alphah in block <unit> at ./bin/galaxy.p6 line 7
16:06 alphah so, without this commit, I get the NQPMu error: https://github.com/alphah77/galaxy/commit/c661fba4fbcefdd0a4614b787ef939801486489b
16:06 Zoffix alphah: you don't have a 2017.03 or earlier rakudos laying around, by any chance. Do you?
16:06 Zoffix As in, does the bug happen there.
16:07 alphah I can install latest version, I think I reinstalled rakudo two weeks ago, here is the output of perl6 --version:
16:07 alphah This is Rakudo version 2017.04.3-47-gf0414c468 built on MoarVM version 2017.04-44-gf0db8822
16:07 araraloren So make a clean install will be solved ?
16:07 ugexe s/<(<sym>)>/<::(<sym>)>/ ?
16:08 alphah I'll do that right now and try,,, I will remove ~/.rakudobrew   and install again,, is that sufficant?
16:08 Zoffix alphah: no, I meant earlier rakudo. There's some work that went in a few days before the 2017.04 release that we later found had a bug with capture markers in grammars and.... you have capture markers in grammars
16:08 timotimo alphah: do you get a better error when you give perl6 --ll-exception?
16:08 timotimo i.e. a traceback from the "no such method .perl" error?
16:09 * perlpilot notices that someone is a fan of <( and )>
16:09 perlpilot I don't think I've seen them used so much  :)
16:09 jnthn I use them now and then
16:09 Zoffix ugexe: isn't that different? <(<sym>)> is <(  <sym>  )>, no?
16:09 jnthn They can save having to use a named capture in various cases
16:09 jnthn Or capture at all
16:10 perlpilot yeah
16:10 Zoffix alphah: with rakudobrew, you could do `rakudobrew build moar 2017.03` `rakudobrew switch moar-2017.03` and then you could still switch back to latest
16:12 * Zoffix fails to repro any perl on NQPMu on 2017.04.2-6-g894ba82
16:13 Zoffix alphah: what was the other commit I saw you make, something about changing .ast method to .Str or something? Was that also to workaround some bug?
16:13 alphah timotimo: I got this error message when used --ll-exception: https://gist.github.com/alphah77/0266d18bbd352ef2ceb50e94bd6e255a
16:14 sena_kun joined #perl6
16:15 cpage_ joined #perl6
16:16 alphah Zoffix: That was the commit: replaced .ast by .Str:  https://gist.github.com/alphah77/0266d18bbd352ef2ceb50e94bd6e255a
16:16 Zoffix alphah: well yeah, why did you replace it?
16:17 araraloren Would you mind share your code ?
16:17 Zoffix alphah: anyway, rakudobrew 2017.03 rakudo. Use `rakudobrew switch` to switch between it and latest. Try your bugs with both. If they aren't present in 2017.03, report them, as that's very likely due to Uncurse Curse
16:17 Zoffix left #perl6
16:18 araraloren I want try it on my notebook .
16:18 alphah I thought that the NQPMu error shows because is trying to access the token before it's made. so I just tried to remove .ast and use .Str,,,, I know not logical but it worked
16:18 araraloren I install Perl 6 from source .
16:19 alphah araraloren: here is the code https://github.com/alphah77/galaxy
16:19 araraloren alphah, thank u
16:20 alphah you will need to run the program as bin/galaxy laws bin/laws rakudostar-0.7-x86_64 to produce the error
16:20 moritz I seem to recall a tool that fat-packages a Perl 6 application into a Windows exe file. Possibly created by jnthn++
16:20 moritz anyone got a link for me?
16:21 jnthn eco: installer
16:21 jnthn aww
16:21 jnthn moritz: App::InstallerMaker::WiX on the ecosystem :)
16:22 moritz jnthn: thanks
16:22 jnthn It doesn't quite do that, but it does make an MSI :)
16:22 MasterDuke_ buggable: eco installer
16:22 buggable MasterDuke_, Found 3 results: App::redpanda, Sparrowdo::Cpm, App::InstallerMaker::WiX. See https://modules.perl6.org/#q=installer
16:22 alphah trying rakudobrew build moar 2017.03 now
16:22 moritz and then samcv++ did some AppImage (iirc?) wizardry... is that usable?
16:23 jnthn I'm tempted to make a perl6-winimal "distro" using it that makes a mega simple installer that includes Perl 6, zef, and the debugger frontend or so :)
16:23 moritz in case you can't tell, I'm trying to write a section for my book on how to deploy Perl 6 applications
16:24 jnthn Ah :-)
16:24 El_Che moritz: you covered docker, I suppose
16:24 jnthn The installers that thing makes are super-minimal, but have been successfully used to deploy a Perl 6 app :-)
16:25 timotimo don't spend too many pages on docker, what if docker completely dies next year? :)
16:25 El_Che timotimo: then you update the book and get $ again :)
16:25 timotimo haha
16:25 jnthn Given how widespread docker has become, not to mention containers in general, that's quite a bold prediction :-)
16:26 El_Che at the rate perl6 advances, docker seems to be the only sane way to deploy perl6
16:26 araraloren alphah, no error, in `This is Rakudo version 2017.04.3 built on MoarVM version 2017.04-44-gf0db882
16:26 araraloren `, installed from rakudo source
16:26 * jnthn today discovered that docker special-cases connecting to a registry on localhost to bypass SSL certificate verification... :S
16:27 araraloren The command what I tried `perl6 -Ilib ./bin/galaxy.p6 laws bin/laws rakudostar-0.7-x86_64`
16:29 alphah araraloren: does the output has value "core => Str|x86_64"  , or core => NQPMu ?
16:29 moritz El_Che: re docker, yes
16:29 araraloren Yeah, it has
16:29 alphah Nice, Im installing this version then
16:30 * moritz wonders if he should mention moby
16:30 araraloren https://gist.github.com/araraloren/5598955a601f3ffed95cde0d7c71cd0f, alphah
16:30 jnthn moritz: yes, when I went source digging today I was like "wait, this isn't the official docker repo" and tried to go to it and was redirected straight back where I came from :P
16:30 alphah looks right.
16:31 El_Che moritz: as a anecdocte: I have a perl6 app in prod that run from a "global" perl6 install that I don't date to touch. The app will not run on recent perl6 versions :). It would be easy to migrate with docker (what I use elsewhere)
16:31 El_Che moritz: becasue I use perl6 packages, the image is created by jenkins in no time
16:33 robertle joined #perl6
16:34 ChoHag joined #perl6
16:34 araraloren I agree! :)
16:51 domidumont joined #perl6
16:54 setty1 joined #perl6
17:00 alphah araraloren: would you mind trying again same command above but after checkout 802112596560c64876ea3bb44bd998ce65c52e1e, the reason is latest commit is working fine
17:05 araraloren https://gist.github.com/araraloren/5598955a601f3ffed95cde0d7c71cd0f
17:05 araraloren alphah, I updated output
17:06 alphah checked it, so it did not work:token did not match: core => NQPMu. and only change in this commit is definig the token as proto token {8}
17:06 alphah s/8/*/
17:06 araraloren I checked too
17:07 araraloren It's also worked
17:07 araraloren fine
17:07 alphah building moar 2017.03 and testing on this version...
17:08 kurahaupo joined #perl6
17:09 alphah araraloren: it did not, compare the output of the two, you will se in first: https://gist.github.com/araraloren/5598955a601f3ffed95cde0d7c71cd0f#file-output-p6-L5
17:09 alphah second: https://gist.github.com/araraloren/5598955a601f3ffed95cde0d7c71cd0f#file-output-p6-L5
17:10 alphah line 6 on both files.
17:13 xtreak joined #perl6
17:16 araraloren Yeah, I see it, alphah :)
17:17 alphah nice :)
17:17 alphah also tried on moar 2017.03, still same issue.
17:18 araraloren Em, What about master branch ?
17:19 alphah any docs to install it? I usually install rakudobrew then rakudobrew does the rest
17:19 araraloren What
17:19 araraloren you mean?
17:19 araraloren Install from source ?
17:20 alphah you mean I should install perl6 from master branch?, or I understood wrong?
17:20 araraloren No, I mean your code
17:20 xiaomiao joined #perl6
17:21 alphah aah, master branch work because i just changed the definition of the token (Which i bileve should be exactly the same); in here https://github.com/alphah77/galaxy/commit/c661fba4fbcefdd0a4614b787ef939801486489b
17:22 araraloren Oh, I got it.
17:23 alphah :)
17:32 Cabanossi joined #perl6
17:36 araraloren alphah, I saw you code, and think you forget write action method
17:36 araraloren It's no bug
17:36 araraloren in rakudo
17:38 alphah araraloren: can you point me where I missed action method? I have class Law as Action class, I also have method for that token
17:39 araraloren It's `star-core`
17:39 araraloren You should write `proto version`
17:39 araraloren not regular version
17:40 alphah I wanna bang my head in the keyboard now : D
17:41 araraloren haha.. :P
17:43 itaipu joined #perl6
17:50 labster joined #perl6
17:54 eater is it possible to call a perl6 script within a certain scope in perl6? a bit like PHP's include / require
17:56 araraloren Have you look at require : https://docs.perl6.org/syntax/require ?
17:57 cdg joined #perl6
17:57 eater how can I include an file with that :o
17:58 araraloren It just import module at runtime.
17:58 araraloren I think it's no mechanism in Perl 6.
17:59 eater yeah, and I want to run a script at runtime
17:59 araraloren Yeah, you can use require run a script, maybe .
17:59 araraloren Just try it.
18:03 Geth ¦ modules.perl6.org: c9bce27d29 | (Zoffix Znet)++ | 2 files
18:03 Geth ¦ modules.perl6.org: [REBUILD] Reject too-large logotypes
18:03 Geth ¦ modules.perl6.org:
18:03 Geth ¦ modules.perl6.org: - We first get byte size from github, reject right there and then
18:03 Geth ¦ modules.perl6.org:     if we have more than 32*32*32*2 bytes in logotype
18:03 Geth ¦ modules.perl6.org: - If that passes, fetch the pic and take a peek at the size of the
18:03 Geth ¦ modules.perl6.org:     image and reject it if it's not 32px x 32px
18:03 Geth ¦ modules.perl6.org: review: https://github.com/perl6/modules.perl6.org/commit/c9bce27d29
18:04 araraloren eater, I test it on a example. It's work.
18:05 araraloren Just think you have a r.p6: use lib "."; require "m.p6"; and m.p6: say "CALL ME";
18:05 araraloren It will print CALL ME .
18:06 chee joined #perl6
18:06 TimToady well, there are four or five different things you can mean by "call a script within a certain scope", and sometimes you want 'run', or 'shell', or 'EVALFILE', or even 'EVAL', depending on how much and what kind of dataflow you need in and out of that scope
18:08 TimToady it might also mean you need to write a role, if you're thinking of "include" as a way to write generic code
18:09 TimToady so I wouldn't get hung up on thinking you have to use a verb called "include" or "require"
18:09 TimToady that would be a bit of an XY problem, if so
18:10 araraloren TimToady, Which way can import symbol I declare in that perl6 file ?
18:10 araraloren require and ?
18:10 TimToady well, require can do that, but I don't see eater asking for that, offhand
18:11 TimToady maybe eater is just looking for qx// or qqx//
18:11 araraloren Em, maybe.
18:11 TimToady "run in a scope" is terribly ambiguous
18:12 araraloren Yeah.
18:12 eater Im sorry :')
18:12 eater in PHP you have include / require
18:12 eater which will just run the given file in that scope
18:13 araraloren Is it like include in c /?
18:13 araraloren Import symbol to current scope ?
18:13 Geth ¦ modules.perl6.org: 40e5cd16fa | (Zoffix Znet)++ | lib/ModulesPerl6/DbBuilder/Dist/Source.pm
18:13 Geth ¦ modules.perl6.org: Return failure from _save_logo when size is no good
18:13 Geth ¦ modules.perl6.org:
18:13 Geth ¦ modules.perl6.org: In case something actually uses that value
18:13 Geth ¦ modules.perl6.org: review: https://github.com/perl6/modules.perl6.org/commit/40e5cd16fa
18:14 eater araraloren: not really, php's include is at runtime while C's is at compile time
18:14 dct joined #perl6
18:15 araraloren Oh, except that ?
18:15 TimToady what are you expecting it to do to the current scope after it has run?
18:16 TimToady and do you mean dynamic scope or lexical scope?
18:16 TimToady or some other scope?
18:17 TimToady what kind of data flows back and forth?
18:17 TimToady or are you expecting it to define something?
18:18 eater dynamic scope
18:19 chee left #perl6
18:20 TimToady another degree of freedom is whether you want it to reparse the file every time you call it
18:21 eater as long as it's parsed everytime I run perl itself I'm happy :>
18:22 TimToady do you really need it reparsed every time, or just if it changes?
18:22 eater ^
18:22 eater ye
18:23 Geth ¦ doc/molecules-patch-1: 3794e8dcea | (Christopher Bottoms)++ (committed using GitHub Web editor) | doc/Type/Callable.pod6
18:23 Geth ¦ doc/molecules-patch-1: Added multi-positional use of assuming
18:23 Geth ¦ doc/molecules-patch-1:
18:23 Geth ¦ doc/molecules-patch-1: Borrowed content from brian d foy's Stack Overflow post http://stackoverflow.com/a/43669837/215487
18:23 Geth ¦ doc/molecules-patch-1: review: https://github.com/perl6/doc/commit/3794e8dcea
18:24 TimToady you do you expect it to relate to your current program?  how does the data flow?  what symbols get defined?
18:24 eater what do you mean with "how does the data flow"?
18:25 TimToady what are you trying to do with the file that is run?
18:26 Geth ¦ doc: molecules++ created pull request #1296: Added multi-positional use of assuming
18:26 Geth ¦ doc: review: https://github.com/perl6/doc/pull/1296
18:26 eater i'm trying to create a program that reads an configuration script that's also in perl6, it defines tasks and those are then executed by the main program
18:28 ChoHag joined #perl6
18:28 TimToady okay, so you want it to build a data structure that you can access after you call it, which means you probably want a symbol to be imported so you can access that data structure
18:28 eater yes
18:28 masak nine: thanks for the tip about the p5ish way. that did not occur to me. I might still use that to make the code less obnoxious.
18:28 TimToady in that case, either 'use' or 'require' can do that
18:29 Geth ¦ modules.perl6.org: 8ce873a75d | (Zoffix Znet)++ | 7 files
18:29 Geth ¦ modules.perl6.org: [REBUILD] De-bitrot Mojolicious stuff
18:29 Geth ¦ modules.perl6.org:
18:29 Geth ¦ modules.perl6.org: - Bump Mojolicious prereq to 7.31 and fix all Mojo::File bitrot
18:29 Geth ¦ modules.perl6.org: - Bump Mojolicious::Plugin::AssetPack to 1.42
18:29 Geth ¦ modules.perl6.org: - Fixes #69
18:29 Geth ¦ modules.perl6.org: review: https://github.com/perl6/modules.perl6.org/commit/8ce873a75d
18:29 espadrine joined #perl6
18:29 TimToady you call it a configuration "script", but do you ever run it by itself?
18:29 TimToady maybe it's just a module
18:30 TimToady in which case plain old "use" should work
18:31 TimToady (maybe with a "use lib '.';" or some such to tell it where to look
18:31 TimToady )
18:31 eater I could make it a module, but I rather make it just an script with everything preset for creating tasks in that case
18:31 eater but if that isn't possible
18:31 eater I can make it a module
18:31 AlexDaniel joined #perl6
18:31 TimToady a module is a kind of script
18:32 Cabanossi joined #perl6
18:32 TimToady I don't understand what you mean when you say "just a script"
18:33 TimToady what are you expecting a script to do that a module can't do?
18:33 kyclark joined #perl6
18:33 eater true
18:33 eater I'm not expecting it to be able to do more
18:34 eater but I would like more control over how it's run
18:34 Geth ¦ doc: 1f7cc4efa0 | (Christopher Bottoms)++ (committed by Zoffix Znet) | doc/Type/Callable.pod6
18:34 Geth ¦ doc: Added multi-positional use of assuming (#1296)
18:34 Geth ¦ doc:
18:34 Geth ¦ doc: Borrowed content from brian d foy's Stack Overflow post http://stackoverflow.com/a/43669837/215487
18:34 Geth ¦ doc: review: https://github.com/perl6/doc/commit/1f7cc4efa0
18:34 eater define import modules and methods before it's run
18:34 eater s/define//
18:34 kyclark Given a hash my %h = :one(1), :two(2), :three(3);, how could I sort first by length of key then by key?  E.g., so I get "one two three"?
18:34 gfldex eater: you can do that with require
18:34 kyclark m: my %h = :one(1), :two(2), :three(3); say %h.keys.sort(*.chars || *.Str)
18:34 camelia rakudo-moar 5e6b38: OUTPUT: «(two one three)␤»
18:35 TimToady if you want to define methods, then it's probably a class
18:35 [Coke] .tell zoffix please check my comment on doc pr # 1296
18:35 TimToady (or a role, if it's supposed to be generic)
18:35 yoleaux [Coke]: I'll pass your message to zoffix.
18:35 Geth ¦ doc: 7e84db63a2 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Callable.pod6
18:35 Geth ¦ doc: Move ref to SO to license
18:35 Geth ¦ doc: review: https://github.com/perl6/doc/commit/7e84db63a2
18:35 TimToady but classes and roles are also just modules/scripts that you pull in with 'use' or 'require'
18:35 gfldex m: my %h = :one(1), :two(2), :three(3); say %h.keys.sort(*.Str).sort(*.chars)
18:35 camelia rakudo-moar 5e6b38: OUTPUT: «(one two three)␤»
18:36 gfldex no wait, that's silly
18:36 TimToady afk for a bit &
18:36 literal joined #perl6
18:36 avar joined #perl6
18:36 avar joined #perl6
18:37 Geth ¦ doc: e8ae3b2521 | (Zoffix Znet)++ (committed using GitHub Web editor) | README.md
18:37 Geth ¦ doc: Move ref to SO to LICENSE section
18:37 Geth ¦ doc: review: https://github.com/perl6/doc/commit/e8ae3b2521
18:37 MasterDuke_ m: my %h = :one(1), :two(2), :three(3); say %h.keys.sort({$^a.chars <=> $^b.chars || $^a cmp $^b})
18:37 camelia rakudo-moar 5e6b38: OUTPUT: «(one two three)␤»
18:38 gfldex m: my %h = :one(1), :two(2), :three(3); say %h.keys.sort({$^a.chars cmp $^b.chars || $^a.Str cmp $^b.Str})
18:38 camelia rakudo-moar 5e6b38: OUTPUT: «(one two three)␤»
18:38 itsame joined #perl6
18:38 [Coke] Zoffix++ # thanks.
18:39 Sound joined #perl6
18:43 timotimo kyclark: you can just return a little list of two results
18:43 timotimo be sure to only take one argument, otherwise it'll make a comparator function out of it
18:43 timotimo i.e. try { $^e.chars, $^e.Str }
18:43 timotimo but not perl6-try, but more like english-try, or "attempt" or something
18:44 araraloren night, o/
18:44 gfldex m: my %h = :one(1), :two(2), :three(3); say %h.keys.sort({$^a.chars, $^a.Str})
18:44 camelia rakudo-moar 5e6b38: OUTPUT: «(one two three)␤»
18:45 kyclark timotimo, that works, but I don't understand why!  What is the $^e?
18:45 timotimo { $^e.foo, $^e.bar } is equivalent to -> $e { $e.foo, $e.bar }
18:45 kyclark Default arg like $^a/$^b?
18:45 timotimo not exactly, but similar
18:45 kyclark Is "e" different from a/b?
18:46 timotimo yes
18:46 timotimo e is e, but a is a and b is b
18:46 timotimo you can use any name you want
18:46 gfldex timotimo: is a list return value for the callable speced (in `sort`)
18:46 gfldex ?
18:46 timotimo $^foo, $^meh, $^a, $^OMG-WTF-BBQ
18:46 kyclark Just don't use a/b?
18:46 timotimo for every different $^foo you put you'll get one entry in the signature for the block that contains the $^foo
18:47 gfldex kyclark: alphabetical order is taken into account for autoarguments
18:47 timotimo the entry will be for $foo instead of $^foo, so if you have an innerer block you can just refer to $foo so it won't make a signature for the innerer block
18:47 timotimo aye, the argument will be sorted in the resulting signature
18:48 gfldex sub f(){ say $^b, $^a }; f(1,2)
18:48 gfldex m: sub f(){ say $^b, $^a }; f(1,2)
18:48 camelia rakudo-moar 5e6b38: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Placeholder variable '$^a' cannot override existing signature␤at <tmp>:1␤------> 3sub7⏏5 f(){ say $^b, $^a }; f(1,2)␤»
18:48 timotimo yeah, don't have () there
18:48 gfldex m: sub f { say $^b, $^a }; f(1,2)
18:48 camelia rakudo-moar 5e6b38: OUTPUT: «21␤»
18:48 gfldex a list as return value for the callable of sort is ENODOC
18:49 * gfldex goes to fill the form
18:49 timotimo gfldex: it's just sorting the resulting lists
18:49 timotimo it's just a schwartzian transform of one element to a little list for each of the elements
18:49 gfldex true but not exactly obvious
18:49 timotimo feel free to point it out in the docs
18:51 Geth ¦ doc: 5dfc1effe3 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/operators.pod6
18:51 Geth ¦ doc: Add ...^ and …^ ops to index
18:51 Geth ¦ doc:
18:51 Geth ¦ doc: Fixes #1292
18:51 Geth ¦ doc: review: https://github.com/perl6/doc/commit/5dfc1effe3
18:52 chee joined #perl6
18:59 Sound_ joined #perl6
19:02 Cabanossi joined #perl6
19:03 itsame joined #perl6
19:04 andrzejku joined #perl6
19:07 eater okay
19:07 eater apperently I was looking for EVALFILE
19:10 zakharyas joined #perl6
19:10 Geth ¦ doc: 6e1482811b | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Any.pod6
19:10 Geth ¦ doc: Remove needless prose in .flat
19:10 Geth ¦ doc:
19:10 Geth ¦ doc: - Flat returns a Seq with an iterator fed by original stuff, so it solving any
19:10 Geth ¦ doc:     halting problems is irrelevant.
19:10 Geth ¦ doc: - Flat used to have a bug where it was failing to propagate .is-lazy in certain
19:10 Geth ¦ doc:    cases, causing full reification, which might be what the original author hit
19:10 Geth ¦ doc:    upon, to surmise there are any issues with flattening infinite things.
19:10 Geth ¦ doc: - Fixes #1202
19:10 Geth ¦ doc: review: https://github.com/perl6/doc/commit/6e1482811b
19:11 lichtkind joined #perl6
19:17 timotimo eater: please be aware that when you EVALFILE something the lexical variables you have in those files will not be available outside of the EVALFILE
19:19 eater timotimo: sure, thanks :)
19:20 masak moritz: by the way, the blog post about "infix:<< > >> should be outlawed" (featured in this week's Perl Weekly) felt to me like a good example of "I can't think of a use case for this feature, so let's ban it"
19:21 nowan joined #perl6
19:22 moritz masak: indeed
19:22 moritz masak: my main thought on the topic is that comparisons often include on relatively fixed, known quantity
19:23 moritz masak: and the other one that's being compared
19:23 timotimo so never use > again, always use !< ?
19:23 moritz masak: and I like to put the lesser-known quantity on the LHS
19:23 moritz if $attempts > $threshold { die "nope, not workin'"; }
19:24 moritz timotimo: the author argued that you should use $b < $a instead of $a > $b
19:24 timotimo huh
19:24 timotimo we can outlaw > and force people to use R< for that :P
19:25 moritz timotimo: http://llewellynfalco.blogspot.de/2016/02/dont-use-greater-than-sign-in.html
19:25 moritz timotimo: re R< sure :-)
19:25 itaipu joined #perl6
19:26 moritz though of course in his example, we'd just write 5 < x < 10 :-)
19:26 moritz or 10 > x > 5, neither of which is confusing, IMHO
19:26 moritz or even x ~~ 5^..^10
19:27 gfldex "The way things work in Llewellyn's world" this title clearly states the intend of the author
19:30 gfldex this is brilliant too: http://llewellynfalco.blogspot.de/2017/01/the-perfect-api-design.html
19:30 timotimo both $low < $x < $high and $x ~~ $low..$high are helpful for this
19:30 Geth ¦ doc: ef19149a8b | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Type/Any.pod6
19:30 Geth ¦ doc: Improve C<flat> docs
19:30 Geth ¦ doc:
19:30 Geth ¦ doc: - use more detailed examples that show actual flattening
19:30 Geth ¦ doc: - include that Maps get flattened too, since they're Iterable
19:30 Geth ¦ doc: - Get rid of broken and convoluted `deepmap` example; it destroys Maps and Pairs
19:30 Geth ¦ doc: review: https://github.com/perl6/doc/commit/ef19149a8b
19:30 gfldex you don't even need to read the post, the first two lines give if away
19:30 mcmillhj joined #perl6
19:31 timotimo what constitutes a line on your end?
19:32 Cabanossi joined #perl6
19:32 gfldex err sentence (I got 3 hours sleep last night)
19:32 timotimo ah
19:36 kyclark joined #perl6
19:37 cyphase joined #perl6
19:57 Sound joined #perl6
20:00 matiaslina joined #perl6
20:01 dct joined #perl6
20:15 Praise joined #perl6
20:15 Praise joined #perl6
20:15 raschipi joined #perl6
20:16 itsame joined #perl6
20:18 mcsnolte joined #perl6
20:23 AlexDani` joined #perl6
20:23 mcmillhj joined #perl6
20:27 Sound_ joined #perl6
20:32 Cabanossi joined #perl6
20:42 itsame joined #perl6
20:45 mcmillhj joined #perl6
20:52 yqt joined #perl6
20:58 seano joined #perl6
20:58 mcmillhj joined #perl6
21:09 mcmillhj joined #perl6
21:10 TEttinger joined #perl6
21:14 labster joined #perl6
21:19 silug joined #perl6
21:23 Zoffix joined #perl6
21:24 Zoffix hoelzro: Sent you a PR fixing IO::String for latest Rakudo's: https://github.com/hoelzro/p6-io-string/pull/7
21:24 hoelzro just saw it - thanks! will look in depth after work
21:25 Zoffix ^ that's used by our doc site's `make xtest`, so if anyone were having trouble with it, you can run `zef --force install https://github.com/zoffixznet/p6-io-string/archive/fix-say.zip` in the meantime
21:26 Zoffix left #perl6
21:26 hoelzro ok
21:30 mcmillhj joined #perl6
21:32 labster joined #perl6
21:32 Cabanossi joined #perl6
21:40 mcmillhj joined #perl6
21:44 silug joined #perl6
21:49 eivindgl joined #perl6
21:51 grumble joined #perl6
21:58 Geth ¦ doc: 5b1627785e | (Zoffix Znet)++ | 8 files
21:58 Geth ¦ doc: Fix xtest
21:58 Geth ¦ doc: review: https://github.com/perl6/doc/commit/5b1627785e
21:58 mcmillhj joined #perl6
22:00 dct joined #perl6
22:01 Cabanossi joined #perl6
22:12 mcmillhj joined #perl6
22:26 Bucciarati joined #perl6
22:26 skids joined #perl6
22:28 bjz joined #perl6
22:32 mcmillhj joined #perl6
22:46 mcmillhj joined #perl6
22:57 itsame joined #perl6
23:01 Cabanossi joined #perl6
23:02 mcmillhj joined #perl6
23:08 BenGoldberg joined #perl6
23:15 mcmillhj joined #perl6
23:19 Geth ¦ doc: 8da79bb26e | (Zoffix Znet)++ | doc/Language/pragmas.pod6
23:19 Geth ¦ doc: Document `fatal` pragma
23:19 Geth ¦ doc:
23:19 Geth ¦ doc: Fixes #1275
23:19 Geth ¦ doc: review: https://github.com/perl6/doc/commit/8da79bb26e
23:26 mcmillhj joined #perl6
23:42 mcmillhj joined #perl6
23:55 SCHAPiE joined #perl6
23:57 mcmillhj joined #perl6
23:58 Geth ¦ doc: 3ba0c02390 | (Samantha McVey)++ | lib/Pod/Htmlify.pm6
23:58 Geth ¦ doc: Append .html to pages ending in a dot
23:58 Geth ¦ doc:
23:58 Geth ¦ doc: You are not supposed to end URL's with a dot
23:58 Geth ¦ doc: review: https://github.com/perl6/doc/commit/3ba0c02390

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

Perl 6 | Reference Documentation | Rakudo