Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2017-11-22

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:07 llfourn joined #perl6
00:11 mcmillhj joined #perl6
00:17 El_Che New 2017.11 Linux packages: https://github.com/nxadm/rakudo-pkg/releases/tag/v2017.11
00:20 TEttinger joined #perl6
00:26 Cabanossi joined #perl6
00:32 callyalater left #perl6
00:39 mcmillhj joined #perl6
00:49 pilne joined #perl6
00:49 AlexDaniel El_Che++
00:59 mcmillhj joined #perl6
01:02 cdg joined #perl6
01:11 aborazmeh joined #perl6
01:11 aborazmeh joined #perl6
01:14 mcmillhj joined #perl6
01:32 mcmillhj joined #perl6
01:47 ivans joined #perl6
01:49 mcmillhj joined #perl6
01:52 lucs My mistake, or how do I find out what is wrong?: https://gist.github.com/lucs/43aa5fa13f6866378e8c154a7b45d811
01:55 comborico1611 Quiet night.
01:56 APic *shrug*
02:02 geekosaur weird. I think it dereferenced and flattened it into the p5 arglist
02:04 lookatme joined #perl6
02:05 mcmillhj joined #perl6
02:24 mcmillhj joined #perl6
02:33 comborico1611 Goodnight!
02:43 mcmillhj joined #perl6
02:55 ilbot3 joined #perl6
02:55 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:56 mcmillhj joined #perl6
03:04 cdg joined #perl6
03:05 noganex joined #perl6
03:12 ufobat_ joined #perl6
03:13 mcmillhj joined #perl6
03:25 mcmillhj joined #perl6
03:27 Geth ¦ mu: c6673ce250 | (Zoffix Znet)++ (committed using GitHub Web editor) | misc/perl6advent-2017/schedule
03:27 Geth ¦ mu: Add/rearrange articles
03:27 Geth ¦ mu:
03:27 Geth ¦ mu: - Postpone drummer article 'til next year (ain't got time to record the needed videos)
03:27 Geth ¦ mu: - Add "Perl 6: Sigils, Variables, and Containers" article
03:27 Geth ¦ mu: - Add "Perl 6: Iterate All The Things!" (an article expounding Perl 6's Iterable types)
03:27 Geth ¦ mu: - Add "Extending Perl 6's Exception Reporting"
03:27 Geth ¦ mu: - Add "GitHub to Twitter Notifier in Perl 6"
03:27 Geth ¦ mu: - Rearrange ZofArticles to start filling holes from the *end* of the calendar, to let potential
03:27 Geth ¦ mu:    latecomer authors jump in if they want.
03:27 Geth ¦ mu: review: https://github.com/perl6/mu/commit/c6673ce250
03:39 mcmillhj joined #perl6
03:50 mcmillhj joined #perl6
03:53 Geth ¦ doc: 90f7097b4c | (Jeremy Studer)++ | 18 files
03:53 Geth ¦ doc: Replace "dd" in examples
03:53 Geth ¦ doc:
03:53 Geth ¦ doc: Replacing instances of Rakudo-specific "dd" operator with standard
03:53 Geth ¦ doc: Perl 6.
03:53 Geth ¦ doc:
03:53 Geth ¦ doc: SEE ALSO:
03:53 Geth ¦ doc: [Issue #1680](https://github.com/perl6/doc/issues/1680)
03:53 Geth ¦ doc: review: https://github.com/perl6/doc/commit/90f7097b4c
03:53 Geth ¦ doc: c71c154d74 | (Jeremy Studer)++ | doc/Language/variables.pod6
03:53 synopsebot Link: https://doc.perl6.org/language/variables
03:53 Geth ¦ doc: Modify example to show explicit cloning vs binding
03:53 Geth ¦ doc:
03:53 Geth ¦ doc: Example previously mentions the pitfalls of implicit binding when
03:54 Geth ¦ doc: creating a Pair and suggests cloning. Now shows cloning explicitly.
03:54 Geth ¦ doc: review: https://github.com/perl6/doc/commit/c71c154d74
03:54 Geth ¦ doc: a0ee6719c1 | (Jeremy Studer)++ | xt/examples-compilation.t
03:54 Geth ¦ doc: Fix false positive on dd test due to "yyyy-mm-dd"
03:54 Geth ¦ doc:
03:54 Geth ¦ doc: The "yyyy-mm-dd" method on Dateish role was causing false positives in
03:54 Geth ¦ doc: "dd" test.
03:54 Geth ¦ doc: review: https://github.com/perl6/doc/commit/a0ee6719c1
04:02 john51 joined #perl6
04:07 mcmillhj joined #perl6
04:10 R0b0t1_ joined #perl6
04:15 ZzZombo joined #perl6
04:20 Geth ¦ doc: ad276ed7d5 | (Jeremy Studer)++ | xt/examples-compilation.t
04:20 Geth ¦ doc: Rearrange "dd" regex; Reads better.
04:20 Geth ¦ doc:
04:20 Geth ¦ doc: Moved negative lookbehind before boundary. Reads better.
04:20 Geth ¦ doc: review: https://github.com/perl6/doc/commit/ad276ed7d5
04:26 Cabanossi joined #perl6
04:27 aborazmeh joined #perl6
04:27 aborazmeh joined #perl6
04:31 wamba joined #perl6
04:38 mson joined #perl6
04:48 mcmillhj joined #perl6
05:03 mcmillhj joined #perl6
05:11 aborazmeh joined #perl6
05:11 aborazmeh joined #perl6
05:15 mcmillhj joined #perl6
05:26 mcmillhj joined #perl6
05:41 Cabanossi joined #perl6
05:45 mcmillhj joined #perl6
05:54 raiph joined #perl6
06:06 kaare__ joined #perl6
06:11 cdg joined #perl6
06:18 R0b0t1_ joined #perl6
06:21 mcmillhj joined #perl6
06:28 R0b0t1_ joined #perl6
06:30 wamba joined #perl6
06:32 kaare__ joined #perl6
06:40 mcmillhj joined #perl6
06:41 Cabanossi joined #perl6
06:54 mcmillhj joined #perl6
07:02 AlexDaniel joined #perl6
07:05 domidumont joined #perl6
07:07 darutoko joined #perl6
07:10 mcmillhj joined #perl6
07:11 wamba joined #perl6
07:11 domidumont joined #perl6
07:24 mcmillhj joined #perl6
07:25 R0b0t1` joined #perl6
07:33 rindolf joined #perl6
07:36 Brumbazz joined #perl6
07:40 mcmillhj joined #perl6
07:43 robertle joined #perl6
07:45 lowbro joined #perl6
07:45 lowbro joined #perl6
07:46 Actualeyes joined #perl6
07:54 abraxxa joined #perl6
07:55 mcmillhj joined #perl6
08:03 zakharyas joined #perl6
08:12 wamba joined #perl6
08:13 |oLa| joined #perl6
08:20 sena_kun joined #perl6
08:21 mcmillhj joined #perl6
08:31 kaare__ joined #perl6
08:32 kaare__ joined #perl6
08:34 mcmillhj joined #perl6
08:41 Cabanossi joined #perl6
08:49 konsolebox joined #perl6
08:51 mcmillhj joined #perl6
08:56 zakharyas joined #perl6
09:01 parv joined #perl6
09:08 jeek joined #perl6
09:10 mcmillhj joined #perl6
09:14 zakharyas joined #perl6
09:14 cdg joined #perl6
09:16 cdg_ joined #perl6
09:16 zakharyas joined #perl6
09:20 cdg joined #perl6
09:21 parv joined #perl6
09:23 zakharyas joined #perl6
09:24 mcmillhj joined #perl6
09:29 zakharyas joined #perl6
09:29 zakharyas joined #perl6
09:37 mcmillhj joined #perl6
09:37 dakkar joined #perl6
10:00 sftp joined #perl6
10:01 geospeck joined #perl6
10:02 tyil m: my $a = "test@domain.org"; my @a = ($a, $a); dd @a;
10:02 camelia rakudo-moar 0a24efc32: OUTPUT: «Array @a = ["test\@domain.org", "test\@domain.org"]␤»
10:02 tyil why does it insert these backslashes here?
10:02 wamba joined #perl6
10:04 thunktone joined #perl6
10:06 cdg joined #perl6
10:11 zakharyas joined #perl6
10:13 tyil it seems to write the email correctly to the file (without the backslash), but the test on it fails and shows it has a backslash
10:14 parv perhaps a function of dd?
10:14 tyil it seems so, but I'm not using dd in my test
10:15 tyil and my test shows it with the \, which of course fails the test
10:19 mcmillhj joined #perl6
10:19 jnthn .perl would also do that, I guess
10:23 tyil can I stop it from doing that?
10:25 jnthn Are you actually calling .perl in your test?
10:25 jnthn If so, call .perl on the thing you're testing it against?
10:25 tyil not yet
10:25 tyil but I can add a .perl
10:26 jnthn Ah
10:26 jnthn Then I'm suspecting it's only showing the \ as part of the error reporting
10:26 jnthn Rather than it being there in the data
10:26 jnthn Or at least, it's worth checking if that's what is going on :)
10:28 jast I found a moarvm issue the other day on armv7l and I'm going to report the bug the next time I actually manage to get home before night, but just in case I wanted to try and figure it out myself, any smart ideas on what docs I could read to get an overview of the 6model under-the-hood stuff without going through all of the code?
10:28 jnthn jast: What kind of issue was it?
10:28 jast a SIGBUS due to alignment issues
10:29 jast possibly a compiler problem, too, I haven't tried too many yet
10:29 jast just one so far. lack of time and all that...
10:30 jnthn Ah. I can probably give more hints with a stacktrace
10:30 jnthn Does it get so far as building Rakudo, or does it explode well before that?
10:31 jast the build all succeeds
10:31 jast anyway, I've already traced it, it fails in P6num's set_num
10:31 jast the default case of the switch block, as I recall, but I'd better check again
10:32 jast for getting more info on where the data is actually coming from I'll probably need to collect more than just the stacktrace
10:32 jnthn Do you observe the failure in a nativecall test?
10:32 jast doesn't help that I'm not exactly literate in ARM-style instruction sets
10:33 jast no, it's when I launch perl6.moarvm
10:33 jnthn Ah
10:33 jnthn Then maybe take a look in P6opaque.c which does the layout of objects
10:33 jnthn It may be doing insufficient alignment ahead of a P6num
10:34 jnthn But iirc that's a data-driven process, based on alignment configuration which may be in P6num.c
10:34 jast well, the SIGBUS happens in a 'bx' instruction, that would be code-driven, right?
10:35 jnthn I meant that the calculation of object layout and alignment may be
10:35 jast ah looky here, I kept a copy of the output... https://gist.github.com/jast/df9ba1a023222fb0b942b97ad1dfce45
10:35 jast in another run I checked the register contents and lr was, indeed, not aligned
10:35 jast but I know nothing about the registers and all that, so that didn't tell me a lot :)
10:37 jast I suppose this is an opportunity to start learning more about ARM
10:38 jnthn p &(((MVMP6numBody *)data)->value) may be interesting
10:38 jnthn (To see what the lower bits of the address are, which may hint an the alignment issue)
10:41 Cabanossi joined #perl6
10:42 jast $2 = (union {...} *) 0xb413266a
10:45 jast so I guess it wants 64 bit values aligned at 64 bits, which this isn't
10:53 araraloren joined #perl6
11:16 kaare__ joined #perl6
11:16 xinming_ joined #perl6
11:17 sena_kun joined #perl6
11:18 jnthn jast: Yeah, looks like. Though oddly it already should be accounting for the platform's alignment desires: https://github.com/MoarVM/MoarVM/blob/master/src/6model/reprs/P6num.c#L12
11:22 wamba joined #perl6
11:37 markong joined #perl6
12:05 ZzZombo #perl6, I'm still struggling to make attribute binding to work, what I need is to make an attribute bound to value in the setter. Can somebody show a quick example?
12:07 eliasr joined #perl6
12:08 timotimo maybe you need to set the incoming parameter "is raw" so that it doesn't recontainerize what you're passing into a read-only container?
12:08 timotimo what is your setup? are you using a proxy?
12:09 ZzZombo yes, it is result of `Str.substr-rw`
12:09 timotimo ok, try an "is raw" on the argument to the STORE block in the proxy
12:11 ZzZombo m: class C { has Str $.s;multi method s is raw{return-rw $!s};multi method s(Str:D \s) is raw{$!s:=s};submethod TWEAK(:$s){ self.s($s)} };my $a=C.new(:s<a>);my $s='aaaaaaaaaa';$a.s($s.substr-rw(2,3));$a.s('asd');say ($a,$s)
12:11 camelia rakudo-moar 0a24efc32: OUTPUT: «5===SORRY!5===␤Trait 'is raw' needs whitespace before block␤at <tmp>:1␤------> 3$.s;multi method s is raw{return-rw $!s}7⏏5;multi method s(Str:D \s) is raw{$!s:=s}␤Missing block (apparently claimed by 'is raw')␤at <tmp>:1␤------>…»
12:11 ZzZombo m: class C { has Str $.s;multi method s is raw {return-rw $!s};multi method s(Str:D \s) is raw {$!s:=s};submethod TWEAK(:$s){ self.s($s)} };my $a=C.new(:s<a>);my $s='aaaaaaaaaa';$a.s($s.substr-rw(2,3));$a.s('asd');say ($a,$s)
12:11 camelia rakudo-moar 0a24efc32: OUTPUT: «(C.new(s => "asd") aaaaaaaaaa)␤»
12:12 timotimo ah, you're already using a sigilless parameter, that's equivalent to "is raw"
12:13 timotimo oh, it looks like it worked what you wanted there?
12:13 timotimo like, what's your goal here?
12:13 ZzZombo no? the original string didn't change. I want to be able to change the provided part of a string from my objects.
12:14 timotimo then what you want is assignment, not binding
12:15 timotimo you're binding "asd" into $!s, at which point the result from substr-rw is replaced with "asd"
12:15 timotimo you need two different methods here, one to bind so you can get the substr-rw result in, and one to assign so you can assign into the substr-rw result
12:20 kaare__ joined #perl6
12:21 cdg joined #perl6
12:23 tyil how can I check if a variable contains an object that does Iterable?
12:23 timotimo smart match against Iterable
12:23 tyil thanks :>
12:24 timotimo np
12:40 itaipu joined #perl6
12:43 buggable New CPAN upload: Config-1.3.0.tar.gz by TYIL https://cpan.metacpan.org/authors/id/T/TY/TYIL/Perl6/Config-1.3.0.tar.gz
12:48 Grrrr joined #perl6
12:48 kaare__ joined #perl6
12:54 abraxxa joined #perl6
12:57 Brumbazz joined #perl6
12:58 rindolf joined #perl6
12:59 kaare__ joined #perl6
13:17 mcmillhj joined #perl6
13:20 markmont joined #perl6
13:33 mcmillhj joined #perl6
13:35 ExtraCrispy joined #perl6
13:42 mcmillhj joined #perl6
13:44 zakharyas joined #perl6
13:55 Zoffix joined #perl6
13:55 Zoffix m: &say.wrap: sub (|c) { unless $*x { my $*x = 1; samewith 42; }; nextsame }; say 2
13:55 camelia rakudo-moar 0a24efc32: OUTPUT: «2␤»
13:55 Zoffix m: &say.wrap: sub (|c) { unless $*x { my $*x = 1; say 42; }; nextsame }; say 2
13:55 camelia rakudo-moar 0a24efc32: OUTPUT: «42␤2␤»
13:55 Zoffix Why does using `samewith` instead of the routine name directly give different results?
13:56 Cabanossi joined #perl6
13:56 moritz is "because wrapping is evil" a satisfactory answer?
13:56 moritz probably not...
13:56 Zoffix No, it isn't.
13:58 Zoffix It's probably because it's same-ing using the wrapper sub instead of reaching out to the wrappee
13:58 Zoffix m: &say.wrap: sub (|c) { unless $*x { my $*x = 1; samewith 42; }; dd nextcallee }; say 2
13:58 camelia rakudo-moar 0a24efc32: OUTPUT: «Sub say = sub say (| is raw) { #`(Sub|55633040) ... }␤Nil␤»
13:58 Zoffix m: &say.wrap: sub (|c) { unless $*x { my $*x = 1; say 42; }; dd nextcallee }; say 2
13:58 camelia rakudo-moar 0a24efc32: OUTPUT: «Sub say = sub say (| is raw) { #`(Sub|58302032) ... }␤Sub say = sub say (| is raw) { #`(Sub|58302032) ... }␤»
14:00 Zoffix m: multi z (|) {}; &say.wrap: multi z($) { unless $*x { my $*x = 1; samewith 42; }; dd nextcallee }; say 2
14:00 camelia rakudo-moar 0a24efc32: OUTPUT: «Sub z = sub z (| is raw) { #`(Sub|63117312) ... }␤Sub say = sub say (| is raw) { #`(Sub|63127496) ... }␤»
14:01 Zoffix Yeah. OK. Good enough for me. Thanks.
14:01 Zoffix left #perl6
14:05 wamba joined #perl6
14:10 perlpilot joined #perl6
14:15 lucs How do I get Inline::Perl5 to use my just installed more recent version of Perl 5?
14:17 lucs (the more recent version is the one found in the path where I am using Inline, but it sees my previously installed perl5)
14:20 comborico1611 joined #perl6
14:20 lucs (uninstalling and reinstalling Inline changed nothing)
14:26 timotimo lucs: i'd say inline::perl5 compiling a helper .so during its installation could have something to do with which perl5 actually gets used
14:28 lucs Makes sense, trying to delete relevant stuff (but not sure exactly what) to reattempt build.
14:29 timotimo i'd zef install --force Inline::Perl5, that ought to do it
14:29 ilmari lucs: presumably it builds against whichever perl is first in your path
14:29 lucs timotimo: Tried that, no luck.
14:30 lucs Oops, meeting
14:30 lucs TTYL
14:30 ilmari 'zef uninstall Inline::Perl5' first?
14:30 lucs ilmari: Yep, did that
14:32 El_Che rm -rf ~/.perl6 should fix it, but you'll loose other home installed modules
14:33 * DrForr waves to lucs.
14:36 sftp joined #perl6
14:41 Cabanossi joined #perl6
14:42 Zoffix joined #perl6
14:44 Zoffix Along with `samewith` weirdness, there's also this thing, where you have to pass `self` to nextwith/callwith:
14:44 Zoffix m: $*OUT.WHAT.^lookup('print').wrap: my method (|) { nextwith 42 }; say 42
14:44 camelia rakudo-moar 0a24efc32: OUTPUT: «Type check failed in binding to parameter '<anon>'; expected IO::Handle but got Int (42)␤  in method <anon> at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
14:44 Zoffix Despite `nextsame` knowing what to do... Was this really the design of how this thing was meant to work?
14:45 Zoffix Feels like the wrapper is in want of having its dispatcher tweaked or something
14:46 ugexe zef nuke StoreDir, or zef look Inline::Perl5 && make clean && zef install .
14:47 Zoffix tyil: didn't see anyone mention: the backslashes in `"test\@domain.org"` come from `.perl`. It escapes the `@` because depending on what follows, it could be interpreted as an interpolated Array. Even though in this particular case it wouldn't by escaping all the `@` it doesn't need to know what follows it.
14:48 tyil I saw it before in Config::TOML too, and back then I believed it to be a bug in their lib, but couldnt figure out why
14:48 lucs Hiya DrForr :)
14:49 tyil jnthn: also said it was probably the .perl part
14:49 tyil which seems to also be used in Config::TOML, so now I can try to fix another issue as well
14:49 tyil and the test I had my problem with earlier today now works as well :>
14:49 tyil so everything is fine again
14:49 lucs Okay, getting rid of ~/.perl6
14:50 tyil if I can fix the Config::TOML bug I can resolve another small bug in cpan6, and then continue on writing more tests
14:50 tyil but that'll have to wait until I get home
14:58 * Zoffix retracts attempts to mess with dispatcher
14:58 Zoffix It actually makes sense as is, if you… .wrap… your mind around it ^_^
14:58 Zoffix left #perl6
14:59 wamba joined #perl6
15:05 mson joined #perl6
15:17 llfourn_ joined #perl6
15:20 * [Coke] ~~ to Zoffix
15:38 Actualeyes joined #perl6
15:40 Aaronepower joined #perl6
15:52 kaare__ joined #perl6
15:55 ivans joined #perl6
15:56 Cabanossi joined #perl6
15:56 pmurias joined #perl6
16:08 ugexe lucs: zef look Inline::Perl5 && make clean && zef install .
16:11 El_Che ugexe: it looks like zef could use a clean-install command :)
16:13 ugexe perhaps, or alternatively makefiles could run a make clean step first since they will be more familiar with their build system
16:13 ugexe im open to suggestions though
16:14 perlpilot zef caches module downloads?
16:14 ugexe yes
16:15 perlpilot Hmm.  if this were only cpan, I'd say only cache the tarballs and unpack them each time.
16:16 committable6 joined #perl6
16:16 El_Che why the caching actually?
16:16 ugexe yeah managing a transparent handling of directory based repo vs archive based repo is not fun
16:16 El_Che I can imagine
16:17 perlpilot ugexe: you could make tarballs out of the repos  :)
16:17 ugexe a couple of reasons. one is because a name/auth/ver/api combo is meant to represent that dist no matter what so caching, in theory, should be perfectly fine
16:18 ugexe another was so there was a work directory to see what actually happened in a build
16:18 cdg joined #perl6
16:19 ugexe and finally because it is faster (maybe not compared to tarballs, but to git cloning yeah)
16:19 ugexe well, it should be faster than tarballs but I mean its probably not fast enough to make much difference
16:26 pmurias what is more correct 'Return 1 if ..., 0 otherwise' or 'Return 1 if ..., otherwise 0'
16:28 moritz return ... ?? 1 !! 0
16:28 perlpilot I don't know about "correct", but I like the second one
16:28 moritz oh, this is about language, not code
16:28 moritz sorry
16:28 perlpilot moritz: yeah, it's hard to tell these days sometimes  :)
16:29 * ilmari prefers the second form too
16:29 ugexe perlpilot: then i have to do cross-os adapters for creating tar archives, not just reading them
16:30 perlpilot yeah, that would suck.
16:31 perlpilot Better would be to give a --no-cache option or something
16:32 perlpilot --refetch?
16:32 ugexe you can disable the cache with --/cache
16:33 ugexe --refetch would not help because the distribution is still the same
16:34 ugexe er --/cached
16:35 ugexe but this also means it can be disabled in config.json
16:39 El_Che ugexe: I am curious where did you get the --/ syntax
16:39 El_Che little weird
16:39 ugexe its built in to perl6
16:39 El_Che ok, now I am curious where perl6 got it :)
16:41 Cabanossi joined #perl6
16:42 jferrero joined #perl6
16:43 moritz you could ask [particle]1
16:44 ugexe not sure, but whats the alternative? if you prefix with `no-` or some such then your MAIN signature no longer works like most other subs because you cant have a `no-whatever` param in the signature
16:45 moritz ugexe: no, the preprocessor could do that for you
16:45 ugexe and if you have two flags (true and false) that means you could also set them both which would conflict
16:46 moritz that's the same with --/foo and --no-foo
16:46 El_Che before lizmat fixed MAIN params where pretty useless
16:46 El_Che ag options before commands stuff.
16:46 ugexe --no-foo is a different name, it would (should) show up twice
16:46 moritz there's a step that translates @*ARGS into a capture. It could turn --no-foo into :foo(False)
16:46 ugexe --foo and --/foo would not
16:47 ugexe well yeah, but now your MAIN signature handles named items significantly different than other subs
16:47 El_Che I have no associaciation in my head with / as a negation
16:47 moritz ugexe: it's not MAIN that does it
16:47 El_Che hence the question
16:49 ugexe when i program a MAIN sub i'm not thinking about the preprocessor, and hence not thinking if I can add a :no-whatever option or not
16:49 ugexe if I already have a :whatever, then I cannot add a :no-whatever
16:50 moritz but, how often do you want to add both a :whatever and a :no-whatever option?
16:50 moritz this sounds like a very theoretical option to me
16:50 moritz s/option/problem/
16:50 perlpilot You have: no tea.
16:50 moritz Getopt::Long in Perl 5 does it
16:51 moritz argparse in python does it too (but without the dash)
16:51 ugexe and yet people love perl6's MAIN handling and i never hear praise about either of those
16:52 ilmari ugexe: if you have a Bool :whatever you can do --/whatever to disable it
16:52 moritz ugexe: but it's not because of the weird negation thing that people love Perl 6's MAIN handling
16:53 El_Che should you just give default values (false) and add 1 bool to disabled if needed?
16:53 El_Che that's what's most CLI's use
16:53 ugexe ilmari: right
16:53 El_Che so you'll end up with no --cache option, but a --no-cache is cache is the default
16:54 ugexe and what if the user chooses the defaults?
16:54 El_Che if cache is the defaut
16:54 El_Che ugexe: he'll use a wrapper?
16:54 ugexe in zef you can set any of the plugins to any command you want
16:54 ugexe flag rather
16:54 moritz well, i'd proppose --cache calls MAIN(:cache), and --no-cache calls MAIN(:!cache)
16:55 moritz and MAIN can do a $cache // $users-default
16:55 moritz and MAIN would be declared as sub MAIN(Bool :$cache) { }
16:58 sftp joined #perl6
17:11 Cabanossi joined #perl6
17:11 ugexe still must deal with short name, -c -/c
17:12 ugexe well not must, but its a thing
17:18 mson joined #perl6
17:20 ugexe but as for it being a theoretical option, i'd point you to https://github.com/ugexe/zef/issues/147
17:20 ugexe which is about the rakudo bin installation wrapper adding a named option that it handles
17:24 ugexe well, not quite the same. it does expose issues about what naming you can use in MAIN though
17:26 cpage_ joined #perl6
17:31 comborico1611 joined #perl6
17:31 ryn1x_ joined #perl6
17:32 raschipi joined #perl6
17:32 domidumont joined #perl6
17:35 ryn1x_ How can I make the values of a hash bindings to a variable when creating it? I can do   %a<1> := $a    after the hash is created, but is there a way to use the    my %a = 1 => ???, 2=> ???    syntax?
17:36 ugexe m: sub MAIN(:f(:$foo)) { say << $foo = $foo.Bool() >> }; @*ARGS=<--/foo=bar>; $ = &MAIN; # also this :o
17:36 camelia rakudo-moar 0a24efc32: OUTPUT: «(bar = False)␤»
17:37 raschipi m: my %a := {1 => '???', 2=> '???'}; say %a
17:37 camelia rakudo-moar 0a24efc32: OUTPUT: «{1 => ???, 2 => ???}␤»
17:45 Zoffix joined #perl6
17:45 Zoffix ryn1x: no, but you could alias the hash to $_ and save on variable typing, so at least length-wise the code is comparatively the same
17:46 Zoffix m: my $a = 111; my $b = 222; with my %a {.<1> := $a; .<2> := $b }; $a = 33; $b = 44; say %a
17:46 camelia rakudo-moar 0a24efc32: OUTPUT: «{1 => 33, 2 => 44}␤»
17:50 wamba joined #perl6
17:50 ryn1x_ Zoffix: Your solution works perfectly. Thanks!
17:51 Zoffix m: my $a = 111; my $b = 222; sub circumfix:<raw{ }> (@_ is raw) { my %h; for @_ -> (:key($k), :value($v) is raw)  { %h{$k} := $v }; %h }; my %a := raw{ 1 => $a, 2 => $b }; $a = 33; $b = 44; say %a
17:51 camelia rakudo-moar 0a24efc32: OUTPUT: «{1 => 33, 2 => 44}␤»
17:51 Zoffix ryn1x_: ^ or you could make your own raw-hash-making op
17:54 ryn1x_ That is really cool. I have not messed with making operators yet.
17:54 zakharyas joined #perl6
17:55 AlexDaniel joined #perl6
17:55 Zoffix m: sub infix:<¯\(°_o)/¯> { "@_[] not a big deal; just subs".say };    "They" ¯\(°_o)/¯ "are"
17:55 camelia rakudo-moar 0a24efc32: OUTPUT: «They are not a big deal; just subs␤»
17:57 Zoffix m: my $a = 111; my $b = 222; sub circumfix:<raw{ }> { my %h; %h{.key} := .value for @_; %h }; my %a := raw{ 1 => $a, 2 => $b }; $a = 33; $b = 44; say %a
17:57 camelia rakudo-moar 0a24efc32: OUTPUT: «{1 => 33, 2 => 44}␤»
17:58 Zoffix (a bit shorter version)
17:58 Zoffix left #perl6
18:13 khw joined #perl6
18:21 cdg joined #perl6
18:26 ChoHag joined #perl6
18:31 comborico1611 joined #perl6
18:42 cdg_ joined #perl6
18:43 mcmillhj joined #perl6
18:53 ChoHag joined #perl6
18:54 lucs ugexe: Hi, just got back to the computer.
18:56 Cabanossi joined #perl6
18:56 lucs re. 'zef look Inline::Perl5 && make clean && zef install .', looks like the found directory has no Makefile yet (only the Makefile.in).
18:56 lucs Um, will try the install...
18:57 lucs "All candidates are currently installed"
18:57 ugexe uninstall it or use --force install
18:58 lucs I believe I did that, but, trying again.
18:59 mcmillhj joined #perl6
19:03 lucs Still appears to use 5.22.1 :/
19:03 lucs I think I'll nuke very .precomp directory in sight...
19:04 ugexe well you can go into its direcoty with `zef look Inline::Perl5` and do `perl6 -e 'use Inline::Perl5; ...'` to avoid installation altogether
19:04 ugexe to rule that out
19:04 ugexe er, perl -Ilib -e 'use Inline::Perl5; ...'
19:05 ugexe perl6^
19:05 lucs Okay, trying...
19:06 robertle joined #perl6
19:10 mcmillhj joined #perl6
19:10 setty1 joined #perl6
19:17 ctilmes joined #perl6
19:17 ctilmes m: my $proc = run 'cat', :in, :out; $proc.in.say: "test\n"; say $proc.out.get; $proc.in.close;
19:17 camelia rakudo-moar 0a24efc32: OUTPUT: «run is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in sub run at src/RESTRICTED.setting line 14␤  in block <unit> at <tmp> line 1␤␤»
19:18 ctilmes m: my $proc = run 'cat', :in, :out; say $proc.out.native-descriptor; $proc.in.say: "test\n"; say $proc.out.get; $proc.in.close;
19:18 camelia rakudo-moar 0a24efc32: OUTPUT: «run is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in sub run at src/RESTRICTED.setting line 14␤  in block <unit> at <tmp> line 1␤␤»
19:18 ctilmes If I print out the native-descriptor, it breaks this.
19:20 itaipu joined #perl6
19:24 lucs ugexe: This worked: zef uninstall Inline::Perl5; 「manually removed the "found" directory」; zef look Inline::Perl5 「(Maybe just 'zef install Inline::Perl5' would have worked, but there it is. This recreated the "found" directory and shelled into it.)」; zef install .
19:25 lucs Now Inline::Perl5 sees my more recent perl 5.
19:26 itaipu_ joined #perl6
19:27 lucs But, this Inline::Perl5 problem remains: https://gist.github.com/lucs/43aa5fa13f6866378e8c154a7b45d811
19:28 lucs Is Inline::Perl5 brokened or what?
19:29 moritz lucs: try using ${ some_attr => 42 }
19:29 lucs Okay, trying...
19:29 moritz lucs: Inline::Perl5 has this infuriating thing where it flattens out things that aren't supposed to be flattened out
19:30 moritz and putting it into a scalar (usually by prepeding $) works around that
19:30 lucs That indeed appears to work.
19:31 lucs Thanks
19:31 itaipu joined #perl6
19:32 lucs I wonder if the synopsis example shown at https://github.com/niner/Inline-Perl5 works...
19:32 perlawhirl Hi perlers
19:34 perlawhirl python's itertools.permutations takes a second argument that can give you permutations of length N
19:34 perlawhirl ie. list(permutations('ABC', 2)) --> [(A B) (A C) (B A) (B C) (C A) (C B)]
19:34 perlawhirl trying to find a nice way to do it in perl and this is what i got
19:34 perlawhirl my @x = <A B C>; my $n = 2; say ([X] ^@x xx $n).map({ @x[|$_] if set($_) == $n })
19:34 perlawhirl m: my @x = <A B C>; my $n = 2; say ([X] ^@x xx $n).map({ @x[|$_] if set($_) == $n })
19:34 camelia rakudo-moar 0a24efc32: OUTPUT: «((A B) (A C) (B A) (B C) (C A) (C B))␤»
19:35 moritz m: say permutations([<a b c>], 2)
19:35 camelia rakudo-moar 0a24efc32: OUTPUT: «Too many positionals passed; expected 1 argument but got 2␤  in block <unit> at <tmp> line 1␤␤»
19:35 moritz m: say combinations([<a b c>], 2)
19:35 camelia rakudo-moar 0a24efc32: OUTPUT: «((0 1) (0 2) (1 2))␤»
19:35 moritz m: say combinations([<a b c>], 2).map: *.permutations
19:35 camelia rakudo-moar 0a24efc32: OUTPUT: «(((0 1) (1 0)) ((0 2) (2 0)) ((1 2) (2 1)))␤»
19:35 moritz m: say combinations([<a b c>], 2).map(*.permutations).flat
19:35 camelia rakudo-moar 0a24efc32: OUTPUT: «(0 1 1 0 0 2 2 0 1 2 2 1)␤»
19:36 moritz too flat :-)
19:38 perlawhirl moritz: the combinations trick works... albeit in a different order
19:38 perlawhirl m: my x = <A B C>; say combinations(@x, 2).map({ |@x[|.permutations] })
19:38 camelia rakudo-moar 0a24efc32: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Malformed my (did you mean to declare a sigilless \x or $x?)␤at <tmp>:1␤------> 3my x7⏏5 = <A B C>; say combinations(@x, 2).map(␤»
19:38 perlawhirl m: my @x = <A B C>; say combinations(@x, 2).map({ |@x[|.permutations] })
19:38 camelia rakudo-moar 0a24efc32: OUTPUT: «((A B) (B A) (A C) (C A) (B C) (C B))␤»
19:38 perlawhirl tho it is much nicer, thanks
19:41 kitsunenokenja joined #perl6
19:42 perlawhirl lolfixed
19:42 perlawhirl m: my @x = <A B C>; say combinations(@x, 2).map({ |@x[ [Z] |.permutations ] })
19:42 camelia rakudo-moar 0a24efc32: OUTPUT: «((A B) (B A) (A C) (C A) (B C) (C B))␤»
19:42 perlawhirl oh wait... still not the same order as python... almost
19:43 perlawhirl can just .sort it after the fact, i suppose
19:43 moritz both orders make sense on some level
19:43 perlawhirl yeah
19:44 moritz m: say 'abc' ~~ /$<0>=[.]/
19:44 camelia rakudo-moar 0a24efc32: OUTPUT: «「a」␤ 0 => 「a」␤»
19:44 moritz m: say 'abc' ~~ /$<0>=[.](.)/
19:44 camelia rakudo-moar 0a24efc32: OUTPUT: «「ab」␤ 0 => 「a」␤ 1 => 「b」␤»
19:45 moritz I half-expected this to make $0 a list
19:45 moritz m: say 'abc' ~~ /$<0>=[.](.)$<1>=[.]/
19:45 camelia rakudo-moar 0a24efc32: OUTPUT: «「abc」␤ 0 => 「a」␤ 1 => 「b」␤ 1 => 「c」␤»
19:45 moritz m: say 'abc' ~~ /$<0>=[.](.)$<1>=[.]/; say $1.^name
19:45 camelia rakudo-moar 0a24efc32: OUTPUT: «「abc」␤ 0 => 「a」␤ 1 => 「b」␤ 1 => 「c」␤Array␤»
19:46 moritz fascinating
19:48 Winwin joined #perl6
19:50 perlawhirl ahh... this is most idiomatic...
19:50 perlawhirl m: my @x = <A B C>; say @x.combinations(2).map(|*.permutations)
19:50 camelia rakudo-moar 0a24efc32: OUTPUT: «((A B) (B A) (A C) (C A) (B C) (C B))␤»
19:55 moritz random fun fact: my regex book will have an index entry for "Secret Magic Sauce™" :-)
19:56 Cabanossi joined #perl6
20:13 buggable New CPAN upload: Font-FreeType-0.0.1.tar.gz by WARRINGD https://cpan.metacpan.org/authors/id/W/WA/WARRINGD/Perl6/Font-FreeType-0.0.1.tar.gz
20:19 cdg joined #perl6
20:20 MasterDuke joined #perl6
20:27 s0me0ne-unkn0wn Guys, can someone please explain me that NETWORK_TESTING thing? Is it described somewhere in docs? If I listen/connect on a loopback interface, is it NETWORK_TESTING or not?
20:31 ChoHag joined #perl6
20:40 comborico1611 Sorry, i don't know.
20:41 comborico1611 joined #perl6
20:42 zakharyas joined #perl6
20:44 ugexe is there somewhere in the core you see NETWORK_TESTING used?
20:44 ugexe or are you asking about externals module use of environmental variables?
20:45 mr_ron joined #perl6
20:47 moritz github/azawawi/perl6-net-curl and github/perl6/perl6-lwp-simple use it
20:47 moritz also http-useragent and openssl
20:47 mr_ron rakudo:     {         my int ($a, $one, $three) = (42, 1, 3);         for ^10_000_000 { $a += $one + $a%$three };         say now - ENTER now;         say $a     }     {         my int ($a, $one, $three) = (42, 1, 3);         for ^10_000_000 -> int --> Nil { $a += $one + $a%$three };         say now - ENTER now;         say $a     }
20:47 camelia rakudo-moar 0a24efc32: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Unexpected block in infix position (missing statement control word before the expression?)␤at <tmp>:1␤------> 3ay now - ENTER now;         say $a     }7⏏5     {         my int ($a, $one, $three…»
20:48 ugexe right, but that doesn't mean it belongs in the perl6 docs
20:48 moritz comborico1611: I don't know if it's specified that well. I'd personally be bold enough to do localohost-only tests without that env var
20:48 moritz and only change that if somebody complains, and has good reason
20:50 mr_ron rakudo:    { my int ($a, $one, $three) = (42, 1, 3);   for ^10_000_000 { $a += $one + $a%$three }; say now - ENTER now;  say $a }; {my int ($a, $one, $three) = (42, 1, 3);  for ^10_000_000 -> int --> Nil { $a += $one + $a%$three }; say now - ENTER now;say $a }
20:50 camelia rakudo-moar 0a24efc32: OUTPUT: «2.491267␤15000042␤1.96962212␤15000042␤»
20:52 mr_ron rakudo:     { my int ($a, $one, $three, $limit) = (42, 1, 3, 10_000_000); loop (my int $i = 0; $i < $limit; $i++) { $a += $one + $a%$three }; say now - ENTER now;   say $a }
20:52 camelia rakudo-moar 0a24efc32: OUTPUT: «0.8225151␤15000042␤»
20:53 mr_ron timotimo: RT 130982 - did I get the  int --> Nil signature right or as you intended?
20:53 buggable New CPAN upload: Font-FreeType-0.0.2.tar.gz by WARRINGD https://cpan.metacpan.org/authors/id/W/WA/WARRINGD/Perl6/Font-FreeType-0.0.2.tar.gz
20:53 synopsebot RT#130982 [open]: https://rt.perl.org/Ticket/Display.html?id=130982 [PERF] "for $a..$b -> $i { ... }" loops are sometimes much slower than c-style loops
20:54 s0me0ne-unkn0wn ugexe: asking regarding install-time tests of external modules, I need to write some more tests for IO::Socket::Async:SSL and I want to understand "dos and donts" better before I start :)
20:54 timotimo mr_ron: yeah, that works
20:55 timotimo i haven't looked closer at why the native loop (...) outperforms the optimizer's result for the for-range-loop by so much
20:55 mr_ron thank your
20:55 moritz s0me0ne-unkn0wn: as a data point, roast (the perl 6 test suite) does not require NETWORK_TESTING for tests on the loopback device
20:57 s0me0ne-unkn0wn moritz: thanks, that's good news
20:57 * mr_ron (sorry, meant thank you)
20:57 ugexe you can  use set BLARG=1; if %*ENV<BLARG> { <do tests> } if you wish. e.g. its something the test author exposes to allow the end user to give it parameters
20:58 ugexe the fact NETWORK_TESTING is used in different modules is a good thing, but it has no defined meaning beyond what each author gives it
21:00 s0me0ne-unkn0wn Ok, than I'll just pray nobody runs those tests on a host without loopback interface :)
21:00 geospeck joined #perl6
21:00 s0me0ne-unkn0wn One won't require IO:Socket::Async::SSL anyway, I suppose
21:00 ugexe `require IO::Socket::SSL` might be the most used require in the ecosystem
21:01 s0me0ne-unkn0wn But not on the hosts with no loopback interface, I hope :)
21:01 ugexe if you can detect something exists or not you should and make the tests act accordingly. NETWORK_TESTING also disables it for slow networks, whenyou dont care, etc
21:11 diakopter joined #perl6
21:13 buggable New CPAN upload: Config-1.3.1.tar.gz by TYIL https://cpan.metacpan.org/authors/id/T/TY/TYIL/Perl6/Config-1.3.1.tar.gz
21:14 sftp joined #perl6
21:18 geospeck joined #perl6
21:21 cdg joined #perl6
21:25 lizmat joined #perl6
21:39 ctilmes Test::When uses ONLINE_TESTING instead of NETWORK_TESTING
21:46 espadrine joined #perl6
21:48 geospeck joined #perl6
21:51 mson joined #perl6
22:06 comborico1611 New p6 alias idea: 6lerp (pronounced slurp).
22:07 Geth ¦ doc: 00e1a3abe7 | (Will "Coke" Coleda)++ | EXAMPLES.md
22:07 Geth ¦ doc: formatting fix
22:07 Geth ¦ doc: review: https://github.com/perl6/doc/commit/00e1a3abe7
22:07 comborico1611 Huh, huh?
22:07 comborico1611 ++Zoffix, 6lerp?
22:11 Cabanossi joined #perl6
22:19 mcmillhj joined #perl6
22:25 cdg joined #perl6
22:32 AndChat|688961 joined #perl6
22:35 mcmillhj joined #perl6
22:41 Cabanossi joined #perl6
22:43 buggable New CPAN upload: Config-1.3.2.tar.gz by TYIL https://cpan.metacpan.org/authors/id/T/TY/TYIL/Perl6/Config-1.3.2.tar.gz
22:44 jaush joined #perl6
22:51 mcmillhj joined #perl6
22:55 kitsunenokenja joined #perl6
23:01 _28_ria joined #perl6
23:03 char_var[buffer] joined #perl6
23:07 mcmillhj joined #perl6
23:11 Cabanossi joined #perl6
23:17 markmont joined #perl6
23:23 mcmillhj joined #perl6
23:33 Herby_ joined #perl6
23:33 Herby_ o/
23:34 itaylor57 joined #perl6
23:34 timotimo m: sub wiggle($a) { $a.uc }; my @data = { foo => a }, { foo => b }, { foo => c }; for @data { .<foo> .= &wiggle }; say @data
23:34 camelia rakudo-moar c967cb6cc: OUTPUT: «5===SORRY!5=== Error while compiling <tmp>␤Undeclared routines:␤    a used at line 1␤    b used at line 1␤    c used at line 1␤␤»
23:35 timotimo m: sub wiggle($a) { $a.uc }; my @data = { foo => "a" }, { foo => "b" }, { foo => "c" }; for @data { .<foo> .= &wiggle }; say @data
23:35 camelia rakudo-moar c967cb6cc: OUTPUT: «[{foo => A} {foo => B} {foo => C}]␤»
23:35 timotimo i like this.
23:35 timotimo o/ Herby_
23:39 mcmillhj joined #perl6
23:41 Cabanossi joined #perl6
23:44 kitsunenokenja joined #perl6
23:55 mcmillhj joined #perl6

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

Perl 6 | Reference Documentation | Rakudo