»ö« 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:02
irced joined
|
|||
irced | hi when I launch a process via Proc::Async.new and start it, the process appears to be killed when my script exits, even after I call start. Maybe it is not starting before the script exits? or maybe it is actually killing the process upon exit? how can I ensure that a process is fired and forgotten upon exit? | 00:05 | |
tellable6 | 2019-08-26T22:03:34Z #perl6 <guifa> irced: Take a look at the name token. Two things: | ||
irced | guifa: thanks for your feedback on subparse on august 26 | 00:08 | |
got that tellable6? | 00:09 | ||
AlexDaniel | irced: no, because guifa is here :) | 00:10 | |
00:10
|oLa| left
|
|||
AlexDaniel | but you can use .tell to force it to pass the message | 00:10 | |
irced rubs his eyes. | |||
AlexDaniel: thanks! | |||
.tell guifa: thanks for your feedback on subparse on august 26 | 00:11 | ||
tellable6 | irced, I'll pass your message to guifa | ||
AlexDaniel | irced: it's not a perl6 issue, I'm pretty sure you'll see the same behavior everywhere else | ||
irced | basically, with Proc::Async (or any process launcher) I want a script that launches the process and exits immediately. | ||
i have a bash script that with & proceeds even after exit | 00:12 | ||
AlexDaniel | it doesn't, try closing your terminal | ||
irced | AlexDaniel: well basically i want to reproduce what I can do when calling my bash script from an open terminal session but use perl6 not the bash script. | 00:13 | |
AlexDaniel: that is call the perl6 script instead of the bash script and get the same behavior that & after the command results in | 00:14 | ||
AlexBaniel: from my bash shell, while the terminal is still open. | |||
so I have a command, which specifically is the sox play command that in a bash script I can do play whatever.wav & | 00:15 | ||
or actually it's play.whatever.wav 2>/dev/null & | |||
anyway, the bash script will start playing as expected and in the meantime exit and return me to my bash prompt | |||
can a perl script also exit to my bash prompt and still allow the process to start-finish ? | 00:16 | ||
perl6 | |||
irced maybe should be looking at exec | |||
AlexDaniel | irced: no you should be looking for a way to detach the child process | 00:17 | |
irced | AlexDaniel: sounds about right. | ||
irced starts thinking. | |||
AlexDaniel | see this for some info: unix.stackexchange.com/a/148698/221501 | 00:18 | |
irced starts reading. | |||
AlexDaniel | but that's not it | 00:20 | |
irced | i dunno, could be something there | ||
there's disown for one | 00:21 | ||
disown [-h] [-ar] [jobspec ... | pid ...] | |||
irced eyes the pid. | |||
then there's nohup | 00:22 | ||
disown is a builtin, that might be an obstacle .. .. .. | |||
AlexDaniel | no, cuz you don't need disown… | ||
irced decides to roll a nohup. | 00:23 | ||
irced starts editing. | |||
AlexDaniel | I guess it would've been easier if we had `fork`, but we don't | 00:24 | |
maybe nativecall and popen? I'm not sure, really… | |||
irced | AlexDaniel: yes, that is certainly an avenue to consider! | 00:25 | |
AlexDaniel: an asynchronous native call could be just the thing. | |||
irced has not lost faith in nohup / disown as of yet. | 00:26 | ||
irced moves on to disown utilizing pid | 00:28 | ||
AlexDaniel | no-no, hold on | 00:29 | |
you have to understand what's going on there exactly | |||
but have you tried something like this? perl6 -e 'start { run <nohup play -n synth 3 triangle 800-500> }; sleep 0.1' | 00:30 | ||
should also work with Proc::Async | 00:31 | ||
`sleep` is there to make sure it doesn't exit before the process is started, with Proc::Async you can handle it better | |||
irced eyes the sleep command. | 00:32 | ||
AlexDaniel | the sound lasts much longer than 0.1s | ||
irced | i was thinking about that | ||
lessee | |||
irced smiles. | |||
00:33
Sgeo__ joined
00:36
Sgeo_ left
|
|||
AlexDaniel | honestly, I myself don't quite get it. So the parent exits, and nohup prevents SIGHUP from terminating the process, and that's it? | 00:37 | |
I thought it required a bit more than just letting the process become an orphan | 00:38 | ||
anyway, someone probably knows much more about this stuff and will likely scream at my once they read these messages :) | |||
irced | AlexDaniel: interesting, i have confirmed it works with a short sound sample but not with Proc::Async (that is it won't work with Proc::Async).trying now with a longer sound | 00:39 | |
wow, it is working with a longer sound sample | 00:43 | ||
irced smiles. | |||
irced starts making some adjustments. | 00:44 | ||
AlexDaniel: thanks for your creative input on this! | |||
I'll see if I can speak to the nohup part of it after I try without. | |||
so, nohup is just another way of suppressing the standard outputs it appears | 00:45 | ||
irced continues to tweak. | 00:46 | ||
but without nohup run bombs if the :err adverb .. hmm | 00:47 | ||
even with nohup. so this worked but nohup (without any arguments anyway) outputs some bleeps which means it is only satisfying part of my objective of reproducing play whateversound.wav 2>/dev/null & | 00:50 | ||
irced reconsiders async and grabbing the pid and operating on it with the builtin disown | |||
note that the process seems to run if I don't try to redirect err | 00:53 | ||
ok, for some reason things are behaving as expected even with super short sound samples (whereas before it wasn't but i wasn't doing much differently). anyway, i settled on the following: | 00:59 | ||
my $proc = Proc::Async.new('play', $cmd-arg, :err); my $h = '/dev/null'.IO.open(:w); $proc.bind-stderr($h); $proc.start; | |||
now another can of worms is i have to type stty sane afterwards doh! | 01:01 | ||
solved it, added :out adverb (which apparently is used by SoX to make thing sane ?? 😃) | |||
so fingers crossed looks like with your help discussing it i arrived at a solution. thanks again AlexDaniel. | 01:02 | ||
irced added $proc.bind-stdout($h) | 01:07 | ||
i think i just pulled a nohup 😃 | 01:08 | ||
01:11
molaf left
01:24
molaf joined
01:33
rindolf left
01:51
hythm joined
|
|||
hythm | hello, Where can I find a list of all modules available in json format? ecosystem-api.p6c.org/projects.json this doesn't seem to have all available modules | 02:01 | |
02:04
Manifest0 left,
Manifest0 joined,
kurahaupo joined
02:06
adu joined
|
|||
vrurg | hythm: try modules.perl6.org | 02:13 | |
modules.perl6.org/search/?q=json | |||
hythm | vrurg: sorry about the confusion, this lists all modules have tagged with "json", I did not mean all json modules, I meant to get list of all the modules, similar to this ecosystem-api.p6c.org/projects.json (this does not have every available modules in module.perl6.org) | 02:17 | |
vrurg | hythm: Oh, I see. I confused myself. I'm afraid, ecosystem is the fullest list you could get. | 02:20 | |
AlexDaniel | hythm: what about ecosystem-api.p6c.org/projects.json and raw.githubusercontent.com/ugexe/Pe.../cpan.json | ||
hythm: ah, now I see you linked projects.json :) I think cpan.json is the one you are missing | 02:21 | ||
hythm: if both these files together are not full please let me know as that's exactly what I use in Blin github.com/perl6/Blin/blob/30d894c...p6#L35-L38 | 02:22 | ||
hythm | Thanks AlexDaniel, checking... | ||
02:31
Cabanossi left
02:35
Cabanossi joined
03:13
ravenous_ joined
03:18
ravenous_ left
03:27
AlexDani` joined
03:31
AlexDaniel left
03:48
AlexDani` is now known as AlexDaniel,
AlexDaniel left,
AlexDaniel joined
04:00
molaf left
04:32
irced left
04:35
proc joined
04:39
Black_Ribbon left
|
|||
proc | What's the correct way to use a variable within a character class? I've been trying to do something similar to the following which isn't working: "my $aa = 'abc'; my $bb = 'yabba'; say so $bb ~~ /<[$aa]>/;" | 04:39 | |
an error get printed that says: "Repeated character (a) unexpectedly found in character class" | 04:40 | ||
Grinnz | =~ is the match binder not ~~ | ||
anyway that looks right to me | 04:41 | ||
proc | when attempting to replace the ~~ with a =~ I get "Unsupported use of =~ to do pattern matching; in Perl 6 please use ~~" | 04:42 | |
There's a thread on the perl6-users mailing list w/ this very question. There have been lots of guesses, but no one actually knows how to do it. I just figured I ask here. | 04:45 | ||
04:53
MilkmanDan left
04:54
MilkmanDan joined
|
|||
hythm | how to write an array content to file without stratifying it first? the below code outputs "a 1", instead of "{a => 1}" | 04:55 | |
m: my %h = :1a; my @a = %h; 'test'.IO.spurt: @a; say slurp 'test'; | |||
evalable6 | (exit code 1) Failed to open file /home/bisectable/git/whateverable/test: Read-only file system in block <unit> at /tmp/Ie09BxRR_B line 1 |
04:56 | |
hythm | stringifying* | ||
Grinnz | whoops, didn't see the channel name :) | 04:57 | |
proc | s'ok | 04:58 | |
discord6 | <Aearnus> hythm: try .perl | 05:07 | |
<Aearnus> m: my %h = :1a; %h.perl.say | 05:08 | ||
evalable6 | {:a(1)} | ||
discord6 | <Aearnus> Oh. Huh. | ||
<Aearnus> Thought that did what you wanted | |||
05:10
MilkmanDan left
|
|||
hythm | Aearnus: Thanks anyway, yeah it did not work, the array contains JSON and .perl makes from-json not able to parse it | 05:10 | |
I think looping through the array and :append to the files works | 05:11 | ||
file* | |||
may be not | |||
05:12
MilkmanDan joined
05:14
aborazmeh joined,
aborazmeh left,
aborazmeh joined
05:17
[particle] joined
05:18
[particle]1 left
|
|||
Xliff | irced++: You might want to consider adding that to the docs! | 05:21 | |
05:34
[particle] left
05:44
cpan-p6 left
05:45
cpan-p6 joined,
cpan-p6 left,
cpan-p6 joined
05:46
[particle] joined
05:51
[particle]1 joined
05:52
[particle] left,
kurahaupo left
05:55
kurahaupo joined
|
|||
aearnus[m] | codegolf.stackexchange.com/a/191104 how does this work? | 05:59 | |
i've never seen the `~m/<regex>/` syntax before | 06:00 | ||
also... where is the argument there? | |||
06:03
jmerelo joined,
[particle] joined
|
|||
moritz | m/.../ matches against $_ | 06:04 | |
06:04
[particle]1 left
|
|||
aearnus[m] | ahh | 06:05 | |
06:10
cgfbee joined
06:22
[particle]1 joined
06:24
[particle] left,
antoniogamiz joined
|
|||
antoniogamiz | o( | 06:25 | |
aearnus[m] | o/ | ||
jmerelo | hi! | 06:26 | |
antoniogamiz: checking out [Coke]'s report? | 06:27 | ||
antoniogamiz | yep | ||
jmerelo | antoniogamiz: just seen that. Let's wait for the answer. Although we can test 0.3.3 right now, and check if it's OK (maybe it's not) | ||
Leaving for $dayjob | |||
06:28
jmerelo left
|
|||
antoniogamiz | ok | 06:28 | |
Xliff | Where is [Coke]'s report? | 06:32 | |
antoniogamiz | github.com/finanalyst/pod-cached/issues/25 | ||
Xliff | Ah. | 06:34 | |
06:37
[particle]1 left
06:47
abraxxa joined
|
|||
tobs | proc: chances are interpolation into a character class "literal" is not supported, but I don't know for sure either. The regex interpolation mechanism sits further outside: | 06:49 | |
m: my @aa = 'a' .. 'f'; say "0123def" ~~ /^ <{ "<[0..9 @aa.join() ]>" }>+ $/ # based on stackoverflow.com/a/47265426 | 06:50 | ||
evalable6 | 「0123def」 | ||
tobs | m: my @aa = flat '0' .. '9', 'a' .. 'f'; "0123def" ~~ /^ @aa+ $/ # proc: or if you have the entire character class in an array anyway, you can use that in matching | 06:52 | |
evalable6 | |||
tobs | m: my @aa = flat '0' .. '9', 'a' .. 'f'; say "0123def" ~~ /^ @aa+ $/ | ||
evalable6 | 「0123def」 | ||
Xliff | \o tobs | 07:02 | |
07:02
hythm left
07:03
domidumont joined
07:08
dolmen joined
|
|||
tobs | Xliff: o/ | 07:12 | |
07:25
reach_satori left
07:31
robertle_ joined,
ravenous_ joined
07:37
AlexDaniel left
07:43
dolmen left
07:51
pmurias joined
08:06
adu left
08:08
reach_satori joined
08:10
sena_kun joined
08:27
Kaiepi left
|
|||
El_Che | last commenter on the renaming thread is trolling, right? | 08:31 | |
08:34
ravenous_ left
08:39
reach_satori left,
chloekek joined
08:41
zakharyas joined
08:43
antoniogamiz left
08:53
chloekek left
|
|||
pmurias | El_Che: hard to distinguish weird and trolling | 08:59 | |
El_Che | good point | ||
tadzik | I don't think the comments in that thread have value anymore :) | 09:06 | |
El_Che | I wouldn't mind the weird, but it's clear that some commenters haven't read the thread or even the title of the issue | 09:07 | |
09:07
pmurias left
09:09
zakharyas left
09:11
chloekek joined
|
|||
cpan-p6 | New module released to CPAN! LibXML (0.0.1) by 03WARRINGD | 09:17 | |
09:25
pecastro joined
09:33
pat_js joined
09:34
pmurias joined
|
|||
Geth | doc: 9065702106 | (JJ Merelo)++ | 2 files Removes tests that are now in Documentable, refs #2996 |
09:45 | |
doc: 21546ff149 | (JJ Merelo)++ | META6.json Eliminates from META6 |
|||
doc: 1e1b878fc3 | (JJ Merelo)++ | util/travis-test.sh Eliminates htmlify.p6 from test refs #2996 |
09:47 | ||
09:47
Itaipu left
09:48
dolmen joined,
aborazmeh left
09:49
Itaipu joined
|
|||
pmurias | vrurg: ping | 09:56 | |
vrurg: if we want to get rid of the code gen step for the js makefile, what would be a good plan to do it? | 09:57 | ||
vrurg: I guess I should fix the build after the revision changes first | 09:58 | ||
09:58
pat_js left
|
|||
pmurias | vrurg: and then just replacing the script with it's output and cleaning it up? | 09:58 | |
09:58
dolmen left
10:06
dolmen joined
10:11
dolmen left,
dolmen joined
10:16
rindolf joined,
rindolf left,
kamog joined
10:18
netrino joined
10:24
Kaiepi joined
10:25
antoniogamiz joined
10:29
pat_js joined
10:37
antoniogamiz left
10:58
dolmen left
11:08
matiaslina left,
Matthew[m] left,
AlexDaniel` left
11:12
AlexDaniel` joined
11:19
chloekek left
11:26
BlackChaosNL[m] joined,
EuAndreh[m] joined,
rba[m] joined,
lance_w[m] joined,
sergiotarxz[m] joined,
TravisRt2botio[m joined,
Matthew[m] joined,
Guest55169 joined,
unclechu joined,
aearnus[m] joined,
Demos[m] joined,
matiaslina joined,
mack[m]1 joined,
Seance[m] joined,
uzl[m] joined,
folex joined,
CIAvash joined,
xliff[m] joined
11:32
domidumont left
11:34
domidumont joined
11:36
rindolf joined
|
|||
El_Che | www.heise.de/developer/meldung/Per...10571.html | 11:47 | |
for those that read German | |||
(or know of Google Translate) | |||
daxim | github.com/perl6/problem-solving/i...-526596745 # the uncharitable interpretation is that strika is trying to fool us. what is the charitable interpretation for that post? | 11:49 | |
11:50
jaldhar left
|
|||
El_Che | according google translate, the servian word is Рак | 11:52 | |
Raku is probably phonetically similar to the word in cyrilic | 11:53 | ||
it has the sound of the first 3 letters (long a), but no u | 11:54 | ||
jast | I believe that refers to the animal, not to the medical thing? just from looking at the list of translations on translate | ||
El_Che | both | ||
jast | oh yeah, I can't read, never mind :} | ||
El_Che | as in several languages | 11:55 | |
and the constallation | |||
Xliff | m: class A { method a { $*CLASS.^name.say } }; A.a | ||
evalable6 | Failure | ||
El_Che | because it looks like the animal | ||
11:55
scimon joined
|
|||
El_Che | (with some imagination like all constillations :) ) | 11:55 | |
jast | yeah, I just try to avoid making assumptions about one language from another | ||
El_Che | good principle | ||
Xliff | m: class A { method a { ::?CLASS.^name.say } }; A.a | ||
evalable6 | A | ||
jast | anyway, I guess the charitable interpretation is that the response was a little too literal? it's not *exactly* raku | 11:56 | |
daxim | -u is the masculine dative ending, so raku would mean e.g. (with) cancer | 11:57 | |
jast | also I suspect it will be quite hard to find a combination of syllables none of which has a negative association in *some* language ;) | ||
daxim | certainly | ||
jast | I see | ||
El_Che | in estonian is tranlating as "cell" | 11:58 | |
that would be pretty cool | |||
OO to the next level | |||
jast | cells, the true microservices | 11:59 | |
moritz | now we can have powerpoints with cell microscopy instead of container ships. I'm all for it :D | 12:00 | |
El_Che | A fork could be called "mitosis" | 12:04 | |
12:06
dolmen joined
|
|||
Xliff | m: "Hello".substr(0, 1).say | 12:13 | |
evalable6 | H | ||
Xliff | m: "Hello".substr(0).say | ||
evalable6 | Hello | ||
Xliff | m: "Hello".comb[0].say | 12:14 | |
evalable6 | H | ||
Xliff | Which is faster? .comb or .substr? | 12:15 | |
El_Che | write a for loop and time it? | ||
I would bet on substr | |||
Xliff | k | 12:16 | |
sena_kun | benchable6, help | ||
benchable6 | sena_kun, Like this: benchable6: f583f22,HEAD my $a = ‘a’ x 2¹⁶; for ^1000 {my $b = $a.chop($_)} # See wiki for more examples: github.com/perl6/whateverable/wiki/Benchable | ||
Xliff | m: "Hello".comb[0] ^10000; say now - INIT now | ||
evalable6 | WARNINGS for /tmp/aAoEKZoCrG: 0.00396207 Useless use of "^" in expression "[0] ^10000" in sink context (line 1) |
||
Xliff | m: "Hello".comb[0] for ^10000; say now - INIT now | ||
evalable6 | 0.0454392 | ||
Xliff | m: "Hello".substr(0, 1) for ^10000; say now - INIT now | ||
evalable6 | 0.0135736 | ||
timotimo | i would also bet on substr | ||
Xliff | And substr is da winnah | ||
.comb is less typing, tho. :( | 12:17 | ||
timotimo | m: say "foo".chop | ||
evalable6 | fo | ||
timotimo | not quite | ||
El_Che | (that's the one jnthn used on his performance talk when comparing to p5 regex :P ) | ||
sena_kun | benchable6, compare HEAD "Hello".comb[0] for ^1000 ||| "Hello".substr(0, 1) for ^1000 | ||
benchable6 | sena_kun, starting to benchmark the 1 given commit | ||
sena_kun, gist.github.com/3639712f3d2464b2ac...000b72604c | |||
sena_kun | Xliff, ^ | ||
timotimo | 1000 is really not enough by far | 12:19 | |
benchable6, compare HEAD "Hello".comb[0] for ^100_000 ||| "Hello".substr(0, 1) for ^100_000 | |||
benchable6 | timotimo, starting to benchmark the 1 given commit | ||
timotimo, gist.github.com/01ca063d4c79fccca1...b71d5512ca | |||
timotimo | there the difference is a lot more, about 10x | 12:20 | |
sena_kun | timotimo, it still was correct with who is faster in general. :P | ||
timotimo | well, yeah | ||
benchable6, compare HEAD "Hello".comb[0] for ^1_000_000 ||| "Hello".substr(0, 1) for ^1_000_000 | 12:21 | ||
benchable6 | timotimo, starting to benchmark the 1 given commit | ||
timotimo, ¦HEAD: «Benchmark: «timed out after 10 seconds»» | |||
timotimo | wow, only 10 seconds? | ||
benchable6, compare HEAD "Hello".comb[0] for ^300_000 ||| "Hello".substr(0, 1) for ^300_000 | |||
benchable6 | timotimo, starting to benchmark the 1 given commit | ||
timotimo, gist.github.com/740e1275a59a4fd9ad...8e843fa30b | |||
timotimo | wow, that is very wobbly | 12:22 | |
Xliff | Which one is 0 and which one is 1? | ||
timotimo | the first is 0, the second is 1 | 12:23 | |
Xliff | It's kinda hard to tell from the output. | ||
timotimo | agreed | ||
12:27
pmurias left
|
|||
scimon | So I'm thinking the longer the string the worse comb with get (as unless the compiler is smart it's going to make an array of all the characters). | 12:30 | |
s/with/will/ | |||
Wierdly... not as bad as I'd thought | 12:33 | ||
m: p6 '( "a" x 4294967295 ).substr(0,1).say;say now - BEGIN now' | |||
evalable6 | (exit code 1) 04===SORRY!04=== Error while compiling /tmp/jqjCHPDJ1x Undeclared routine: p6 used at line 1 |
||
scimon | m: ( "a" x 4294967295 ).substr(0,1).say;say now - BEGIN now | ||
evalable6 | a 0.0123537 |
||
scimon | m: ( "a" x 4294967295 ).comb[0].say;say now - BEGIN now | ||
evalable6 | a 0.0114297 |
||
jnthn | I think comb works lazily | ||
12:34
pmurias joined
|
|||
scimon | (p6 is my alias for perl6 -e and 4294967295 is apparently the longest string length) | 12:34 | |
jnthn: Looks like it! Awesome. | |||
I did love this error message "Repeat count (100000000000) cannot be greater than max allowed number of graphemes 4294967295" | |||
(But... if you want the 10 millionth character? Yeah... use substr) | 12:37 | ||
m: ( "a" x 4294967295 ).substr(9_999_999,1).say;say now - BEGIN now | |||
evalable6 | a 0.01058806 |
||
scimon | m: ( "a" x 4294967295 ).comb[10_000_000].say;say now - BEGIN now | ||
evalable6 | (signal SIGHUP) «timed out after 10 seconds» | ||
scimon | (Takes 20 seconds on my laptop. The other takes 0.009.) | 12:43 | |
timotimo | ha | 12:44 | |
perhaps the comb iterator can be taught to skip, or maybe you need to .skip manually to make it fast | 12:45 | ||
m: ( "a" x 4294967295 ).skip(9_999_999).head(1).say;say now - BEGIN now | |||
evalable6 | () 0.0110685 |
||
timotimo | oh look | ||
it can skip very quickly | |||
d'oh | |||
m: ( "a" x 4294967295 ).comb.skip(9_999_999).head(1).say;say now - BEGIN now | |||
evalable6 | (a) 3.6842543 |
||
timotimo | that's still not terribly slow, but pretty slow none the less | 12:46 | |
12:46
reach_satori joined
|
|||
scimon | Really depends on what you want to do I think (but yeah that's a LOT better than it was). | 12:53 | |
12:58
lucasb joined
13:23
reach_satori left
|
|||
SmokeMachine | m: ( "a" x 4294967295 ).comb.last.say; say now - BEGIN now | 13:25 | |
evalable6 | (exit code 1) No such method 'last' for invocant of type 'Seq'. Did you mean any of these? Hash List Rat flat in block <unit> at /tmp/f0UexesTI2 line 1 |
||
SmokeMachine | m: ( "a" x 4294967295 ).comb.tail.say; say now - BEGIN now | ||
evalable6 | (signal SIGHUP) «timed out after 10 seconds» | 13:26 | |
SmokeMachine | m: ( "a" x 4294967295 ).comb.skip(*-1).say; say now - BEGIN now | ||
evalable6 | (signal SIGHUP) «timed out after 10 seconds» | ||
SmokeMachine | m: ( "a" x 4294967295 ).comb.skip(*-1).head.say; say now - BEGIN now | 13:27 | |
evalable6 | (signal SIGHUP) «timed out after 10 seconds» | ||
13:27
antoniogamiz joined
13:32
antoniogamiz left
|
|||
KotH | stupid question: is there an equivalent of the camel book for perl6? | 13:34 | |
13:35
pat_js left
|
|||
Xliff | m: use NativeCall; my Str $s = 'Hello'; my $sp = nativecast(Pointer, $s); say $sp; | 13:39 | |
evalable6 | (exit code 1) Native call cast expected return type with CPointer, CStruct, CArray, or VMA… | ||
Xliff, Full output: gist.github.com/634c6c9e7d5d61410f...7b7b97f4fd | |||
Xliff | m: use NativeCall; my str $s = 'Hello'; my $sp = nativecast(Pointer, $s); say $sp; | ||
evalable6 | (exit code 1) Native call cast expected return type with CPointer, CStruct, CArray, or VMA… | ||
Xliff, Full output: gist.github.com/039d7b5b2963a245ef...19087521fd | 13:40 | ||
Kaiepi | so in a chat bot i'm writing, i'm doing a huge refactor and now it deadlocks when i try to use a command. i have a feeling it's because it's trying to lock a lock while it's already locked, but it's not very easy to tell where that's actually happening | ||
is there a way to debug this? | |||
Xliff | jnthn: If you have a CArray[Str] that's pulling data from C, do you have to worry about freeing the contents? | ||
13:46
pat_js joined
|
|||
Xliff | m: $*STDIN.fd.say | 13:48 | |
evalable6 | (exit code 1) Dynamic variable $*STDIN not found in block <unit> at /tmp/LlGNk0_Ymq line 1 |
||
Xliff | m: $*IN.fd.say | ||
evalable6 | (exit code 1) No such method 'fd' for invocant of type 'IO::Handle' in block <unit> at /tmp/3cxLq0TPnV line 1 |
||
Xliff | m: $*IN.native-descriptor | ||
evalable6 | |||
Xliff | m: $*IN.native-descriptor.say | ||
evalable6 | 0 | ||
Xliff | m: $*ERR.native-descriptor.say | 13:49 | |
evalable6 | 2 | ||
Xliff | m: $*OUT.native-descriptor.say | ||
evalable6 | 1 | ||
scimon | KotH: Probably Perl6 Deep Dive at the moment. | ||
jnthn | Kaiepi: Run under debugger, pause execution, look at the call stacks, if it's a real lock | 13:50 | |
Kaiepi | perl6-debug-m jnthn? | 13:51 | |
jnthn | No, that doesn't understand threads | 13:52 | |
The MoarVM remote debugger; I use it with Comma but timotimo++ wrote a command line client too and I guess it can also do what you want | |||
Also, gist.github.com/jnthn/25349dee44f2...dbe504c39e may help you too | |||
Xliff: Not immediately sure, sorry. | 13:53 | ||
13:55
antoniogamiz joined
|
|||
timotimo | that's outstanding | 13:55 | |
13:56
mowcat joined
13:57
ravenous_ joined
|
|||
KotH | scimon: thanks! | 14:00 | |
14:03
[particle] joined,
ravenous_ left,
robertle_ left
14:05
robertle_ joined
14:09
cheese16 joined
14:12
antoniogamiz left
14:13
antoniogamiz joined
|
|||
antoniogamiz | it looks like comma does not recognize routines declared in others modules | 14:13 | |
it should detect 'lives-ok' and 'ok' from Test module, shouldn't it? | |||
jnthn | antoniogamiz: If you `use Test` then yes; check in File > Project Structure that a valid Perl 6 interpreter is selected though, that's the usual problem. | 14:15 | |
cheese16 | moritz: GPW is a great idea! Will be there. Currently working on a p5 script to talk about maybe. Marketing team is considering a booth (probably not gonna happen, but I appreciate that they are considering it). just so you know. BTW some stuff on the website is still labeled "GPW 2019" and the 2019 archive is not so easy to open, because the drop | 14:18 | |
down does not have a 2020 entry (at least when i last looked) and it is only loaded onchange IIRC. looking forward to the schedule / submission deadlines etc. until then I will probably be passively following here as always ;) best regards to all | |||
tellable6 | 2019-08-29T18:06:42Z #perl6 <moritz> cheese16 come to the German Perl Workshop 2020, I'll be there (and I'm one of the organizers) :D | ||
proc | What's the proper way to use variables within a character class? I.E.: my $aa = 'abc'; my $bb = 'yabba'; say so $bb ~~ /<[$aa]>/; | 14:19 | |
14:19
cheese16 left
|
|||
antoniogamiz | jnthn: oh, you're right, thanks :) | 14:20 | |
14:25
aborazmeh joined,
aborazmeh left,
aborazmeh joined
14:32
Kaiepi left
|
|||
sena_kun | m: my $aa = '<[abc]>'; my $bb = 'aaa'; say $bb ~~ /<$aa>+/; | 14:34 | |
evalable6 | 「aaa」 | ||
14:35
chloekek joined
14:36
molaf joined
|
|||
sena_kun | m: my $aa = 'abc'; my $bb = 'aaa'; say $bb ~~ /<$_>/ given "<[$aa]>"; say $aa; | 14:36 | |
evalable6 | 「aaa」 abc |
||
14:36
Kaiepi joined
|
|||
sena_kun | proc, ^ | 14:36 | |
proc | thanks sena_kun. How would you handle the case if you had multiple character classes that were defined in variables? | 14:40 | |
14:41
pmurias left
|
|||
sena_kun | proc, e.g. `my $a = 'abc'; my @b = 'def'`? | 14:41 | |
14:42
Sgeo_ joined
|
|||
sena_kun | m: my $aa = 'abc'; my $cc = 'def'; my $bb = 'aaaeee'; say $bb ~~ /<$_>/ given "<[{join $aa, $cc}]>"; | 14:42 | |
evalable6 | 「aaaeee」 | ||
sena_kun | though in reality I'd use a separate variable to do joining | ||
14:43
pmurias joined
|
|||
sena_kun | because doing it on every match (?) is a very, very bad idea | 14:43 | |
proc | like: my $aa = 'abc'; my $bb = 'def'; my $cc = 'yabda'; say so $bb ~~ /<[$aa]><[$bb]>/; | ||
err | |||
like: my $aa = 'abc'; my $bb = 'def'; my $cc = 'yabda'; say so $cc ~~ /<[$aa]><[$bb]>/; | |||
something like that | |||
sena_kun | m: my $aa = 'abc'; my $cc = 'def'; my $bb = 'aaaeee'; say $bb ~~ /<$_>/ given "<[$aa]>+<[$bb]>+"; | 14:44 | |
evalable6 | 「aaaeee」 | ||
proc | in perl5, you could simply enbed the variables directory within the character class. Trying to wrap my head around how to do it in perl6. | ||
ah ok | |||
sena_kun | well, you can always just construct regex by hands and interpolate it | ||
14:45
Sgeo__ left
|
|||
proc | cool. Thanks. | 14:46 | |
14:46
Kaiepi left
|
|||
sena_kun | m: my @foo := <a b c>; say 'aeee' ~~ /@foo/; | 14:47 | |
evalable6 | 「a」 | ||
sena_kun | proc, ^ this one should feel more natural. :) | ||
and is probably to be cheaper | |||
14:47
Kaiepi joined
|
|||
sena_kun | m: my @foo = <a b c>; say 'abbbbccceee' ~~ /@foo+/; | 14:48 | |
evalable6 | 「abbbbccc」 | ||
sena_kun | docs.perl6.org/language/regexes#Re...erpolation helps a lot | ||
antoniogamiz | can someone try to execute 'zef install Pod::To::Cached' please? | 14:50 | |
proc | Thanks for the information. This question was posted on the #perl6-users mailing list and no one truly knows the answer. I just figured I'd pop in here and ask the horses mouth as it were. | ||
Thanks for the info. Also, I read that page and it clearly states "$variableInterpolates stringified contents of variable literally." ..... which I took to mean <[$variable]> would work as expected. | |||
vrurg | antoniogamiz: installed ok | 14:51 | |
antoniogamiz | ok, thanks! can you tell me your perl6 version? | ||
vrurg | antoniogamiz: the HEAD | ||
antoniogamiz | mm ok, thanks a lot for your help :) | ||
sena_kun | proc, well, interpolating @foo is the suitable answer, I hope. :) as for why `<[$foo]>` does not work - it treats `$` and the rest as literals, so no interpolation, but interpolating a @ does roughtly the same thing for this case | ||
*roughly | 14:52 | ||
antoniogamiz, installs on 07 | |||
proc | sena_kun yeah cool. Thanks. | ||
antoniogamiz | sena_kun: installs on 07? | 14:53 | |
14:53
tester87 joined
|
|||
sena_kun | antoniogamiz, Pod::To::Cached installs fine on 2019.07. | 14:53 | |
antoniogamiz | ah ok, thanks for testing it out | 14:54 | |
14:57
tester87 left
15:02
chloekek left
|
|||
proc | sena_kun - I wonder if it's worth updating the documentation to make the mention that character classes interpret their contents literally with an example showing how to circumvent it using `given`. | 15:04 | |
only because, this specific thing had quite a few people stumped. Myself included. | 15:05 | ||
sena_kun | proc, I would not do that. The reason is that `given` thing is a hack I quickly put up because I did not remember exactly how @ interpolation works, was too lazy to look up the docs, and made it work "by force" using a more generic approach (which is usually bad). @ is documented and that's the way I'd prefer like 100% of time. | 15:06 | |
15:07
aborazmeh left
|
|||
sena_kun | The real question here is how to make "Interpolating variables" section more prominent to people. | 15:07 | |
proc | I'd agree. People coming from other languages like perl5 for example, would expect [$var] to work, so it needs to be clear. As of right now, @var doesn't really come to mind. | 15:10 | |
and even the documentation mentions $var would get interpreted....yet doesn't in this specific case.....that's gotta count for something. | 15:11 | ||
sena_kun | I am not sure how many other languages other than perl5 allow to do it so easily with programmers being aware about it, but probably due to my lack of knowledge. | ||
jnthn | Might be worth a mention in character classes noting that they don't interpolate anything, and with a link to the docs on how to do that | ||
sena_kun | but there is 5 to 6 guide - docs.perl6.org/language/5to6-nutshell <- maybe it wants some tweaks, imho. | 15:12 | |
proc | When people look up regex documentation they aren't hitting that page. They are hitting the regex page. Should really be there IMHO. | 15:13 | |
sena_kun | proc, can't really object that. A ticket for github.com/perl6/doc/ or a patch will be welcome. :) | 15:14 | |
15:15
pmurias left
|
|||
proc | alright. ;) | 15:15 | |
15:18
ChoHag left
15:25
ChoHag joined
15:26
jmerelo joined
|
|||
jmerelo | squashable6: next | 15:27 | |
squashable6 | jmerelo, ⚠🍕 Next SQUASHathon in 3 days and ≈12 hours (2019-09-07 UTC-12⌁UTC+20). See github.com/rakudo/rakudo/wiki/Mont...Squash-Day | ||
jmerelo | Everyone's ready for the squashathon? | ||
15:28
robertle_ left
15:42
Sgeo__ joined
15:45
Sgeo_ left
15:49
domidumont left
16:07
mowcat left,
dolmen left
16:25
antoniogamiz left
16:26
scimon left
16:27
Cabanossi left
16:30
Cabanossi joined
16:32
dolmen joined
16:35
domidumont joined
16:39
dolmen left
|
|||
uzl[m] | I thought the Github renaming issue was locked to the members who will make the final decision. It seems the issue is getting some trolling comments that adds nothing to the discussion. And furthermore almost everything that had to be said about it had been said already 😅�. | 16:40 | |
Grinnz | it was locked for a week or two, then reopened | ||
16:40
ChoHag left
16:41
ChoHag joined
|
|||
Grinnz | there will always be trolling comments, the more common problem seems to be comments from people who can't read the first post :/ | 16:42 | |
uzl[m] | Oh, I see. It seems they had a kneejerk reaction and didn't even bothered going through the previous comments. | 16:44 | |
Grinnz | well, i don't blame people for not catching up on the massive amount of comments | 16:45 | |
but at least understand the opening premise :) | |||
16:48
dolmen joined
16:51
pat_js left
|
|||
tadzik | amazing how there's suddenly all these people interested in Perl 6's future :P | 16:51 | |
16:55
domidumont left
17:00
dolmen left
17:01
dolmen joined
|
|||
Xliff | Is there a way to fire a method in a role when it is composed to an object? | 17:04 | |
m: role A { }; my $a = 1 but A; | |||
evalable6 | |||
Xliff | I want a method to fire off when $a is assigned. Is that possible? | 17:05 | |
17:06
dolmen left
17:09
reach_satori joined,
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
Xliff | m: class A { method a { say callframe(1).perl }; }; class B { method a { A.a } }; B.a | 17:21 | |
evalable6 | CallFrame.new(annotations => {:file("/tmp/dH86KGRNcl"), :line("1")}, my => {"\$!" => Nil, … | ||
Xliff, Full output: gist.github.com/82ac6a78b63800cbab...c8cb91fc57 | |||
Xliff | m: class A { method a { callframe(1) }; }; class B { method a { A.a.code.^name.say } }; B.a | ||
evalable6 | Method | ||
Xliff | m: class A { method a { callframe(1) }; }; class B { method a { A.a.code.name.say } }; B.a | ||
evalable6 | a | ||
Xliff | m: class A { method a { callframe(1) }; }; class B { method a { A.a.code.name.package.say } }; B.a | ||
evalable6 | (exit code 1) No such method 'package' for invocant of type 'Str' in method a at /tmp/6eR8xruaab line 1 in block <unit> at /tmp/6eR8xruaab line 1 |
||
Xliff | m: class A { method a { callframe(1) }; }; class B { method a { A.a.code.package.say } }; B.a | 17:22 | |
evalable6 | (B) | ||
17:23
AlexDaniel joined,
AlexDaniel left,
AlexDaniel joined
17:28
pecastro left
|
|||
Xliff | m: class X::My::Type::Ω::NotListening is Exception { }; throw X::My::Type::Ω::NotListening (message => 'Lalalalala'); | 17:30 | |
evalable6 | (exit code 1) 04===SORRY!04=== Error while compiling /tmp/LBoahEjCzC Two ter… |
||
Xliff, Full output: gist.github.com/df621bfd9202ba5c56...082e910ffa | |||
Xliff | m: class X::My::Type::Ω::NotListening is Exception { }; throw X::My::Type::Ω::NotListening(message => 'Lalalalala'); | ||
evalable6 | (exit code 1) 04===SORRY!04=== Error while compiling /tmp/cOXqd6uUaj Undeclared routine: throw used at line 1. Did you mean 'THROW'? |
||
Xliff | m: class X::My::Type::Ω::NotListening is Exception { }; X::My::Type::Ω::NotListening(message => 'Lalalalala').throw; | ||
evalable6 | (exit code 1) Cannot coerce to X::My::Type::Ω::NotListening with named arguments in block <unit> at /tmp/ydQ7yhzikh line 1 |
||
Xliff | m: class X::My::Type::Ω::NotListening is Exception { }; X::My::Type::Ω::NotListening.new(message => 'Lalalalala').throw; | 17:31 | |
evalable6 | (exit code 1) Died with X::My::Type::Ω::NotListening in block <unit> at /tmp/oLY0RNpuU5 line 1 |
||
17:38
molaf left,
pecastro joined
|
|||
Xliff | m: class A { method a { * }; }; A.new; | 17:40 | |
evalable6 | |||
Xliff | m: class A { method a { * }; }; A.new.a | ||
evalable6 | |||
Xliff | m: class A { method a { * }; }; A.new.a.say | ||
evalable6 | * | ||
Xliff | m: class A { method a { }; }; A.new.a.say | ||
evalable6 | Nil | ||
17:41
vrurg left
17:58
proc left
18:02
wildtrees joined
18:10
vrurg joined
18:11
jmerelo left
18:15
chloekek joined
18:33
ravenous_ joined
18:37
khisanth_ left
18:39
aborazmeh left
18:53
khisanth_ joined
|
|||
rindolf | Hi all! | 18:55 | |
eval: my @nums = (1, 20, 333, 40, 55); my @sums=(0); for @nums -> $n { @sums.push(@sums[*-1]+$n}; @sums | 18:57 | ||
evalable6 | (exit code 1) 04===SORRY!04=== Error while compiling /tmp/Hj8xQxRpjT Unable … |
||
rindolf, Full output: gist.github.com/0c0fb1e733744e421d...3dd3cd4aa6 | |||
rindolf | eval: my @nums = (1, 20, 333, 40, 55); my @sums=(0); for @nums -> $n { @sums.push(@sums[*-1]+$n);}; @sums | ||
evalable6 | WARNINGS for /tmp/aLip2M8f4F: Useless use of @sums in sink context (line 1) |
||
rindolf | eval: my @nums = (1, 20, 333, 40, 55); my @sums=(0); for @nums -> $n { @sums.push(@sums[*-1]+$n);}; say @sums | 18:58 | |
evalable6 | [0 1 21 354 394 449] | ||
18:58
[Sno] joined
|
|||
rindolf | is there a more idiomatic way to write it? tried ddg | 18:58 | |
sena_kun | m: my @nums = (1, 20, 333, 40, 55); gather { my $sum = 0; for @nums -> $n { take $sum += $n } }[4].say; | 19:02 | |
evalable6 | 449 | ||
sena_kun | m: my @nums = (1, 20, 333, 40, 55); my $seq = gather { my $sum = 0; for @nums -> $n { take $sum += $n } }; .say for $seq; # can work with $seq Seq lazily... | ||
evalable6 | (1 21 354 394 449) | ||
sena_kun | rindolf, ^ | 19:03 | |
rindolf | sena_kun: ah | 19:04 | |
sena_kun | imho, this one is cleaner, though has some penalty for laziness, to avoid that just a loop with $sum variable will be a bit easier to grasp than @sums.push(@sums[*-1]+$n) | ||
rindolf | sena_kun: ok | 19:05 | |
nine | m: my @nums = (1, 20, 333, 40, 55); @nums.map($ += *).say | 19:06 | |
evalable6 | (1 21 354 394 449) | ||
nine | rindolf: ^^^ | ||
rindolf | nine: thanks ! | 19:07 | |
cpan-p6 | New module released to CPAN! BDD::Behave (0.0.1) by 03GDONALD | 19:09 | |
19:13
MasterDuke joined
|
|||
CIAvash | m: my @nums = (1, 20, 333, 40, 55); say [\+] @nums | 19:19 | |
evalable6 | (1 21 354 394 449) | ||
19:20
veesh left
19:27
Cabanossi left,
netrino left
19:36
molaf joined
19:37
Black_Ribbon joined
19:42
pmurias joined,
Cabanossi joined
19:46
kaare__ joined,
moritz joined
19:47
a3f joined
|
|||
cpan-p6 | New module released to CPAN! Channel::Pauseable (1.0.0) by 03THINCH | 19:55 | |
20:06
sena_kun left
20:11
epony left
20:13
Guest71418 joined
20:17
mack[m]1 left,
sergiotarxz[m] left,
Harzilein left
20:21
Guest71418 left,
sergiotarxz[m] joined
20:22
aborazmeh joined,
aborazmeh left,
aborazmeh joined
20:23
mack[m]1 joined,
mack[m]1 left,
mack[m]1 joined
|
|||
Kaiepi | argh, i really don't like how IO::Socket::INET handles URIs, but i didn't think to include anything remotely related to that in my grant, so i'll be stuck waiting until i'm finished before i can really do anything about it | 20:25 | |
20:26
aborazmeh left
20:28
aborazmeh joined,
aborazmeh left,
aborazmeh joined
|
|||
Xliff | Anyone else know how to get a role method to automatically call a method when it is composed into a class? | 21:00 | |
21:02
ravenous_ left
21:04
wildtrees left,
reach_satori_ joined,
reach_satori left
|
|||
discord6 | <Aearnus> Xliff: maybe TWEAK on the role? | 21:04 | |
<Aearnus> don't the roles have to get instantiated when they're composed | |||
Xliff | will try TWEAK | 21:05 | |
m: role A { submethod TWEAK { say 'BOO!' }; }; my $a = 1 but A; | 21:06 | ||
evalable6 | BOO! | ||
Xliff | \o/ | ||
Aearnus++ | |||
discord6 | <Aearnus> :D | 21:07 | |
21:08
lichtkind joined
21:14
mowcat joined
21:29
abc3354 joined
|
|||
abc3354 | Hi | 21:30 | |
Just here to test the bridge | |||
discord6 | <abc3354> Sorry for the spam | ||
21:31
abc3354 left,
krunen left,
krunen joined
21:32
aborazmeh left
21:35
Cabanossi left
|
|||
discord6 | <RaycatWhoDat> Running into a bit of a problem. | 21:45 | |
<RaycatWhoDat> I'm trying to pass a list of integers as a single parameter. | 21:46 | ||
21:46
Cabanossi joined
|
|||
discord6 | <RaycatWhoDat> But I want the subroutine to treat it as a list. | 21:46 | |
<RaycatWhoDat> What step am I missing? | 21:47 | ||
<RaycatWhoDat> gist.github.com/RayMPerry/e38337cc...5642871a19 | 21:48 | ||
tobs | m: (1..25).tail.say | 21:54 | |
evalable6 | 25 | ||
tobs | RaycatWhoDat: tail only returns the very last element by default. You probably expected it to return a list of everything except the head? | 21:55 | |
and that int does not pass as an array of int | |||
discord6 | <abc3354> It seems to be be the problem for me too @RaycatWhoDat ? | 21:56 | |
21:57
netrino joined
|
|||
tobs | but if you pass a parameter "how much tail?", it will give you something sufficiently positional | 21:57 | |
tbrowder | .tell jjmerelo doc v2 is looking good structurally, but i wish i could launch it local | 21:58 | |
tellable6 | tbrowder, I'll pass your message to jmerelo | ||
tobs | m: sub f (@numbers) { say @numbers.head; f @numbers.tail(*-1) #`(everything but the head) if @numbers }; f 1..10 | ||
evalable6 | 1 2 3 4 5 6 7 8 9 10 Nil |
||
22:05
Itaipu_ joined
22:06
Cabanossi left,
Itaipu left
|
|||
discord6 | <RaycatWhoDat> Ahh, gotcha. | 22:11 | |
<RaycatWhoDat> Thanks! | |||
<RaycatWhoDat> Now, to reduce the lines... | 22:17 | ||
22:18
Cabanossi joined
22:21
grumble joined
22:23
pmurias left
|
|||
Geth | ecosystem: pheix++ created pull request #466: Add LZW::Revolunet to ecosystem |
22:28 | |
22:30
agentzh joined,
agentzh left,
agentzh joined
22:42
cpan-p6 left
22:43
cpan-p6 joined,
cpan-p6 left,
cpan-p6 joined,
MasterDuke left
23:08
lichtkind left
23:09
|oLa| joined
23:21
mowcat left,
rindolf left
23:25
MilkmanDan left,
chloekek left
23:26
MilkmanDan joined
23:33
pecastro left
23:36
Cabanossi left
23:41
Cabanossi joined
|
|||
cpan-p6 | New module released to CPAN! Net::BGP (0.1.3) by 03JMASLAK | 23:44 | |
23:57
lucasb left
|