»ö« 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:04
aborazmeh joined,
aborazmeh left,
aborazmeh joined
00:24
hasuwiz left
00:30
rindolf left
00:32
i1nfusion1 left
00:33
aborazmeh left
00:34
i1nfusion1 joined
|
|||
lookatme_q | :) morning | 00:37 | |
00:43
dominix joined
|
|||
dominix | Hi everyone | 00:44 | |
I Would like to know how perl6 handle perl5 when using <perl5> keyword to load a module | 00:46 | ||
lookatme_q | dominix, It's using Perl 5 C interface | 00:47 | |
dominix | Is it launching a perl5 instance or is it using a nqp/perl5 interpreter | ||
lookatme_q | If you mean Inline::Perl5 | ||
dominix | Yes | ||
lookatme_q | yes, It's using Perl 5 interpreter | ||
Same as Inline::Python, they are all using the C interface | 00:48 | ||
dominix | Is this perl5 a linked lib or is it included in perl6 ? | ||
lookatme_q | a library | ||
common named perl5-dev | |||
dominix | Ok, so it might be linked to the installed perl5 version , right ? | 00:49 | |
lookatme_q | hmm, I am not very sure it will linked to the installed Perl 5 | 00:50 | |
dominix | I mean if my local perl5 had a bug with a specific module, I may have the same in perl6 using inline::perl5 | 00:51 | |
lookatme_q | hmm, probably | ||
dominix | I would like to be sure | ||
lookatme_q | you better check it :) | ||
dominix | I can not uninstall system perl5... | 00:53 | |
lookatme_q | yes, you can't | ||
dominix | I can install another perl version with perlbrew but in that case I don't know which perl5 perl6 gonna use. | 00:56 | |
lookatme_q | check the library version | ||
using package manager | |||
dominix | How ? | 00:58 | |
lookatme_q | Which distribution do you used ? | ||
01:01
kurahaupo left,
kurahaupo joined
|
|||
dominix | Ubuntu 18.04 | 01:05 | |
Perl6 is the last release | 01:06 | ||
2019.03 | |||
Perl6.d | |||
The perl5 module I am trying to use is know to work on 5.14 | 01:07 | ||
lookatme_q | so what's your Perl 5 version is ? | 01:08 | |
5.14 ? | |||
dominix | There is known problems with other version. | ||
Yes it's an internal project things, based on POE | 01:09 | ||
lookatme_q | dominix, try this, apt-cache show PACKAGE, PACKAGE is the package name, I am not sure the name of Perl 5 dev package on Ubuntu | ||
dominix | My perl5 is 5.22 | ||
lookatme_q | or using dpkg : dpkg -L package_name | 01:10 | |
dominix | 5.26 | 01:14 | |
Sorry | 01:15 | ||
lookatme_q | hmm, if you are using newer Ubuntu version, it'll using new version Perl 5 obviously | 01:17 | |
01:20
jaldhar_ left,
jaldhar_ joined
01:23
i1nfusion1 left
01:35
i1nfusion1 joined
01:38
buffet left
01:39
buffet joined
01:52
someuser left
01:59
MidCheck joined
02:05
netrino left
02:07
netrino joined
02:09
netrino left
|
|||
MidCheck | hello,This is a draft of my GSoC proposal. Can someone help me make it better? | 02:28 | |
docs.google.com/document/d/1-we2kt...sp=sharing | |||
02:38
atroxaper joined
02:50
i1nfusion1 left
|
|||
ugexe | What is “Information Confrontation Technology”? | 02:54 | |
02:56
amfabasti left
03:02
i1nfusion1 joined
03:03
i1nfusion1 left
|
|||
MidCheck | ugexe, It belongs to a kind of cyberspace security | 03:03 | |
03:16
i1nfusion1 joined
|
|||
ugexe | sounds like something used offensively | 03:28 | |
MidCheck | but we are learning defense | 03:33 | |
ugexe | some might think great firewall is defense, so maybe that is true | 03:37 | |
depending on ones perception | |||
MidCheck | that's right | 03:41 | |
defense is a complicated thing | 03:43 | ||
ugexe | yeah, U.S. military is finding that out the hard way as companies are refusing / canceling government contracts because workers think it is not moral to help kill people or deny freedoms | 03:45 | |
03:49
atroxaper left
03:51
aborazmeh joined,
aborazmeh left,
aborazmeh joined
03:58
vrurg joined
|
|||
masak | good morning, #perl6 | 04:00 | |
m: say "food" ~~ / "fool" | "food" / | |||
evalable6 | 「food」 | ||
masak | I have a question. the above regex is all declarative, yes? and the `|` operator is transparent to declarativeness, so it "seeps into" both alternations. | 04:01 | |
but what about something like this?: | 04:02 | ||
m: say "food" ~~ / { say "procedural!" } ["fool" | "food"] / | |||
evalable6 | procedural! 「food」 |
||
masak | the `{}` block throws the regex out of the declarative and into the procedural. is the rest of the regex now procedural, all the way until we call a subrule? | 04:03 | |
AlexDaniel | MidCheck: have you talked to samcv yet? | ||
masak | or does the regex "regain declarativeness" in the group `[]` ? | ||
MidCheck | AlexDaniel: yes, we have been talking | 04:04 | |
ugexe: I believe in freedom | 04:06 | ||
masak | my reading of S05 is that the `[]` is now in the procedural part. | 04:09 | |
if so, does the `|` in it act exactly like a `||`? | |||
04:10
kurahaupo left
04:11
kurahaupo joined
|
|||
AlexDaniel | MidCheck: I made some minor tweaks | 04:16 | |
04:17
jmerelo joined
|
|||
jmerelo | releasable6: status | 04:17 | |
releasable6 | jmerelo, Next release in ≈12 days and ≈14 hours. 11 blockers. 0 out of 167 commits logged | ||
jmerelo, Details: gist.github.com/d976872b867741ad9f...3b3177116e | |||
AlexDaniel | kawaii: how is it going, btw? :) | 04:19 | |
kawaii: maybe it's a good time to run Blin | |||
04:19
cpan-p6 left
04:21
cpan-p6 joined,
cpan-p6 left,
cpan-p6 joined
|
|||
MidCheck | AlexDaniel: ok, i will check it after lunch | 04:21 | |
04:31
vrurg left
04:36
dalek left
04:41
aborazmeh left
04:48
AlexDaniel left,
AlexDaniel joined
04:52
i1nfusion1 left,
i1nfusion left
04:53
curan joined,
i1nfusion joined
04:54
i1nfusion1 joined
04:59
aborazmeh joined,
aborazmeh left,
aborazmeh joined
05:01
dominix left
05:23
ufobat left,
robertle left
05:24
aborazmeh left
05:36
w_richard_w joined
|
|||
tyil | jmerelo: are there plans to enter GSoD? | 05:50 | |
05:53
Geth left
|
|||
jmerelo | tyil: yes | 05:55 | |
tyil | sweet! | 05:56 | |
jmerelo | tyil: it's slightly different from GSoC. There are no "umbrella organizations", but single "projects". So of course I'm trying to propose Perl 6 docs | ||
tyil: I've already created a repo. I'll send you an invite. Specific "ideas" have to be proposed in this case, too. | 05:57 | ||
tyil | alright, thanks :D | ||
I'll take a peek later today at work and try to help out | |||
moritz | what does the "D" stand for? Death? :D | ||
destruction? | 05:58 | ||
jmerelo | moritz: hope not. Documents. It's been spun off summer of code this year | ||
moritz | jmerelo: ah, nice! | ||
jmerelo | moritz: wanna help? You're the ur-documentor, after all. | ||
06:01
ufobat joined
06:03
ravenousmoose joined
06:07
abraxxa joined
|
|||
jmerelo | Talking about documentation, contributions to it have decreased sharply lately. It would *really* help if you would take a look at the issues from time to time and helped a bit there... | 06:07 | |
06:08
abraxxa left
|
|||
jmerelo | Every little contribution helps... | 06:08 | |
06:08
abraxxa joined
06:18
abraxxa left
06:19
abraxxa joined
06:24
pistacchio left,
pistacchio joined
|
|||
moritz | jmerelo: I'll try to free some time for it | 06:29 | |
jmerelo | moritz++ | 06:30 | |
moritz: should I add you to the repo, then? | |||
06:30
jmerelo left
|
|||
moritz | jmerelo: yes, wouldn't hurt | 06:34 | |
06:41
domidumont joined
07:03
patrickb joined
07:07
robertle joined
07:22
domidumont left
07:31
zakharyas joined
07:36
rindolf joined
07:40
domidumont joined
07:45
pistacchio left,
pistacchio joined
07:49
ravenousmoose_ joined
07:50
ravenousmoose left
07:58
ravenousmoose_ left
08:12
kurahaupo left
08:26
sena_kun joined
08:27
khisanth_ left
08:32
reach_satori left
08:33
pistacchio left,
pistacchio joined
08:47
khisanth_ joined
08:55
Black_Ribbon left
08:57
aindilis left
09:00
atroxaper joined
09:01
aindilis joined
09:06
aindilis left
09:08
ravenousmoose_ joined
09:10
aindilis joined
09:11
demanuel joined
09:13
pistacchio left
09:14
pistacchio joined
09:22
w_richard_w left
09:25
Manas joined
09:27
Manas left
09:44
ctilmes left
09:55
ctilmes joined
10:03
pistacchio left,
pistacchio joined
10:04
dalek joined,
ChanServ sets mode: +v dalek,
p6lert_ joined,
synopsebot joined,
Geth joined,
ChanServ sets mode: +v synopsebot,
ChanServ sets mode: +v Geth,
synopsebot_ left,
p6lert left,
atweiden-air joined
10:17
domidumont left
10:24
atweiden-air left
|
|||
atroxaper | Hello, #perl6 ! | 10:37 | |
kawaii | AlexDaniel: morning! Yes I agree since it's getting close to cutting 2019.04. I'll provision some server space at work to get it running this week. | ||
AlexDaniel | yaay | ||
kawaii: also if you can get me the json file from the output I'd love that | |||
(to update ecosystem-unbitrot issues) | 10:38 | ||
atroxaper | Do we support variadic functions in NativeCall? en.wikipedia.org/wiki/Variadic_function#In_C | ||
10:45
ctilmes_ joined
|
|||
timotimo | just recently there was a proof-of-concept gist posted | 10:46 | |
but i think it might still be missing something related to varargs calling conventions | |||
ctilmes_ | atroxaper: If there are only a few different variations you need, you can define each of them (like 1 name for 2 args, 1 for 3 args) | 10:47 | |
timotimo | but aren't you also forced to put the "number of arguments actually passed" into a certain register? | ||
ctilmes_ | If it requires that I don't know how to do it. | 10:51 | |
10:55
andrzejku joined
10:59
araraloren joined
|
|||
lizmat | weekly: blogs.perl.org/users/pawel_murias/2...hrome.html | 11:05 | |
notable6 | lizmat, Noted! | ||
11:05
mowcat joined
11:15
pmurias joined
11:18
zakharyas left
|
|||
timotimo | dyncall does say it has support for varargs | 11:22 | |
... i can't find anything about varargs in dyncall | 11:26 | ||
atroxaper | timotimo: journald native subs uses variadic. There are complex cubs without it - will use them. | ||
timotimo | cubs? like little bear babies? | 11:27 | |
atroxaper | ctilmes_: I thought so too :), but in my case I do not know a types of arguments. | ||
ctilmes_ | You can do some fancy things with tcc (github.com/CurtTilmes/perl6-tcc) embeds a C compiler into your program | 11:28 | |
atroxaper | timotimo: yes. ~complex~ cubs xD | ||
timotimo | - updated API, introduced DC_CALL_C_ELLIPSIS_VARARGS | ||
pmurias | blogs.perl.org/users/pawel_murias/2...hrome.html # Rakudo.js update draft (the test runner is still undergoing last minute fixes to work on machines that aren't mine) | ||
timotimo | so, anybody want to try figuring varargs support out? :) | 11:29 | |
atroxaper | ctilmes_: TCC?! Brilliant! I will leave it as a last resort :) | 11:30 | |
ctilmes_ | TCC is nice in that you have complete power, but it isn't really a great general solution to publish in a module | 11:31 | |
atroxaper | ctilmes_: agreed | ||
... will be back | |||
11:32
atroxaper left
|
|||
timotimo | If the function being called is variadic (varargs) then ffi_prep_cif_var must be used instead of ffi_prep_cif. ffi_status ffi prep cif var (ffi cif *cif, ffi abi varabi, unsigned int [Function] nfixedargs, unsigned int varntotalargs, ffi type *rtype, ffi type **argtypes) | 11:33 | |
so that's how you do it in libffi | |||
11:40
aborazmeh joined,
aborazmeh left,
aborazmeh joined
11:44
pistacchio left,
ctilmes_ left,
pistacchio joined
11:58
domidumont joined
11:59
ctilmes_ joined
|
|||
pmurias | github.com/pmurias/perl6-js-roast-test-runner should now work | 12:02 | |
12:03
cpan-p6 left
|
|||
pmurias | it would be super cool if someone tested that at least running a single test works on boxes other then mine | 12:03 | |
12:03
cpan-p6 joined,
cpan-p6 left,
cpan-p6 joined
12:08
ctilmes_ left
12:10
syntaxfree left,
pistacchio left
12:11
pistacchio joined
12:14
andrzejku_ joined
12:17
andrzejku left
12:23
fnux left
12:31
kubrat left
12:34
Altai-man_ joined
12:38
sena_kun left
12:51
kubrat joined
12:55
aborazmeh left
12:59
netrino joined
13:03
robertle left
13:04
andrzejku joined,
zakharyas joined
13:07
andrzejku_ left,
robertle joined
13:11
ufobat_ joined
13:14
pmurias left
13:15
ufobat left
|
|||
lizmat | and another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2019/04/08/...aking-off/ | 13:16 | |
13:17
i1nfusion left,
i1nfusion1 left
13:20
andrzejku left
13:21
atroxaper joined
13:33
quipa joined
13:37
skids joined
13:38
[Coke] joined,
[Coke] left,
[Coke] joined
13:39
__jrjsmrtn__ joined
13:41
_jrjsmrtn left
13:42
MilkmanDan left,
robertle left
|
|||
[Coke] | If you're interested in serving on the TPF GC or want to suggest someone, please ping me via email (I am not on IRC frequently anymore). | 13:42 | |
yoleaux | 24 Mar 2019 00:04Z <timotimo> [Coke]: my emails aren't reaching alan, could you point my latest blog post out to him? (google mail is telling me it thinks my mails are spam) | ||
[Coke] | .msg timotimo don't @ me - use email. I'm not really on IRC anymore. | 13:43 | |
yoleaux | [Coke]: Sorry, this command is admin-only. | ||
13:43
MilkmanDan joined
|
|||
[Coke] | .msg timotimo don't msg me - use email. I'm not really on IRC anymore. | 13:43 | |
yoleaux | [Coke]: Sorry, this command is admin-only. | ||
[Coke] | .tell timotimo don't msg me - use email. I'm not really on IRC anymore. | ||
yoleaux | [Coke]: I'll pass your message to timotimo. | ||
13:43
vrurg joined
13:49
robertle joined
13:52
lucasb joined
13:59
[Coke] left,
SergiusUA joined
14:12
curan left
14:28
holyghost joined
|
|||
holyghost | hello, back again | 14:29 | |
I'm going to do some audio effects tomorrow (wikipedia - audio effects) | 14:32 | ||
for in the perl6 DAW | |||
15:11
patrickb left
15:13
SergiusUA left
|
|||
AlexDaniel | oh yay, a debian sid user | 15:24 | |
using the distro packages :) | |||
15:29
pmurias joined,
jmerelo joined
15:36
araraloren left
|
|||
holyghost | hi JJ, I'm going to try to put the docs in my packages, I took a month of vacation | 15:37 | |
15:46
lichtkind joined
|
|||
holyghost | I'm going to search for the Wario nintendo GBoy games and recreate them on perl6 SDL2 | 15:47 | |
The graphics system I have on Xliff's server, now I need gfx | |||
and my simple game system | |||
jmerelo | holyghost: lucky you :-) | ||
holyghost | :-0 | 15:48 | |
s/O/) | |||
I'll post it on github later on | |||
15:49
pmurias left
|
|||
holyghost | I'm glad the SDL2 system is in place | 15:52 | |
The gfx loop is in and I just need to put in a game system | 15:53 | ||
which I have but needs tuning for my DAW and perl6 game software, I might need to write another game kit than the Game::Markov things | 15:54 | ||
SmokeMachine | is there a docker image of Rakudo star 2019.03.1? | ||
15:58
abraxxa left,
abraxxa joined
15:59
domidumont left
16:00
abraxxa left,
robertle left
|
|||
jmerelo | SmokeMachine: I can create one in a while for you if you want... | 16:01 | |
SmokeMachine: as a matter of fact, the jjmerelo/alpine-perl6 is up to date with 2019.03.1 Core language should be the same, unless you want the packaging, of course... | 16:02 | ||
SmokeMachine | jmerelo: Thanks! Ill use it... I just want to test a reported bug on Red that I can't reproduce: github.com/FCO/Red/issues/135#issu...-480790839 | 16:03 | |
jmerelo | SmokeMachine: I do have it on my machine anyway. Will check it out. | 16:06 | |
SmokeMachine | jmerelo: thanks... | 16:07 | |
jmerelo | SmokeMachine: but you tried it already with 2019.03.1, right? It's in the comments... | 16:08 | |
SmokeMachine | jmerelo: yes, but the master (using rakudobrew)... But I have averything installed and working... I was trying with docker to test it from 0... | 16:10 | |
jmerelo | SmokeMachine: the jjmerelo/test-perl6 container should do that directly if you don't need any additional external libraries to install... | 16:11 | |
SmokeMachine: it's testing OK with 2019.03.1. I installed everything from scratch, including DBIIsh, which complained a bit but got installed anyway | 16:13 | ||
SmokeMachine | jmerelo: have you installed from the repo? | 16:15 | |
jmerelo | SmokeMachine: yep | 16:16 | |
16:17
agentzh left
16:19
agentzh joined,
agentzh left,
agentzh joined
16:23
someuser joined
|
|||
SmokeMachine | I had to install gcc, postgres-client, mysql-client, mysql-dev, sqlite-libs, but its not installing NativeLibs yet... | 16:25 | |
jmerelo: ^^ | |||
jmerelo | SmokeMachine: ah, I didn't install any of that... that's why it complained. Maybe Red skipped that test? | 16:29 | |
16:29
zakharyas left
|
|||
jmerelo | SmokeMachine: if you are going to use all that, you'll need to install a bit of that inside the container. Best thing would be to create a custom container for testing it. | 16:29 | |
SmokeMachine | jmerelo: I had to `--force-test` the NativeLibs... but now Red is installed... I couldn't reproduce the error... | 16:31 | |
jmerelo: yes.. I think Ill do that... | |||
16:49
ctilmes1 joined
|
|||
ctilmes1 | NativeLibs is installed in an unfortunate manner. There is an older version embedded within DBIish, and a later, better version installed by itself | 16:50 | |
"use NativeLibs" will force an install of DBIish, so it can get the older one | |||
16:51
ssm left
16:55
vrurg left
16:56
jaldhar_ left,
jaldhar_ joined,
robertle joined
|
|||
cpan-p6 | New module released to CPAN! LogP6 (1.4.1) by 03ATROXAPER | 16:58 | |
tony-o | . | 17:04 | |
17:09
vrurg joined
17:13
vrurg left
17:14
vrurg joined
17:23
domidumont joined
|
|||
guifa | What would be the best way to get IEEE-style rounding? (where, e.g. 1.5 rounds up to 2, but 2.5 rounds down to 2)? | 17:26 | |
Kaiepi | how do i start a new topic on the perl 6 users mailing list? | 17:27 | |
jmerelo | guifa: because of the IEEE 754 representation? | ||
Kaiepi: just send an email, I guess. Don't think there's GUI for that. | |||
Kaiepi | ok i'll try that | 17:28 | |
17:28
cpan-p6 left
17:29
cpan-p6 joined,
cpan-p6 left,
cpan-p6 joined
|
|||
guifa | jmerelo: yup, for number formatting in CLDR supposed to use half-even rounding. , but .round uses half-up | 17:29 | |
jmerelo | guifa: unless you hack it somehow, I'm afraid you'll have to program a new round method | 17:33 | |
guifa | I mean *technically* it says implementations are free to have the rounding method they want, but it strongly implies the half-even should always be an option. And I really should hew close to other implementations | 17:34 | |
jmerelo | guifa: you can try and propose it in the problem-solving repo; but other than that, you're on your own, I guess. | 17:36 | |
tony-o | that'd be an easy thing to put in rakudo, i could add it if you want to open a ticket guifa (github.com/rakudo/rakudo/issues) | 17:38 | |
Kaiepi | jmerelo, sending an email to [email@hidden.address] works. thanks | 17:39 | |
guifa | tony-o++ I’ll put in a ticket. I have a feeling I won’t be the only person that will eventually need it | ||
jmerelo | Kaiepi: sure :-) | ||
17:47
vrurg left,
vrurg joined
17:57
kurahaupo joined
17:58
kurahaupo left,
kurahaupo_ joined
17:59
Kaiepi left
18:00
Kaiepi joined
18:14
Cabanossi left
18:18
vrurg left,
vrurg joined
18:19
|oLa| left,
|oLa| joined
18:20
Cabanossi joined,
kawaii left,
isacl___ left,
Spot_ left,
kawaii joined
18:21
Spot_ joined,
isacl___ joined
18:25
Cabanossi left
18:26
sauvin left
18:27
Cabanossi joined
18:29
atroxaper left
18:35
jaldhar_ left
18:44
Kaiepi left
18:46
vrurg left,
Kaiepi joined,
vrurg joined
18:50
domidumont left
19:00
ctilmes_ joined
19:01
ctilmes left
19:02
ctilmes1 left
19:04
ctilmes joined,
ctilmes_ left
19:06
vrurg left
19:07
vrurg joined,
Kaiepi left
19:31
jmerelo left
19:40
kurahaupo_ left,
kurahaupo joined
19:42
someuser left
19:51
Kaiepi joined
19:57
SCHAPiE left
19:59
MidCheck left,
SergiusUA joined
20:01
Black_Ribbon joined
20:06
pmurias joined
20:08
SCHAPiE joined
20:11
SergiusUA left
|
|||
guifa | Is having multiple alias considered good / bad / neutral? For example, I’ve got a parameter “maximum-significant-digits”. That mirrors the usage in ICU and other support docs, but it seems natural to want some variants. max-sd is about as terse as it could get, but then I wonder if Is hould allow “max-significant-digits”, “maximum-sig-digits”, “max-sig-digits” as well. | 20:12 | |
Altai-man_ | I'd go with `maximum-significant-digits` or `max-significant-digits` if you want to make it a bit shorter. `max-sd` doesn't tell the reader what it is immediately, like, "Max system disk" or "Max super driver" or... | 20:15 | |
it sure is pretty long, of course, but there is no much can be done. | 20:16 | ||
timotimo | hopefully your code editor or ide can autocomplete :) | 20:17 | |
yoleaux | 13:43Z <[Coke]> timotimo: don't msg me - use email. I'm not really on IRC anymore. | ||
Altai-man_ | yes, in best case it should be on IDE. | 20:18 | |
guifa | Heh, ideally most of this stuff is auto filled in. Number formatting is hideous with all the options. | ||
do you show the decimal separator or no? And if so, what is it? Do you group thousands? What’s the distance between the decimal and the first one, and then from the first one onward? Max minimum integer, significant, fractional, and exponential digits, padding and rounding, prefixes and suffixes *sigh* | 20:20 | ||
Kaiepi | what scope would GLOBAL::<foo> be in? | 20:21 | |
gabc | hi, is there a reason why there is a need for parenthesis around a block? why can't I do `.map { say $_ }` or something like that? | ||
guifa | gabc: you’re passing it to the method .map. You use a colon if you’re not chaining it | 20:22 | |
`.map: {say $_ }` for instance | |||
gabc | Ooooh indeed | ||
moritz | gabc: without any separators, `.map { say $_ }` would be two terms in a row, which Perl 6 generally forbids | ||
without this rule, it would be nearly impossible to generate good syntax error messages | 20:23 | ||
gabc | That is fair, thanks! :) | ||
guifa | And .map{$_} would be looking for the a key with value $_ in the attribute map :-) | ||
20:23
kurahaupo left,
kurahaupo joined
|
|||
guifa | (theoretically, at least, It would probably error) | 20:24 | |
discord6 | <Tyler (Aearnus)> I don't have my computer with me but a thought popped into my mind: can you use unions as a way to emulate sum types? Something like my (Int | Bool) $v = 10; #or $v = True | ||
gabc | I see, thanks for the insights :) | 20:25 | |
20:25
Altai-man_ left
20:26
ctilmes_ joined
|
|||
guifa | Aernus: nope. | 20:27 | |
AlexDaniel | but… but! | ||
guifa | p6: my (Int|Bool) $foo; | ||
evalable6 | (exit code 1) 04===SORRY!04=== Error while compiling /tmp/kk6iP1dPzu Term definition requires an initializer at /tmp/kk6iP1dPzu:1 ------> 03my (Int|Bool)08⏏04 $foo; |
||
discord6 | <Tyler (Aearnus)> hmm... can you define a union operator that wraps the generated union in some type of way to do that? | 20:28 | |
guifa | eh if I think I understand what you’re wanting you can use a where clause | 20:29 | |
p6: my $foo where Int | Str; $foo = “bar”; $foo = 10; | |||
20:29
ctilmes left
|
|||
evalable6 | 20:29 | ||
guifa | but | ||
discord6 | <Tyler (Aearnus)> I specifically wanted to manipulate the sum type as an object -- a where clause would normally work for every other situation | ||
20:29
Xliff joined
|
|||
guifa | p6: my $foo where Int | Str; $foo = 2.5 | 20:29 | |
evalable6 | (exit code 1) Type check failed in assignment to $foo; expected <anon> but got Rat (2.5) in block <unit> at /tmp/fQHeYW9N43 line 1 |
||
Xliff | m: my @a = ('Gtk'); (my $type = 'GtkGrid') ~~ | 20:30 | |
s/ ( @p ) ( <[A..Za..z]>+ )/{ $0.uc }::{ $1 }/; say $type | |||
evalable6 | (exit code 1) 04===SORRY!04=== Error while compiling /tmp/CGGHzNX4hX Missing… |
||
Xliff, Full output: gist.github.com/8e2aa2a27f9d830d2a...5d871a0c2f | |||
Xliff | m: my @a = ('Gtk'); (my $type = 'GtkGrid') ~~ s/ ( @p ) ( <[A..Za..z]>+ )/{ $0.uc }::{ $1 }/; say $type | ||
evalable6 | (exit code 1) 04===SORRY!04=== Error while compiling /tmp/9aYQmBqjtx Variabl… |
||
Xliff, Full output: gist.github.com/5b30a967814f3e347d...c138a5bc61 | |||
Xliff | m: my @a = ('Gtk'); (my $type = 'GtkGrid') ~~ s/ ( @a ) ( <[A..Za..z]>+ )/{ $0.uc }::{ $1 }/; say $type | ||
evalable6 | GTK::Grid | ||
AlexDaniel | m: class Foo { has $.a }; class Bar { has $.b }; my $x = Foo.new(:42a) but Bar.new(:56b); say $x.a; say $x.b | 20:31 | |
evalable6 | (exit code 1) 42 No such method 'b' for invocant of type 'Foo+{<anon|1>}'. Did you mean 'a'? in block <unit> at /tmp/gAVzx_5H5D line 1 |
||
AlexDaniel | why is this not working? | ||
I thought it should | |||
m: class Foo { has $.a }; class Bar { has $.b }; my $x = Foo.new(:42a) but Bar.new(:56b); say $x.a; say $x.Bar.b | |||
evalable6 | 42 56 |
||
guifa | So you’re wanting it to be a Int, but be able to assign a boolean value for wherever it gets used as a boolean separate from the integer value? Sorry for the questions just want to make sure I’m getting it to do what you’re wanting | 20:32 | |
discord6 | <Tyler (Aearnus)> Less struct, more union. I want it to be able to store one or the other, not both | ||
AlexDaniel | m: class Foo { method a { 42 } }; class Bar { method b { 50 } }; subset Baz where Foo | Bar; my Baz $x = Foo.new; $x = Bar.new | 20:34 | |
evalable6 | |||
discord6 | <Tyler (Aearnus)> I guess the where clause works | ||
guifa | I think the where clause should work then. When you assign, it will check that it’s one or the other | ||
AlexDaniel | m: class Foo { method a { 42 } }; class Bar { method b { 50 } }; subset Baz where Foo | Bar; my Baz $x = Foo.new; $x = Bar.new; $x = Int | ||
evalable6 | (exit code 1) Type check failed in assignment to $x; expected Baz but got Int (Int) in block <unit> at /tmp/4vy9LxwYMN line 1 |
||
guifa | ^^ The subset will let you name it, if you’ll use it a lot. | 20:35 | |
discord6 | <Tyler (Aearnus)> Ooh yes subsets That looks much better to me | 20:36 | |
<Tyler (Aearnus)> That feels like a very theorem-prover-y way to use subset. It's fantastic | 20:37 | ||
guifa | The nice thing about subset is you’ll be able to do type checks for that Int-Bool-Combo, BUT unfortunately you type check against Int or Bool strictly because the .WHAT and the .isa won’t return Int or Bool. | 20:38 | |
There may be a way to figure out the classes it’s made of, but I’m not sure off the top of my head | |||
20:38
ctilmes joined
20:39
ctilmes_ left
|
|||
AlexDaniel | Bool is already an Int, no? | 20:40 | |
yes | |||
guifa | Yeah in this particular case both are Cool | ||
AlexDaniel | not just that, but both are Int | 20:41 | |
guifa | So I think you’d be safe to ask for Int() or Bool() in a sub | ||
errrrr | 20:42 | ||
I stand corrected | |||
discord6 | <Tyler (Aearnus)> Perhaps it's smart to define a custom | operator that does the same thing, but also redefines .WHAT | ||
20:43
zachk joined
|
|||
guifa | p6: class A { ; }; class B { ; }; subset Foo where A|B; my Foo $a = A.new; say $a.isa(A); say $a.isa(B); | 20:43 | |
evalable6 | True False |
||
discord6 | <Tyler (Aearnus)> nice :^) | 20:44 | |
20:44
zachk left,
zachk joined
|
|||
guifa | But … | 20:44 | |
p6: class A { ; }; class B { ; }; subset Foo where A|B; my Foo $a = A.new; say $a.isa(A); say $a.isa(B); say $a.isa(Foo) | |||
evalable6 | True False False |
||
discord6 | <Tyler (Aearnus)> Ohh, it's because the subset doesn't define a type it is the subset of | 20:45 | |
<Tyler (Aearnus)> So you're not constraining the type in that way, I guess | |||
guifa | yeah, but the docs say “A subset declares a new type that will re-dispatch to its base type” | ||
discord6 | <Tyler (Aearnus)> If you said something like subset Foo is Cool where Int|Bool it'd probably do what you expect | 20:46 | |
guifa | That doesn’t work. Can’t is Type/Class a subset it seems (lacks the add_parent method) | 20:47 | |
20:49
ayerhart left
|
|||
discord6 | <Tyler (Aearnus)> Err, I meant of not is | 20:49 | |
20:53
kurahaupo left,
kurahaupo joined
|
|||
guifa | Oh duh | 20:54 | |
I’m an idiot | |||
You can check via .does(Foo) and not .isa(Foo) | 20:55 | ||
Because it’s a role and not a class | |||
Geth | doc: Kaiepi++ created pull request #2711: JS nutshell: clarify variables section, clean up code examples |
20:57 | |
20:58
ayerhart joined
|
|||
guifa | also, aearnus and AlexDaniel: thanks for getting me to remember about the subsets and where unions. Will make some of my Intl module codes much cleaner with a Str|LanguageTag union | 21:01 | |
AlexDaniel | I wouldn't call it a union though :) | 21:02 | |
guifa | I mean yeah. But I dunno a better word for it ha | ||
AlexDaniel | junction | ||
guifa | err junction | ||
guifa needs more sleep | 21:03 | ||
21:03
skids left
21:04
antanst8 joined,
antanst left
|
|||
discord6 | <Tyler (Aearnus)> Err yeah I kept calling them unions too Figures why I couldn't find them in the docs | 21:09 | |
21:09
kurahaupo left,
kurahaupo joined
21:11
kurahaupo left,
kurahaupo joined
21:15
pistacchio left,
pistacchio joined
21:19
pistacchio left
21:20
denix13 joined
21:23
denix13 left
21:29
vrurg left,
vrurg joined
|
|||
SmokeMachine | Excuse me... but could, please, some one help me? Can anyone reproduce this error? github.com/FCO/Red/issues/135#issu...-480790839 | 21:32 | |
tony-o | wonder what the output of his git status is | 21:34 | |
or git diff | |||
SmokeMachine | tony-o: he tried with a fresh clone... | 21:35 | |
tony-o: some tries after that... | 21:36 | ||
21:38
choiboi_ left
|
|||
Xliff | How can I create a private class variable? | 21:43 | |
tony-o | he has a file from building/testing/attempting install of red `site#source/D10D41AB1ED8F1B8E05FB2205140E2E2710D3419` | ||
Xliff | Just "class A { my $a }" ?? | ||
tony-o | Xliff: class A { has $!a; } | ||
discord6 | <Tyler (Aearnus)> Xliff: using has $!a | ||
<Tyler (Aearnus)> ah shoot, ninja'ed | |||
Xliff | tony-o: private class variable. | 21:44 | |
tony-o | that is private. | ||
Xliff | not an attribute. | ||
guifa | my $a works | ||
Xliff | That is a private attribute. Its lifetime is over an instance. | ||
tony-o | ah, then my $a works | ||
Xliff | OK. Thanks. | ||
ugexe | That will be included in all classes | 21:45 | |
class instances | |||
(which is probably why you want it...) | |||
tony-o | SmokeMachine: he has other files in his repo from building that would be clues to how that error is happening | ||
in his last response, it's the file `/home/bazzaar/git_projects/p6code/Red/site#sources/D10D41AB1ED8F1B8E05FB2205140E2E2710D3419` | 21:46 | ||
ugexe | Seems like their perl6 install is screwy | 21:47 | |
tony-o | looks like it needs nuke | 21:48 | |
SmokeMachine | hum! I haven’t seen that!!! Thank you guys! | ||
21:49
pistacchio joined
|
|||
Xliff | m: my $a = --> Int { 1 }; $a().say | 21:49 | |
evalable6 | (exit code 1) 04===SORRY!04=== Error while compiling /tmp/cE8NCqloPp Prefix … |
||
Xliff, Full output: gist.github.com/2b0be65a19d7dd02c7...0397cbb23e | |||
Xliff | m: my $a = -> --> Int { 1 }; $a().say | ||
evalable6 | 1 | ||
Xliff | OK. Well at least I had that right. | ||
22:06
ayerhart_ joined
22:09
ChoHag left
22:10
ayerhart left,
ChoHag joined
22:11
ayerhart_ left
22:14
ayerhart joined
|
|||
Xliff | Hmm... this is odd. | 22:19 | |
I can use the following module "use SourceViewGTK::View", however when I try to "require .value" where $_.value is "SourceViewGTK::View", I get an error: "Could not find SourceViewGTK::StyleChooserWidget in:..." | 22:20 | ||
Before you ask, yes, the lib directory is included in the list of libs. Otherwise the initial "use SourceViewGTK::View" would not work. | 22:21 | ||
Is there something about require that ... ahem... requires special handling? | |||
timotimo | i think that's a compile-time/run-time thing | 22:23 | |
the require happens at run time, but perhaps the error happens at compile time | |||
you may have to indirectify this | |||
Xliff | Ah. I do require "::( .value )" and it hangs. Progress! | ||
OK. No hang, but long time processing. Finally got another recurring error. Definitely progress. So you were right about the indirectify. timotimo++ | 22:24 | ||
timotimo | phew :) | ||
perhaps have to go via GLOBAL:: | |||
Kaiepi | how would you say what named parameters are mainly used for? | 22:25 | |
i'm writing up the functions section of the js nutshell page but there is no equivalent to them in javascript | |||
22:28
rindolf left
|
|||
Xliff | Maybe. I keep getting "Type check failed for return value; expected Str but got Whatever (*)" when I do "::(.value).new()" | 22:32 | |
And NONE of those routines require a string return value. | |||
22:33
ayerhart left
22:35
skids joined
|
|||
timotimo | what does --ll-exception point at? | 22:37 | |
Kaiepi: often what you'd use "true" or "false" in random places in js you'd have as a named parameter in perl6 | 22:38 | ||
22:38
pmurias left
|
|||
timotimo | also in javascript you have some apis that rely on "configuration objects" to be passed | 22:39 | |
guifa | Kaiepi: As a general rule, I tend to think of them as options. Consider a program like cp. We all know the basic and 99% use case is cp foo bar; but sometimes we need options, so we get cp -R foo bar. That’s a prime use case for the named parameters | ||
timotimo | like jquery's ajax thingie; you pass an object with the url, data, type, success/failure callbacks, ... | ||
ugexe | require "::( .value )" this isn't going to do anything | 22:40 | |
its a literal string value | |||
no quotes are needed here | |||
22:41
DarthGandalf left
|
|||
timotimo | oh, d'oh, of course | 22:42 | |
ugexe | fwiw you might try `(require ::($ = "some string")).new` | ||
22:43
ayerhart joined
22:44
|oLa| left
|
|||
guifa | Kaiepi: they can also be good in where in other langauges you’d have a some sort of a fluent interface | 22:44 | |
ugexe | i'm not sure what that might fix, but zef had a similar problem at one point that requires the `$ =`: github.com/ugexe/zef/blob/a1d6d543...f.pm6#L133 | ||
22:44
Sgeo_ joined
|
|||
Xliff | ugexe: So I can't require something at the lexical level for use, later? | 22:46 | |
I'm using `require ::(.value)' | |||
22:46
Sgeo left
|
|||
tony-o | try require ::("{.value}") | 22:47 | |
ugexe | you can, i was just shortening the two steps down | ||
tony-o | there's a couple of spots in DB::Xoos where that was required too | ||
22:47
lichtkind left
|
|||
Xliff | OK. So after I do that, why does any indirect all say "expecting return value of Str but got Whatever (*)" | 22:47 | |
ugexe | m: require ::("Test"); | 22:48 | |
evalable6 | |||
Xliff | And why would ::({ $value }) be any different than ::( $value ) | ||
ugexe | so it must be weird | ||
Xliff | m: my $a = 'Test'; require ::( $a ) | ||
evalable6 | |||
Xliff | m: my $a = 'Test'; require ::( $a ); my $t = ::( $a ).new; $t.^name.say | 22:49 | |
evalable6 | (exit code 1) You cannot create an instance of this type (Test) in block <unit> at /tmp/i3VA2Chn9w line 1 |
||
Xliff | *shrug* | ||
ugexe | Test isnt a class, its a module/package | ||
tony-o | Xliff: it loads the file in a different way if you do "{.value}" | ||
Xliff | tony-o: Really? | 22:50 | |
tony-o | than just a bare .value | ||
yes | |||
ugexe | im not sure thats true | ||
tony-o | err sorry, i'm thinking of .IO | ||
timotimo | probably want .Str | ||
Xliff | OK. So no difference, then? | ||
tony-o | loads differently than Str | ||
so you want .Str | |||
but you definitely want to make sure it's a Str | 22:51 | ||
Xliff | Isn't "{.value}" already a Str? | ||
And yes, I am sure .value is a Str | |||
ugexe | it has an additional lexical scope, that could possible cause an issue to disappear | ||
timotimo | m: $_ = "hello"; say "{$_}" | ||
evalable6 | hello | ||
timotimo | m: $_ = "hello"; say "foo {$_} bar" | ||
evalable6 | foo hello bar | ||
ugexe | did you try ::($ = ...) ? | ||
Xliff | OK. Will try. Doing a full rebuild after a rakudobrew | 22:52 | |
timotimo | it doesn't get its own $_ at least :) | ||
Xliff | ugexe: No. Doing a full rebuild. That's on the lisdt | ||
ugexe | ah, the good ol days when `"{foo}"` wasn't thread safe | ||
m: my $w = *; require $w | 22:55 | ||
evalable6 | (exit code 1) No such method 'IO' for invocant of type 'Whatever' in block <unit> at /tmp/grJq6RXTDq line 1 |
||
ugexe | i demand this loads a random module | 22:56 | |
tony-o | lol | 22:57 | |
timotimo | it should load all modules | ||
all versions of every module, too | |||
tony-o | jvms die everywhere | 22:58 | |
Kaiepi | what's a practical example of using optional parameters that wouldn't be better written using named parameters? | 23:18 | |
tony-o | if you have a case where the subsequent optionals rely on earlier optionals having them positional rather than named helps | 23:20 | |
rely on earlier options being defined, i mean | 23:24 | ||
guifa | take split | ||
ugexe | anything that would take *@. e.g. chmod(@files), not chmod(files => @files) | ||
guifa | there’s only really one really common option besides the mandatory delimiter — the limit. | 23:25 | |
Or another way. If you feel like 2 paremeters will be the *norm*, but things work just fine with the first one, I’d make it an optional positional | 23:29 | ||
ugexe | of course if you are using methods/classes then you might avoid positionals altogether to make inheritance easier | 23:30 | |
guifa | substr probably falls under that one. substr($start, $length) is how most calls will be made. But substr($start) works fine — just means it gulps up the rest of the string | ||
23:31
quipa left
|
|||
ugexe | timotimo: use Test:ver(*) only loads one version of test though, not all of hem | 23:37 | |
someone should file a bug that :ver(*) isnt loading all versions | 23:38 | ||
23:41
vrurg left,
vrurg joined
23:51
lucasb left
|