»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
00:02 mcmillhj left 00:03 llfourn left 00:07 llfourn joined 00:11 mcmillhj joined 00:12 raschipi left 00:16 mcmillhj left
El_Che New 2017.11 Linux packages: github.com/nxadm/rakudo-pkg/releas...g/v2017.11 00:17
00:20 TEttinger joined 00:24 Cabanossi left 00:26 Cabanossi joined 00:30 troys is now known as troys_ 00:32 callyalater left 00:39 mcmillhj joined 00:44 sena_kun left, mcmillhj left 00:49 pilne joined
AlexDaniel El_Che++ 00:49
00:52 markong left 00:58 kyan left 00:59 mcmillhj joined 01:02 cdg joined 01:04 mcmillhj left 01:07 cdg left 01:11 aborazmeh joined, aborazmeh left, aborazmeh joined 01:14 mcmillhj joined 01:22 mcmillhj left 01:32 mcmillhj joined 01:37 mcmillhj left 01:41 ivans_ left 01:47 ivans joined 01:49 mcmillhj joined
lucs My mistake, or how do I find out what is wrong?: gist.github.com/lucs/43aa5fa13f686...4a7b45d811 01:52
01:53 mcmillhj left
comborico1611 Quiet night. 01:55
APic *shrug* 01:56
geekosaur weird. I think it dereferenced and flattened it into the p5 arglist 02:02
02:04 lookatme joined 02:05 mcmillhj joined 02:10 mcmillhj left 02:24 mcmillhj joined 02:29 mcmillhj left 02:33 pilne left
comborico1611 Goodnight! 02:33
02:33 comborico1611 left 02:43 mcmillhj joined 02:45 ilbot3 left 02:46 kitsunenokenja left 02:47 llfourn left 02:49 mcmillhj left 02:51 llfourn joined 02:54 cdg joined 02:55 ilbot3 joined, ChanServ sets mode: +v ilbot3 02:56 mcmillhj joined 02:58 cdg left 03:01 mcmillhj left 03:04 cdg joined 03:05 noganex joined 03:06 aborazmeh left 03:07 noganex_ left 03:12 ufobat_ joined 03:13 mcmillhj joined 03:15 ufobat left 03:17 mson left 03:18 mcmillhj left 03:25 mcmillhj joined
Geth mu: c6673ce250 | (Zoffix Znet)++ (committed using GitHub Web editor) | misc/perl6advent-2017/schedule
Add/rearrange articles

  - Postpone drummer article 'til next year (ain't got time to record the needed videos)
  - Add "Perl 6: Sigils, Variables, and Containers" article
  - Add "Perl 6: Iterate All The Things!" (an article expounding Perl 6's Iterable types)
  - Add "Extending Perl 6's Exception Reporting"
  - Add "GitHub to Twitter Notifier in Perl 6"
  - Rearrange ZofArticles to start filling holes from the *end* of the calendar, to let potential
   latecomer authors jump in if they want.
03:27
03:30 mcmillhj left 03:39 mcmillhj joined 03:43 mcmillhj left 03:50 mcmillhj joined
Geth doc: 90f7097b4c | (Jeremy Studer)++ | 18 files
Replace "dd" in examples

Replacing instances of Rakudo-specific "dd" operator with standard Perl 6.
SEE ALSO:
  [Issue #1680](github.com/perl6/doc/issues/1680)
03:53
doc: c71c154d74 | (Jeremy Studer)++ | doc/Language/variables.pod6
Modify example to show explicit cloning vs binding

Example previously mentions the pitfalls of implicit binding when creating a Pair and suggests cloning. Now shows cloning explicitly.
synopsebot Link: doc.perl6.org/language/variables
doc: a0ee6719c1 | (Jeremy Studer)++ | xt/examples-compilation.t
Fix false positive on dd test due to "yyyy-mm-dd"

The "yyyy-mm-dd" method on Dateish role was causing false positives in
  "dd" test.
03:55 mcmillhj left 04:02 john51 left, john51 joined 04:07 mcmillhj joined 04:08 R0b0t1_ left 04:10 R0b0t1_ joined 04:11 mcmillhj left 04:14 ZzZombo left, bwisti left 04:15 ZzZombo joined
Geth doc: ad276ed7d5 | (Jeremy Studer)++ | xt/examples-compilation.t
Rearrange "dd" regex; Reads better.

Moved negative lookbehind before boundary. Reads better.
04:20
04:24 eliasr left, Cabanossi left 04:26 Cabanossi joined 04:27 aborazmeh joined, aborazmeh left, aborazmeh joined 04:31 wamba joined 04:38 mson joined 04:48 mcmillhj joined 04:53 mcmillhj left 05:03 mcmillhj joined 05:08 mcmillhj left 05:09 aborazmeh left 05:11 aborazmeh joined, aborazmeh left, aborazmeh joined 05:15 mcmillhj joined 05:20 mcmillhj left 05:23 aborazmeh left 05:26 mcmillhj joined 05:31 mcmillhj left 05:35 cdg left 05:37 wamba left 05:38 Cabanossi left 05:39 khw left 05:41 Cabanossi joined 05:45 mcmillhj joined 05:49 mcmillhj left 05:54 raiph joined, raiph left 06:06 kaare__ left, AlexDaniel left, kaare__ joined 06:11 cdg joined 06:12 R0b0t1_ left 06:15 cdg left 06:18 R0b0t1_ joined 06:21 R0b0t1_ left, mcmillhj joined 06:26 mcmillhj left 06:28 R0b0t1_ joined 06:29 R0b0t1_ left 06:30 wamba joined 06:32 kaare__ left, kaare__ joined 06:38 Cabanossi left 06:40 mcmillhj joined 06:41 Cabanossi joined 06:45 mcmillhj left 06:54 Actualeyes left, mcmillhj joined 06:59 mcmillhj left 07:02 AlexDaniel joined 07:05 domidumont joined 07:06 AlexDaniel left 07:07 darutoko joined 07:09 wamba left 07:10 mcmillhj joined, domidumont left 07:11 wamba joined, domidumont joined 07:15 mcmillhj left 07:20 lizmat left 07:24 mcmillhj joined 07:25 R0b0t1` joined 07:29 mcmillhj left 07:33 rindolf joined 07:36 Brumbazz joined 07:40 mcmillhj joined 07:43 robertle joined 07:44 wamba left 07:45 mcmillhj left, lowbro joined, lowbro left, lowbro joined 07:46 Actualeyes joined 07:54 abraxxa joined 07:55 mcmillhj joined 08:00 mcmillhj left 08:03 zakharyas joined 08:07 mson left 08:12 wamba joined 08:13 |oLa| joined 08:20 sena_kun joined 08:21 mcmillhj joined 08:25 mcmillhj left 08:31 kaare__ left, kaare__ joined, kaare__ left 08:32 kaare__ joined 08:34 mcmillhj joined 08:38 mcmillhj left 08:39 Cabanossi left 08:41 Cabanossi joined 08:43 Actualeyes left, konsolebox_ left 08:47 zakharyas left 08:49 konsolebox joined 08:51 mcmillhj joined 08:55 mcmillhj left 08:56 zakharyas joined 09:01 parv joined 09:08 jeek joined 09:10 mcmillhj joined 09:12 parv left 09:13 zakharyas left 09:14 zakharyas joined, cdg joined 09:15 mcmillhj left 09:16 cdg_ joined, zakharyas left, zakharyas joined 09:19 cdg left, cdg_ left 09:20 cdg joined 09:21 parv joined 09:23 zakharyas left, zakharyas joined 09:24 cdg left, mcmillhj joined 09:28 zakharyas left, mcmillhj left 09:29 zakharyas joined, zakharyas left, zakharyas joined 09:37 mcmillhj joined, dakkar joined 09:41 mcmillhj left 09:58 wamba left 10:00 sftp joined 10:01 geospeck joined
tyil m: my $a = [email@hidden.address] my @a = ($a, $a); dd @a; 10:02
camelia Array @a = ["test\@domain.org", "test\@domain.org"]
tyil why does it insert these backslashes here?
10:02 wamba joined 10:04 thunktone joined 10:06 cdg joined, zakharyas left 10:10 cdg left 10:11 zakharyas joined
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:13
parv perhaps a function of dd? 10:14
tyil it seems so, but I'm not using dd in my test
and my test shows it with the \, which of course fails the test 10:15
10:19 mcmillhj joined
jnthn .perl would also do that, I guess 10:19
10:23 mcmillhj left
tyil can I stop it from doing that? 10:23
jnthn Are you actually calling .perl in your test? 10:25
If so, call .perl on the thing you're testing it against?
tyil not yet
but I can add a .perl
jnthn Ah 10:26
Then I'm suspecting it's only showing the \ as part of the error reporting
Rather than it being there in the data
Or at least, it's worth checking if that's what is going on :)
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?
jast a SIGBUS due to alignment issues
possibly a compiler problem, too, I haven't tried too many yet 10:29
just one so far. lack of time and all that...
jnthn Ah. I can probably give more hints with a stacktrace 10:30
Does it get so far as building Rakudo, or does it explode well before that?
jast the build all succeeds 10:31
anyway, I've already traced it, it fails in P6num's set_num
the default case of the switch block, as I recall, but I'd better check again
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?
jast doesn't help that I'm not exactly literate in ARM-style instruction sets
no, it's when I launch perl6.moarvm 10:33
jnthn Ah
Then maybe take a look in P6opaque.c which does the layout of objects
It may be doing insufficient alignment ahead of a P6num
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?
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... gist.github.com/jast/df9ba1a023222...7ad1dfce45
in another run I checked the register contents and lr was, indeed, not aligned
but I know nothing about the registers and all that, so that didn't tell me a lot :)
I suppose this is an opportunity to start learning more about ARM 10:37
jnthn p &(((MVMP6numBody *)data)->value) may be interesting 10:38
(To see what the lower bits of the address are, which may hint an the alignment issue)
10:39 Cabanossi left 10:41 Cabanossi joined
jast $2 = (union {...} *) 0xb413266a 10:42
so I guess it wants 64 bit values aligned at 64 bits, which this isn't 10:45
10:53 araraloren joined 11:08 domidumont left 11:12 parv left 11:16 kaare__ left, kaare__ joined, xinming_ joined 11:17 sena_kun left, sena_kun joined
jnthn jast: Yeah, looks like. Though oddly it already should be accounting for the platform's alignment desires: github.com/MoarVM/MoarVM/blob/mast...6num.c#L12 11:18
11:20 xinming left, wamba left 11:22 wamba joined 11:37 markong joined 11:56 Brumbazz left 12:02 piojo left
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:05
12:07 eliasr joined
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
what is your setup? are you using a proxy?
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
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 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
------>…
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)
camelia (C.new(s => "asd") aaaaaaaaaa)
timotimo ah, you're already using a sigilless parameter, that's equivalent to "is raw" 12:12
oh, it looks like it worked what you wanted there? 12:13
like, what's your goal here?
ZzZombo no? the original string didn't change. I want to be able to change the provided part of a string from my objects.
timotimo then what you want is assignment, not binding 12:14
you're binding "asd" into $!s, at which point the result from substr-rw is replaced with "asd" 12:15
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:19 kaare__ left 12:20 kaare__ joined 12:21 cdg joined
tyil how can I check if a variable contains an object that does Iterable? 12:23
timotimo smart match against Iterable
tyil thanks :>
timotimo np 12:24
12:24 char_var[buffer] left 12:26 cdg left 12:40 itaipu joined, markmont left, rindolf left
buggable New CPAN upload: Config-1.3.0.tar.gz by TYIL cpan.metacpan.org/authors/id/T/TY/...3.0.tar.gz 12:43
12:48 Grrrr joined, kaare__ left, kaare__ joined 12:50 abraxxa left 12:54 abraxxa joined 12:56 zakharyas left 12:57 Brumbazz joined 12:58 rindolf joined 12:59 kaare__ left, kaare__ joined 13:17 mcmillhj joined 13:20 markmont joined 13:22 mcmillhj left 13:33 mcmillhj joined 13:35 ExtraCrispy joined 13:38 mcmillhj left 13:42 mcmillhj joined 13:44 zakharyas joined 13:54 Cabanossi left, avalenn left 13:55 Zoffix joined
Zoffix m: &say.wrap: sub (|c) { unless $*x { my $*x = 1; samewith 42; }; nextsame }; say 2 13:55
camelia 2
Zoffix m: &say.wrap: sub (|c) { unless $*x { my $*x = 1; say 42; }; nextsame }; say 2
camelia 42
2
Zoffix Why does using `samewith` instead of the routine name directly give different results?
13:56 Cabanossi joined
moritz is "because wrapping is evil" a satisfactory answer? 13:56
probably not...
Zoffix No, it isn't.
It's probably because it's same-ing using the wrapper sub instead of reaching out to the wrappee 13:58
m: &say.wrap: sub (|c) { unless $*x { my $*x = 1; samewith 42; }; dd nextcallee }; say 2
camelia Sub say = sub say (| is raw) { #`(Sub|55633040) ... }
Nil
Zoffix m: &say.wrap: sub (|c) { unless $*x { my $*x = 1; say 42; }; dd nextcallee }; say 2
camelia Sub say = sub say (| is raw) { #`(Sub|58302032) ... }
Sub say = sub say (| is raw) { #`(Sub|58302032) ... }
Zoffix m: multi z (|) {}; &say.wrap: multi z($) { unless $*x { my $*x = 1; samewith 42; }; dd nextcallee }; say 2 14:00
camelia Sub z = sub z (| is raw) { #`(Sub|63117312) ... }
Sub say = sub say (| is raw) { #`(Sub|63127496) ... }
Zoffix Yeah. OK. Good enough for me. Thanks. 14:01
14:01 Zoffix left 14:02 wamba left 14:05 wamba joined 14:10 perlpilot joined
lucs How do I get Inline::Perl5 to use my just installed more recent version of Perl 5? 14:15
(the more recent version is the one found in the path where I am using Inline, but it sees my previously installed perl5) 14:17
14:20 comborico1611 joined
lucs (uninstalling and reinstalling Inline changed nothing) 14:20
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:26
lucs Makes sense, trying to delete relevant stuff (but not sure exactly what) to reattempt build. 14:28
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
lucs timotimo: Tried that, no luck.
Oops, meeting 14:30
TTYL
ilmari 'zef uninstall Inline::Perl5' first?
lucs ilmari: Yep, did that
El_Che rm -rf ~/.perl6 should fix it, but you'll loose other home installed modules 14:32
DrForr waves to lucs. 14:33
14:35 sftp left 14:36 sftp joined 14:39 Cabanossi left 14:41 Cabanossi joined 14:42 Zoffix joined
Zoffix Along with `samewith` weirdness, there's also this thing, where you have to pass `self` to nextwith/callwith: 14:44
m: $*OUT.WHAT.^lookup('print').wrap: my method (|) { nextwith 42 }; say 42
camelia 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
Zoffix Despite `nextsame` knowing what to do... Was this really the design of how this thing was meant to work?
Feels like the wrapper is in want of having its dispatcher tweaked or something 14:45
ugexe zef nuke StoreDir, or zef look Inline::Perl5 && make clean && zef install . 14:46
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:47
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 :)
tyil jnthn: also said it was probably the .perl part 14:49
which seems to also be used in Config::TOML, so now I can try to fix another issue as well
and the test I had my problem with earlier today now works as well :>
so everything is fine again
lucs Okay, getting rid of ~/.perl6
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
but that'll have to wait until I get home
14:54 wamba left
Zoffix retracts attempts to mess with dispatcher 14:58
It actually makes sense as is, if you… .wrap… your mind around it ^_^
14:58 Zoffix left 14:59 wamba joined 15:05 mson joined 15:06 ExtraCrispy left 15:17 llfourn_ joined
[Coke] ~~ to Zoffix 15:20
15:20 llfourn left 15:33 araraloren left 15:38 Actualeyes joined 15:40 robertle left, Aaronepower joined 15:44 ivans left 15:49 lowbro left 15:51 kaare__ left 15:52 kaare__ joined 15:54 Cabanossi left 15:55 ivans joined 15:56 Cabanossi joined, pmurias joined 16:06 troys_ is now known as troys
ugexe lucs: zef look Inline::Perl5 && make clean && zef install . 16:08
16:09 Aaronepower left
El_Che ugexe: it looks like zef could use a clean-install command :) 16:11
ugexe perhaps, or alternatively makefiles could run a make clean step first since they will be more familiar with their build system 16:13
im open to suggestions though
perlpilot zef caches module downloads? 16:14
ugexe yes
perlpilot Hmm. if this were only cpan, I'd say only cache the tarballs and unpack them each time. 16:15
16:15 committable6 left 16:16 committable6 joined, ChanServ sets mode: +v committable6
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
El_Che I can imagine
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
another was so there was a work directory to see what actually happened in a build 16:18
16:18 cdg joined
ugexe and finally because it is faster (maybe not compared to tarballs, but to git cloning yeah) 16:19
well, it should be faster than tarballs but I mean its probably not fast enough to make much difference
pmurias what is more correct 'Return 1 if ..., 0 otherwise' or 'Return 1 if ..., otherwise 0' 16:26
moritz return ... ?? 1 !! 0 16:28
perlpilot I don't know about "correct", but I like the second one
moritz oh, this is about language, not code
sorry
perlpilot moritz: yeah, it's hard to tell these days sometimes :)
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
perlpilot yeah, that would suck. 16:30
Better would be to give a --no-cache option or something 16:31
--refetch? 16:32
ugexe you can disable the cache with --/cache
--refetch would not help because the distribution is still the same 16:33
er --/cached 16:34
but this also means it can be disabled in config.json 16:35
16:38 Cabanossi left
El_Che ugexe: I am curious where did you get the --/ syntax 16:39
little weird
ugexe its built in to perl6
El_Che ok, now I am curious where perl6 got it :)
16:41 Cabanossi joined 16:42 jferrero joined
moritz you could ask [particle]1 16:43
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:44
16:45 wamba left
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
moritz that's the same with --/foo and --no-foo 16:46
El_Che before lizmat fixed MAIN params where pretty useless
ag options before commands stuff.
ugexe --no-foo is a different name, it would (should) show up twice
moritz there's a step that translates @*ARGS into a capture. It could turn --no-foo into :foo(False)
ugexe --foo and --/foo would not
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
moritz ugexe: it's not MAIN that does it
El_Che hence the question
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
if I already have a :whatever, then I cannot add a :no-whatever
moritz but, how often do you want to add both a :whatever and a :no-whatever option? 16:50
this sounds like a very theoretical option to me
s/option/problem/
perlpilot You have: no tea.
moritz Getopt::Long in Perl 5 does it
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
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
El_Che should you just give default values (false) and add 1 bool to disabled if needed? 16:53
that's what's most CLI's use
ugexe ilmari: right
El_Che so you'll end up with no --cache option, but a --no-cache is cache is the default
ugexe and what if the user chooses the defaults? 16:54
El_Che if cache is the defaut
ugexe: he'll use a wrapper?
ugexe in zef you can set any of the plugins to any command you want
flag rather
moritz well, i'd proppose --cache calls MAIN(:cache), and --no-cache calls MAIN(:!cache)
and MAIN can do a $cache // $users-default 16:55
and MAIN would be declared as sub MAIN(Bool :$cache) { }
16:56 abraxxa left 16:57 sftp left 16:58 sftp joined 17:08 Cabanossi left 17:11 Cabanossi joined
ugexe still must deal with short name, -c -/c 17:11
well not must, but its a thing 17:12
17:14 mson left 17:18 mson joined
ugexe but as for it being a theoretical option, i'd point you to github.com/ugexe/zef/issues/147 17:20
17:20 cdg left
ugexe which is about the rakudo bin installation wrapper adding a named option that it handles 17:20
well, not quite the same. it does expose issues about what naming you can use in MAIN though 17:24
17:26 cpage_ joined 17:29 cpage left, cpage_ is now known as cpage 17:30 comborico1611 left 17:31 comborico1611 joined, ryn1x_ joined 17:32 raschipi joined, domidumont joined
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:35
17:35 dakkar left
ugexe m: sub MAIN(:f(:$foo)) { say << $foo = $foo.Bool() >> }; @*ARGS=<--/foo=bar>; $ = &MAIN; # also this :o 17:36
camelia (bar = False)
raschipi m: my %a := {1 => '???', 2=> '???'}; say %a 17:37
camelia {1 => ???, 2 => ???}
17:45 Zoffix joined
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:45
m: my $a = 111; my $b = 222; with my %a {.<1> := $a; .<2> := $b }; $a = 33; $b = 44; say %a 17:46
camelia {1 => 33, 2 => 44}
17:46 zakharyas left 17:48 comborico1611 left 17:50 wamba joined
ryn1x_ Zoffix: Your solution works perfectly. Thanks! 17:50
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 {1 => 33, 2 => 44}
Zoffix ryn1x_: ^ or you could make your own raw-hash-making op
ryn1x_ That is really cool. I have not messed with making operators yet. 17:54
17:54 zakharyas joined 17:55 AlexDaniel joined
Zoffix m: sub infix:<¯\(°_o)/¯> { "@_[] not a big deal; just subs".say }; "They" ¯\(°_o)/¯ "are" 17:55
camelia They are not a big deal; just subs
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 {1 => 33, 2 => 44}
Zoffix (a bit shorter version) 17:58
17:58 Zoffix left 18:13 khw joined 18:21 cdg joined 18:25 ChoHag left 18:26 ChoHag joined 18:31 mcmillhj left, comborico1611 joined 18:32 ChoHag left 18:42 cdg left, cdg_ joined 18:43 mcmillhj joined 18:44 darutoko left 18:48 mcmillhj left 18:53 ChoHag joined
lucs ugexe: Hi, just got back to the computer. 18:54
18:55 Cabanossi left 18:56 Cabanossi joined
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
Um, will try the install...
"All candidates are currently installed" 18:57
ugexe uninstall it or use --force install
lucs I believe I did that, but, trying again. 18:58
18:59 mcmillhj joined
lucs Still appears to use 5.22.1 :/ 19:03
I think I'll nuke very .precomp directory in sight...
19:03 itaipu left
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
to rule that out
er, perl -Ilib -e 'use Inline::Perl5; ...'
perl6^ 19:05
lucs Okay, trying...
19:06 mcmillhj left, robertle joined 19:10 mcmillhj joined, setty1 joined 19:14 raschipi left 19:17 ctilmes joined
ctilmes m: my $proc = run 'cat', :in, :out; $proc.in.say: "test\n"; say $proc.out.get; $proc.in.close; 19:17
camelia 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
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 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
ctilmes If I print out the native-descriptor, it breaks this.
19:20 itaipu joined
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:24
Now Inline::Perl5 sees my more recent perl 5. 19:25
19:26 itaipu_ joined
lucs But, this Inline::Perl5 problem remains: gist.github.com/lucs/43aa5fa13f686...4a7b45d811 19:27
19:27 zakharyas left
lucs Is Inline::Perl5 brokened or what? 19:28
moritz lucs: try using ${ some_attr => 42 } 19:29
19:29 itaipu left
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
and putting it into a scalar (usually by prepeding $) works around that 19:30
lucs That indeed appears to work.
Thanks 19:31
19:31 itaipu joined 19:32 itaipu_ left
lucs I wonder if the synopsis example shown at github.com/niner/Inline-Perl5 works... 19:32
perlawhirl Hi perlers
python's itertools.permutations takes a second argument that can give you permutations of length N 19:34
ie. list(permutations('ABC', 2)) --> [(A B) (A C) (B A) (B C) (C A) (C B)]
trying to find a nice way to do it in perl and this is what i got
my @x = <A B C>; my $n = 2; say ([X] ^@x xx $n).map({ @x[|$_] if set($_) == $n })
m: my @x = <A B C>; my $n = 2; say ([X] ^@x xx $n).map({ @x[|$_] if set($_) == $n })
camelia ((A B) (A C) (B A) (B C) (C A) (C B))
moritz m: say permutations([<a b c>], 2) 19:35
camelia Too many positionals passed; expected 1 argument but got 2
in block <unit> at <tmp> line 1
moritz m: say combinations([<a b c>], 2)
camelia ((0 1) (0 2) (1 2))
moritz m: say combinations([<a b c>], 2).map: *.permutations
camelia (((0 1) (1 0)) ((0 2) (2 0)) ((1 2) (2 1)))
moritz m: say combinations([<a b c>], 2).map(*.permutations).flat
camelia (0 1 1 0 0 2 2 0 1 2 2 1)
moritz too flat :-) 19:36
perlawhirl moritz: the combinations trick works... albeit in a different order 19:38
m: my x = <A B C>; say combinations(@x, 2).map({ |@x[|.permutations] })
camelia 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(
perlawhirl m: my @x = <A B C>; say combinations(@x, 2).map({ |@x[|.permutations] })
camelia ((A B) (B A) (A C) (C A) (B C) (C B))
perlawhirl tho it is much nicer, thanks
19:41 kitsunenokenja joined
perlawhirl lolfixed 19:42
m: my @x = <A B C>; say combinations(@x, 2).map({ |@x[ [Z] |.permutations ] })
camelia ((A B) (B A) (A C) (C A) (B C) (C B))
perlawhirl oh wait... still not the same order as python... almost
can just .sort it after the fact, i suppose 19:43
moritz both orders make sense on some level
perlawhirl yeah
19:44 cdg_ left
moritz m: say 'abc' ~~ /$<0>=[.]/ 19:44
camelia 「a」
0 => 「a」
moritz m: say 'abc' ~~ /$<0>=[.](.)/
camelia 「ab」
0 => 「a」
1 => 「b」
moritz I half-expected this to make $0 a list 19:45
m: say 'abc' ~~ /$<0>=[.](.)$<1>=[.]/
camelia 「abc」
0 => 「a」
1 => 「b」
1 => 「c」
moritz m: say 'abc' ~~ /$<0>=[.](.)$<1>=[.]/; say $1.^name
camelia 「abc」
0 => 「a」
1 => 「b」
1 => 「c」
Array
moritz fascinating 19:46
19:48 Winwin joined 19:50 Winwin left
perlawhirl ahh... this is most idiomatic... 19:50
m: my @x = <A B C>; say @x.combinations(2).map(|*.permutations)
camelia ((A B) (B A) (A C) (C A) (B C) (C B))
19:53 Cabanossi left
moritz random fun fact: my regex book will have an index entry for "Secret Magic Sauce™" :-) 19:55
19:56 Cabanossi joined 20:04 domidumont left 20:07 ChoHag left 20:13 MasterDuke left
buggable New CPAN upload: Font-FreeType-0.0.1.tar.gz by WARRINGD cpan.metacpan.org/authors/id/W/WA/...0.1.tar.gz 20:13
20:19 cdg joined 20:20 MasterDuke joined 20:25 cdg left
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:27
20:31 ChoHag joined 20:33 kitsunenokenja left
comborico1611 Sorry, i don't know. 20:40
20:41 comborico1611 left, comborico1611 joined 20:42 zakharyas joined
ugexe is there somewhere in the core you see NETWORK_TESTING used? 20:44
or are you asking about externals module use of environmental variables?
20:44 mson left 20:45 mr_ron joined
moritz github/azawawi/perl6-net-curl and github/perl6/perl6-lwp-simple use it 20:47
also http-useragent and openssl
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 }
camelia 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…
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
and only change that if somebody complains, and has good reason
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 2.491267
15000042
1.96962212
15000042
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 0.8225151
15000042
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 cpan.metacpan.org/authors/id/W/WA/...0.2.tar.gz
synopsebot RT#130982 [open]: rt.perl.org/Ticket/Display.html?id=130982 [PERF] "for $a..$b -> $i { ... }" loops are sometimes much slower than c-style loops
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
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
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:55 troys is now known as troys_
s0me0ne-unkn0wn moritz: thanks, that's good news 20:57
mr_ron (sorry, meant thank you)
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 mr_ron left
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 20:58
21:00 geospeck left
s0me0ne-unkn0wn Ok, than I'll just pray nobody runs those tests on a host without loopback interface :) 21:00
21:00 geospeck joined
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
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:04 geospeck left 21:11 diakopter joined
buggable New CPAN upload: Config-1.3.1.tar.gz by TYIL cpan.metacpan.org/authors/id/T/TY/...3.1.tar.gz 21:13
21:14 sftp left, sftp joined 21:18 itaipu left, geospeck joined 21:21 cdg joined 21:25 lizmat joined 21:29 perlpilot left 21:33 robertle left
ctilmes Test::When uses ONLINE_TESTING instead of NETWORK_TESTING 21:39
21:45 cdg left 21:46 espadrine joined 21:47 geospeck left 21:48 geospeck joined 21:49 Brumbazz left 21:51 mson joined 21:52 geospeck left 22:03 markmont left
comborico1611 New p6 alias idea: 6lerp (pronounced slurp). 22:06
Geth doc: 00e1a3abe7 | (Will "Coke" Coleda)++ | EXAMPLES.md
formatting fix
22:07
comborico1611 Huh, huh?
++Zoffix, 6lerp?
22:08 Cabanossi left 22:10 thunktone left 22:11 Cabanossi joined 22:13 zakharyas left 22:15 mcmillhj left 22:19 mcmillhj joined 22:21 ctilmes left 22:23 mcmillhj left 22:24 ryn1x_ left 22:25 cdg joined 22:32 AndChat|688961 joined, troys_ is now known as troys, comborico1611 left 22:35 mcmillhj joined 22:38 setty1 left 22:40 mcmillhj left, Cabanossi left 22:41 Cabanossi joined
buggable New CPAN upload: Config-1.3.2.tar.gz by TYIL cpan.metacpan.org/authors/id/T/TY/...3.2.tar.gz 22:43
22:44 jaush joined 22:51 mcmillhj joined 22:55 kitsunenokenja joined 22:56 mcmillhj left 23:01 _28_ria joined 23:03 char_var[buffer] joined 23:07 mcmillhj joined 23:08 Cabanossi left 23:11 Cabanossi joined 23:13 mcmillhj left 23:16 kitsunenokenja left 23:17 markmont joined 23:21 itaylor57 left 23:23 mcmillhj joined 23:28 mcmillhj left 23:33 Herby_ joined
Herby_ o/ 23:33
23:34 itaylor57 joined, troys is now known as troys_
timotimo m: sub wiggle($a) { $a.uc }; my @data = { foo => a }, { foo => b }, { foo => c }; for @data { .<foo> .= &wiggle }; say @data 23:34
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routines:
a used at line 1
b used at line 1
c used at line 1
timotimo m: sub wiggle($a) { $a.uc }; my @data = { foo => "a" }, { foo => "b" }, { foo => "c" }; for @data { .<foo> .= &wiggle }; say @data 23:35
camelia [{foo => A} {foo => B} {foo => C}]
timotimo i like this.
23:35 troys_ is now known as troys
timotimo o/ Herby_ 23:35
23:36 espadrine left 23:38 Cabanossi left 23:39 lizmat left, mcmillhj joined 23:41 Cabanossi joined 23:44 mcmillhj left, kitsunenokenja joined 23:46 pmurias left 23:49 Herby_ left 23:55 mcmillhj joined