»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_log/perl6 | UTF-8 is our friend! 🦋
Set by Zoffix on 25 July 2018.
Xliff Why is Data::Dump::Tree giving me a "..." in my output? 00:03
00:04 Kaiepi left
timotimo a lazy Seq maybe? 00:04
Xliff Yeah. That was it.
00:04 Kaiepi joined, aborazmeh joined, aborazmeh left, aborazmeh joined 00:06 HoboWithAShotgun left
irced can i define a character class from a list (of characters) ? 00:15
List 00:16
AlexDaniel irced: github.com/perl6/problem-solving/issues/97 00:17
m: my @letters = <a b c d e>; say ‘bah’ ~~ /@letters/ # 「b」 # workaround
evalable6 「b」
irced AlexDaniel: thanks for confirming that works! have to relook at my code to see where i went wrong 00:18
m: use lib 'data/all-modules/github/tadzik/Terminal-ANSIColor/';use Terminal::ANSIColor;my %colortable = a =>"red",d =>"yellow",q =>"magenta",r=>"green";my $toformat="Given a ∈ ℤ and d ∈ ℤ+, there are unique integers q and r, with 0 ≤ r < d, st a = d * q + r"; print $toformat ~~ s:g/ <wb>(<[adqr]>)<wb> /{ colored("$0", %colortable{$0}) }/; 00:21
evalable6 a d q r r d a d q r
irced m: use lib 'data/all-modules/github/tadzik/Terminal-ANSIColor/';use Terminal::ANSIColor;my %colortable = a =>"red",d =>"yellow",q =>"magenta",r=>"green";my $toformat="Given a ∈ ℤ and d ∈ ℤ+, there are unique integers q and r, with 0 ≤ r < d, st a = d * q + r"; my $letters=<a d q r>; $toformat ~~ s:g/ <wb>(@letters)<wb> /{ colored("$0", %colortable{$0}) }/; print $toformat; 00:22
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/XqK3T4EXCw
Variabl…
irced, Full output: gist.github.com/eecafae9332333ecb5...23611ba445
irced m: use lib 'data/all-modules/github/tadzik/Terminal-ANSIColor/';use Terminal::ANSIColor;my %colortable = a =>"red",d =>"yellow",q =>"magenta",r=>"green";my $toformat="Given a ∈ ℤ and d ∈ ℤ+, there are unique integers q and r, with 0 ≤ r < d, st a = d * q + r"; my $letters=<a d q r>; $toformat ~~ s:g/ <wb>(<[adqr]>)<wb> /{ colored("$0", %colortable{$0}) }/; print $toformat;
evalable6 Given 04a ∈ ℤ and 08d ∈ ℤ+, there are unique integers 06q and 03r, with 0 ≤ 03r < 08d, st 04a = 08d * 06q + 03r
irced m: use lib 'data/all-modules/github/tadzik/Terminal-ANSIColor/';use Terminal::ANSIColor;my %colortable = a =>"red",d =>"yellow",q =>"magenta",r=>"green";my $toformat="Given a ∈ ℤ and d ∈ ℤ+, there are unique integers q and r, with 0 ≤ r < d, st a = d * q + r"; my @letters=<a d q r>; $toformat ~~ s:g/ <wb>(@letters)<wb> /{ colored("$0", %colortable{$0}) }/; print $toformat; 00:23
evalable6 Given 04a ∈ ℤ and 08d ∈ ℤ+, there are unique integers 06q and 03r, with 0 ≤ 03r < 08d, st 04a = 08d * 06q + 03r
irced m: use lib 'data/all-modules/github/tadzik/Terminal-ANSIColor/';use Terminal::ANSIColor;my %colortable = a =>"red",d =>"yellow",q =>"magenta",r=>"green";my $toformat="Given a ∈ ℤ and d ∈ ℤ+, there are unique integers q and r, with 0 ≤ r < d, st a = d * q + r"; my @letters=@%colortable.keys; $toformat ~~ s:g/ <wb>(@letters)<wb> /{ colored("$0", %colortable{$0}) }/; print $toformat;
evalable6 (exit code 1) Type check failed in binding to parameter '$how'; expected Str but got Any (…
irced, Full output: gist.github.com/eaec682f2d6b6c5a2f...65d3a6fbf9
irced m: use lib 'data/all-modules/github/tadzik/Terminal-ANSIColor/';use Terminal::ANSIColor;my %colortable = a =>"red",d =>"yellow",q =>"magenta",r=>"green";my $toformat="Given a ∈ ℤ and d ∈ ℤ+, there are unique integers q and r, with 0 ≤ r < d, st a = d * q + r"; my @letters=%colortable.keys.list; $toformat ~~ s:g/ <wb>(@letters)<wb> /{ colored("$0", %colortable{$0}) }/; print $toformat;
evalable6 Given 04a ∈ ℤ and 08d ∈ ℤ+, there are unique integers 06q and 03r, with 0 ≤ 03r < 08d, st 04a = 08d * 06q + 03r
00:26 __jrjsmrtn__ left 00:30 __jrjsmrtn__ joined 01:09 [Coke] left 01:14 [Coke] joined
irced so i have a map my %colortable = a => "red", d => "yellow", "divisor" => %colortable{<d>} <-- this does not work, can keys refer to other keys in the same map? 01:23
maybe postprocessing... 01:24
yeah, postprocessing was the strategy 01:26
irced thanks the bots for their unremitting attention and stares. Okay, maybe not the stares.
01:38 vike left 01:43 molaf left
Elronnd irced: I tried your solution; unfortunately, it doesn't work 01:45
tellable6 2019-09-11T23:43:06Z #perl6 <irced> Elronnd glad i was able to help, i know what you're thinking tho, what the heap!
Elronnd I'm able to create and modify the union, but the struct layout doesn't match the c side
01:45 vike joined
irced Elronnd: hmm 01:45
Elronnd you can tell by checking the type--p6 makes a struct with size 40, c side is only 16 bytes
*by checking the size 01:46
irced share the code here on one of the paste sites?
Elronnd ix.io/1USe here 01:47
wait--hmmm. I found one problem--my P6Data was repr('CStruct") instead of CUnion 01:50
irced hmm
then your union had better add up! 01:51
Elronnd still doesn't seem to work, though 01:52
irced well, binding the other struct variables (union will be a different beast to deal with) 01:53
try binding the other struct variables
that does not look setup to be a union anyway, i expect unions to be decomposed as subunits of the highest allocation 01:54
anyway, try binding the others like, $!bool := Bool.new; 01:55
again, working with the struct
01:55 molaf joined
Elronnd what do you mean? Why would that not be set up as a union? 01:56
where do I say $!bool := Bool.new?
irced maybe it can be but it's a confusing union
Elronnd why? That's a pretty standard setup
problem is, no data is getting back. Not even $.type
irced sees if i can write some code to test. 01:57
Elronnd I can send you my WIP code if it's helpful
01:59 Actualeyes left
irced let's start with type 02:00
Elronnd now for some reason it's trying to put a poiner in $.type
irced since that probable needs to be private
Elronnd whyyyy 02:04
is it putting a pointer there
it makes no sense
irced i'm looking at the docs
i'm new to nativecall so roll with it 😀 02:05
Elronnd files.catbox.moe/kbpyx4.tar here's my WIP code if you want to take a look
irced so let's see if we can't both learn something about nativecall 02:07
Elronnd let's do it!
irced you say no data is getting back
Elronnd well no 02:08
right now if I set $.type on the perl6 side and I declare it as uint64_t* -- a pointer -- on the c side, then I can deref it from c and get back a value
irced so dealing with type 02:11
explain what you mean when you say no data is getting back not even $.type wrt type 02:12
Elronnd I'm not sure :P
irced what happened wrt to $.type 02:13
Elronnd 3type0 was just 0 on the c side
then it magically started pointing to something. I'm not sure what made that happen
irced but everything as expected on the p6 side? 02:14
Elronnd yes
irced ok, i untarred your work and compiled 02:16
Elronnd ahh-tf? 02:17
it looks like it's stuffing a pointer into the union part too. But unclear what it points to
irced i'll probably have to be afk in about 10 minutes for half an hour fyi, looking at the code now
Elronnd aight, see ya! 02:18
irced maybe 10 minutes will get us somewhere
irced inspects the code
Elronnd oh, misread--I thought you said you were leaving (now) *for* 10 minutes-half an hour
irced i noticed if I assign to type in TWEAK that the value is seen on the c side, just an observation 02:25
for some reason it crashes unless i use a private variable, but maybe i am doing something wrong, since you said itmakes not sense 02:27
anyway, i can say that assignment from TWEAK to a private $!type finds its way to the c side
this will help us narrow where the "bug" may be hiding
Elronnd hmm? 02:28
irced hmm?
Elronnd for me, assigning to $!type still makes a pointe ron the c side
irced from within TWEAK
Elronnd yes
irced i gotta go for now, maybe i can quickly post my code adjustment 02:29
Elronnd please do!
irced f.perl.bot/p/tdxx7o 02:30
that's all, it prints 24 on the c side
gotta run be back in half
irced is afk
Elronnd see ya!
02:35 AlexDani` joined 02:39 AlexDaniel left
Elronnd irced: p6 is still sending me a pointer with your code. I do not understand 02:41
I will update my perl6 version. Maybe it has a but
*bug
02:45 aborazmeh left, AlexDani` is now known as AlexDaniel, AlexDaniel left, AlexDaniel joined
Elronnd irced: ah, in the tarball I sent you type was already declared as uint64_t*. Maybe you forgot to remove the pointer before testing? 02:57
irced back, sort of. why remove the pointer? 03:00
returned type 24 val 0.000000
Elronnd because I don't want it to be a pointer, I want it to be a value
irced printf("returned type %ld val %lf\n", *v.type, v.num); 03:01
Elronnd want it to be v.type, not *v.type
irced k
Elronnd kind of a pointless indirection, no?
irced yeah, unless that sort of thing is necessary in nativecall, anyway, let's see 03:02
Elronnd it shouldn't be 03:03
hmm, what if I make $.type a Pointer? 03:04
nope, segfault 03:06
irced anyway, i wasn't able to get a value in the first place until i tweaked
and tweak i believe only applies to private variables
Elronnd hmmm 03:07
irced i'm not saying it needs to be private 03:08
but there's a discrepancy
03:08 AlexDaniel left
Elronnd well...making a pointer and stuffing an integer into it doesn't help. It makes a pointer to the 'pointer' 03:10
I give up. Nativecall is stupid 03:12
irced really?
irced checks the docs.
Elronnd I really don't understand why it keeps making everything into a pointer 03:13
my only guess is that all the methods are somehow keeping the repr('CStruct') from doing its job
irced eyes the Notes on memory management 03:14
have you reviewed that section of the docs? 03:15
Elronnd yeah 03:16
I also note that it says 'int32_t an_int32;'. No pointer
irced right
but the "memory management" is not limited i think to the pointer
i think 03:17
i think that section is instructive. 03:18
Elronnd ah
irced in that a function explicitly makes the assignments in the c code, <looking again at your c code to see if that's the case> 03:19
Elronnd yes 03:20
I was about to say, I don't want to make the helper script depend on any c objects, so the library can be statically linked
but then I remembered, why not pass in the assignment functions from the parent like I do with set-evaluator?
and I'll need something on the c side to construct objects *anyway*, so the c clients can do it 03:21
irced i suggest writing an init_struct declaration (p6, c) and definition (c) and calling it p6 side from BUILD
Elronnd yes
irced ok, so we're thinking the same thing
03:39 Xliff left
Elronnd irced: I think I have another nativecall bug 03:55
irced Elronnd: oh, what's happening?
Elronnd The struct is getting corrupted somehow 03:56
I suspect because it's larger than a word
I tried single-stepping through the asm, but I can't find where it all goes wrong. Assembly code for p6's gc is inscrutable to me 03:57
irced Elronnd: well, perhaps there's more you can do on the c side 03:58
Elronnd I could have the c side take a pointer
or return one
irced well, i mean to confirm the cause anyway 03:59
Elronnd well 04:00
I know there's a corruption somewhere
I know perl6 is stashing a pointer in that type variable
the question is what to do about it
actually 04:01
irced i'm still unpiecing your code
😀 04:02
Elronnd I think I *do* want to pass around pointers to P6Vals anyway, to reduce calling overhead and promot compartmentalization
great
irced continues unpiecing, wondering if Elronnd will have a change of mind.
Elronnd and if it's all compartmentalized anyway, I can use null to represent any/nil 04:04
which is probably obviously the wrong thing, but I'm gonna do it anyway
yay!
cleanup time
irced continues to work a little longer on the original issue.
Elronnd next on the agenda: modules, functions, arrays 04:05
oh, and errors 04:08
irced: is there anything in particular in the code that's unclear? I Will Comment It 04:11
irced Elronnd: still wrapping my mind around it
since nativecall is still greek to me. someday i think i should know why it's not working tho without a pointer 04:15
irced is eyeing set-evaluator 04:16
04:19 brian1729 left
irced anyway, following the docs instructions i referred to needs libsimple-struct.so 04:19
which could not be located as per my end
irced considers adding it to the makefile 04:20
04:20 brian1729 joined
Elronnd where does libsimple-struct.so come from? And what does it do? 04:20
I can't find anything on it 04:21
irced sub init_struct(AStringAndAnInt is rw, Str, int32) is native('simple-struct') { * }
hhmmm
Elronnd oh, no 04:22
irced not in my directory tree
Elronnd that's the init_struct() function they show right there
they're expecting you to compile that function into libsimple-struct.so to run the example
irced ok
toldya i didn't know nativecall from Adam
anyway, did you try initializing the struct via BUILD already? (even tho you have moved on, just wondering) 04:23
Elronnd Heh, I don't know nativecall really either
you mean like setting the values like $!whatever = whatever from there?
I trie dthat. It really looks like all accesses try to go through a pointer indirectiona nd I don't know why 04:24
irced ok. it was worth a shot
maybe i'll try on my end again
Elronnd the thing is, I'm like 99% sure I've done actual array access before. And I have no idea how
irced Elronnd: so how did you define sub init_struct ? i tried native('port') and defined init_struct in .h .c of port 04:29
Elronnd irced: sorry for delay, I had a thing to do 04:36
also one sec, I have a new version which makes that clearer 04:37
irced Elronnd: cool
Elronnd: no problem
Elronnd irced: ok, git pull now and check it out 04:38
irced ok, in a moment thanks 😀
Elronnd the gist is: there is no init_struct() file, but there are analogous functions p6_make_int, p6_make_str, etc. 04:39
those *aren't* imported from libport.so
but instead they're passed as command-line arguments like you can see around line 90 of port.so
(sprintf gobble-di-gook is because they have to be strings)
then, near the top of support.p6, all those pointers are pulled out of the command-line arguments and made back into function pointers 04:40
set-evaluator/set_evaluator works in a similar way, although it's declared at the bottom of support 04:41
04:42 epony left 04:46 HoboWithAShotgun joined, sena_kun joined
irced ok, looking good, thanks for discussing native call etc with me. hope i can contribute more in the near future! 04:53
Elronnd gl! 04:59
irced and for every1 lurking, this project aims to create a c-interface to the perl6 routines. github.com/Elronnd/libport
that sums it up, right Elronnd?
Elronnd yep!
irced k
Elronnd it's for my game engine
05:00 irced left 05:03 molaf left 05:12 robertle left 05:34 sena_kun left 05:45 kurahaupo left 05:59 kurahaupo joined 06:01 jmerelo joined 06:09 sauvin joined 06:17 jmerelo left 06:19 domidumont joined 06:36 HoboWithAShotgun left 07:10 ravenousmoose left 07:11 pecastro joined 07:12 robertle joined 07:13 wamba joined 07:14 ChoHag left 07:23 ravenousmoose joined 07:31 leont joined 07:38 leont left, brian1729 left, brian1729 joined 07:42 dakkar joined 07:48 khisanth_ left 07:55 zakharyas joined 07:57 reach_satori_ left 08:02 khisanth_ joined 08:07 xinming joined 08:10 xinming_ left 08:14 dolmen joined 08:15 sena_kun joined 08:36 reach_satori_ joined 08:37 rindolf joined 08:39 kurahaupo left 08:45 kurahaupo joined 08:58 daxim left 09:00 epony joined 09:04 daxim joined 09:18 pmurias joined 09:19 pat_js joined 09:28 reach_satori_ left 09:33 reach_satori joined, ravenous_ joined 09:37 ravenous_ left 09:40 dakkar left, cpan-p6 left
holyghost I have learned some more noise estimates, it seems I can use my statistical chaos theory in my cell system by using the noise as an attractor 09:40
09:41 dakkar joined, cpan-p6 joined, cpan-p6 left, cpan-p6 joined
holyghost A dirac delta function can be used in there and as Fermi-Dirac statistics e.g. the attractor of the elementary particle 09:41
Thus the elementary particles such as fermions in the cell system can be alleviated up or down with the statistical chaos theory 09:44
My cell system will have molecular orbital (sigma, pi, delta) functionality above the quark level so with e.g. a photo-electric effect on them 09:45
Again, photons, ions and so on as a minimum, not that photons get targetted on the ions (AFAIK here) and are affected by the prinnciple of Heisenberg 09:46
*note
Herein lie attractors 09:47
09:48 roguelazer left, roguelazer joined
holyghost I have to comprehend stochastical dynamic systems for the chaos theory of e.g. the ATP molecule in the cell system then the molecular quantum mechanics for the some of the rest 09:51
09:52 pat_js left 09:53 profan joined 09:58 pat_js joined, pilne left 09:59 Black_Ribbon left 10:01 reach_satori_ joined 10:03 reach_satori left 10:04 reach_satori_ left 10:05 reach_satori_ joined
holyghost Problem is I will probably need a partial differential computational modeling package :-) 10:05
10:06 reach_satori_ left
holyghost Which I will probably put in a separate directory of the cell system 10:07
and is rather hard as I have to read up on the numerical analysis for it
10:07 reach_satori_ joined
holyghost It is needed for example in the emmission of QED (Quantum Electro Dynamics) 10:08
Hence the molecular quantum mechanics for the cell system 10:09
I won't go down to Quark level as it is somewhat cumbersome
The orbitals on the molecules are more interesting but the photon in QED will be hard 10:10
10:10 HoboWithAShotgun joined
holyghost I need to read several books to continue 10:16
10:17 reach_satori_ left 10:18 reach_satori_ joined 10:19 wamba left 10:32 reach_satori_ left 10:33 reach_satori_ joined 10:37 reach_satori_ left 10:38 reach_satori_ joined 10:41 ravenousmoose left 10:49 reach_satori_ left 10:51 reach_satori_ joined 10:52 reach_satori_ left 10:54 reach_satori joined 10:55 [particle]1 joined 10:56 [particle] left 10:58 pat_js left 11:01 dolmen left 11:08 reach_satori_ joined 11:09 reach_satori_ left 11:11 reach_satori left, reach_satori_ joined 11:13 reach_satori_ left 11:15 reach_satori joined 11:17 reach_satori left 11:18 reach_satori joined 11:19 reach_satori left, reach_satori joined 11:20 pmurias left 11:22 reach_satori left 11:23 reach_satori joined 11:29 zakharyas left 11:31 wamba joined, reach_satori left 11:44 daemon joined 12:03 reach_satori joined 12:07 dolmen joined, reach_satori left 12:14 dolmen left 12:15 dolmen joined 12:20 gabiruh_ joined
guifa I’m having to write some JS code after quite some time and …. dang I’m spoiled in P6 … so. many. parantheses. It feels like i’m back in lisp land practically lol 12:24
12:24 gabiruh left
sena_kun m: to-json({ one => 1|2|3 }).say; 12:25
evalable6 {
"one": 123
}
Saw 1 occurrence of deprecated code.
====================================…
sena_kun, Full output: gist.github.com/b05d1cd786927675df...a39fb39539
sena_kun I don't like what I am seeing, on the other hand I am not sure what the semantic should be in this case
timotimo, ^? I wonder if you thought about to-json for junctions 12:26
timotimo json doesn't support junctions :)
sena_kun well, JSON::Fast "supports" them by generating invalid json 12:27
tadzik :D
guifa I guess the problem is there’s no way to easily grab the contents of a junction, right?
sena_kun I know there is no "correct" path, of course
guifa Although an error / warning might be a good idea with to-json(Junction \j) 12:28
sena_kun ...with a flag to just to skip it instead of erroring... 12:29
timotimo you're right, it's not good that you can have to-json generate invalid json with a junction 12:31
tadzik it should generate a Junction of JSONs, obviously
/s ;)
timotimo <bison>of course!</bison> 12:32
sena_kun timotimo, I am now doing some local patching, if a PR with a flag would be desireable, can do 12:33
timotimo flag as in named argument?
sena_kun yeah
timotimo what options would you offer?
sena_kun :$skip-junctions 12:34
we can also error, but that'd be a more breaking change
OTOH it is hard to imagine someone relies this feature
lizmat feels to me it should just throw on a Junction 12:35
as timotimo said: JSON doesn't support junctions
guifa ^^ It’s not different than calling to-json on an object type that doesn’t support JSON. We error in that case. It’s just that Junctions slip through unless specifically called out. I’d call it more of a bug fix than a breaking change 12:36
12:37 dolmen_ joined 12:38 dolmen left
timotimo right 12:41
12:45 reportable6 left 12:48 ravenousmoose joined 12:50 reportable6 joined, ChanServ sets mode: +v reportable6
Voldenet I think by default json should just not serialize things that make no sense in that context 12:50
m: to-json({ one => -> {} }).say 12:51
evalable6 {
"one": {
"0": "null"
}
}
Saw 1 occurrence of deprecated code.
==================…
Voldenet, Full output: gist.github.com/729edbb09d9f71bece...006d5b64d9
Voldenet that's quite surprising output
timotimo Don't know how to jsonify Block 12:56
that's how JSON::Fast does that example
Voldenet JSON::Pretty/Json::Tiny just error in that case 12:57
13:01 aborazmeh joined, aborazmeh left, aborazmeh joined 13:06 dolmen_ left 13:16 aborazmeh left 13:17 number6` left 13:26 pat_js joined 13:30 pmurias joined 13:33 zakharyas joined 13:35 wamba left 13:44 HoboWithAShotgun left 13:47 ravenousmoose left 13:56 HoboWithAShotgun joined 14:02 cpan-p6 left 14:12 cpan-p6 joined, cpan-p6 left, cpan-p6 joined 14:15 aborazmeh joined, aborazmeh left, aborazmeh joined 14:18 aborazmeh left, HoboWithAShotgun left, HoboWithAShotgun joined
[Coke] m: say (1,1,*+*...*)[^100].map: {.log10.Int} 14:25
evalable6 (0 0 0 0 0 0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 4 4 4 4 4 5 5 5 5 5 6 6 6 6 6 7 7 7 7 8 8 8 8 8 9…
[Coke], Full output: gist.github.com/7dba739a7f46c401af...a4672d674d
14:26 dolmen_ joined 14:27 camelCaser left 14:30 pmurias left 14:36 camelCaser joined
[Coke] wonder if there is an idiomatic way of turning that into an a list of counts of each number. 14:40
moritz (idealerweise nicht matlab/mathematica :D) 14:41
sorry, wrong channel
[Coke]: Bag? 14:42
m: say (1,1,*+*...*)[^100].map: {.log10.Int}
evalable6 (0 0 0 0 0 0 1 1 1 1 1 2 2 2 2 2 3 3 3 3 4 4 4 4 4 5 5 5 5 5 6 6 6 6 6 7 7 7 7 8 8 8 8 8 9…
moritz, Full output: gist.github.com/6fb2b8ce204a85071a...41a97ea67f
moritz m: say bag((1,1,*+*...*)[^100].map: {.log10.Int})
evalable6 Bag(0(6), 1(5), 10(5), 11(5), 12(4), 13(5), 14(5), 15(5), 16(5), 17(4), 18(5), 19(5), 2(5), 20(3), 3(4), 4(5), 5(5), 6(5), 7(4), 8(5), 9(5))
[Coke] m: say ((1,1,*+*...*)[^100].map: {.log10.Int}).Bag.kv.rotor(2).sort(*[0]).map(*[1]) 14:45
evalable6 (6 5 5 4 5 5 5 4 5 5 5 5 4 5 5 5 5 4 5 5 3)
[Coke] m: say ((1,1,*+*...*)[^1000].map: {.log10.Int}).Bag.kv.rotor(2).sort(*[0]).map(*[1]) 14:46
evalable6 (6 5 5 4 5 5 5 4 5 5 5 5 4 5 5 5 5 4 5 5 5 4 5 5 5 5 4 5 5 5 5 4 5 5 5 4 5 5 5 5 4 5 5 5 4 5 5 5 5 4 5 5 5 5 4 5 5 5 4 5 5 5 5 4 5 5 5 5 4 5 5 5 4 5 5 5 5 4 5 5 5 5 4 5 5 5 4 5 5 5 5 4 5 5 5 5 4 5 5 5 ...)
[Coke] m: say ((1,1,*+*...*)[^1000].map: {.log10.Int}).Bag.kv.rotor(2).sort(*[0]).map(*[1]).grep(* != 4|5) 14:47
evalable6 (6)
[Coke] m: say ((1,1,*+*...*)[^100000].map: {.log10.Int}).Bag.kv.rotor(2).sort(*[0]).map(*[1]).grep(* != 4|5) 14:48
evalable6 (signal SIGHUP) «timed out after 10 seconds»
14:49 marcusal1987 joined
[Coke] (also, wonder if .chars is faster for what I want. 14:49
14:54 aborazmeh joined, aborazmeh left, aborazmeh joined, aborazmeh left 14:55 aborazmeh joined, aborazmeh left, aborazmeh joined 15:04 Actualeyes joined 15:11 domidumont left 15:13 ChoHag joined
lizmat twitter.com/andrewshitov/status/11...3973237760 :-( 15:25
15:25 jmerelo joined
timotimo :( 15:26
lizmat also: www.facebook.com/groups/perl6/perm...820948496/ 15:27
tellable6 lizmat, I'll pass your message to also
15:27 daxim left
[Coke] Eh. the situation is a mess, we all knew that at some point in the last 20 years. 15:27
15:27 daxim joined, Actualeyes left
[Coke] Thank you for trying to move things along. 15:29
15:29 tmtvl joined
lizmat tellable6: please remove "also:" 15:29
tellable6 lizmat, I haven't seen please around, did you mean plutes?
timotimo haha
tmtvl m: say Date.today(formatter => { sprintf "%d%d%d", .month, .day, .year }).later(:day); 15:30
evalable6 9132019
tmtvl Hm, odd, maybe my local install is outdated...
timotimo yeah, that was fixed not too long ago
lizmat what timotimo said
timotimo that was also fixed not too long ago
15:31 aborazmeh left 15:32 antoniogamiz joined
tadzik hm, perhaps only Larry can rename Perl, but anyone can make a Perl fork and call it something else... 15:32
jmerelo lizmat: agree with [Coke]. We need to get out of this.
Geth doc: antoniogamiz self-assigned Cursor is deprecated and should be deleted github.com/perl6/doc/issues/3022
5d47a7b8b6 | Antonio++ | 3 files

  * Delete its pod6 document
  * Delete its entry from type-graph
  * Add a short reference (with a deprecated message) to Match documentation.
15:34
jmerelo The perl6 GitHub organization has just been admitted into the Github Actions beta 15:36
El_Che jmerelo: just in time for the rename
El_Che ducks
jmerelo I means that we can create "actions" or "hooks" for stuff using GitHub infrastructure itself.
That also means that some stuff that we've done using Travis can now be done, faster, using GitHub. We can even run both in parallel. 15:37
El_Che faster?
jmerelo [Coke]: for instance, we could run some author tests on the documentation automatically.
El_Che: yep, less latency and also the thing is we're a bunch of bikeshedding geeks right now there. It'll probably change when it gets out of beta and the crowds move in. 15:38
El_Che I have been pretty happy with travis so far, I am curious what github will bring to the table 15:40
(besides hurting travis business model) 15:41
El_Che jmerelo: does it support containers?
antoniogamiz El_Che: yep => help.github.com/en/articles/creati...ner-action 15:42
jmerelo El_Che: it does, also native node actions and the GitHub API. I don't think it will hurt anything else, you're probably a-OK if you don't use the GitHub API. If you do, however, it's probably the best option.
[Coke] The author tests need to be run automatically somewhere, yes. 15:43
El_Che anyway, multi providers test are a nice to have
jmerelo [Coke]: there are two options. Neither of them is easy. One is to create a Docker container we can use as an Action (which is probably easy, but I have no experience so far) 15:44
[Coke]: The second is to reprogram some of them in JS. I'm thinking about spelling, for instance.
15:45 marcusal1987 left
[Coke] ... why rewrite in JS? 15:45
jmerelo [Coke]: maybe it's better if I install some sanity checks of the kind: check that this file is always present, things like that.
[Coke] My assumption is so that you run the tests in a browser? 15:46
jmerelo [Coke]: no, you use directly GitHub's infrastructure
El_Che jmerelo: node? 15:47
[Coke] I wouldn't convert xt/ tests to that if you're not converting t/ tests.
jmerelo El_Che: yep, you can only run node natively, any other language through containers. 15:48
[Coke]: if we prepare some Docker infrastructure, we could do both. Also, run them in parallel.
El_Che jmerelo: fair enough
jmerelo: does node has some sandboxing like wasm?
jmerelo El_Che: I don't think so. It's simply that's what installed in the virtual machine they have. Same as in Travis, only that one has Ruby by default. 15:49
El_Che sign o' times 15:50
jmerelo El_Che: It's probably easier for them to maintain just those two options, than throw in all a bunch of languages.
El_Che (it used to be Perl)
15:50 HoboWithAShotgun left
El_Che jmerelo: it certainly is, but they are no small startup anymore, so I reckon they have resources 15:50
jmerelo [Coke]: I guess we need to upgrade Perl 6 containers somehow. We need to get new ones for Travis, that's something I self-assigned some time ago. While I'm at it, I could also try and change that...
El_Che but if the config interface for containers is nice, it could even be tranaprent 15:51
even nices
r
jmerelo El_Che: right; I started with Travis because it was the only one that supported Perl...
El_Che: well, I like CircleCI's, which antoniogamiz started using and I got it from him. It's kind of transparent. But the problem with Github actions is that they're still in Beta, so documentation is not ideal. 15:52
Geth doc: 52945a511b | (JJ Merelo)++ | doc/Type/Match.pod6
Small correction and reindexing
15:53
synopsebot Link: doc.perl6.org/type/Match
Geth doc: 2abff48675 | Antonio++ | 2 files
Fix xt/type-graph.t test, close #3001

  * Telemetry module is needed to use telemetry related types
  * Types whitout 'mro' method support has been whitelisted
  * UInt was missing
  * X::Scheduler::CueInNaNSeconds mro fixed
15:56
timotimo lizmat: hey btw did you see the VMEvent stuff I recently started?
lizmat no, I haven't (really been tracking what's going on in the core) 15:57
timotimo you'll perhaps like it a lot! 15:58
you can subscribe to get notified when GCs happen, with some stats
gist.github.com/timo/c729d8899b482...7fc5229a21 - lizmat, usage examplep 16:01
lizmat cool 16:02
timotimo just need someone to implement Telemetry support for it :) :) :) :) :) :)
antoniogamiz jmerelo: do you know how to solve this error in shippable? 16:03
app.shippable.com/github/perl6/doc.../1/console
jmerelo antoniogamiz: doesn't look like it's anyone's fault. I'm restarting it 16:05
antoniogamiz it has failed a couple of times now
16:06 HoboWithAShotgun joined
jmerelo antoniogamiz: you broke Shippable! 16:07
antoniogamiz: :-) Not really. Some temporary network failure. I've just restarted it and it's running tests now.
16:08 aborazmeh joined, aborazmeh left, aborazmeh joined
antoniogamiz I break things without touching them... I have a great super powe 16:08
r
jmerelo antoniogamiz: :-) 16:09
lizmat timotimo: my head is deep in sprintf land atm, will look at it after it :-)
timotimo take all the time you need :)
16:18 brian1729 left, tmtvl left 16:33 robertle_ joined, leont joined 16:38 antoniogamiz left, molaf joined 16:39 dakkar left 16:42 molaf left 16:44 lucasb joined
Geth doc: 43554877b1 | (JJ Merelo)++ | doc/Type/Grammar.pod6
Changes Grammar to correct definition, refs #3022
16:47
synopsebot Link: doc.perl6.org/type/Grammar
16:49 leont left, leont joined 16:53 wamba joined, dolmen_ left 17:05 mowcat left 17:17 pat_js left 17:22 k-man left 17:25 k-man joined, dwarring joined 17:45 AlexDaniel joined, AlexDaniel left, AlexDaniel joined
timotimo anybody want to fix --stagestats showing errors over and over when a module that's being precomped multiple levels deep fails compilation? 17:46
currently it's re-outputted at every level going back up
17:46 zakharyas left
ingy I just updated github.com/acmeism/RosettaCodeData FYI 17:47
Last update was a year ago 17:49
1158 .pl6 files
timotimo how big is the .git folder (after packing with "git gc")?
17:51 aborazmeh left
tadzik heh, I think I've hit the limit of Perl6's type checking :D 17:52
or I'm just doing it wrong... 17:55
m: gist.github.com/tadzik/573f55b6814...b4b64f3230 17:56
evalable6 (exit code 1) Type check failed in binding to parameter '@things'; expected Positional[Num] but got Array ($[1, 5, 25])
in sub grep-somethings at sandbox/stuff.pl line 1
in block <unit> at sandbox/stuff.pl line 8
tadzik oh nevermind, that's not what broke in my actual code
m: gist.github.com/tadzik/573f55b6814...b4b64f3230 17:57
evalable6 (exit code 1) Type check failed for return value; expected Positional[Numeric] but got Seq ($((25,).Seq))
in sub grep-somethings at sandbox/stuff.pl line 4
in block <unit> at sandbox/stuff.pl line 8
tadzik yeah, that
am I just declaring it poorly?
timotimo well, you're returning a Seq, and i think the PositionalBindFailover doesn't happen in returning stuff
m: say Seq ~~ Positional 17:58
evalable6 False
timotimo Seq will not conform to Positional[Numeric] ever
tadzik hrm 17:59
making a .list out of it doesn't work either
m: say List ~~ Positional
evalable6 True
tadzik ah, perhaps it doesn't like when things are in scalar containers inside? 18:00
because now I get Type check failed for return value; expected Positional[Numeric] but got List ($(25,))
timotimo List doesn't conform to Positional[Numeric] unless you declare that list specifically to have that constraint on it
so you want to "return my Numeric @ = @foo.grep(...)
"
tadzik right
I was hoping that grep is clever enough to know that it's turning Positional[T] into another Positional[T] 18:01
or something like that
timotimo would be neat if it could
tadzik I'm apparently trying to write Rust in Perl 6 :P
Kaiepi oooh the new output when building rakudo looks really nice
timotimo what do you mean?
Kaiepi +++ Checking for moar NQP version 18:02
+++ Expanding gen/moar/main-version.nqp
+++ Generating gen/moar/perl6.nqp
etc.
timotimo oh, cool
haven't seen that yet
tadzik it now bites me all the time :/
Type check failed in binding to parameter '@words'; expected Positional[Array[NLP::Ashley::Parser::Word]] but got Array ($[NLP::Ashley::Parser...)
tadzik blows raspberry
timotimo hah
you're getting an `of` when you want an `is`
tadzik where would I put these? :) 18:03
timotimo is my guess
tadzik I wanted to say my Perl 6 is rusty but that just brings on more awful puns
timotimo well, you seem to have a "(Array[NLP::Ashley::Parser::Word] @foo)" in a signature somewhere
tadzik I do, yes
it seemed natural, but maybe it's wron g:) 18:04
timotimo that'll give you an array of arrays
if you don't want that, use $ as the sigil or drop one Array from the type constraint
tadzik ahh
ingy timotimo: ★ ~/src/RosettaCodeData master $ du -sh . 18:05
661M.
timotimo that includes the data on top of the .git, right? 18:06
ingy derp
Elronnd try du -sh *
[Coke] ingy: hio
ingy ★ ~/src/RosettaCodeData master $ du -sh .git
67M.git
hey [Coke] :)
timotimo not bad 18:07
i wonder if git will ever get an option to use zstd for its object packing
Elronnd how can I check if a function is variadic? 18:10
&foo.arity == &foo.count? That seems hacky 18:11
cpan-p6 New module released to CPAN! Compress::Zstd (0.0.3) by 03TIMOTIMO 18:13
Geth doc: deacf9456f | Coke++ | 2 files
learn new words
18:21
doc: 287ac6971e | Coke++ | doc/Language/regexes.pod6
fix typo
synopsebot Link: doc.perl6.org/language/regexes
doc: 848747eb9e | Coke++ | doc/Language/opener-chars.pod6
braces and brackets have very specific meanings in the docs
synopsebot Link: doc.perl6.org/language/opener-chars
timotimo Elronnd: you could introspect the signature itself, but that's more work, and i think comparing arity and count should be fine 18:24
though tbh a signature like (*@foo [$a, $b]) isn't actually variadic
even though it'd have arity 0 and count Inf i think?
Elronnd I'm not actually all that worried about some false positives
I just want to make sure nothing gets detected as being not variadic is secretly variadic 18:25
so that's fine
so--ok
18:29 Xliff joined
Geth doc: 952c33b6c5 | Coke++ | doc/Language/glossary.pod6
pass links test.

  * change what was being linked in one
  * reformat for picky test in another
18:29
synopsebot Link: doc.perl6.org/language/glossary
18:29 sauvin left
Xliff m: class A {}; A.^can('all').say 18:29
evalable6 (Method+{is-nodal}.new)
Xliff m: Mu.^can('all').say
evalable6 ()
Xliff m: Class.^can('all').say
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/934lgmXFxr
Undeclared name:
Class used at line 1
Xliff Where is .all coming from?
m: Class.^can('all').say 18:30
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/egTomJgDUy
Undeclared name:
Class used at line 1
Xliff m: class A {}; A.^can('all').say
evalable6 (Method+{is-nodal}.new)
Xliff ^^
timotimo any-iterable-methods maybe?
m: class A {}; A.^can('all').file.say
Xliff How is that punned into a blank class?
evalable6 (exit code 1) No such method 'file' for invocant of type 'List'
in block <unit> at /tmp/_sruGfAEDT line 1
timotimo m: class A {}; A.^can('all')[0].file.say
evalable6 SETTING::src/core.c/Any.pm6
timotimo m: class A {}; A.^can('all')[0].line.say
evalable6 400
timotimo there you go
Xliff LOL! :)
timotimo all classes derive from Any
(by default) 18:31
Xliff m: Any.^can('all').say
evalable6 (Method+{is-nodal}.new)
Xliff m: class A {}; A.^can('all', :local).say
evalable6 (exit code 1) Unexpected named argument 'local' passed
in block <unit> at /tmp/RWtUBm_2K9 line 1
Xliff m: class A {}; A.^can('all').file 18:33
evalable6 (exit code 1) No such method 'file' for invocant of type 'List'
in block <unit> at /tmp/OHgs5bWBcj line 1
Xliff m: class A {}; A.^can('all')[0].file
evalable6
Xliff timotimo: What's the best way to pull out methods that are defined internally by rakudo? 18:36
timotimo how do you mean "pull out"? 18:37
Xliff "exclude"
[Coke] Why? 18:38
Xliff XML::Actions
[Coke] (I mean: what problem are you trying to solve?)
Xliff I'm writing up an issue right now, so give me a moment.
[Coke] hokay
timotimo define your own .^find_method i guess
Xliff ( But seriously, with the MOP, this was bound to happen, so asking "Why?" is disengenous at best... :> ) 18:39
timotimo m: class Test { method ^find_method(|c) { die "oh no" with c.list.first(*.Str.contains("any")); callsame } }; Test.any();
evalable6 Use of uninitialized value of type Test in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
in method find_method at /tmp/IJK8v3VPjc line 1
timotimo m: class Test { method ^find_method(|c) { die "oh no" with c.list.first(*.Str.contains("any")); callsame } }; Test.new.any();
evalable6 Use of uninitialized value of type Test in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
in method find_method at /tmp/AoLdxiVfEG line 1
timotimo *shrug* 18:40
*continues writing blogpost*
18:45 wildtrees joined 18:50 krychu joined, jmerelo left
Xliff timotimo: Blogging? About what, praytell? 18:51
timotimo moarperf
Xliff Ah. 18:56
18:56 aborazmeh joined, aborazmeh left, aborazmeh joined 19:13 aborazmeh left
timotimo wakelift.de/p/3b104399-50d2-4792-b9...94e074e96/ - i would love proofreading and other feedback on the post 19:17
Xliff, you interested, maybe? :)
19:17 Sgeo left, krychu left 19:18 molaf joined 19:22 netrino joined
Xliff timotimo: Sure. Lemme commit. 19:27
Kaiepi wonder when i'll need to do my first progress report for the networking grant, should be soon 19:28
Xliff Reading. 19:29
19:31 natrys joined
Xliff timotimo++ 19:36
Nothing really reached out and said: "No soup for you!" 19:37
Now... I must brew
19:40 leont left
Elronnd if I have a list in a scalar ($-sigil), how can I iterate over it? 19:40
19:40 zakharyas joined
timotimo should be able to .map right? 19:40
m: my $foo = (1, 2, 3, 4); $foo.map({ say "foo $_" }) 19:41
evalable6 foo 1
foo 2
foo 3
foo 4
timotimo other than that, "for $foo.list { ... }"
Elronnd aight, thanks!
tobs m: my $list = $(1..10); .say for $list; .say for $list<> # or decont
evalable6 1..10
1
2
3
4
5
6
7
8
9
10
timotimo aye, decont is also good 19:42
tobs well, I guess this is not an itemized list, but it should behave the same way :)
doing mostly perl5 things for the last weeks
MasterDuke m: my $list = $(1..10); .say for $list; .say for @$list # or prepend '@' 19:46
evalable6 1..10
1
2
3
4
5
6
7
8
9
10
19:47 Kaiepi left
lizmat MasterDuke: that'd be a Range in $list, not a List 19:52
and tobs :-)
19:53 Kaiepi joined
MasterDuke ah right. but i think my example should still work 19:53
timotimo wakelift.de/2019/09/12/progressing...-progress/ - lul i blugged
19:53 Black_Ribbon joined 19:56 mensvaga left
MasterDuke m: my $list = $(1,2,4,6,8,10); .say for $list; .say for @$list, .say for $list<> 19:56
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/xZtoqHf2iV
Missing semicolon
at /tmp/xZtoqHf2iV:1
------> 03; .say for $list; .say for @$list, .say 08⏏04for $list<>
MasterDuke m: my $list = $(1,2,4,6,8,10); .say for $list; .say for @$list; .say for $list<> 19:57
evalable6 (1 2 4 6 8 10)
1
2
4
6
8
10
1
2
4
6
8
10
20:04 Kaiepi left, Kaiepi joined
El_Che urbantz 20:13
oops
timotimo another password burned ;) 20:14
El_Che no, it's a company where someone I know started working
timotimo urban timezones?
El_Che urbantz.com/en
it looks like a hipster startup :) 20:15
20:15 aborazmeh joined, aborazmeh left, aborazmeh joined 20:23 krychu joined
gdonald how can I require/use a class in a file that is not in my lib directory? this looked promising but didn't work: stackoverflow.com/questions/132626...1#13265111 20:25
moritz in general with -I$PATH, use lib 'path' or PERL6LIB env var 20:26
gdonald does `use lib` support multiple directories? 20:29
I mean, I tried and failed already but thought I'd ask. 20:30
Demos[m] does the nativecall cpp name mangling always do itanium mangling or can it also do MSVC mangling 20:33
20:34 zakharyas left 20:36 natrys left
Seance[m] Are you guys aware of any perl6 module that exists that can provide clipboard access along the lines of pyperclip? 20:37
[Coke] gdonald: call it more than once.
20:39 robertle_ left
timotimo github.com/rakudo/rakudo/blob/mast...SVC.pm6#L5 20:40
Demos[m]: ^- here's the MSVC mangling
gdonald [Coke]: thanks, got it working. I had been failing trying with commas and paths :( 20:42
20:45 sena_kun left 20:47 aborazmeh left
[Coke] yah, don't recall if there's a way to pass a list. 20:51
Xliff Seance[m]: For any desktop type? 20:55
Seance[m] Linux
Xliff gmp? GTK? KDE? 20:56
Demos[m] Oh awesome!
Xliff Seance[m]: What distribution are you running? If you are unsure, try "lsb_release -a"
Seance[m] Currently Ubuntu 18.04 20:57
But that's my work machine, so it's the distro I'd wanna target
Xliff Yes, but the problem is that it depends on the base desktop you are running.
Seance[m] should I just make a call to xsel from inside the script or something
Xliff The clipboard is not a unified thing. 20:58
Seance[m] Oh, I use Pantheon and openbox, depending on my mood
Xliff Re: xsel -- I think you could do that.
Seance[m]: Try 'my $clipboard = qqx{xsel -o}; say $clipboard' 20:59
That's assuming you want just text.
Seance[m] Yeah, I'd be planning to insert variable into a text template
i.e. Long response, sorry you're having issues on $this-platform Please review $relevant-reference-material 21:00
Xliff `xsel -o` will give you current contents.
Are you going to want to SET the clipboard or just retrieve? 21:01
Seance[m] I suppose to put in my own variables I'd need to set it 21:02
i.e. use case of
21:02 melezhik joined
Seance[m] scriptname.p6 hardware-issue relevant-info id-num 21:02
Xliff Seance[m]: Do you have some code showing what you are attempting?
Oh. Ah! So you want to set. 21:03
melezhik I have /usr/bin/env: ‘perl6’: No such file or directory error when try to run perl6 witing my mintty terminal
Seance[m] I'll try to mock something up in the next couple days
melezhik my os is mingw64_nt-10.0-17763
and I installed rakudo-star-2019.03-x86_64.msi for Windows 21:04
for some reasons git-bash does not see my Perl6
Xliff Seance[m]: my $p = Proc::Async.new("xsel -i", :w); $p.start; $p.say($new-contents); $p.close-stdin 21:05
You might want...
melezhik however "perl6.bat --version" works
Xliff Seance[m]: "my $p = Proc::Async.new("xsel -i", :w); $p.start; $p.write($new-contents); $p.close-stdin"; instead
melezhik ls /c/rakudo/bin/
Seance[m] <Xliff "Seance: "my $p = Proc::Async.new"> Cool, i need to read up on Proc::Async
melezhik libgcc_s_seh-1.dll* libmoar.dll.a libwinpthread-1.dll* moar.dll* moar.exe* nqp.bat nqp-m.bat perl6.bat perl6-debug-m.bat perl6-m.bat 21:06
any ideas?
I know this is strange setup Perl6+Windows+GitBash ... anyway (((=:
Seance[m] What are the implications of using that vs. say qx/shell command here/ 21:07
Xliff Seance[m]: You don't have control over STDIN that way.
qqx and qx are only useful if you only want the output.
Seance[m] that makes sense, thank you much
Xliff Seance[m]: And one more thing. 21:08
Seance[m]: Use this -- "my $p = Proc::Async.new(<xsel -i>, :w);" -- everything else stays the same.
21:11 dogbert17 left
Seance[m] why the carats 21:11
Xliff m: <a b c d>.say 21:12
evalable6 (a b c d)
Xliff Seance[m]: List constructor.
Grinnz chevrons*
Xliff Grinnz: Only if rotated appropriately. :) 21:13
Demos[m] is ℚ an alias for Rat? 21:21
Xliff whois Demos[m] 21:22
Whoops! ;)
21:22 mowcat joined
Demos[m] ahem 21:22
Xliff No. I was just curious as to the "[m]" behind your nick. I'm clued in, now. 21:24
tobs Demos[m]: no, but it can be if you want
Demos[m] yep! its because matrix, I like history, and my capitalist overlords (my employer's IT department) blocks IRC 21:26
21:26 AlexDaniel left, AlexDaniel joined 21:27 AlexDaniel left, AlexDaniel joined
tobs Demos[m]: Math::Sequences exports some of these blackboard symbols as aliases for custom number classes github.com/ajs/perl6-Math-Sequence...r.pm6#L130 21:28
21:39 khisanth_ left 21:43 leont joined, [particle] joined 21:44 [particle]1 left, pecastro left 21:47 Sgeo joined 21:48 irced joined 21:50 leont left
irced hi all, what would be the best way to define a custom Int? say I want an Int called dividend_t. I can assign a value to it with the assignment operator but additionally i can get more information from methods and (private) properties. so, something like, my dividend_t $a = -11; $a.divisor=3; $a.get_quotient(); $a.get_remainder(); or the like 21:50
21:51 khisanth_ joined
irced my first thought is maybe i can extend Int, but it didn't work for me. next i thought maybe there is a operator method for assignments that i could add to a class, but i don't know of anyway 21:51
21:52 Sgeo_ joined 21:53 cpage_ joined 21:54 Sgeo left, cpage left, cpage_ is now known as cpage 21:56 melezhik left
[Coke] you can AUGMENT Int, but that impacts everything, and you have to redo the MRO once you do it. subclass is probably the best way 21:58
irced ok, subclassing an Int didn't seem to work for me. how about this instead. i want a class that does a role and the role operates on variables from the class. now if i declare a private variable of the same name in both the role and the class, there is a conflict. if i refer to a variable in the class from the role, it is not recognized. 21:59
and thanks for your input, Coke.
[Coke] m: class MyInt is Int { method frob() { 5 } } ; my MyInt $a = 4; say $a.frob; say $a + 3;
evalable6 (exit code 1) Type check failed in assignment to $a; expected MyInt but got Int (4)
in block <unit> at /tmp/Kt39HpvDgi line 1
[Coke] m: class MyInt is Int { method frob() { 5 } } ; my MyInt $a = MyInt.new(4); say $a.frob; say $a + 3; 22:00
evalable6 5
7
irced observes.
Elronnd irced: design question for libport, how do you think type errors should be handled from the c side? E.G. if I try to append to an integer, or call a string?
irced Elronnd: thanks for asking, let me see if i can help 😀
Coke: thanks for that. 22:01
Elronnd: I am thinking about it. 22:03
m: role division_algorithm { has $.divisor; }; class dividend_t is Int does division_algorithm { }; 22:04
evalable6
irced m: role division_algorithm { has $.divisor; }; class dividend_t is Int does division_algorithm { }; my dividend_t $a; 22:05
evalable6
irced m: role division_algorithm { has $.divisor; }; class dividend_t is Int does division_algorithm { }; my dividend_t $a=5;
evalable6 (exit code 1) Type check failed in assignment to $a; expected dividend_t but got Int (5)
in block <unit> at /tmp/qvFQvpM_LV line 1
irced m: role division_algorithm { has $.divisor; }; class dividend_t is Int does division_algorithm { }; my dividend_t $a; $a=5;
evalable6 (exit code 1) Type check failed in assignment to $a; expected dividend_t but got Int (5)
in block <unit> at /tmp/5qY1o0_Em6 line 1
irced m: role division_algorithm { has $.divisor; }; class dividend_t is Int does division_algorithm { }; my $a=dividend_t.new(11);
evalable6
irced that should get me started 22:06
irced gives evalable6 a break.
Elronnd: you can go the traditional route via ernno defined in errno.h and set the constant EINVAL for invalid argument. does that answer your question? 22:15
Elronnd: though I can speak to ernno.h on non-linux 22:16
can't
ernno is globally imported from errno.h
Elronnd irced: errno is *shit*
irced laughs. 22:17
that's what every1 says
Elronnd yes
it's an indirection
it's vulnerable to race conditions
it's easy to ignore
irced well thread safe it is not 22:18
obviously
the main arguments against errno that i am aware of is that people don't implement it the way it was designed to be implemented 22:19
but anyway, let me think of anything else
Elronnd I mean, it could easily be TLS--why would I want to know about another thread's errors?
I do already have an error type, I could return that
would cover calling functions, but I don't think appending to arrays would return anything
Xliff gist.github.com/Xliff/74eac079c138...1b610507f1 22:20
Elronnd Xliff: cool 22:21
irced i'm thinking maybe signal.h and setjmp.h but i have only seen that used for signals that have not originated from within the execution 22:22
Elronnd sounds like exceptions 22:23
lemme see what s7 does
22:24 lucasb left
irced could be from within execution from raise(int sig) <signal.h> equivalent to kill(getpid(), sig); man raise 22:24
Elronnd s7 returns a dummy value (e.g.) and does nothing 22:25
irced you could raise(SIGILL) for illegal instruction (see man signal.h)
Elronnd I'm trying to decide if that's reasonable. Having to handle signals to do error handling seems like it complicates things to much for the caller
lizmat
.oO( that's sick )
22:26
Elronnd irced: I think raising an error that the parent can handle is wrong. If the parent is interested in doing error-checking around the callsite, then it is simpler for them to say if (!p6_is_sub(whatever)) { my_own_error_handling(); } 22:27
otherwise, can just abort()
irced well, signal and setjmp along with a handler as in void handler(int signum) to catch signal(SIGINT, handler) is one paradigm, not sure how to go about more complex error handling atm e.g. passing information to the handler besides int signum 22:30
SIGILL
Elronnd if the caller wants to do get information about what went wrong, they can do their own introspection 22:31
irced but the simpler solution is as you put forward, to pass an error variable to the called function and check on return 22:32
22:32 dolmen joined
irced assuming the caller is expected to be seen next (different programming paradigms ya know) 22:33
ok, afk for a bit
Elronnd see ya
22:35 dolmen left
Xliff How do you use an class that is defined in the same compunit? 22:36
m: class A { method a { do-a }; }; package AA { method do-a is export { say 'Hi, A!' }; }; A.a; 22:37
evalable6 (exit code 1) 04===SORRY!04===
Undeclared routine:
do-a used at line 1

Xliff, Full output: gist.github.com/11b8e12154edfb5d77...da69065726
Xliff m: package AA { method do-a is export { say 'Hi, A!' }; }; class A { method a { do-a }; }; A.a; 22:38
evalable6 (exit code 1) 04===SORRY!04===
Undeclared routine:
do-a used at line 1

Xliff, Full output: gist.github.com/b7527037be11132d63...dfcc73ef2d
Xliff m: package AA { our method do-a is export { say 'Hi, A!' }; }; class A { method a { do-a }; }; A.a; 22:40
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/Qazgl6YAsl
Undeclared routine:
do-a used at line 1
Xliff m: package AA { our sub do-a is export { say 'Hi, A!' }; }; class A { method a { do-a }; }; A.a;
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/gDBunV_vVy
Undeclared routine:
do-a used at line 1
Xliff m: package AA { our sub do-a is export { say 'Hi, A!' }; }; class A { method a { AA::do-a }; }; A.a;
evalable6 Hi, A!
Xliff m: package AA { sub do-a is export { say 'Hi, A!' }; }; class A { method a { AA::do-a }; }; A.a;
evalable6 (exit code 1) Could not find symbol '&do-a'
in method a at /tmp/Vn4xqiMTCv line 1
in block <unit> at /tmp/Vn4xqiMTCv line 1
22:42 Xliff left 22:57 krychu left 22:58 [particle] left 22:59 [particle] joined 23:06 Xliff joined
Xliff (50, 50 + 160 / 10...310).say 23:10
evalable6 (50 66 82 98 114 130 146 162 178 194 210 226 242 258 274 290 306)
23:10 sftp left, sftp joined
Xliff Is there a better way to go through a range using a step? 23:10
(50, 50 + (160 / 10)...310).say 23:11
evalable6 (50 66 82 98 114 130 146 162 178 194 210 226 242 258 274 290 306)
irced Xliff: a better way?
Xliff Yeah. I want 10 evenly spaced elements between ($min..$max)
(50, 50 + (260 / 10)...310).say 23:12
evalable6 (50 76 102 128 154 180 206 232 258 284 310)
Xliff (50, 50 + (260 / 9)...310).say
evalable6 (50 78.888889 107.777778 136.666667 165.555556 194.444444 223.333333 252.222222 281.111111 310)
Xliff (50, 50 + (260 / 9).Int ... 310).say 23:15
evalable6 (50 78 106 134 162 190 218 246 274 302)
irced m: my &evenly-spaced := ->$min,$max { for 0..10 { say $min + $_*($max-$min)/10; } }; print evenly-spaced(50, 310); 23:17
evalable6 50
Use of Nil in string context
76
102
128
154
180
206
232
258
284
310
in block <unit> at /tmp/l4O5lYIzzA line 1
irced m: my &evenly-spaced := ->$min,$max { for 0..10 { say $min + $_*($max-$min)/10; } }; evenly-spaced(50, 310);
evalable6 50
76
102
128
154
180
206
232
258
284
310
irced m: my &evenly-spaced := ->$min,$max { for 0..9 { say $min + $_*($max-$min)/10; } }; evenly-spaced(50, 310); 23:18
evalable6 50
76
102
128
154
180
206
232
258
284
Xliff my &evenly-spaced := -> $n, $min, $max { for 0..9 { say $min + $_*($max-$min)/$n; } }; evenly-spaced(10, 50, 310);
evalable6 50
76
102
128
154
180
206
232
258
284
irced i think the math is right, now it's just the programming 23:19
m: sub by_n(:$min, :$max, :$n) { gather for 0 .. 9 { take $min + $_*($max-$min)/$n; } }; print by_n(:10n, :50min, :310max); 23:25
evalable6 50 76 102 128 154 180 206 232 258 284
irced Xliff, approve?
oh, one adjustment 23:26
m: sub by_n(:$min, :$max, :$n) { gather for 0 .. $n-1 { take $min + $_*($max-$min)/$n; } }; print by_n(:10n, :50min, :310max);
evalable6 50 76 102 128 154 180 206 232 258 284
23:26 netrino left
irced Xliff: does that look like the droid you're looking for? 23:26
23:27 [particle]1 joined 23:28 [particle] left 23:30 [particle] joined 23:31 [particle]1 left, MilkmanDan left 23:32 MilkmanDan joined
Xliff irced: Close. Thanks! 23:33
m: my @a = <a b c d e>; @a.kv.say
evalable6 (0 a 1 b 2 c 3 d 4 e)
irced hth 23:35
tobs one thing that has been bothering me about Ranges is that they are vague about about whether they are discrete or continuous, i.e. `2.5 ~~ 1..5` is True but 2.5 will never materialize in an iteration over 1..5 23:37
in this case, whether a range is to be taken as discrete elements or as an interval of real numbers would influence if you want to take .excludes-{min,max} into account when you want to get "n evenly spaced elements".
irced tobs: continuous in as an operand of ~~, discrete otherwise?
tobs or maybe evenly spaced elements is the wrong query for a discrete range altogether... 23:38
irced < Elronnd> irced: I think raising an error that the parent can handle is wrong. If the parent is interested in doing error-checking around the callsite, then it is simpler for them to say if (!p6_is_sub(whatever)) { my_own_error_handling(); } 23:40
Elronnd: you said earlier raising an error that the parent can handle is wrong. If the parent is interest in doing error... with signal.h you can set the handler down the stack and simple raise(SIGILL) from the callee. no setjmp.h needed if all you need to do is indicate the error and terminate. (assuming no memory leaks) 23:41
Elronnd: consider dpaste.com/30NR3QS 23:47
this may be analagous to p6's react { whenever signal(SIGILL) { ... } } 23:51
analogous
23:53 rindolf left