»ö« 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.
00:15 patrickz joined 00:17 huf left 00:18 patrickb left 00:23 netrino left 00:53 w_richard_w joined 01:14 zachk left 01:22 patrickz left 02:19 leont left 02:20 MidCheck left 02:27 sftp left 02:29 sftp joined 02:44 kini left 02:51 kini joined 02:52 huf joined 03:18 mowcat left 03:21 ufobat_ joined 03:24 aborazmeh joined, aborazmeh left, aborazmeh joined 03:25 ufobat__ left 03:26 jeek_ left
Xliff "Unexpected named argument 'binding' passed 03:44
"
What causes that?!
03:48 aindilis joined 03:49 jeek joined 03:59 Xliff left
MasterDuke m: sub f(:$a) { say $a }; f(:2b) 04:02
camelia Unexpected named argument 'b' passed
in sub f at <tmp> line 1
in block <unit> at <tmp> line 1
04:43 aborazmeh left 05:32 sauvin joined 05:56 andrzejku joined 05:58 curan joined 06:08 xtreak joined 06:14 xtreak left 06:19 robertle left 06:26 xtreak joined 06:44 molaf joined, MidCheck joined 06:57 nebuchadnezzar joined
tyil tfw cpan-p6_' memory usage has not increased during my sleep 07:09
this is a good sign (but it also has not seen any new modules come by) 07:10
07:11 molaf left 07:12 domidumont joined 07:28 simcop2387 left 07:29 TeamBlast left, TeamBlast joined, simcop2387 joined 07:35 rindolf joined 07:38 domidumont1 joined 07:41 domidumont left 07:47 patrickb joined 07:55 ekexium joined, andrzejku left 07:59 dmaestro left 08:03 zakharyas joined 08:04 robertle joined 08:08 sno left 08:30 dakkar joined 08:32 kensanata joined 08:33 cpan-p6 joined, cpan-p6 left, cpan-p6 joined, cpan-p6_ left 08:36 molaf joined 08:37 xtreak left 08:45 domidumont1 left 08:46 cpan-p6_ joined, cpan-p6_ left, cpan-p6_ joined, mowcat joined, cpan-p6 left, mowcat left 08:47 mowcat joined, yqt joined, cpan-p6_ left, cpan-p6 joined, cpan-p6 left, cpan-p6 joined
tyil .bots 08:53
cpan-p6 03cpan-p6 reporting for duty! [Perl 6] 02git.tyil.nl/perl6/app-cpan-uploadannouncer-irc
tyil :D 08:54
Geth doc: a198ad46f6 | (JJ Merelo)++ | doc/Language/packages.pod6
Eliminating erroneous examples

This closes #2700. Also eliminates a few paragraphs below that did not work either.
08:56
synopsebot Link: doc.perl6.org/language/packages
08:58 ravenousmoose_ joined
lizmat weekly: medium.com/@jcoterhals/perl-6-smal...e741bf8716 08:58
notable6 lizmat, Noted!
09:00 ravenousmoose left 09:05 sena_kun joined, xtreak joined, antoniogamiz joined
kawaii AlexDaniel: any idea what's going on here? using the sakefile recursively (localhost) on a larger server and coming back with sake not found... www.irccloud.com/pastebin/vC0BiJih/ 09:07
09:17 ravenousmoose_ left, ravenousmoose_ joined
moritz sake not found? no booze for you? :D 09:18
kawaii sadly :(
09:19 reach_satori_ left 09:21 ravenousmoose_ left 09:22 ravenousmoose joined 09:28 antoniogamiz left 09:29 antoniogamiz joined 09:35 w_richard_w left 10:00 zacts joined 10:01 zacts left 10:02 zacts joined, zacts left 10:09 reach_satori joined 10:14 domidumont joined
Altreus kawaii: presumably the ssh is complicit 10:30
kawaii: I bet if you do something like ssh localhost sh -c sake
this won't work because your zshrc doesn't set your $PATH because sh doesn't run it
from that we could hypothesise that whatever's doing that ssh is doing it that way
10:31 ravenousmoose left 10:33 reach_satori left 10:36 yqt left 10:40 xtreak left, ravenousmoose joined 10:41 xtreak joined 10:46 reach_satori joined, ravenousmoose left
kawaii Altreus: yeah you're right, `sake` invokes `perl6` so I then get `/usr/bin/env: ‘perl6’: No such file or directory` 10:52
this is all just bash on this server
10:53 domidumont1 joined 10:55 leont joined 10:56 domidumont left
patrickb tyil: Question about the license you chose for the dockerfiles of yours: Why did you choose AGPL? 10:57
tyil because it's my preferred license 10:58
patrickb If I understand the AGPL correctly it has little effect on Dockerfiles.
Altreus kawaii: set up /etc/bashrc or whatever
might be a bit heavy-handed but you get the idea 10:59
some file that Makes It Work
tyil all it means is that you're free to use any code in the repo for whatever purpose you see fit, so long as you make the stuff you're using it free (as in freedom)
patrickb Because one usually doesn't distribute them to users of the software nor uses them implicitly on webservers.
Altreus Speaking of freedom, looks like Mel Gibson is playing another Scot
tyil patrickb: correct, but the license is for the entire repo, and is my default go-to license 11:00
I don't have any reasons for that license to be there other than having no reasons *not* to have it :>
patrickb tyil: I'm ok with the license. In fact I do plan to release my adaption of it as well. It's just that the license confuses me a bit when applied to dockerfiles since I think in most normal use cases the license doesn't enforce anything. 11:02
tyil fair enough 11:03
I'm not aware of any license to slap on Dockerfiles in particular that could do a better job for the intended purposes (make it available for free as in freedom, to anyone who wants to make something free as in freedom)
I don't think the Dockerfiles matter that much to most people anyway, licensed or not, as they'd use the images themselves 11:04
patrickb I suspect there is none. All free licences I'm aware of build on the concept of being activated when the piece in question is distributed or serviced (AGPL). This usually doesn't happen with dockerfiles. 11:07
True that it doesn't matter much for dockerfiles though.
Except for people being unfamiliar with licenses and avoiding the docker files because they think it'd taint the software they build using the resulting docker images... 11:08
tyil I'm not sure what I can do to resolve such simple misunderstandings, though 11:14
11:17 reach_satori left 11:21 bobby left 11:23 bobby joined 11:27 andrzejku joined 11:33 ekexium left, Bob- joined 11:34 llfourn left, bobby left, llfourn joined 11:35 ekexium joined 11:39 llfourn left 11:45 Sgeo left
lizmat weekly: www.khanate.co.uk/blog/tag/weekly-challenge-1/ 11:46
notable6 lizmat, Noted!
11:46 Sgeo joined 11:47 molaf left 11:48 lucasb left
cpan-p6 New module released to CPAN! Acme::Cow (0.0.1) by 03ELIZABETH 11:51
11:51 Black_Ribbon left
tadzik :o 11:51
this is great :D 11:52
11:54 reach_satori joined
lizmat tadzik: you mean the cow ? 11:57
tyil lizmat: ty, your module confirmed cpan-p6 to be still working as intended :D 12:02
now I can also start on making it say updated when there's an earlier version of it available in my db :3 12:03
and hopefully a command to make a paste containing all new and updated modules of the past 7 days
tadzik lizmat: yes :) 12:06
cpan-p6 New module released to CPAN! Acme::Cow (0.0.2) by 03ELIZABETH 12:07
12:07 xtreak left 12:11 reach_satori left, xtreak joined 12:15 zakharyas left, llfourn joined 12:18 ravenousmoose joined 12:24 llfourn left 12:25 llfourn joined 12:31 SergiusUA joined
kawaii does anyone have any idea why this results in an output of `Level 5 1234 is now tied to`? :) www.irccloud.com/pastebin/vw5rKJFD/ 12:33
12:33 llfourn left
kawaii how does one unpack a regex match into multiple scalars? 12:33
sena_kun m: my ($foo, $bar) = ('ab' ~~ /('a') ('b')/).List; say $foo; say $bar; 12:34
camelia 「a」
「b」
12:34 llfourn joined
sena_kun kawaii, something like ^? 12:34
kawaii looks to be what I'm looking for :)
moritz through at +<< in front if you want to convert to integers 12:35
*a
m: my $in = '12 34'; my ($a, $b) = +«($in ~~ /(\d+) \s+ (\d+)/).List
camelia ( no output ) 12:36
moritz m: my $in = '12 34'; my ($a, $b) = +«($in ~~ /(\d+) \s+ (\d+)/).List; say :$a.perl, :$b.perl
camelia :a(12):b(34)
kawaii the role-ids are used as strings by the target API, so no need :)
sena_kun m: my ($foo, $bar) = ~<<('ab' ~~ /('a') ('b')/).List; say $foo; say $bar; 12:37
camelia a
b
lizmat m: my ($foo, $bar) = ~<<('ab' ~~ /('a') ('b')/); say $foo; say $bar; # don't need the List
camelia a
b
lizmat afk& 12:38
Altreus ~<< seems more subtle than .List
ugexe m: my ($foo, $bar) = ("ab" ~~ /("a") ("b")/)>>.Str; say $foo; say $bar;
kawaii lizmat++ :)
camelia a
b
kawaii works perfectly
`Level 7 is now tied to 1234567`
ugexe just let >> turn it into a list
oh thats what lizmat did :)
Altreus What if one needs .Int and the other .Str? 12:39
timotimo try >>.&var :)
you'll get IntStr or just Str
ugexe type them as Str() and Int()
timotimo or RatStr, ComplexStr, NumStr
ugexe well that doesn't work either 12:40
Altreus m: my (Int $foo, Str $bar) = ("1 01020" ~~ /(\d+) \s+ (\d+)/)>>.&var; say $foo.WHAT; say $bar.WHAT;
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
var used at line 1. Did you mean 'VAR', 'val'?
ugexe m: my (Str() $foo, Int() $bar) = ("ab" ~~ /("a") ("1")/)>>.Str; say $foo.WHAT; say $bar.WHAT;
camelia Use of Nil in string context
(Str)
(Any)
in block <unit> at <tmp> line 1
ugexe m: my (Str() $foo, Int() $bar) = ("ab" ~~ /("a") ("a")/)>>.Str; say $foo.WHAT; say $bar.WHAT;
camelia Use of Nil in string context
(Str)
(Any)
in block <unit> at <tmp> line 1
Altreus oh heck
timotimo: is that what you meant by >>.&var ? 12:41
ugexe wait what?
timotimo yeah
ugexe m: my (Str() $foo, Int() $bar) = ("ab" ~~ /("a") ("a")/)>>.Str; say $foo.WHAT; say $bar.WHAT;
camelia Use of Nil in string context
(Str)
(Any)
in block <unit> at <tmp> line 1
Altreus ugexe: you used "a" twice
ugexe m: my (Str() $foo, Int() $bar) = ("ab" ~~ /("a") ("b")/)>>.Str; say $foo.WHAT; say $bar.WHAT;
camelia (Str)
(Str)
Altreus there we are xD
timotimo: I'm not sure it worked
timotimo yeah, must match, else it'll be empty
ugexe the only differenc ein those two is one has "a", "a", and the other "a", "b"
but their output is quite different
oh god nevermind 12:42
too early :/
12:44 llfourn left, antoniogamiz left 12:45 llfourn joined
Altreus m: my (Int $foo, Str $bar) = ("1 01020" ~~ /(\d+) \s+ (\d+)/)>>.&val; say $foo.WHAT; say $bar.WHAT; 12:45
camelia Value of type Match uselessly passed to val()
in block <unit> at <tmp> line 1
Value of type Match uselessly passed to val()
in block <unit> at <tmp> line 1
Type check failed in assignment to $foo; expected Int but got Match (Match.new(from…
12:45 xtreak_ joined
Altreus ¯\(._.)/¯ 12:46
timotimo oh, oops
12:46 AlexDaniel joined 12:48 xtreak left 12:49 llfourn left 12:50 yoleaux joined, ChanServ sets mode: +v yoleaux, llfourn joined, epony left
Altreus ugexe: can't help but notice that your example put 'b' into an Int() and then said it was a Str 12:55
Feels like perl6's type system might have some gaps
where a gap is a thing that violates POLA 12:56
timotimo principle of least astonishment? 12:57
Altreus just so 12:58
timotimo m: my Int() $foo = "a"
camelia 5===SORRY!5=== Error while compiling <tmp>
Coercion Int(Any) is insufficiently type-like to qualify a variable
at <tmp>:1
------> 3my Int() $foo7⏏5 = "a"
expecting any of:
constraint
12:58 domidumont1 left
timotimo it perhaps shouldn't have allowed that code to compile at all? 12:58
12:58 llfourn left
Altreus yes either DWIM or die trying 12:59
12:59 llfourn joined, Sigyn left 13:00 Sigyn joined 13:04 epony joined, llfourn left 13:05 llfourn joined 13:06 xtreak_ left 13:09 molaf joined, llfourn left 13:10 llfourn joined 13:12 domidumont joined 13:15 llfourn left, llfourn joined 13:16 molaf left 13:19 xtreak joined 13:20 llfourn left, llfourn joined 13:25 llfourn left, llfourn joined 13:27 zakharyas joined 13:29 AlexDaniel left 13:31 llfourn left, llfourn joined 13:36 llfourn left, llfourn joined 13:37 pistacchio joined
pistacchio hi, a couple of question. Is it possible, while instantiating an object, to reference a just-assigned property? 13:38
for instance Object.new(property1 => 42, property2 => property1 * 2) or something like that? 13:39
sena_kun no, as they are passed as named arguments(i.e. pairs) and don't have values yet. However, you can make such a link in the class body itself.
m: class A { has $.a; has $.b = $!a * 3 }; A.new(a => 10).say 13:40
camelia A.new(a => 10, b => 30)
sena_kun m: class A { has $.a; has $.b = $!a * 3 }; A.new(a => 10, b => 15).say
camelia A.new(a => 10, b => 15)
sena_kun pistacchio, what about ^?
13:41 llfourn left, cpan-p6 left, llfourn joined, cpan-p6 joined, cpan-p6 left, cpan-p6 joined
pistacchio an unrelated question. is there any place in the community where one can get its code reviewed for best practices / check if the code is perl6-y? 13:41
@sena_kun thank you. so $.b is actually a getter for $.a, right? does that mean that at every access $.b is re-calculated? 13:42
sena_kun asking here, I'd say. Though it works only for small gists/scripts and such, of course. 13:43
pistacchio, it depends on its placing. When you are defining an attribute with `has $.foo`, it is, in fact, a private attribute `$!foo` and a getter is created for you. But no, it is not re-calculated. When you are doing assignment in an attribute declaration, you are defining a "default value" which will be used at object creation time. 13:44
so it is calculated only once - at object creation. and if you will give `b` a value, it will be used instead of the default one. 13:45
If you want to have a stronger linking between your attributes, I'd go some another way. But you have asked about object instantiation time.
13:46 llfourn left, llfourn joined
sena_kun if you are working with a class attribute from the inside, I'd always just use `$!foo` instead of `$.foo`. 13:49
you can read more at docs.perl6.org/language/classtut#State <- this section.
pistacchio @sena_kun yes, of course. i'm converting a simple python script that analyses some csv to perl6, but the language is huge and i don't know how to check if i'm doing more work because there are more idiomatic ways of doing what i'm doing 13:50
and thanks for the link!
13:51 llfourn left
sena_kun pistacchio, for such cases you can ask here and it is very likely to get someone's help here with a review, a help with debugging, profiling and so on. 13:51
13:52 llfourn joined
pistacchio great, thank @sena_kun 13:53
13:58 robertle left 14:01 robertle joined 14:04 llfourn left, llfourn joined 14:06 traxex joined 14:07 llfourn left, llfourn joined 14:11 CepriN joined, xtreak left 14:13 SergiusUA left 14:18 llfourn left
pistacchio how do i dynamically access an object's property having the property name as a string in variable? 14:30
ugexe m: class Foo { has $.a; has $.b; submethod BUILD(:$!a, :$!b = $!a * 2) { }; }; say Foo.new(a => 2); 14:31
camelia Foo.new(a => 2, b => 4)
pistacchio @ugexe thanks!
ugexe m: class Foo { has $.a; has $.b; submethod BUILD(:$!a, :$!b = $!a * 2) { }; }; my $property = "a"; say Foo.new(a => 2)."$a"(); 14:32
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$a' is not declared
at <tmp>:1
------> 3y $property = "a"; say Foo.new(a => 2)."7⏏5$a"();
ugexe m: class Foo { has $.a; has $.b; submethod BUILD(:$!a, :$!b = $!a * 2) { }; }; my $property = "a"; say Foo.new(a => 2)."$property"();
camelia 2
pistacchio @ugexe thanks! 14:33
14:33 llfourn joined 14:36 cpan-p6_ joined, cpan-p6_ left, cpan-p6_ joined 14:37 cpan-p6 left 14:38 llfourn left 14:39 molaf joined 14:41 cpan-p6 joined, cpan-p6 left, cpan-p6 joined, cpan-p6_ left 14:43 cpan-p6 left, cpan-p6 joined, cpan-p6 left, cpan-p6 joined
patrickb tyil: github.com/patzim/perl6-dockerfiles <- I implemented building release versions. In case you like to pull stuff. 14:48
tyil nice
I'll take a look once I figure out a nice way to have cpan-p6 report it's build date on .bots 14:49
vrurg patrickb: you're a windows guy, as I remember. Are you? 14:50
tyil patrickb: ah, build utils and git. For some zef actions one would need unzip and curl, though 14:53
14:53 Shashi joined
tyil I left them out of my builds because those packages make the image huge, and for running a Perl 6 applications they're not needed (but also easily installed for the install/build phase) 14:54
I'm wondering if I should provide two seperate variants, though
one as minimal as possible, just for running, and one for installing/building/testing
14:54 Shashi left
tyil can you explain what RELEASE does? 14:56
patrickb vrurg: Not really. I'm on Linux when I can. I do have a Windows installation sitting somewhere and thus can do stuff there if necessary.
tyil: internal flag to determine what the build scripts should do 14:57
tyil ah, I see it now in the last file on that commit
patrickb see the makefile
tyil: What I'm doing now is basing another image with my application in it on the perl6 one and stripping that. This way I get to use full zef in my Dockerfile and still have a small image in the end. 14:59
14:59 EWDurbin18 joined
EWDurbin18 Bored? Call the official freenode IRC partyline at +4521137886 14:59
14:59 EWDurbin18 left
patrickb tyil: btw. I added another commit to not use a temporary zef URL in build.sh. Please do not take the one with 'github.com/patzim/' in it. 15:01
15:02 JayC3 joined
JayC3 Bored? Call the official freenode IRC partyline at +4521137886 15:02
15:02 JayC3 left 15:03 lucasb joined, zedomega joined
zedomega Bored? Call the official freenode IRC partyline at +4521137886 15:03
15:03 zedomega left 15:04 MoaMoaK27 joined
MoaMoaK27 Bored? Call the official freenode IRC partyline at +4521137886 15:04
15:04 debdog12 joined, MoaMoaK27 left, debdog12 left
tyil patrickb: I'd rather not have build-essential and other stuff in the main Docker image (I want those to be small, after all), but I do see use in a -dev image containing all those tools 15:05
15:05 Sgeo_ joined
tyil then one can use that -dev image to get all the deps sorted, then use a new stage based on the regular variant and copy in the resolved deps 15:05
and run their application
patrickb tyil: Makes sense. Then it might also make sense to leave zef out. 15:06
tyil this would make zef perfectly usable when it's needed, and still have a small image for running the actual application
yes, indeed
15:07 llfourn joined 15:08 Sgeo left 15:12 bigfondue joined, bigfondue left 15:13 scimon joined, S0rin6 joined 15:14 S0rin6 left
scimon Afternoon 15:14
15:14 Sgeo__ joined 15:16 cpan-p6 left, llfourn left 15:17 pistacchio left, llfourn joined, cpan-p6 joined, cpan-p6 left, cpan-p6 joined, Sgeo_ left 15:20 pistacch_ joined 15:21 cpan-p6 left, llfourn left 15:22 cpan-p6 joined, cpan-p6 left, cpan-p6 joined, llfourn joined 15:24 cpan-p6_ joined, cpan-p6_ left, cpan-p6_ joined, cpan-p6 left
tyil .bots 15:24
cpan-p6_ 03cpan-p6_:121.0.1 (2019-03-28T15:22:52Z) reporting for duty! [Perl 6] 02git.tyil.nl/perl6/app-cpan-uploadannouncer-irc
tyil \o/
15:27 llfourn left 15:28 llfourn joined 15:30 traxex left 15:32 Wahnberger joined
Wahnberger hi! someone know how the status of this project? github.com/jnthn/cro-webapp 15:33
15:33 llfourn left
Wahnberger *is 15:33
15:33 llfourn joined
sena_kun Wahnberger, not yet publically released. Likely to be released with Cro 0.9. When it will be exactly - when it will be ready. 15:33
Wahnberger, though the API is more or less stable and it can be used for small projects, just have to install it manually, as it isn't added to the ecosystem yet. 15:34
Wahnberger so it Ill become a part of cro (when its ready)
very nice
sena_kun according to jnthn - yes. :) 15:35
timotimo for whatever that's worthington
Wahnberger i asked some days ago for samples of websites with perl6..now ive found github.com/lancew/MyJudo (with Mustache) and then Jonathans Project 15:36
sena_kun MyJudo looks pretty good to get inspiration from 15:42
Altreus timotimo: :| 15:43
15:43 llfourn left 15:44 llfourn joined
Altreus I appreciate a good pun but nevertheless cannot bring myself to use a happier face than that in recognition of one 15:44
15:45 CepriN left
timotimo it's kind of a bittersweet thing 15:45
Wahnberger sena_kun: yep, escpecially how to handle routes togehter with a template system
15:45 CepriN joined 15:48 CepriN left, pistacch_ left 15:49 llfourn left, pistacchio joined, SergiusUA joined 15:51 patrickb left 16:02 jmerelo joined 16:09 cpan-p6 joined, cpan-p6 left, cpan-p6 joined, cpan-p6_ left, andrzejku_ joined 16:12 andrzejku left, andrzejku_ is now known as andrzejku 16:13 reach_satori joined 16:15 cpan-p6 left 16:16 cpan-p6 joined, cpan-p6 left, cpan-p6 joined 16:18 cpan-p6_ joined, cpan-p6_ left, cpan-p6_ joined, cpan-p6 left 16:19 pistacch_ joined 16:20 andrzejku left 16:21 cpan-p6_ left, andrzejku joined, cpan-p6 joined, cpan-p6 left, cpan-p6 joined, curan left 16:22 pistacchio left 16:23 domidumont left
xinming m: role T { method meth () { "role meth".say; }; method test () { "get-code-object for meth in the class which have role applied".say; "test".say; }; }; class C { method meth () { "C meth".say; } }; (my C $t .= new) does T; $t.test; 16:23
camelia get-code-object for meth in the class which have role applied
test
16:24 pistacch_ left
xinming Anyone here tells me, How can I get the code object from the class C? 16:24
I just got an idea. bbl
16:26 cpan-p6_ joined, cpan-p6_ left, cpan-p6_ joined, cpan-p6 left
Geth doc: a9b2310075 | (JJ Merelo)++ | doc/Language/py-nutshell.pod6
Adds some more examples

Actually sigilless variables are all over the document, apparently with the intent indicated before: to make it look like Python. I have added a note, and also more examples that work the same, which I guess illustrates also the More than One Way To Do It (theoretically opposite the philosophy of Python). Closes #2699
16:29
synopsebot Link: doc.perl6.org/language/py-nutshell
16:30 pistacchio joined
tyil it seems IRC::Client strips off the name of the bot if that is the first word in a message 16:32
does anyone know if this can be turned off?
xinming When we apply a role to a class, the WHAT returns the class name with role names. How can I get only the class name? 16:34
tyil .^name?
sena_kun xinming, ^name?
16:35 andrzejku_ joined
xinming sena_kun: Nope, Name still returns the T+{R} 16:35
tyil .^name.split("+").head? :D
xinming I want the T part. But don't like to do regex myself.
:-)
sena_kun m: role A {}; class B does A {}; B.^name.say
camelia B
xinming m: role A {}; (my $x = 5) does A; $x.^name.say; 16:36
camelia Int+{A}
sena_kun xinming, are you doing `but` magic or something?
xinming yes, with does
SmokeMachine Hi! is there any thing that I can add to my tests and it would test the code inside my pod? 16:37
sena_kun xinming, I don't think there is a way besides regexing. 16:38
jmerelo SmokeMachine: not for the time being. It's something I wanted to do, and even created a few lines of code, but there's no straightforward way to do it.
xinming sena_kun: Ok, Thanks, Then, Do we need to add helper for this? :-)
ugexe look at .^mro maybe
jmerelo SmokeMachine: You can use Pod::Load to load the Pods, and then some pod-filtering to extract code.
16:38 andrzejku left, andrzejku_ is now known as andrzejku
xinming ((C+{T}) (C) (Any) (Mu)) 16:39
sena_kun xinming, not sure, sounds as a pretty rare case for me. Do you need a name for debug purposes?
xinming mro returns something like this.
sena_kun: Nope, I need to get the class name within role. need to call the "class" method within role first.
16:39 drags1 joined
SmokeMachine jmerelo: yes... I think Ill have to do that... :( 16:39
xinming I'll later give the same.
tyil m: role A {}; (my $x = 5) does A; $x.^name.split("+").first.say
camelia Int
tyil shrugs 16:40
16:40 drags1 left
sena_kun xinming, have you tried $?CLASS(or how it is written)? 16:40
tyil xinming: does my .split solution not work? 16:42
sena_kun hmm, no, class gives Int+{A}, so forget it.
16:42 robertle left 16:43 kensanata left
xinming m: class C { method meth () { "C meth".say } }; role T { method meth () { "role meth".say }; method test () { my $class = ::?CLASS.^name.split("+")[0]; ::("::$class").^lookup("meth")(self); "test".say; self.meth; }; }; (my C $t .= new) does T; $t.test; 16:47
camelia C meth
test
role meth
xinming sena_kun: I tried. This is what I'm trying to do.
tyil xinming: role A {}; (my $x = 5) does A; $x.^name.split("+").first.say worked both on my machine and in this channel
xinming m: class C { method meth () { "C meth".say } }; role T { method meth () { "role meth".say }; method test () { my $class = ::?CLASS.^name.split("+")[0]; ::($class).^lookup("meth")(self); "test".say; self.meth; }; }; (my C $t .= new) does T; $t.test;
camelia C meth
test
role meth
16:48 yht__ joined
xinming tyil: it works, doesn't mean it's the best. I just try to find the right way to do things in perl6. 16:48
16:48 yht_ left
xinming sena_kun: Can I have a better version for ::($class).^lookup("meth")(self) ? 16:49
sena_kun xinming, does "::($class)."meth"()" work?
xinming can we do something like self.::("{$class}::meth")()
let me try
sena_kun works for me
ugexe m: role A {}; (my $x = 5) does A; $x does role :: { }; say $x.^mro.first(!*.^name.contains("+"));
camelia (Int)
ugexe that gives you the class object itself 16:50
xinming m: class C { method meth () { "C meth".say } }; role T { method meth () { "role meth".say }; method test () { my $class = ::?CLASS.^name.split("+")[0]; self.::($class)."meth"(); "test".say; self.meth; }; }; (my C $t .= new) does T; $t.test;
camelia ===SORRY!===
cannot stringify this
sena_kun m: class C { method meth () { "C meth".say } }; role T { method meth () { "role meth".say }; method test () { my $class = self.^name.split("+")[0]; ::("::$class")."meth"(); "test".say; self.meth; }; }; (my C $t .= new) does T; $t.test;
camelia C meth
test
role meth
xinming I need the "self" for the "meth"() part 16:51
maybe my $meth = ::("::$class")."meth"; self."$meth"();
sena_kun self is passed automatically when you call it this way.
ugexe i think they are trying to use fully qualified name 16:53
xinming So, so, my $c = "Class"; ::("::$c")."meth"(); will auto pass the current self as the "self" for the method call?
I'll try it, bbl
sena_kun I think so.
xinming sena_kun: it not. 16:55
It doesn't*
sena_kun sorry, then I'm wrong.
xinming m: class C { has $.a; method meth () { self.a.say; "C meth".say } }; role T { method meth () { "role meth".say }; method test () { my $class = ::?CLASS.^name.split("+")[0]; ::($class)."meth"(); "test".say; self.meth; }; }; (my C $t .= new(:a<5>)) does T; $t.test;
camelia Cannot look up attributes in a C type object
in method a at <tmp> line 1
in method meth at <tmp> line 1
in method test at <tmp> line 1
in block <unit> at <tmp> line 1
sena_kun then explicit passing with lookup is probably what you want.
xinming the self will be the first arg for Method object, right? 16:56
sena_kun ah, of course it's not, it is called on C type object, not instance. :|
xinming so, MethodObject(self, @other-arg-is-here)
sena_kun I guess that's the solution. 16:57
xinming if I don't want the Method to be called for self, I can do something like MethodObject(Nil, @other-arg-is-here)
hmm, Just to clarify some confusion. :-)
Am I right?
sena_kun as with `lookup` you are getting a Method object, I am not sure "Nil" will be appropriate, but you can just pass a type object. 16:58
ugexe there is always EVAL 16:59
m: use MONKEY-SEE-NO-EVAL; role Foo { method bar { 42 } }; class Bar does Foo { method bar { 1 }; method go { my $class = "Foo"; EVAL("self.{$class}::bar") } }; say Bar.new.go
camelia 42
16:59 llfourn joined
xinming sena_kun: You are right, I just now tried, It requires a type object to be passed as first arg. 17:01
ugexe: I don't like EVAL. :-)
Thanks all for your ideas.
best sollution solved. :-) 17:02
best sollution got.
17:03 maxim_d33_26 joined, maxim_d33_26 left 17:04 irietux19 joined, Wahnberger left, irietux19 left, llfourn left
timotimo you can also reach the dispatch that it normally does with a package name inside the method name part 17:05
m: IntStr.new(1, "1").perl.say; IntStr.new(1, "1").Str::perl.say 17:07
camelia IntStr.new(1, "1")
"1"
timotimo m: IntStr.new(1, "1").perl.say; IntStr.new(1, "1").Str::perl.say; IntStr.new(1, "1").dispatch:<::>("perl", Str); IntStr.new(1, "1").dispatch:<::>("perl", Int);
camelia IntStr.new(1, "1")
"1"
timotimo m: IntStr.new(1, "1").perl.say; IntStr.new(1, "1").Str::perl.say; IntStr.new(1, "1").dispatch:<::>("perl", Str).say; IntStr.new(1, "1").dispatch:<::>("perl", Int).say;
camelia IntStr.new(1, "1")
"1"
"1"
1
timotimo xinming, sena_kun, ugexe: ^ 17:08
sena_kun haha
ugexe i knew the answer would be obvious
timotimo "obvious" :)
i got it by looking at the --target=ast of using .foo::bar 17:09
xinming m: class C { has $.a; method meth () { self.a.say; "C meth".say } }; role T { method meth () { "role meth".say }; method test () { my $class = ::?CLASS.^name.split("+")[0]; self.::($class)::test(); "test".say; self.meth; }; }; (my C $t .= new(:a<5>)) does T; $t.test; 17:11
camelia ===SORRY!===
cannot stringify this
xinming m: class C { has $.a; method meth () { self.a.say; "C meth".say } }; role T { method meth () { "role meth".say }; method test () { my $class = ::?CLASS.^name.split("+")[0]; self.dispatch:<::>("test"); "test".say; self.meth; }; }; (my C $t .= new(:a<5>)) does T; $t.test;
camelia ===SORRY!===
MVMArray: Can't shift from an empty array
xinming m: class C { has $.a; method meth () { self.a.say; "C meth".say } }; role T { method meth () { "role meth".say }; method test () { my $class = ::?CLASS.^name.split("+")[0]; self.dispatch:<::>("C::test"); "test".say; self.meth; }; }; (my C $t .= new(:a<5>)) does T; $t.test; 17:12
camelia ===SORRY!===
MVMArray: Can't shift from an empty array
timotimo that's not how that works :)
you pass the class type object as well as the method name
xinming m: class C { has $.a; method meth () { self.a.say; "C meth".say } }; role T { method meth () { "role meth".say }; method test () { self.dispatch:<::>("test", C); "test".say; self.meth; }; }; (my C $t .= new(:a<5>)) does T; $t.test;
camelia Cannot find method 'test' on object of type C
in method test at <tmp> line 1
in block <unit> at <tmp> line 1
xinming m: class C { has $.a; method meth () { self.a.say; "C meth".say } }; role T { method meth () { "role meth".say }; method test () { self.dispatch:<::>("C::test", C); "test".say; self.meth; }; }; (my C $t .= new(:a<5>)) does T; $t.test; 17:13
camelia Cannot find method 'C::test' on object of type C
in method test at <tmp> line 1
in block <unit> at <tmp> line 1
xinming I did that.
17:14 ravenousmoose left
kawaii I have some functions that add/remove to a jsonb value in a postgresql database, when all the values are removed I'm left with `{}` in that col, so my 'list' command returns `{}` thinking it's 'something' and not null/empty, is there a way I can validate the result I pull from the database to return an alternative message? 17:18
xinming m: class C { has $.a; method meth () { self.a.say; "C meth".say } }; role T { method meth () { "role meth".say }; method test () { self.dispatch:<::>("meth", C); "test".say; self.meth; }; }; (my C $t .= new(:a<5>)) does T; $t.test;
camelia 5
C meth
test
role meth
xinming finally, got it work.
timotimo: Is there a syntax sugar for self.dispatch:<::>("meth", C); ? 17:19
ugexe self.C::method :P
timotimo if it's okay that the result will have .item called on it, it should be possible to $.dispatch:<::>("meth", C) 17:20
but i wouldn't expect $.C::foo to work. try it, though!
xinming ugexe: what if C is a string?
ugexe m: use MONKEY-SEE-NO-EVAL; role Foo { method bar { 42 } }; class Bar does Foo { method bar { 1 }; method go { my $class = "Foo"; EVAL("self.{$class}::bar") } }; say Bar.new.go
camelia 42
timotimo then you'll need to call the long name of the dispatch thing
xinming no eval. :-) 17:21
class C { has $.a; method meth () { self.a.say; "C meth".say } }; role T { method meth () { "role meth".say }; method test () { self.dispatch:<::>("meth", C); "test".say; self.meth; }; }; (my C $t .= new(:a<5>)) does T; $t.test; 17:22
evalable6 5
C meth
test
role meth
xinming We'll have to use the .dispatch:<::>, the self.::C::meth() will work. other than that, nothing works 17:23
17:23 scimon left
xinming We'll get error which is can't stringify this. 17:23
timotimo can you give the code for that exact error? or nopaste the output of --ll-exception somewhere? 17:24
ugexe m: class Foo { method foo::bar { 42 } }; say Foo.new."foo::bar"()
camelia 42
lucasb m: 1.::(1) 17:25
camelia ===SORRY!===
cannot stringify this
timotimo yeah, quotes are also the way to call methods with silly names
that doesn't even have a method name! :D
at gen/moar/Perl6-Actions.nqp:6022 (/home/timo/perl6/install/share/nqp/lib/Perl6/Actions.moarvm:methodop)
who wants to fix it
xinming timotimo: Is this consider a missing feature? 17:26
for the question I asked.
17:26 ekexium left
timotimo which exactly? 17:26
17:27 Riddick joined
xinming m: class C { has $.a; method meth () { self.a.say; "C meth".say } }; role T { method^Ceth () { "role meth".say }; method test () { self.::("C::meth")::meth; "test".say; self. 17:27
camelia ===SORRY!===
cannot stringify this
xinming methny; }; }; (my C $t .= new(:a<5>)) does T; $t.test;
17:28 Riddick left
xinming m: class C { has $.a; method meth () { self.a.say; "C meth".say } }; role T { method meth () { "role meth".say }; method test () { self.::(::("C"))::meth; "test".say; self.meth; }; }; (my C $t .= new(:a<5>)) does T; $t.test; 17:28
camelia ===SORRY!===
cannot stringify this
xinming self.::(::("C"))::meth; <--- This part.
timotimo not sure. the error should surely be better
ugexe m: role Bar { method bar { 69 } }; class Foo does Bar { method Bar::bar { 42 } }; say Foo.new.Bar::bar()
camelia 69
ugexe m: role Bar { method bar { 69 } }; class Foo does Bar { method Bar::bar { 42 } }; say Foo.new."Bar::bar"() 17:29
camelia 42
ugexe i assume this is why it cannot do what you ask
xinming m: class C { has $.a; method meth () { self.a.say; "C meth".say } }; role T { method meth () { "role meth".say }; method test () { self."C::test"(); "test".say; self.meth; }; }; (my C $t .= new(:a<5>)) does T; $t.test; 17:30
camelia No such method 'C::test' for invocant of type 'C+{T}'
in method test at <tmp> line 1
in block <unit> at <tmp> line 1
xinming m: class C { has $.a; method meth () { self.a.say; "C meth".say } }; role T { method meth () { "role meth".say }; method test () { self."C::meth"(); "test".say; self.meth; }; }; (my C $t .= new(:a<5>)) does T; $t.test;
camelia No such method 'C::meth' for invocant of type 'C+{T}'
in method test at <tmp> line 1
in block <unit> at <tmp> line 1
xinming ugexe: With 'does', that doesn't work. I'll try something else
timotimo like ugexe says, that's already syntax for something else 17:31
17:31 robertle joined, absentia17 joined 17:32 absentia17 left
xinming m: class C { has $.a; method meth () { self.a.say; "C meth".say } }; role T { method meth () { "role meth".say }; method test () { my $class = self.^name.split("+").first; $class.say; self."{$class}::meth"(); "test".say; self.meth; }; }; (my C $t .= new(:a<5>)) does T; $t.test; 17:32
camelia C
No such method 'C::meth' for invocant of type 'C+{T}'
in method test at <tmp> line 1
in block <unit> at <tmp> line 1
xinming I think I understand why we need the dispatch version 17:34
17:35 dakkar left 17:39 llfourn joined
jmerelo .seen chsanch 17:43
yoleaux I saw chsanch 13 Nov 2018 12:57Z in #perl6: <chsanch> I've learn the hardway to never do push to master directly, mostly when working with more people, or at least limit the access to push commits to master to just the admins. But is just one of the other ways to manage the work flow
17:43 llfourn left 17:44 pistacchio left, pistacchio joined 17:49 pistacchio left 17:53 SergiusUA left 18:03 cpan-p6 joined, cpan-p6 left, cpan-p6 joined, cpan-p6_ left 18:18 iqubic joined, iqubic left 18:20 kylese joined 18:21 skids joined, llfourn joined 18:25 sauvin left 18:26 llfourn left, pistacchio joined 18:32 rnd_gen joined, rnd_gen left 18:34 [Sno] joined 18:44 MidCheck left 18:46 irdr left, Black_Ribbon joined 18:47 irdr joined, zakharyas left 18:54 llfourn joined 18:57 domidumont joined
xinming m: {}.perl.say; 18:57
camelia {}
18:58 klaxa3 joined
xinming m: ({ +1; }).perl.say; (-> { }).perl.say; 18:58
camelia -> ;; $_? is raw { #`(Block|77600280) ... }
-> { #`(Block|77606832) ... }
18:58 klaxa3 left
xinming So, { } as block is different from -> { } am I right? 18:58
18:58 llfourn left
vrurg xinming: No, it's same Block. 19:02
Pointy has a non-empty signature, that's all. 19:03
19:05 Guest67700 joined, Guest67700 left 19:10 dosaboy6 joined, dosaboy6 left
timotimo { } has an optional $_ positional parameter, which -> { } does not have 19:14
19:20 shinobi_cl joined
shinobi_cl Hi all 19:20
19:20 molaf left
timotimo yo 19:23
sena_kun o/ 19:28
xinming m: my $f = start { sleep 1 }; my @arr = ^4; my @t = @arr.map: { my $t = $_; $f.then(-> { sleep $t; $t.say; }) }; await Promise.allof(@t).then({ "doen".say; });
camelia doen
xinming m: my $f = start { sleep 1 }; my @arr = ^4; my @t = @arr.map: { my $t = $_; $f.then({ sleep $t; $t.say; }) }; await Promise.allof(@t).then({ "doen".say; });
camelia 0
1
2
3
doen
19:29
xinming :-)
timotimo: Can you tell me why the poiny doesn't work, while the bare block work in then?
It takes me quite a while to find the differences
sena_kun m: my $f = start { sleep 1 }; my @arr = ^4; my @t = @arr.map: { my $t = $_; $f.then(-> $_ { sleep $t; $t.say; }) }; await Promise.allof(@t).then({ "doen".say; }); 19:30
camelia 0
1
2
3
doen
19:31
xinming Then, -> { } { } -> $_ { } are different? 19:32
sena_kun well, first one explicitly takes 0 arguments, second one takes implicitly 1 argument($_), third one takes explicitly 1 argument($_). 19:33
I am not an expert though. :| But my guess is that `then` passes result of the Promise as `$_` into the block, and when body of `then` callback rejects it, it somehow isn't executed. 19:34
thus `{}` and `-> $_ {}` with a promise result argument(implicit and explicit) are executed, while block that ignores the result is not.
xinming I think so, that's why someone here can help me clarify this, or maybe we can add warnings to tell user the use of -> { } is wrong
sena_kun m: my $a = Promise.new; $a.then(-> { 1.say }); $a.keep; sleep 0.5; 19:36
camelia ( no output )
sena_kun m: my $a = Promise.new; $a.then({ 1.say }); $a.keep; sleep 0.5;
camelia 1
sena_kun I wonder if it seems like a bug. 19:37
19:39 aindilis left
xinming sena_kun: I'd say it's a bug. :-) 19:41
But need someone who can clarify this 19:42
sena_kun github.com/rakudo/rakudo/blob/mast...e.pm6#L179 <- the best thing I can do is to find the implementation code piece. :)
though I wonder how a Block is coerced into Promise there. 19:45
xinming I know it's perl6, But I can't read the source. :-)
19:46 llfourn joined 19:47 d-fence_23 joined, netrino joined, d-fence_23 left 19:49 domidumont left 19:52 pistacchio left, pistacchio joined 19:56 llfourn left 20:02 pistacchio left 20:03 pistacchio joined 20:06 blueness29 joined, blueness29 left 20:09 llfourn joined
timotimo it's not a bug 20:10
the resulting promise is surely set to Broken
m: my $trigger = Promise.new; my $result = $trigger.then(-> { say "blah" }); $trigger.keep; say $result.status; say await $result 20:11
camelia Planned
An operation first awaited:
in block <unit> at <tmp> line 1

Died with the exception:
Too many positionals passed; expected 0 arguments but got 1
in block at <tmp> line 1
timotimo m: my $trigger = Promise.new; my $result = $trigger.then(-> { say "blah" }); $trigger.keep; sleep 0.1; say $result.status; say await $result
camelia Broken
An operation first awaited:
in block <unit> at <tmp> line 1

Died with the exception:
Too many positionals passed; expected 0 arguments but got 1
in block at <tmp> line 1
timotimo Promise.allof will just give you a promise that is kept when all promises have changed away from "Planned"
whether or not all of them are Kept or one, more, or all of them are Broken doesn't matter to that one
you'll instead just want to "await @t 20:12
"
20:12 SCHAPiE left 20:17 SCHAPiE joined 20:19 llfourn left 20:26 zachk joined 20:28 zachk left, zachk joined 20:30 Guest21615 joined, Guest21615 left 20:32 MidCheck joined
xinming timotimo: Thanks for the explanation. 20:32
20:52 antoniogamiz joined
antoniogamiz \o/ 20:52
20:54 netrino_ joined, netrino left 21:04 molaf joined 21:05 RaycatWhoDat joined
antoniogamiz mmmm what's the standard? 21:07
El_Che weekly: twitter.com/omengue/status/1111373440794058752
notable6 El_Che, Noted!
antoniogamiz I'm getting this failed test from Test::META
# license ‘GPL-v3.0’ is not one of the standardized SPDX license identifiers.
El_Che .tell pmurias: twitter.com/omengue/status/1111373440794058752 21:08
yoleaux El_Che: What kind of a name is "pmurias:"?!
21:08 Xliff joined
El_Che .tell pmurias twitter.com/omengue/status/1111373440794058752 21:08
yoleaux El_Che: I'll pass your message to pmurias.
Xliff \o
Has anyone worked on a way to create a "array" of CStructs? 21:09
Not pointers to CStructs, just (CStruct *)
21:12 skids left 21:15 wraithm1 joined, wraithm1 left
RaycatWhoDat This might be a faux pas but what compiled languages do you guys like using? 21:16
I'm finding myself at a bit of an impassé. I have to learn one but I don't like how inflexible/unexpressive they tend to be. 21:17
21:18 glenfe19 joined
sena_kun antoniogamiz, spdx.org/licenses/ <- maybe you can find appropriate code here? 21:18
21:18 glenfe19 left 21:19 mdeslaur23 joined, mdeslaur23 left
sena_kun RaycatWhoDat, I've used Haskell in the past and it was pretty nice, though it's probably not the answer you want. :) 21:19
ugexe C++ is the opposite of inflexible and unexpressive
RaycatWhoDat Maybe I did something wrong. ugexe, what's your experience with it? 21:21
tyil antoniogamiz: you're looking for "GPL-3.0" I think
sena_kun antoniogamiz, I am having github.com/Altai-man/Slang-Kazu/bl...6.json#L12 <- and it works...
RaycatWhoDat sena_kun: What's your experience with Haskell and how does it compare with your Perl experiences? 21:22
ugexe: The latter question goes to you, too.
21:22 beasty_3 joined, beasty_3 left
tadzik RaycatWhoDat: I found Rust nice 21:22
tyil antoniogamiz: for future reference, this is the list of SPDX identifiers: spdx.org/licenses/
tadzik the experience is completely different from Perl's though 21:23
21:23 TheAvatar22 joined, llfourn joined
tyil it's a standardized list, thus making it easier for other applications to parse and get conclusions from, without having to guess whether it parsed something correctly 21:23
tadzik it takes more effort to write the thing you want, but then it takes substancially less to test it properly and identify/fix the bugs
antoniogamiz tyil: thanks, I've found the correct one1 :)
21:23 TheAvatar22 left
tyil huh, it looks like everyone's favourite AGPL-3.0 is actually deprecated 21:24
RaycatWhoDat tadzik: Maybe I've been too jaded towards Rust. I looked at it, tried writing a file lister program, and struggled for two hours to even get basic functionality.
tyil guess I should update my repos
RaycatWhoDat I should give it another go.
tadzik RaycatWhoDat: it's kinda like that, yes 21:25
tyil I dont think feeding Go to your Rust compiler is going to help
tadzik it shatters a lot of assumptions you normally have as to how the code works
normally a language usually assumes that you know what you're doing 21:26
rust assumes, and sometimes knows, that you don't
and it can be frustrating because very often it nags you about things that really don't matter in this particular case
21:27 desuwa9 joined, desuwa9 left
antoniogamiz sena_kun: ty 21:28
jnthn jmerelo: At last found the mentor email and did the signup :)
RaycatWhoDat tadzik: Interesting. I'll assume it feels less constraining as long as you play by its rules? 21:29
sena_kun RaycatWhoDat, well, from small things like 99 problems to writing an imageboard engine with Yesod underneath. Haskell does a lot of things very differently compared to a lot of languages, imperative ones, but what I really appreciate is how it makes you thik in terms of data transformation processes and chaining those processes in abstract ways.
RaycatWhoDat Ah. I like that. :) 21:31
sena_kun though it gets annoying when you have to work with real world things. when you work with e.g. a database using a library with generic type families with exestential types and I don't even know what I am talking about and suddenly it goes "Boom, type mismatch" with the error described in like 40-50 lines of type descriptions, that is sometimes irritating. :)
RaycatWhoDat Ah. That sucks, though.
sena_kun but as for now, I am super-satisfied with Perl 6. I am not really an enthusiast hacker that can just write code all the day including weekends, but I find myself having "Oh, so I have an hour this morning, let's patch some things up quickly" situation to be not so rare. 21:33
21:33 llfourn left 21:34 kylese left
sena_kun even considering that, if you want to have some interesting (possibly mind-bending) journey, I'd recommend Haskell. If you want to write code in this language at $dayjob, well, Haskell is still not the best choice. 21:34
RaycatWhoDat I'm torn, honestly. I'm a JavaScript dev by trade and as much as I enjoy JS, I'm growing tired of the ecosystem. I want to learn a new language that's fun to program in and expressive but I don't want to have another hobby language. 21:36
But then again, I could just be complaining about absolutely nothing. 21:38
21:38 learningprogged joined 21:39 meowray11 joined 21:40 meowray11 left, netameta joined, netameta left
tadzik RaycatWhoDat: it is, but the rules are really really unfamiliar 21:41
RaycatWhoDat :( 21:42
tadzik no other language I know "thinks" in terms of what function does a variable belong to, and I don't think that way either P
so it's quite hard to adapt
because I think I understand programming, and I write code that I'm sure will work safely: in that specific context, scope etc
but Rust will think in broader terms and say "well, it's *potentially* unsafe this way" 21:43
and it is ultimately right
because one day I may call these few functions in different order and hurt myself 21:44
so it's fundamentally different from other languages I normally use, which are very results-oriented and often force me to compensate for my lack of foresight in different ways :) 21:45
21:46 grepper4 joined, grepper4 left
tony-o weekly: deathbyperl6.com/zef-plugins-a-ver...a-glimpse/ 21:47
notable6 tony-o, Noted!
tony-o jmerelo: ^
antoniogamiz mmm how do you avoid adding use lib "lib" when you are developing a module? 21:55
I have to add that line to each file where I want to use the module :/
21:56 RaycatWhoDat left
jnthn antoniogamiz: One option is to invoke `perl6 -Ilib` instead (I have my IDE do it for me, so don't even have to remember). You can also set PERL6LIB=lib in the environment. 22:00
22:00 Khisanth left
antoniogamiz jnthn: :oooooooooooooooooooo thanks a lot!!!!! :DDD 22:00
22:03 ctilmes joined
ctilmes Xliff: re: array of CStructs, I tried but had trouble. See my workaround here: github.com/CurtTilmes/perl6-dbmysq...e.pm6#L142 22:04
vrurg "If builders built houses the way programmers built programs, the first woodpecker to come along would destroy civilization." – current Configure.pl reminds me about this quote... 22:05
Xliff ctilmes++ # Thanks! Love that comment, btw! =)
tony-o antoniogamiz: perl6 -Ilib 22:07
Xliff m: role A does Positional { method AT-POS(Int $f) { self + 3 }; }; my $a = 1 but A; say $a[5]; 22:08
camelia 4
Xliff m: role A does Positional { method AT-POS(Int $f) { self + 3 + $f }; }; my $a = 1 but A; say $a[5];
camelia 9
tony-o vrurg: lol 22:10
jnthn: what IDE do you use? 22:11
sena_kun tony-o, well, he wrote "my IDE", so... (Comma)
jnthn Hah...I didn't mean it in *that* sense, but yeah, I guess it is that too :) 22:12
22:12 Khisanth joined
tony-o looks p cool 22:13
sena_kun I wouldn't consider that a pun, but a tiny double meaning joke - certainly. ;)
tony-o i'll count it as a pun
antoniogamiz tony-o: thanks :D 22:15
I'm using atom
vrurg is unlucky with IDEs. None works properly for me. :( 22:17
22:18 geordi18 joined
jnthn antoniogamiz: I think there's a way to get atom to run your script, and presumably to sneak the -Ilib in there too 22:18
22:18 geordi18 left
vrurg Regarding Configure.pl: anybody knows if there is reason in gen_nqp() to iterate over backends in the order of jvm first, then moar and js? 22:20
ugexe probably just how it came out. it was probably parrot first 22:24
antoniogamiz jnthn: mm I will take a look then :D 22:25
ugexe yeah, moar wasnt in the Configure.pl when the jvm conditional was added github.com/rakudo/rakudo/commit/49...23462ba093 22:26
tony-o vrurg: i use vim
22:26 rindolf left
vrurg tony-o: vim is hellishly slow with perl6 syntax highlight. Especially in a terminal. Basically, I currently mix atom and MacVIM. 22:27
ugexe: Probably you're right. After all, the loop ends up storing results in a hash. 22:28
tony-o i don't seem to have much lagginess with the syntax, it was awfully slow when it firt came out but has gotten a lot better since
Xliff ctilmes: Is there a converse operation? Say I want to create a traditional C array of structs in Perl6. Have you figured out a workaround for that? 22:29
I was thinking I could do something like that with memset and a pre-allocated buffer... 22:30
vrurg tony-o: I'm that lucky or I demand more. BTW, I'm using perl6 plugin because the original support is incomplete. 22:31
Anyway, atom is really fast. My biggest complain with this one is that perl6 package conflicts with perl5 and the latter gets disabled. 22:32
22:41 MidCheck left
Xliff Has there been any thought as to providing function pointer types in NativeCall? 22:44
Currently if I have &handler (Type1, Type2, Type3), I have to specify that out fully for each callback. 22:45
I'm wondering if I can define the sig in a Signature object and use that with NativeCall... or a similar mechanism.
22:46 shinobi_cl left
ctilmes Xliff: I just call calloc with nativesizeof(my CStruct) to make an array of structs 22:53
Xliff How do you assign to a specific POS? memset? 22:54
or memcpy?
22:54 domme joined, domme left
ctilmes define AT-POS as nativecast(foo, Pointer.new(nativecast(Pointer, blah) + $count*nativesizeof(my struct))) 22:54
Xliff Oh! I thought that was only for RO! 22:55
ctilmes could wrap all that up into a parameterized "array-of-cstruct[my CStruct]" or some such module util real array of CStruct works
^until
Xliff So that works for assignment, too!
?
22:56 FireBreath_ joined
ctilmes once you nativecast() the Pointer into a CStruct repr thing, you can access its parts just like it was a single CStruct 22:56
22:56 FireBreath_ left
ctilmes You have to be careful with assignment to CStruct parts, some things you need to take special care with 22:57
Xliff Like what?
ctilmes Pointers to pointers, arrays of stuff, etc. 22:58
antoniogamiz more than 5 minutes to pass simple tests 22:59
build-zef is quite time consuming, any solution? 23:00
Xliff ctilmes: OK, thanks. I take it some of that has been dealt with in perl6-dbmysql? 23:01
If so, I'll take a deeper look.
ctilmes Xliff: github.com/CurtTilmes/perl6-dbmysq...ve.pm6#L90 23:03
Xliff Ah. SMH. right. ;) 23:07
23:12 lucasb left
ctilmes Xliff: gist.github.com/CurtTilmes/bd3b515...e73a4b34a5 23:13
Xliff if you need to pass it to a C function, pass $array.base in as a Pointer. 23:14
Xliff So: Pointer.new($array.base) ??
23:15 sena_kun left
ctilmes $array.base *is* a Pointer, just use it. 23:15
sub c_function(Pointer --> int32) is native() {}, just call c_function($array.base);
Xliff Ah. OK! Thanks. 23:16
ctilmes if you are supposed to pass in a struct foo[], just define the Perlish native sub as 'Pointer'
If you're feeling ambitious, package up that gist, write some basic docs and push it to the ecosystem as a reusable module ;-) 23:18
23:27 antoniogamiz left 23:28 helldorado15 joined, helldorado15 left 23:29 llfourn joined 23:34 llfourn left, llfourn joined 23:39 llfourn left 23:40 gist_ joined, gist_ left, llfourn joined 23:54 llfourn left 23:55 llfourn joined 23:57 aindilis joined 23:59 jungleboyj8 joined, jungleboyj8 left