»ö« 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:06
w_richard_w joined,
p6bannerbot sets mode: +v w_richard_w
00:10
kurahaupo left
00:31
rindolf left,
guifa joined,
p6bannerbot sets mode: +v guifa
|
|||
guifa just found out that .assuming is really costly | 00:32 | ||
I tried to do a simple BF optimization consolidating ++++ into an &increment.assuming(4), and it's actually slower than calling an equivalent incrementByOne() four times over | 00:33 | ||
Sierpinski triangle took 8x longer to run, even though it ran 25% less operations (and there's no extra code other than adding 2 or 3 or 4 instead of 1 several times over). Is it that $a++ is that much faster than $a += 1 ? | 00:42 | ||
MasterDuke | guifa: have you compared profiles? | 00:45 | |
zachk | i know most processros have an increment by 1 and decrement by 1 op codes in the cpu, so it could be much faster if the perl6 vm optimizes for it | ||
timotimo | how often do you actually call the .assuming method? | 00:47 | |
guifa | timotimo: it's called during a compile phase, the slow down is in the execution phase (where it just does a .() for @ops). I haven't tried profiling yet, kinda forgot about that ^_^ (just been calculating time in code) let's see what it says | 00:50 | |
(where @ops is a list of &increment, &output, etc) | 00:51 | ||
01:00
lizmat joined,
p6bannerbot sets mode: +v lizmat
|
|||
guifa | Egads, I may need to go grab dinner while the browsers load these profiles | 01:02 | |
MasterDuke | guifa: if they're too big, you may want to try creating SQL profiles and using timotimo++'s new profiler frontend | 01:04 | |
zachk | is zef kinda slow? | ||
01:05
lizmat left
|
|||
MasterDuke | zachk: it can be, especially some of the json parsing i believe | 01:05 | |
zachk | is it written in perl6 and using perl6 grammer rules for the json? | ||
MasterDuke | it is written in perl6. i think it uses JSON::Tiny (and there has been some talk of switching to JSON::Fast) | 01:06 | |
but ugexe is the person to ask | 01:07 | ||
zachk | yea it's just sitting there after it said it was looking for Digest | 01:08 | |
guifa | MasterDuke: timotimo++'s profiler is the MoarPerf yeah? | 01:14 | |
MasterDuke | yep | ||
01:15
zachk left
01:19
test123__ joined,
p6bannerbot sets mode: +v test123__,
hcs^ left
01:22
test123__ left
01:36
guifa left
01:59
dncefan joined
02:00
p6bannerbot sets mode: +v dncefan
02:04
abaiste joined
02:05
p6bannerbot sets mode: +v abaiste
|
|||
Xliff | m: gist.github.com/Xliff/d139f0e12f69...056eb401af | 02:13 | |
camelia | 「aaaaab」 Rules: TOP,a,b (Any) |
||
Xliff | OK, why is the grammar not matching. I bet it's something simple, isn't it? | ||
I think it might be time for me to go to bed. | |||
02:14
Ven`` left
02:19
kybr joined
02:20
p6bannerbot sets mode: +v kybr
|
|||
lucs | Xliff: What are you expecting $r.gist to show? | 02:36 | |
02:44
mowcat left
|
|||
Xliff | lucs: Those lines got blotted out by Markdown formatting. | 02:48 | |
I think I figured out most of it, though. Thanks! | |||
I am headed to bed. | |||
o7 | |||
lucs | Ok. Just note that the whole string needs to conform to TOP, not just part of it like when using ~~. | 02:49 | |
02:50
khisanth_ left
|
|||
lookatme_q | m: gist.github.com/araraloren/0d567e3...78b5c2b921 | 02:57 | |
camelia | 「aaaaab」 Rules: TOP,a,b (Any) |
||
lookatme_q | m: gist.githubusercontent.com/araralo...f/gisty.md | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Confused at <tmp>:1 ------> 3https:7⏏5//gist.githubusercontent.com/araraloren/ expecting any of: colon pair |
||
lookatme_q | evalable6 gist.githubusercontent.com/araralo...f/gisty.md | ||
02:59
daotoad joined
|
|||
AlexDaniel | lookatme_q: missed : after nickname | 02:59 | |
also you can use e: | |||
lookatme_q | evalable6: gist.githubusercontent.com/araralo...f/gisty.md | ||
evalable6 | lookatme_q, Successfully fetched the code from the provided URL | ||
「aaaaab」 Rules: TOP,a,b (Any) |
|||
02:59
p6bannerbot sets mode: +v daotoad
|
|||
lookatme_q | oh, same result :) AlexDaniel thanks | 03:00 | |
03:01
leont left
03:08
khisanth_ joined
03:09
p6bannerbot sets mode: +v khisanth_,
w_richard_w left
|
|||
holyghost | .seen Zoffix | 03:23 | |
yoleaux | I saw Zoffix 6 Jan 2019 17:41Z in #perl6: <Zoffix> moritz: the project's direction and management style doesn't match my goals and I'll be happier elsewhere. | ||
rjbs | Huh! | 03:30 | |
03:50
daotoad left
|
|||
simple | why does perl6's regexp have to be just different enough in every single way =/ | 04:00 | |
lookatme_q | simple, you can use Perl5 regex | 04:01 | |
simple | i know, but i feel guilty doing it that way | ||
it's like... taking your ancient video card out of the old computer, and putting it in the new one | 04:02 | ||
theoretically, the new one should be better... | |||
lookatme_q | simple,I think that's fine | 04:03 | |
m: say "aa" ~~ m:P5/(\w)\1/ | |||
camelia | 「aa」 0 => 「a」 |
||
simple | i just want $0 to be a string, not some weird MATCH object | 04:04 | |
lookatme_q | oh, noway to do that | 04:05 | |
simple, but that's Perl 6 , they are different language :) | |||
simple | yeah | 04:06 | |
i get that | |||
04:06
daotoad joined
|
|||
lookatme_q | have a break, bye :) | 04:06 | |
simple | so i have $name = $1, then i do a j2p($name) which does some ~~ s/things/here/, and it errors out, saying it's a readonly variable | ||
even when i do j2p($name.Str) it says it is readonly | 04:07 | ||
04:07
p6bannerbot sets mode: +v daotoad
|
|||
lookatme_q | you have to mark the argument as `is copy` or `is rw` | 04:08 | |
maybe | |||
simple | hm | ||
04:09
daotoad left
|
|||
holyghost | simple : has x is rw; | 04:11 | |
simple | this is not an object, or in a class | 04:12 | |
lucs | m: sub foo ($s) { $s ~~ s/b/B/ }; print foo('abc') | 04:14 | |
camelia | Cannot assign to a readonly variable or a value in sub foo at <tmp> line 1 in block <unit> at <tmp> line 1 |
||
lucs | m: sub foo ($s is copy) { $s ~~ s/b/B/ }; print foo('abc') | ||
camelia | b | ||
holyghost | my $name is rw | ||
AlexDaniel | also ~$0 will give you a Str, so hardly the end of the world :) | ||
m: sub foo($s) { say S/b/B/ given $s }; print foo(‘abc’) | 04:16 | ||
camelia | aBc True |
||
lucs | Better, thanks :) | ||
AlexDaniel | m: sub foo($s) { S/b/B/ given $s }; say foo(‘abc’) | ||
camelia | aBc | ||
AlexDaniel | m: sub foo($s) { $s.subst: 'b', 'B' }; say foo(‘abc’) | 04:17 | |
camelia | aBc | ||
simple | adding "is copy" worked for me | ||
ooh, .subst | |||
AlexDaniel | S/// should also work, just not with ~~ | 04:18 | |
(big S) | |||
simple | i've never seen big S before | ||
AlexDaniel | TR is also a thing, btw :) | ||
04:23
guifa joined,
p6bannerbot sets mode: +v guifa
|
|||
simple | m: my $mod = '<stuff>'; say $mod.subst(/\</, '_'); | 04:24 | |
camelia | _stuff> | ||
simple | m: my $mod = '<stuff>'; say $mod.subst(/\</, '_', :g); | ||
camelia | _stuff> | ||
simple | wtf doesn't that work in my sub | 04:25 | |
m: my $mod = '<stuff>'; $mod.subst(/\</, '_', :g); say $mod | 04:26 | ||
camelia | <stuff> | ||
simple | aha | ||
it doesn't do it in-place like the docs say | |||
oh, different syntax | |||
.= not just . | 04:27 | ||
that looks goofy as hell heh | |||
m: my $mod = '<stuff>'; $mod.=subst(/\</, '_', :g); say $mod | |||
camelia | _stuff> | ||
SmokeMachine | for the first time, bernalang (that is written in perl6) can compile binary! | 04:30 | |
AlexDaniel | simple: .= is just a shortcut for $foo = $foo.bar() | ||
SmokeMachine | usercontent.irccloud-cdn.com/file/...653995.jpg | ||
AlexDaniel | much like you can do $foo += $bar instead of $foo = $foo + $bar | 04:31 | |
simple | thanks | ||
SmokeMachine | \o/ | 04:32 | |
simple | bedtime, i'll hack at this some more tomorrow | ||
04:32
Cabanossi joined,
Cabanoss- left,
p6bannerbot sets mode: +v Cabanossi
|
|||
guifa | So after dinner I just ran a test and wow, assuming is excruciatingly slow. | 04:38 | |
tio.run/##lY9BC4JAEIXP7q94iIgmRV46...RMk/E8Yhhc | |||
04:39
molaf joined
04:40
p6bannerbot sets mode: +v molaf
|
|||
AlexDaniel | guifa: please file a ticket, chances are there are ways to speed it up | 04:41 | |
SmokeMachine | Xliff: ^^ | 04:45 | |
guifa | AlexDaniel: submitted | 04:59 | |
Also, question on module naming. I would have thought it best to avoid overlapping names but on modules.perl6.org there are definitely several with the same. Is there a recommendation ATM for that? | 05:04 | ||
AlexDaniel | guifa: example? | 05:06 | |
most of them are just hosted in multiple places at the same time, so they show up more than once | |||
(cpan + github) | |||
I think avoiding name clashes is best | |||
05:08
MasterDuke left
|
|||
SmokeMachine | Is there any recommend way to test nativecall methods! | 05:12 | |
05:12
w17t joined,
p6bannerbot sets mode: +v w17t
05:14
silug left
05:25
silug joined,
jme` joined,
p6bannerbot sets mode: +v silug
05:26
p6bannerbot sets mode: +v jme`
|
|||
guifa | AlexDaniel: I've been working on a BF compiler/interpreter. The current one is Inline::Brainfuck and that seems to be the naming convention used for other languages | 05:33 | |
There were two that are Inline::Perl5 for instance | |||
I'm just trying to think how I should best name mine as I'm getting closer to finishing off everything | 05:34 | ||
05:46
molaf left
|
|||
guifa | With JSON there's a clear distinction between JSON::Tiny and JSON::Fast, so I was thinking maybe Inline::Brainfuck::Open or ::Extensible because of the extra options, but then that would make it be more sense for the other one to be Inline::Brainfuck::Fast or similar | 05:51 | |
06:13
guifa left,
guifa joined,
p6bannerbot sets mode: +v guifa
|
|||
moritz | simple: do answer your "why" question: because p5 regexes weren't extensible enough to extend them and be backwards compatible | 06:14 | |
06:16
Kaiepi left,
Kaiepi joined
06:17
p6bannerbot sets mode: +v Kaiepi
|
|||
guifa | smokemachine: parabéns pelo compilador! | 06:18 | |
06:32
jmerelo joined
06:33
p6bannerbot sets mode: +v jmerelo
|
|||
holyghost | hi JJ, I have a cache and imaging system ripped from PaganSound2 into PaganVideo2, the client reads frames now, I am also building FFmpegx, as a perl6 package | 06:39 | |
I just need the transcoder of MP4 or MPEG and I have a video server for e.g. phone apps | 06:40 | ||
It's a dumb client | 06:41 | ||
I also have a simple widget kit for display based on SDL2::Raw | 06:42 | ||
PaganSound2 is the wave editor I mentioned | |||
06:46
vrurg left
|
|||
jmerelo | Sorry, don't work (or for that matter, know anything) about sound processing | 06:56 | |
06:58
domidumont joined
06:59
p6bannerbot sets mode: +v domidumont
|
|||
holyghost | right | 07:04 | |
07:10
guifa left
|
|||
Geth | doc: 6c1ec11daa | (JJ Merelo)++ | doc/Language/variables.pod6 Adds variable (rakudo-specific). Refs #2547 |
07:29 | |
doc: ea91e36849 | (JJ Merelo)++ | doc/Language/variables.pod6 Eliminates $?ENC Str.encode does not seem to have ever used it, even going back in history 7 years: github.com/rakudo/rakudo/blame/845...ore/Str.pm I haven't checked the other mentioned, but it does not seem to be either in Rakudo or roast now. Refs #2547 |
|||
synopsebot | Link: doc.perl6.org/language/variables | ||
doc: 594645eb6f | (JJ Merelo)++ | doc/Language/variables.pod6 Eliminates $?GRAMMAR Which does not seem to be either in rakudo or roast or, for that matter, work. Closes #2547 |
|||
jmerelo | The Perl foundation is asking for feedback on jnthn grant extension news.perlfoundation.org/2019/01/gra...l-6-3.html | 07:39 | |
holyghost | I have remade it from dumb client to dumb server | 07:49 | |
08:10
evalable6 left
08:11
evalable6 joined,
p6bannerbot sets mode: +v evalable6
08:12
sauvin left
08:17
sauvin joined,
p6bannerbot sets mode: +v sauvin
08:19
zakharyas joined
08:20
p6bannerbot sets mode: +v zakharyas
|
|||
moritz | dumb everything! :) | 08:20 | |
masak | is that... an observation, or a command? | 08:30 | |
moritz | dump everything? :D | 08:32 | |
timotimo | m: say Whatever.DUMP | ||
camelia | Whatever | ||
timotimo | m: say (^Inf).DUMP | 08:33 | |
camelia | Range<1>( :min(0), :max(Inf), :$!excludes-min(0), :$!excludes-max(1), :$!infinite(=Int<5>), :$!is-int(=Int<4>) ) |
||
masak | m: say Any.DUMP | ||
camelia | Any | ||
masak | I had missed that we now have .DUMP, too | ||
timotimo | it's very old :) | 08:34 | |
moritz | m: class Everything is Any { }; say Everything.DUMP | 08:35 | |
camelia | Everything | ||
jmerelo | masak: since when? | 08:37 | |
not in the docs | 08:38 | ||
Why nobody ever tells me these things? | |||
masak | jmerelo: maybe we need to formalize a role/responsibility of telling you these things :P | 08:39 | |
I see pmichaud added a &DUMP back in 2011 | |||
so yes, ancient | |||
jmerelo | Instead of a horse whispererer, we need a doccer-teller of stuff that should or should not be there | 08:40 | |
I just discovered today there were 2 variables documented that had disappeared circa 2012 | |||
masak | spooky. | ||
jmerelo | DUMP looks rakudo specific | 08:41 | |
But still. | |||
timotimo | i.imgur.com/R5wgPDQ.png - if anybody is wondering why &foo.assuming(4)() is so slow ... | ||
masak | timotimo: I wasn't, but wow | 08:42 | |
08:43
w17t left
|
|||
timotimo | the spike on the left is the compiler creating the primed functions | 08:44 | |
jmerelo | BTW, maybe take a look at this issue: github.com/perl6/doc/issues/2542 and comment. I would be interested on your feedback. | ||
08:46
dakkar joined
08:47
p6bannerbot sets mode: +v dakkar
|
|||
timotimo | so what's the deal with author tests here? | 08:49 | |
it seems to be running tests in parallel, and output is tripping over itself | 08:50 | ||
jmerelo | timotimo: here where? | ||
timotimo | travis ci of the docs repo | 08:51 | |
but i'm glad to see that's already split out | 08:54 | ||
jmerelo | timotimo: you mean this error: github.com/perl6/doc/issues/1951 | 08:55 | |
timotimo | right | ||
08:56
holyghost left
|
|||
jmerelo | timotimo: any idea of what might be happening? | 08:56 | |
timotimo | no clue :\ | ||
jmerelo | timotimo: I'm not sure it's a race condition. | ||
timotimo: it's also showing up in sequential tests. | 08:57 | ||
timotimo: the thing with Rakudo issues, 3 are created every day, while 1 is solved every 3 days. | 08:58 | ||
m: print "del\b\b\b"; say "del\b\b\b"; put "del\b\b\b" | 09:07 | ||
camelia | deldel del |
||
jmerelo | ^^^That does not work the same in "the wild" | 09:09 | |
timotimo | well, without a terminal emulator, it won't be doing the same thing | ||
how do you suggest camelia handle cursor movement in general? | |||
jmerelo | timotimo: not the thing | 09:11 | |
timotimo: the thing is that I just discovered that between print, say and put only print actually handles some escape codes like ºb | |||
sorry \b | |||
timotimo | when i pipe the output through xxd, i do see 0x61 0x08 for all three, and an extra 0a for say and put | 09:13 | |
echo behaves the same way fwiw | 09:14 | ||
echo "a"\b gives me "nothing" | |||
er | |||
gives me "a" | |||
and echo -n "a"\b gives me "nothing | |||
" | |||
jmerelo | perl6 -e 'print "del\b\b"' will effectively delete; same with put and say | ||
timotimo | echo -n "del"\b\b gives me "d" and echo "del"\b\b gives me "del" | 09:16 | |
so yeah, if you want to fix this i guess travel back in time to 1850 and talk to the original virtual terminal inventors? | 09:17 | ||
jmerelo | timotimo: not my point | 09:18 | |
timotimo: (and actually, I was wrong above) | |||
Just test that thing above in a terminal, and then change to put or say. | |||
That script above will print "d", say and put will output "del" | 09:19 | ||
timotimo | yeah | ||
i know | |||
09:19
reach_satori left
|
|||
timotimo | what is your point, then? | 09:19 | |
jmerelo | timotimo: just asked in StackOverflow... | ||
timotimo: it's not documented... | |||
timotimo | i'm not sure that's in scope for perl6 documentation | ||
jmerelo | timotimo: ? | 09:20 | |
timotimo | what would you have it say? | ||
jmerelo | stackoverflow.com/questions/541253...characters | ||
timotimo: something like "print will apply escape characters, while say and put will not" | |||
timotimo | that's not true, though | ||
jmerelo | timotimo: right. I'm checking the other escape characters. Seems to happen only to \b | 09:21 | |
timotimo | the difference between say/put and print really is only that they append a \n | ||
jmerelo | so, "print will apply \b, while the others will not" | 09:22 | |
timotimo | all of them turn \b into the corresponding ascii thing | ||
the difference is only in what the terminal does with it | 09:23 | ||
you want some extra fun? | |||
put a space after the \b\b | |||
09:23
rindolf joined
|
|||
jmerelo | timotimo: OK. I see it works now for all of them _if it's not at the end of the string | 09:23 | |
timotimo | you're misinterpreting your observations | ||
09:24
p6bannerbot sets mode: +v rindolf
|
|||
jmerelo | timotimo: please explain | 09:24 | |
timotimo | the difference is not something perl6 does | 09:25 | |
it literally outputs exactly what the docs claim it does | |||
jmerelo | timotimo: so you are saying that whitespace cancels \b somehow | ||
timotimo | it's about cursor movement in the terminal | 09:26 | |
for some reason, closing the program clips everything to the right of the cursor maybe? | |||
so when you put a newline before the program ends, there's nothing in that line that could be cleared, it's already an empty line | |||
did you try "del\b\b "? | 09:27 | ||
jmerelo | timotimo: right. That works. | ||
timotimo | can you explain the result based on your understanding? | ||
jmerelo | timotimo: you are professoring a professor. That's a dangerous thing. | 09:29 | |
09:29
kensanata joined,
p6bannerbot sets mode: +v kensanata
|
|||
timotimo | negotiable :) | 09:29 | |
jmerelo | timotimo: but I would say that what it's doing it's first printing all the string to the terminal, and then going in a second step and applying whatever they mean | 09:30 | |
timotimo | what does "it" mean here? | 09:31 | |
jmerelo | timotimo: OK, there are two its. | ||
El_Che | but who is professoring the professoringer? | ||
jmerelo | The program is outputing everything to the terminal. Then the terminal takes the codes and say: OK, here's the thing, I have two \b\b, but I'm already in the next line, so let's drop that | 09:32 | |
timotimo | it isn't in the next line yet, though, when it sees the \b | ||
jmerelo | timotimo: then what's the deal? | ||
09:33
lizmat joined,
p6bannerbot sets mode: +v lizmat
|
|||
timotimo | do we get the same output from outputting "del\b\b "? with say vs with print? | 09:33 | |
jmerelo | timotimo: yep, we do. | ||
timotimo | "d l" or "d ", right? | ||
jmerelo | yep, kinda | 09:34 | |
timotimo | "d l" in the case with \n, "d " in the case without \n | ||
what does "kinda" mean? :) | 09:35 | ||
jmerelo | timotimo: OK, I see your point. | ||
it's moving the cursor back two positions, _in the same line_ | 09:36 | ||
not in the string | |||
timotimo | "the string" is an abstraction that no longer exists at that point | ||
jmerelo | I thought "backspace" was exactly the same as "delete". It's not. | 09:37 | |
It's, literally, back the space of a single character. | |||
timotimo | right | ||
similar to the distinction between \n and \r | |||
at least on windows, that is | |||
jmerelo | timotimo++ | 09:38 | |
jmerelo stands professored. | |||
timotimo | haha | 09:39 | |
you gave me a lot of wrong to work with, but it's totally understandable | |||
i mean it's not surprising that you'd not immediately get what's going on | |||
09:40
leont joined,
p6bannerbot sets mode: +v leont
|
|||
jmerelo | timotimo: you could also answer in StackOverflow :-) | 09:42 | |
timotimo | actually i might go rest a little because my sleep ended much too early today compared to when it started and i think i can't feel my brain %) | 09:44 | |
jmerelo | timotimo: it's got to be there. Where was it last time you checked? | 09:46 | |
timotimo: :-) thanks again. | |||
m: say "الخط العربي" | |||
camelia | الخط العربي | ||
09:58
rindolf left
09:59
robertle left
10:03
rindolf joined
10:04
p6bannerbot sets mode: +v rindolf
10:06
MilkmanDan left
10:08
MilkmanDan joined,
p6bannerbot sets mode: +v MilkmanDan
10:12
reach_satori joined
10:13
p6bannerbot sets mode: +v reach_satori
10:23
leont left
10:26
sena_kun joined
10:27
p6bannerbot sets mode: +v sena_kun
10:43
reach_satori left
11:04
w17t joined,
p6bannerbot sets mode: +v w17t
11:23
w17t left
11:28
w17t joined,
p6bannerbot sets mode: +v w17t
11:40
robertle joined
11:41
p6bannerbot sets mode: +v robertle
12:06
leont joined,
p6bannerbot sets mode: +v leont
12:09
mowcat joined,
p6bannerbot sets mode: +v mowcat
12:16
molaf joined,
p6bannerbot sets mode: +v molaf
12:26
zakharyas left
12:27
molaf left,
leont left
|
|||
SmokeMachine | .tell guifa thanks! | 12:35 | |
yoleaux | SmokeMachine: I'll pass your message to guifa. | ||
12:39
lucasb joined,
p6bannerbot sets mode: +v lucasb
|
|||
SmokeMachine | Os there any good practice on writing tests to NativeCall modules? | 12:42 | |
12:42
kyzn joined
|
|||
lizmat | writing tests for the functionality itself ? regardless of whether NativeCall is used underneath ? | 12:43 | |
12:43
p6bannerbot sets mode: +v kyzn
|
|||
SmokeMachine | lizmat: I mean: the lib the module is using is alread tested... so, I’d like to test if the wrapper is working, and not test the lib again... | 12:46 | |
lizmat | hmmm... not sure how one would do that | 12:47 | |
wouldn't that be testing if NativeCall works ? | |||
SmokeMachine | lizmat: kind of... but yes, I’d like to not retest the lib nor NativeCall... | 12:49 | |
lizmat: I men, for example here: github.com/FCO/GccJit/blob/master/...GccJit.pm6 theres a lot here that need to be tested but isn’t the lib’s functionality neither NativeCall’s | 12:51 | ||
12:51
reach_satori joined
12:52
p6bannerbot sets mode: +v reach_satori
|
|||
AlexDaniel | .tell guifa “There were two that are Inline::Perl5 for instance” – it's the same module | 12:52 | |
yoleaux | AlexDaniel: I'll pass your message to guifa. | ||
12:55
w17t left
12:57
w17t joined,
p6bannerbot sets mode: +v w17t
|
|||
lucasb | AlexDaniel: seems like I was banned from zofbot. is it still possible to use the bots there? | 12:57 | |
AlexDaniel | lucasb: go to #whateverable instead | 12:58 | |
lucasb | ah, thanks. I wasn't aware | ||
13:01
robertle left
13:03
robertle joined
13:04
gregf_ joined,
p6bannerbot sets mode: +v robertle,
p6bannerbot sets mode: +v gregf_,
jmerelo left
13:05
reach_satori left
13:12
molaf joined
13:13
p6bannerbot sets mode: +v molaf
13:16
w17t left
13:20
w17t joined,
p6bannerbot sets mode: +v w17t
13:25
Ven`` joined
13:26
p6bannerbot sets mode: +v Ven``
13:38
w17t left
13:44
reach_satori joined
13:45
p6bannerbot sets mode: +v reach_satori
13:49
robertle left
13:53
leont joined
13:54
molaf left,
p6bannerbot sets mode: +v leont
13:56
cosimo left,
zakharyas joined
13:57
p6bannerbot sets mode: +v zakharyas
13:58
robertle joined,
molaf joined
13:59
p6bannerbot sets mode: +v robertle,
p6bannerbot sets mode: +v molaf
14:00
cosimo joined
14:01
p6bannerbot sets mode: +v cosimo
14:02
molaf left,
leont left
|
|||
daxim | class Foo {}; class Bar {}; class Quux { has Array[Foo|Bar] $.attr; }; Quux.new(attr => [Bar.new, Foo.new]); | 14:02 | |
m: class Foo {}; class Bar {}; class Quux { has Array[Foo|Bar] $.attr; }; Quux.new(attr => [Bar.new, Foo.new]); | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> An exception occurred while parameterizing Array at <tmp>:1 Exception details: 5===SORRY!5=== Error while compiling <tmp> Can not parameterize Array with any(Foo, Bar) at <tmp>:1 … |
||
14:05
reach_satori left
|
|||
lizmat | daxim: you cannot currently parameterize with a Junction | 14:06 | |
daxim | what's the workaround? | ||
jnthn | If you have the possibility, create a role and make both types do the role. Otherwise, probably a subset type is the best bet | 14:07 | |
lizmat | m: my subset A where $_ ~~ Int || $_ ~~ Str; my A $a = 0e0 | ||
camelia | Type check failed in assignment to $a; expected A but got Num (0e0) in block <unit> at <tmp> line 1 |
||
lizmat | m: my subset A where $_ ~~ Int || $_ ~~ Str; my A $a = 42 | ||
camelia | ( no output ) | ||
lizmat | m: my subset A where $_ ~~ Int || $_ ~~ Str; my A $a = "foo" | ||
camelia | ( no output ) | ||
jnthn | m: my subset A where Int | Str; my A $a = "foo"; | 14:08 | |
camelia | ( no output ) | ||
jnthn | m: my subset A where Int | Str; my A $a = 0e0; | ||
camelia | Type check failed in assignment to $a; expected A but got Num (0e0) in block <unit> at <tmp> line 1 |
||
jnthn | Can even write it like that :) | ||
lizmat | ah, cool | ||
jnthn | Though if you own all the types involved, I'd still suggest a role is better design. | ||
daxim | like this? | 14:11 | |
m: role Foobar {}; class Foo does Foobar {}; class Bar does Foobar {}; class Quux { has Array[Foobar] $.attr; }; Quux.new(attr => [Bar.new, Foo.new]); | |||
camelia | Type check failed in assignment to $!attr; expected Array[Foobar] but got Array ($[Bar.new, Foo.new]) in block <unit> at <tmp> line 1 |
||
jnthn | More like `has Foobar @.attr` | 14:12 | |
That way you get it to assign (copy from) the input array rather than binding it. With a Scalar you'd need to make sure the incoming array is correctly typed already since that will really be stored there directly. | 14:13 | ||
daxim | I didn't know it's binding! | ||
jnthn | Well, "binding" is not quite true | 14:14 | |
What's really happening is that you're assigning the array into the Scalar typed Array[Foobar] | |||
So it asks the array "are you an Array[Foobar]?" and if it wasn't declared as such, it fails | |||
m: my @a = 1,2,3; my $b = @a; my @c = @a; @a[1] = 5; dd $b; dd @c; | 14:15 | ||
camelia | Array $b = $[1, 5, 3] Array @c = [1, 2, 3] |
||
simple | moritz: ok | ||
jnthn | m: my @a = 1,2,3; my Array[Int] $b = @a; | ||
camelia | Type check failed in assignment to $b; expected Array[Int] but got Array ($[1, 2, 3]) in block <unit> at <tmp> line 1 |
||
jnthn | m: my @a = 1,2,3; my Int @b = @a; | ||
camelia | ( no output ) | ||
jnthn | Second one works because array assignment means "iterate the thing we're assigning and store each value" | 14:16 | |
daxim | I think I understand it, and I do want the @ sigil attributes, then | 14:18 | |
I feel a bit overwhelmed, I hope this distinction becomes easier to make for me with practice | 14:19 | ||
lizmat | daxim++ | 14:21 | |
14:22
Ven`` left
|
|||
simple | can someone help me translate perl5 to per6 regex? my @params = ($line =~ /[a-z](\d+)/g); # gives an array of 0,1,2,3 for string 'a0 b1 c3 z3' | 14:38 | |
there will be other text in the line as well, not just [a-z]\d pairs | |||
14:38
zacts joined,
p6bannerbot sets mode: +v zacts
|
|||
simple | m:g/[a-z\(\d+)/ sure doesn't work like that | 14:39 | |
evalable6 | (exit code 1) 04===SORRY!04=== Error while compiling /tmp/sPoixm85SX Missing… |
||
simple, Full output: gist.github.com/1b1a28152e3f18baba...4da7fdb4b0 | |||
AlexDaniel | hah | ||
stupid bot :) | |||
simple | yeah | ||
sena_kun | m: say 'a0 b1 c3 z3' ~~ m:g/<[a..z]>(\d+)/ | ||
camelia | (「a0」 0 => 「0」 「b1」 0 => 「1」 「c3」 0 => 「3」 「z3」 0 => 「3」) |
||
simple | typo: m:g/[a-z](\d+)/ sure doesn't work like that | ||
sena_kun | m: .Str.say for ('a0 b1 c3 z3' ~~ m:g/<[a..z]>(\d+)/); | 14:42 | |
camelia | a0 b1 c3 z3 |
||
sena_kun | m: .Str.say for ('ehehe a0 b1 ehehe c3 z3 ehehe' ~~ m:g/<[a..z]>(\d+)/); | ||
camelia | a0 b1 c3 z3 |
||
simple | m: .Str.say 'ehehe a0 b1 ehehe c3 z3 ehehe'.match(/<[a-z]>(\d+)/) | 14:44 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Two terms in a row at <tmp>:1 ------> 3.Str.say7⏏5 'ehehe a0 b1 ehehe c3 z3 ehehe'.match(/ expecting any of: infix infix stopper statement end sta… |
||
simple | m: .Str.say "ehehe a0 b1 ehehe c3 z3 ehehe".match(/<[a-z]>(\d+)/) | 14:45 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Two terms in a row at <tmp>:1 ------> 3.Str.say7⏏5 "ehehe a0 b1 ehehe c3 z3 ehehe".match(/ expecting any of: infix infix stopper statement end sta… |
||
tobs | m: .Str.say for ('ehehe a0 b1 ehehe c3 z3 ehehe' ~~ m:g/ <[a..z]> <(\d+)> /) | ||
camelia | 0 1 3 3 |
||
sena_kun | m: .Str.say for 'ehehe a0 b1 ehehe c3 z3 ehehe'.match(/<[a..z]>(\d+)/, :g) | ||
camelia | a0 b1 c3 z3 |
||
tobs | you can use <( ... )> to enclose which part of the match you want to be in $0 | 14:46 | |
simple | m: .Str.say "ehehe a0 b1 ehehe c3 z3 ehehe".match(/<[a-z]><(\d+)>/, :global) | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Two terms in a row at <tmp>:1 ------> 3.Str.say7⏏5 "ehehe a0 b1 ehehe c3 z3 ehehe".match(/ expecting any of: infix infix stopper statement end sta… |
||
simple | m: .Str.say ("ehehe a0 b1 ehehe c3 z3 ehehe".match(/<[a-z]><(\d+)>/, :global)) | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Two terms in a row at <tmp>:1 ------> 3.Str.say7⏏5 ("ehehe a0 b1 ehehe c3 z3 ehehe".match( expecting any of: infix infix stopper statement end sta… |
||
simple | so alien, heh | ||
m: .Str.say for ('ehehe a0 b1 ehehe c3 z3 ehehe' ~~ m:g/ <[a..z]> <(\d+)> /) | 14:47 | ||
camelia | 0 1 3 3 |
||
simple | that's what i want though | ||
the way it handles whitespace really messes me up | |||
Kaiepi | i have a websocket connection and i want to write some code where i alternate between sending a message upon receiving a certain type of message, which is the response to the message sent | 14:48 | |
simple | thank you tobs | ||
Kaiepi | how do i do it? | ||
simple | tobs++ | 14:49 | |
Kaiepi | i feel like there's some way to do it with supplies but i'm not sure how | ||
14:51
MasterDuke joined,
p6bannerbot sets mode: +v MasterDuke,
Ven`` joined
14:52
p6bannerbot sets mode: +v Ven``
14:57
MasterDuke left,
MasterDuke joined,
herbert.freenode.net sets mode: +v MasterDuke,
p6bannerbot sets mode: +v MasterDuke
14:59
reach_satori joined
15:00
p6bannerbot sets mode: +v reach_satori,
Ven`` left
|
|||
Kaiepi | what i want to do is | 15:02 | |
- send a message | |||
- wait for a response | |||
- send another message | |||
sena_kun | 1)whenever $responses -> { send-message() }; 2)send-message(); | 15:05 | |
no? | |||
jnthn | Yes, and you can probably even put them in the other order for clarity | 15:06 | |
Kaiepi | i can't write it like that the way i have it written | 15:09 | |
masak | then the way you have it written isn't that good, is it? :P | 15:10 | |
Kaiepi | wait yes i can | ||
i store a list of messages to send and in the react block i send a message upon receiving the right kind of message | 15:11 | ||
15:11
vrurg joined
15:12
p6bannerbot sets mode: +v vrurg
15:19
lucasb left
15:31
jme` left
|
|||
b2gills | simple: 'a0 b1 c2 z3'.comb(/ <[a..z]> <( \d+ /) # use comb, and no need to use both `<(` and `)>` | 15:39 | |
m: say 'a0 b1 c2 z3'.comb(/ <[a..z]> <( \d+ /).perl | |||
camelia | ("0", "1", "2", "3").Seq | ||
simple | another routine i've never seen | 15:40 | |
b2gills | comb can take a regex, a number or nothing | ||
m: 'abcd'.comb(2).perl.say | |||
camelia | ("ab", "cd").Seq | ||
b2gills | m: 'abcd'.comb(/ b | c /).perl.say | ||
camelia | ("b", "c").Seq | ||
b2gills | m: 'abcd'.comb().perl.say | 15:41 | |
camelia | ("a", "b", "c", "d").Seq | ||
daxim | m: subset Foo of Str where .chars > 0; subset Foo-SetHash of SetHash where $_ ~~ Foo; my Foo-SetHash $f; $f.elems.say; # expect 0 | 15:42 | |
camelia | Invocant of method 'elems' must be an object instance of type 'Setty', not a type object of type 'Foo-SetHash'. Did you forget a '.new'? in block <unit> at <tmp> line 1 |
||
daxim | m: subset Foo of Str where .chars > 0; subset Foo-SetHash of SetHash where $_ ~~ Foo; my $f = Foo-SetHash.new; $f.elems.say; | ||
camelia | You cannot create an instance of this type (Foo-SetHash) in block <unit> at <tmp> line 1 |
||
lizmat | daxim: what are you trying to achieve ? | 15:43 | |
daxim | I can show the moose code, hold on | 15:44 | |
15:46
zacts left
15:48
dogbert2_ left
|
|||
daxim | paste.scsys.co.uk/582727 | 15:51 | |
that editing took much longer than I expected | 15:52 | ||
vrurg | daxim: I don't have much time to get into, but in Foo-SetHash your $_ matches against a SetHash object, not its keys or values. | 15:56 | |
15:56
melezhik joined,
p6bannerbot sets mode: +v melezhik
|
|||
vrurg | I think, to achieve what you want you'd need to inherit from SetHash and validate storing values. | 15:58 | |
16:10
robertle left
|
|||
lizmat | daxim: so if I understand correctly, you want a Set but limit its keys to a certain type ? | 16:17 | |
daxim | yes | 16:18 | |
lizmat | you cannot currrently do that easily, looking into if it could be added easily | 16:19 | |
MasterDuke | yes, is there some reason why SetHash can't be paramterized? | 16:20 | |
lizmat | well, or Set for that matter :-) | ||
MasterDuke | m: subset Foo of Str where .chars > 0; my SetHash of Foo %f; %f.elems.say; | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> SetHash cannot be parameterized at <tmp>:1 ------> 3 Str where .chars > 0; my SetHash of Foo7⏏5 %f; %f.elems.say; |
||
16:20
kensanata left
|
|||
lizmat | I think the reason for it is really that at the time I worked on that, either paramerization wasn't done that easily and/or not understood by me | 16:21 | |
16:24
domidumont left
16:29
donaldh joined
16:30
p6bannerbot sets mode: +v donaldh
|
|||
lizmat | daxim: looks like it's going to need quite a significant overhaul to prevent normal operation from suffering | 16:35 | |
could you please make a ticket for it, though? | |||
daxim | I don't know what to write :-S | ||
lizmat | "Quanthashes should be parameterizable" and link to this discussion in the chat log | 16:39 | |
16:50
ofperfection[m] joined,
p6bannerbot sets mode: +v ofperfection[m]
16:54
w17t joined,
p6bannerbot sets mode: +v w17t
|
|||
Geth | doc: f9481e1248 | cfa++ | doc/Language/variables.pod6 Remove index entries for $?GRAMMAR and $?ENC. (See ea91e368 and 594645eb for content removal.) |
16:59 | |
synopsebot | Link: doc.perl6.org/language/variables | ||
17:01
w17t left
17:03
jme` joined,
p6bannerbot sets mode: +v jme`
17:05
w17t joined,
p6bannerbot sets mode: +v w17t
17:09
khisanth__ joined,
p6bannerbot sets mode: +v khisanth__
17:13
khisanth_ left
17:14
patrickb joined
17:15
p6bannerbot sets mode: +v patrickb
17:33
dakkar left
17:41
donaldh left
17:52
donaldh joined,
donaldh left
17:55
leont joined
17:56
p6bannerbot sets mode: +v leont,
melezhik left
18:02
khisanth__ is now known as Khisanth
18:10
domidumont joined
18:11
p6bannerbot sets mode: +v domidumont
18:12
vrurg left
18:13
vrurg joined
18:14
p6bannerbot sets mode: +v vrurg
18:17
leont left
|
|||
Xliff | \o/ | 18:25 | |
Xliff can now style individual areas of text in a GtkTextView. | |||
18:30
jme` left
|
|||
sena_kun | Xliff++ | 18:32 | |
Xliff | sena_kun: :) | 18:34 | |
For the curious, that's now pushed to p6-GtkPlus | |||
No example, yet. I'm currently working on it. :/ | 18:35 | ||
Geth | doc: 2424e6273d | cfa++ | 2 files Document &*ARGS-TO-CAPTURE, &*GENERATE-USAGE on the variables page. Move documentation from Language/create-cli.pod6; cross reference. This also fixes broken links to: - /language/&*ARGS-TO-CAPTURE - /language/&*GENERATE-USAGE |
18:41 | |
19:07
jmerelo joined
19:08
p6bannerbot sets mode: +v jmerelo
19:11
cfa joined,
p6bannerbot sets mode: +v cfa
19:20
patrickb left
|
|||
cfa | 👋🏽 | 19:21 | |
19:22
patrickb joined,
p6bannerbot sets mode: +v patrickb
19:43
tomaw left
19:44
tomaw joined,
p6bannerbot sets mode: +v tomaw
|
|||
TreyHarris | Can I create a control-flow construct with syntactic sugar? Like, if I wanted `wenn $x == 1 { ... } sonst { ... }` to be my own if/else? I see how to do it with extraneous commas and brackets | 19:44 | |
jmerelo | TreyHarris: combining term and grammars, you probably can. | ||
TreyHarris: Or just grammars. | 19:45 | ||
TreyHarris | jmerelo: those aren't fully supported yet in Rakudo, though, are they? | ||
sena_kun | TreyHarris, technically, you can create a slang. | ||
Xliff | Is there a reason Arrays don't have an avg or mean method? | ||
jmerelo | TreyHarris: Grammars? As supported as it gets... | 19:46 | |
Xliff | m: use MONKEY-SEE-NO-AUGMENT; augment List { method avg { self.sum / self.elems } }; (^6).avg.say | ||
camelia | ===SORRY!=== Could not find MONKEY-SEE-NO-AUGMENT at line 1 in: /home/camelia/.perl6 /home/camelia/rakudo-m-inst-2/share/perl6/site /home/camelia/rakudo-m-inst-2/share/perl6/vendor /home/camelia/rakudo-m-inst-2/share/perl6 … |
||
TreyHarris | jmerelo: I was thinking slangs | ||
jmerelo | Xliff: Arrays can hold somethign else than numbers... | ||
sena_kun | Xliff, isn't it takes elements to be Numeric? | ||
jmerelo | TreyHarris: but the way to define a slang is to create Grammar + actions... | 19:47 | |
sena_kun | or be coerce-able to something that can be. | ||
Xliff | sena_kun: If it's an array of Cools, that's easy enough to check for, but I get the point. | ||
m: sub avg($a) { $a.sum / $a.elems }; my @a = (^6); @a."&sum".say | 19:48 | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Quoted method name requires parenthesized arguments. If you meant to concatenate two strings, use '~'. at <tmp>:1 ------> 3um / $a.elems }; my @a = (^6); @a."&sum"7⏏5.say |
||
Xliff | m: sub avg($a) { $a.sum / $a.elems }; my @a = (^6); @a."&sum"().say | ||
camelia | No such method '&sum' for invocant of type 'Array'. Did you mean any of these? Num sum in block <unit> at <tmp> line 1 |
||
Xliff | m: sub avg($a) { $a.sum / $a.elems }; my @a = (^6); @a."&avg"().say | 19:49 | |
camelia | No such method '&avg' for invocant of type 'Array'. Did you mean 'Bag'? in block <unit> at <tmp> line 1 |
||
Xliff | m: method avg($a) { $a.sum / $a.elems }; my @a = (^6); @a."&avg"().say | ||
camelia | Potential difficulties: Useless declaration of a has-scoped method in mainline (did you mean 'my method avg'?) at <tmp>:1 ------> 3method7⏏5 avg($a) { $a.sum / $a.elems }; my @a = No such method '&avg' for invocant of type '… |
||
Xliff | m: my method avg($a) { $a.sum / $a.elems }; my @a = (^6); @a."&avg"().say | ||
camelia | No such method '&avg' for invocant of type 'Array'. Did you mean 'Bag'? in block <unit> at <tmp> line 1 |
||
TreyHarris | Or term macros? Hrm, I haven't asked this question in several years (though it was post-rakudo, pre-Christmas), but then the answer was "not yet". If it's doable now, that's cool; know of any examples I could learn from? The slang tutorial in advent I see seems to be for the equivalent of Inline.... | ||
sena_kun | m: say (.sum / .elems given <1 2 3>); | ||
camelia | 2 | ||
jmerelo | TreyHarris: depending on what you're looking for, term might be more than enough. If Perl 6 syntax is OK, probably terms are all you need. | 19:50 | |
Xliff | sena_kun: I want shorter! :)( | ||
s/\(// | |||
jmerelo | TreyHarris: macros, well, they're not there yet. You might want to take a look at masak's 007, meanwhile. | ||
sena_kun | TreyHarris, unfortunately, there are no really much docs about making a slang. You can take a look at github.com/mryan/perl6-Slang-AltTernary <- it "redefined" ternary operator, if all you want is to replace some syntax using existing one, that may be a reference. | 19:52 | |
19:52
dct joined,
p6bannerbot sets mode: +v dct
|
|||
TreyHarris | jmerelo: I'm just thinking about the best way to port Commands-Guarded to Perl 6 without just being a slavish reimplementation of the Perl 5 syntax where I could get close, but I had to use commas and end with a semicolon *and* I needed wantarray to tell me when I was in sink context | 19:53 | |
The way I would like to do it is: "guard $x.ready { $x.setup } # no semicolon needed here" and "guard $x.ready { $x.setup } rollback { $db.remove($x) } # no semicolon here either" | 19:55 | ||
jmerelo | TreyHarris: If there's a change in syntax, like no semicolons, well, you'll have to do it in your own Grammar. | ||
TreyHarris | Where, if you're not familiar with guarded commands, they're a way to impose idempotency on actions with side effects, so `$x.ready` is a boolean evaluated at runtime; if it evaluates true, the block is skipped and evaluation continues; if it evaluates false, the block is run and the guard boolean is checked again; if it's still false, it runs the rollback block if it exists, then throws an exception unless | 19:57 | |
suppressed by something (in the Perl 5 implementation it was setting a sentinal in the rollback block, but it could just as easily be an adverb or something) | |||
tbrowder | o/ #perl6 | 19:58 | |
TreyHarris | jmerelo: if I can do it with the only penalty being a semicolon at the end of "guard ...;" and "guard ... { ... } rollback { ... };", I can live with that | ||
jmerelo | tbrowder: hi! | ||
tbrowder: happy new year! | |||
TreyHarris: give it a try... | 19:59 | ||
tbrowder | :jmerelo happy new year to you and all! | ||
TreyHarris | jmerelo: will do, thanks. I just hate it when I go down the road of something that unknowingly depends on a NYI thing, which has stalled some prior efforts to port some P5 modules | 20:00 | |
tbrowder | is there any way to use multiple traits on a sub? i want to use "cached" on an exported sub | ||
sena_kun | `is cached is export` | ||
jmerelo goes AFK for dinner and couch-surfing. See you tomorrow! | 20:01 | ||
sena_kun | m: use experimental :cached; sub a() is cached is export {} | ||
camelia | ( no output ) | ||
sena_kun | tbrowder, ^ | ||
20:01
jmerelo left,
zakharyas left,
dct left
|
|||
tbrowder | :sena_kun i've tried that, but maybe i typoed...i'll check | 20:01 | |
TreyHarris | jmerelo: on another note, since you've been on top of tickets related to this, I did a docs fork where I fixed all the urlencoded relative links since they were broken, but that made the links in the pop-up search for things like $*OUT break. Has anybody got a solution for the search box? Because if so, I can quickly rebase my fork and fix the rest of the broken internal links. | 20:03 | |
I didn't have time to figure out the search box issue, so I've sat on that fork for a couple weeks now | 20:04 | ||
tbrowder | looks like my sub is not clean or decoupled enough; the "is cached is export" appears to work but i get an error pointing inside the sub--thanks! | 20:05 | |
20:05
robertle joined
20:06
p6bannerbot sets mode: +v robertle
20:11
Guest29947 joined
20:12
Guest29947 left,
jme` joined
20:13
p6bannerbot sets mode: +v jme`
|
|||
Xliff | Can you bind to a Proxy object? | 20:21 | |
20:21
domidumont left
20:23
bartolin joined
20:24
p6bannerbot sets mode: +v bartolin
|
|||
moritz | you can bind to containers, not to objects | 20:25 | |
Xliff | Why YES, Houston! You CAN bind to a Proxy! | ||
m: class A { has $!a; method a is rw { Proxy.new: FETCH => -> {$!a}, STORE => -> $, \v { say v; $!a = v; } }; }; my $b := A.new.a; $b = 1; $b = 0 | |||
camelia | 1 0 |
||
Xliff | m: class A { has $!a; method a is rw { Proxy.new: FETCH => -> {$!a}, STORE => -> $, \v { say "A: {v}"; $!a = v; } }; }; my $b := A.new.a; $b = 1; $b = 0 | ||
camelia | A: 1 A: 0 |
||
Xliff | :-O | ||
I. Muzt. Uze. Dat! | 20:26 | ||
moritz | you are binding an object whose method returns a container to a variable | ||
erm | |||
you are binding an object whose method returns a Proxy to a variable | |||
you aren't binding to a Proxy | 20:27 | ||
20:27
jme` left
|
|||
Xliff | No, but when I change $b, I run the Proxy's store method. | 20:28 | |
That's what I was curious about. | |||
Kaiepi | why does running this throw this error? hastebin.com/ewerixufuq.pl | 20:30 | |
===SORRY!=== | |||
This type cannot unbox to a native string: P6opaque, Failure | |||
20:31
Ven`` joined
|
|||
Kaiepi | OH | 20:31 | |
i forgot use lib 'lib' | |||
20:32
p6bannerbot sets mode: +v Ven``
20:33
molaf joined
20:34
p6bannerbot sets mode: +v molaf
|
|||
Kaiepi | where should config files go on windows? | 20:35 | |
for psbot i have it in ~/.config/psbot.json but i have no clue where it'd go on windows | 20:36 | ||
20:43
molaf left
|
|||
TreyHarris | Kaiepi: %localappdata%\PSbot\psbot.json would be standard | 20:55 | |
Kaiepi | ok | ||
TreyHarris | I'm not sure how to expand path vars on Windows in Perl 6, I've never used it on Windows | ||
Kaiepi | where's %localappdata%? | ||
TreyHarris | Kaiepi: it varies, it's a variable kinda like ~ on Unix | 20:56 | |
Kaiepi | shit | ||
TreyHarris | Each user on the system gets one | ||
moritz | are they in %*ENV? | 20:57 | |
TreyHarris | checking | ||
moritz | or do you have to look up those values in the Registry? | ||
Kaiepi | $*HOME/AppData/Local/PSBot/psbot.json? | ||
TreyHarris | moritz: no, definitely not. | ||
Kaiepi: that would be the default default place for it, but it isn't safe to assume. Since I have a small SSD as my boot drive, mine is elsewhere | |||
Kaiepi: my rakudo on Windows is broken. installing a new one, hang on | 20:58 | ||
21:00
Ven`` left
21:06
guifa joined,
p6bannerbot sets mode: +v guifa,
|oLa| joined
21:07
|oLa| left
|
|||
tbrowder | i'm trying to use two named args to a sub that have the same name but different sigils and am getting an error--surprising!! | 21:10 | |
TreyHarris | Kaiepi: it's not in %*ENV. Give me a moment to check a couple other places | ||
Kaiepi | ok | ||
tbrowder | error: Name stats used for more than one named parameter | ||
:%stats and :$stats | 21:11 | ||
m: sub foo(:$s, :%s) {} | |||
camelia | 5===SORRY!5=== Error while compiling <tmp> Name s used for more than one named parameter at <tmp>:1 ------> 3sub foo(:$s, :%s)7⏏5 {} |
||
TreyHarris | Kaiepi: yes it is! I typod | 21:12 | |
Kaiepi: %*ENV<LOCALAPPDATA> | 21:13 | ||
Kaiepi | perfect! | ||
thanks | |||
tbrowder | is that a bug? | ||
m: my ($s, %s); | 21:14 | ||
camelia | ( no output ) | ||
tbrowder | m: my ($s, %s); $s = 1; %s<a> = 1; | ||
camelia | ( no output ) | ||
tbrowder | m: sub foo($s, %s) {} | 21:15 | |
camelia | ( no output ) | ||
moritz | tbrowder: in a parameter list, :$stats desugars to stats => $stats, and :%stats to stats => :%stats | 21:16 | |
argument list, sorry | |||
so both filll the same named argument | |||
and hence it doesn't make sense to declare both in the same signature | |||
cfa | perhaps worth documenting as a trap if this is confusing? | 21:17 | |
tbrowder | ok, makes sense, thanks! | ||
TreyHarris | Kaiepi: oh, btw, I didn't ask, but if you care, you can check the difference between LOCALAPPDATA and APPDATA; the latter gets synced into one's Windows cloud account if one exists | 21:20 | |
I always just use LOCALAPPDATA | |||
21:31
gfldex joined
21:32
p6bannerbot sets mode: +v gfldex
21:33
ChoHag left
21:40
dncefan left,
cfa left
21:46
patrickb left
21:48
dncefan joined
21:49
p6bannerbot sets mode: +v dncefan
|
|||
tbrowder | m: loop(my $n = 0; $n < 2; ++$n) {} | 21:58 | |
camelia | 5===SORRY!5=== Word 'loop' interpreted as 'loop()' function call; please use whitespace around the parens at <tmp>:1 ------> 3loop7⏏5(my $n = 0; $n < 2; ++$n) {} Unexpected block in infix position (two terms in a row) at <tmp>:1 … |
||
tbrowder | m: loop (my $n = 0; $n < 2; ++$n) {} | ||
camelia | ( no output ) | ||
tbrowder | m: loop (my $n = 0; $n < 2; ++$n) { .say} | 21:59 | |
camelia | (Any) (Any) |
||
tbrowder | m: loop (my $n = 0; $n < 2; ++$n) { say $n} | ||
camelia | 0 1 |
||
tbrowder | m: loop (my $n = 0; $n < 2; ++$n) { say $n}; loop (my $n=0;$n<2;++$n){say $n} | 22:00 | |
camelia | 5===SORRY!5=== Whitespace required before < operator at <tmp>:1 ------> 3ay $n}; loop (my $n=0;$n<2;++$n){say $n}7⏏5<EOL> expecting any of: postfix Other potential difficulties: Redeclaration of symbol '$n' … |
||
tbrowder | m: loop (my $n = 0; $n < 2; ++$n) { say $n}; loop (my $n=0;$n<2;++$n){ say $n} | 22:01 | |
camelia | 5===SORRY!5=== Whitespace required before < operator at <tmp>:1 ------> 3y $n}; loop (my $n=0;$n<2;++$n){ say $n}7⏏5<EOL> expecting any of: postfix Other potential difficulties: Redeclaration of symbol '$n' … |
||
tbrowder | m: loop (my $n = 0; $n < 2; ++$n) { say $n }; loop (my $n=0;$n<2;++$n){ say $n } | ||
camelia | 5===SORRY!5=== Whitespace required before < operator at <tmp>:1 ------> 3$n }; loop (my $n=0;$n<2;++$n){ say $n }7⏏5<EOL> expecting any of: postfix Other potential difficulties: Redeclaration of symbol '$n' … |
||
tbrowder | m: loop (my $n = 0; $n < 2; ++$n) { say $n } loop (my $n=0; $n < 2; ++$n) { say $n } | 22:02 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Strange text after block (missing semicolon or comma?) at <tmp>:1 ------> 3oop (my $n = 0; $n < 2; ++$n) { say $n }7⏏5 loop (my $n=0; $n < 2; ++$n) { say $n } |
||
tbrowder | m: loop (my $n = 0; $n < 2; ++$n) { say $n }; loop (my $n = 0; $n < 2; ++$n) { say $n } | ||
camelia | Potential difficulties: Redeclaration of symbol '$n' at <tmp>:1 ------> 030; $n < 2; ++$n) { say $n }; loop (my $n7⏏5 = 0; $n < 2; ++$n) { say $n } 0 1 0 1 |
||
tbrowder | m: loop (my $n = 0; $n < 2; ++$n) { say $n }; | 22:03 | |
camelia | 0 1 |
||
tbrowder | m: loop ($n = 0; $n < 2; ++$n) { say $n }; | ||
camelia | 5===SORRY!5=== Error while compiling <tmp> Variable '$n' is not declared at <tmp>:1 ------> 3loop (7⏏5$n = 0; $n < 2; ++$n) { say $n }; |
||
tbrowder | m: loop (my $n = 0; $n < 2; ++$n) { say $n }; | ||
camelia | 0 1 |
||
tbrowder | m: my $n; loop ($n = 0; $n < 2; ++$n) { say $n }; loop ($n = 0; $n < 2; ++$n) { say $n } | 22:07 | |
camelia | 0 1 0 1 |
||
tbrowder | ah, the $n decl spillage spoils the second loop | 22:08 | |
22:08
stux|RC joined
|
|||
tbrowder | m: my $n; loop ($n = 0; $n < 2; ++$n) { say $n } loop ($n = 0; $n < 2; ++$n) { say $n } | 22:08 | |
camelia | 5===SORRY!5=== Error while compiling <tmp> Strange text after block (missing semicolon or comma?) at <tmp>:1 ------> 3; loop ($n = 0; $n < 2; ++$n) { say $n }7⏏5 loop ($n = 0; $n < 2; ++$n) { say $n } |
||
tbrowder | m: my $n; loop ($n = 0; $n < 2; ++$n) { say $n }; loop ($n = 0; $n < 2; ++$n) { say $n } | ||
camelia | 0 1 0 1 |
||
22:08
p6bannerbot sets mode: +v stux|RC
22:09
KDr2 left
22:10
KDr2 joined,
p6bannerbot sets mode: +v KDr2
22:20
k-man joined,
p6bannerbot sets mode: +v k-man
22:44
ferreira left
22:52
melezhik joined,
p6bannerbot sets mode: +v melezhik
|
|||
melezhik | hi! how do I run system command and check it fails , without catching exception? | 22:53 | |
sena_kun | m: my $a = run 'l', '-l'; say $a.exitcode == 0; | 22:54 | |
camelia | False | ||
sena_kun | m: my $a = run 'ls', '-l'; say $a.exitcode == 0; | ||
camelia | total 132 drwxr-xr-x 1 camelia users 274 Jul 20 2017 Inline-Perl5 drwxrwxr-x 1 camelia users 494 Dec 28 16:05 Perlito drwxr-xr-x 1 camelia users 30 Jul 16 2016 bin -rw-r--r-- 1 camelia users 810 Dec 31 2015 dalek-queue drwxrwxr-x… |
||
sena_kun | m: my $a = run 'ls', '-l', :!out; say $a.exitcode == 0; | 22:55 | |
camelia | True | ||
sena_kun | melezhik, something like ^? Or you want a Proc::Async to do it in async way. | ||
timotimo | m: my $a = run 'false'; say $a.exitcode == 0 | 22:56 | |
camelia | False | ||
melezhik | thank you! | 22:57 | |
23:07
alpha joined
23:08
p6bannerbot sets mode: +v alpha
|
|||
sena_kun | m: my $a = Metamodel::ClassHOW.new_type(name => 'A'); $a.^compose; say $a; say $a.new; say $a.new ~~ $a; | 23:09 | |
camelia | (A) A.new False |
||
23:09
alpha left
|
|||
sena_kun | this is... totally not something I would expect. | 23:09 | |
hmmm... with `constant` it works. | 23:11 | ||
m: constant A := Metamodel::ClassHOW.new_type(name => 'A'); A.^compose; say A.new ~~ A; | |||
camelia | True | ||
vrurg | m: my $a := Metamodel::ClassHOW.new_type(name => "A"); $a.^compose; say $a; say $a.new; say $a.new ~~ $a | 23:13 | |
camelia | (A) A.new True |
||
vrurg | It's not because of constant. You store a type in a Scalar container. Binding is the key here. | ||
I don't know what happens when a run-time composed type gets stored in a scalar, but strange side-effects are taking place then. | 23:14 | ||
sena_kun | hmm... that is very much appreciated, though I, to be honest, don't really understand the meaning... Ah, ok. | ||
vrurg was fighting with similar case a couple of days ago | |||
sena_kun | vrurg++ | ||
vrurg | sena_kun: basically, whenever you go to metamodel consider using more binding because this is what is natural to NQP. | 23:15 | |
sena_kun | thanks for the advice! | 23:16 | |
vrurg | welcome! | ||
23:25
ferreira joined
23:26
p6bannerbot sets mode: +v ferreira
|
|||
vrurg | Though I still wonder what makes this difference: | 23:26 | |
m my $a = Metamodel::ClassHOW.new_type(name => "A"); $a.^compose; say $a.new.WHICH; say $a.WHICH | |||
m: my $a = Metamodel::ClassHOW.new_type(name => "A"); $a.^compose; say $a.new.WHICH; say $a.WHICH | |||
camelia | A|60460592 A|U42829192 |
||
sena_kun | in my case(I hope), as long as it passes type checks, I am safe... | 23:27 | |
timotimo | one is an instance, the other is the type object, at least in that last example | 23:32 | |
vrurg | timotimo: thanks! And I knew this at some point! ;) | 23:36 | |
Ok, then it's definitely looks like a smartmatch bug | 23:38 | ||
m: my $a = Metamodel::ClassHOW.new_type(name => "A"); $a.^compose; say $a.new.WHAT === $a | |||
camelia | True | ||
vrurg | sena_kun: what's your OS and perl6 version? I'm filing a report on the bug. | 23:46 | |
sena_kun | vrurg, void linux, 2018.12. | 23:47 | |
This is Rakudo version 2018.12 built on MoarVM version 2018.12 | |||
vrurg | same rakudo as mine. Ok, thanks! | ||
sena_kun | Linux miskatonic 4.19.13_1 <- though I am sure such guts will be helpful. :) | 23:48 | |
vrurg++ | |||
s/will/won't/ | |||
vrurg | Most likely not. Mine is macOS, I also tried this on 2017.10 – same everywhere. | 23:50 | |
github.com/rakudo/rakudo/issues/2602 | |||
Hm, my 20th report... | 23:51 | ||
23:52
ChoHag joined
23:53
p6bannerbot sets mode: +v ChoHag
|