»ö« 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:00 w_richard_w joined, melezhik left, p6bannerbot sets mode: +v w_richard_w 00:31 rindolf left 00:39 leont joined, p6bannerbot sets mode: +v leont, sena_kun left 00:50 jast left, kurahaupo joined 00:51 p6bannerbot sets mode: +v kurahaupo
Xliff m: (^6)[* - 1].say 01:06
camelia 5
Xliff m: my %a = (a => 1, b => 2, c => 3); my $e = %a<a>:delete; $e.say; %a.gist.say 01:08
camelia 1
{b => 2, c => 3}
lookatme_q m: my %a = (a => 88, b => 2, c => 3); my $e = %a<a>:delete; $e.say; %a.gist.say 01:09
camelia 88
{b => 2, c => 3}
01:30 leont left 01:53 jme` joined 01:54 p6bannerbot sets mode: +v jme` 01:57 Cabanossi left 01:58 Cabanossi joined 01:59 p6bannerbot sets mode: +v Cabanossi 02:03 w_richard_w left 03:03 evalable6 left, gregf_ left 03:05 evalable6 joined, p6bannerbot sets mode: +v evalable6 03:35 w17t left 03:55 daotoad joined 03:56 p6bannerbot sets mode: +v daotoad
vrurg Can't find how to create a link to another module in a pod... 04:00
04:16 ferreira left 04:30 Cabanossi left 04:31 Cabanossi joined, p6bannerbot sets mode: +v Cabanossi 04:33 guifa left 04:38 daotoad left
Kaiepi i bought Compilers: Principles, Techniques, and Tools (2nd Edition) 04:38
hopefully it'll help me understand perl 6 core dev better 04:39
04:45 daotoad joined 04:46 p6bannerbot sets mode: +v daotoad, daotoad left 05:00 RavBell joined, p6bannerbot sets mode: +v RavBell
RavBell Test message. Sending first time. 05:03
pony True 05:07
lookatme_q RavBell, True 05:21
05:22 daotoad1 joined, p6bannerbot sets mode: +v daotoad1 05:25 MasterDuke left 05:36 dncefan left 05:37 mowcat left 05:38 molaf joined 05:39 p6bannerbot sets mode: +v molaf 05:40 ferreira joined 05:41 p6bannerbot sets mode: +v ferreira 05:42 dncefan joined, p6bannerbot sets mode: +v dncefan 05:46 molaf left 05:47 daotoad1 left 05:58 curan joined, p6bannerbot sets mode: +v curan 06:14 kurahaupo left 06:16 daemon left
RavBell p6: say 'Hello!;' 06:22
camelia Hello!;
RavBell p6: say "test\ner"~~/test<?before \n'er'>/
camelia 「test」
RavBell p6: say "test\ner"~~/test<?before ^^'er'>/ 06:23
camelia Nil
RavBell Can someone tell me why the output is different for the last two statements?
If I understood it right, ^^ should match the start of a logical new line. Which is what the second of the two statements seems to be doing but the answer is Nil. 06:24
06:25 jmerelo joined
RavBell Am I missing something in my understanding? 06:25
06:25 p6bannerbot sets mode: +v jmerelo
lookatme_q RavBell, I think you missed the \n 06:26
p6: say "test\ner"~~/test\s<?before ^^'er'>/ 06:27
camelia 「test
RavBell But I isn't ^^ inside <> the same as matching after \n? 06:29
lookatme_q RavBell, \n is belong to first line
RavBell May be I am not understanding the difference beween ^^ and \n? 06:30
lookatme_q ^^ is an anchor, not a char 06:31
RavBell I thought \n is ^^ or somthing like that.
lookatme_q no
RavBell That means it does not match it per se?
lookatme_q it's like <?before ..>, match the pos
p6: say "test\ner"~~/<?before ^^'er'>/ 06:32
camelia 「」
RavBell It is what they call the zero-width assertions?
lookatme_q you see, it's nothing
yes
RavBell ok. Thanks for clearing that up!
lookatme_q p6: say "test\ner"~~/^^/ 06:33
camelia 「」
lookatme_q similar things
RavBell Got you!
Thanks lookatme_q!
lookatme_q you welcome 06:34
06:35 domidumont joined 06:36 p6bannerbot sets mode: +v domidumont 06:44 ferreira left 06:45 ferreira joined 06:46 p6bannerbot sets mode: +v ferreira
Geth doc: 800a5b9704 | (JJ Merelo)++ | doc/Language/variables.pod6
Minor corrections and reflow
06:48
doc: 4830298860 | (JJ Merelo)++ | doc/Language/contexts.pod6
Fixes errors

Basically changes say to put, which always calls Str (while say calls
  .gist). Closes #2546
synopsebot Link: doc.perl6.org/language/variables
Link: doc.perl6.org/language/contexts
06:50 dncefan left 06:51 domidumont left 06:54 dncefan joined 06:55 p6bannerbot sets mode: +v dncefan 07:07 domidumont joined 07:08 dct joined, p6bannerbot sets mode: +v dct, p6bannerbot sets mode: +v domidumont 07:15 dct left 07:26 dct joined, p6bannerbot sets mode: +v dct 07:27 reach_satori left 07:32 dct left 07:38 jmerelo left 07:53 dct joined, p6bannerbot sets mode: +v dct 07:58 zacts joined, p6bannerbot sets mode: +v zacts
Kaiepi m: say "A͜͡".subst(rx:i/ <-[a..z]> /, '', :g) 08:01
camelia
Kaiepi how do i get this to return a?
s/a\?/A?/
08:01 reach_satori joined 08:02 p6bannerbot sets mode: +v reach_satori
moritz .uni A͜͡ 08:05
moritz too old to remember bot usage
08:05 reach_satori_ joined
moritz m: say lc samemark ' ', 'A͜͡' 08:06
camelia ͜͡
moritz m: say lc samemark 'A͜͡', ' '
camelia a
moritz Kaiepi: ^^ like this?
08:06 p6bannerbot sets mode: +v reach_satori_
moritz there are also regex and substitution modifies for ignoring marks 08:07
Kaiepi i need the regex modifiers
m: say "A͜͡".subst(rx:i:ignoremark/ <-[a..z]> /, '', :g) 08:08
08:08 reach_satori left
camelia A͜͡ 08:08
Kaiepi hm
m: say "A͜͡".subst(rx:i:samemark/ <-[a..z]> /, '', :g) 08:10
camelia 5===SORRY!5=== Error while compiling <tmp>
Adverb samemark not allowed on rx
at <tmp>:1
------> 3say "A͜͡".subst(rx:i:samemark/ <-[a..z]> /7⏏5, '', :g)
Kaiepi m: say "A͜͡" ~~ S:i:samemark:g/ <-[a..z]> // 08:12
camelia Potential difficulties:
Smartmatch with S/// is not useful. You can use given instead: S/// given $foo
at <tmp>:1
------> 3say "A͜͡" ~~ 7⏏5S:i:samemark:g/ <-[a..z]> //
True
Kaiepi m: say "A͜͡" ~~ s:i:samemark:g/ <-[a..z]> //
camelia ()
Kaiepi m: say "A͜͡" ~~ s:i:ignoremark:g/ <-[a..z]> //
camelia ()
Kaiepi m: say "A͜͡".samemark(' ').subst(rx:i:samemark/ <-[a..z]> /, '', :g) 08:15
camelia 5===SORRY!5=== Error while compiling <tmp>
Adverb samemark not allowed on rx
at <tmp>:1
------> 3rk(' ').subst(rx:i:samemark/ <-[a..z]> /7⏏5, '', :g)
Kaiepi m: say "A͜͡".samemark(' ').subst(rx:i/ <-[a..z]> /, '', :g)
camelia A
Kaiepi there we go
thanks
08:25 pmurias joined, p6bannerbot sets mode: +v pmurias 08:30 lizmat left
pmurias masak: example of a real life assembly generation library, it seems like it would be a good thought experiment to consider how it would look like in a macroish world 08:32
08:38 andrzejku joined 08:39 p6bannerbot sets mode: +v andrzejku 08:57 Sgeo_ joined 08:58 p6bannerbot sets mode: +v Sgeo_ 09:00 Sgeo left
masak pmurias: go on :) 09:01
09:17 robertle_ joined 09:18 p6bannerbot sets mode: +v robertle_ 09:21 zakharyas joined, zacts left 09:22 p6bannerbot sets mode: +v zakharyas 09:25 kiwi_92 joined, p6bannerbot sets mode: +v kiwi_92
kiwi_92 m: class C { method ^test () { "Hi" } }; dd C.new.test 09:27
camelia No such method 'test' for invocant of type 'C'. Did you mean any of these?
List
Set
gist
list

in block <unit> at <tmp> line 1
09:30 jast joined 09:31 p6bannerbot sets mode: +v jast 09:55 rindolf joined
gfldex lolibloggedalittle: gfldex.wordpress.com/2019/01/11/it...he-finish/ 09:55
09:55 p6bannerbot sets mode: +v rindolf 09:58 Sgeo joined, p6bannerbot sets mode: +v Sgeo 10:00 Sgeo_ left 10:02 gregf_ joined, p6bannerbot sets mode: +v gregf_
pmurias masak: I don't have an authoritative answer how a Perl 6y or macroish version would look like 10:09
masak: it seems to be a regular case of generating a different language, with the big difference that because assembly doesn't have structured control flow it's mostly linear 10:10
masak: one possible observations is that any time we are generating an AST for an language a imperative style dsl is a different interface that could be generated automatically 10:13
10:14 Sgeo_ joined 10:15 p6bannerbot sets mode: +v Sgeo_ 10:18 Sgeo left 10:25 kiwi_92 left
pmurias masak: example of a Qtree from the 007 faq being turned into imperative Ruby DSL style: gist.github.com/pmurias/292b3ac5b6...aca1ecc767 10:29
10:30 llfourn left
pmurias masak: if we take it to a logical extreme would such a tranform make sense with actuall extending of the syntax? 10:31
10:33 patrickb joined 10:34 p6bannerbot sets mode: +v patrickb
RavBell m: gist.github.com/ravbell/d94b37f1a3...7d9eaf7c92 10:35
camelia ===SORRY!===
Could not find Grammar::Tracer at line 2 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
Co…
10:36 llfourn joined, p6bannerbot sets mode: +v llfourn
RavBell m: gist.github.com/ravbell/d94b37f1a3...7d9eaf7c92 10:36
camelia Invoice Summary
asd fasdf
asdfasdf
asd 123-fasdf $1234.00
qwe {rq} [we-r_q] we
Start Invoice Details


Nil
RavBell Not sure this is giving a Nil. I have been scratching my head whole day! 10:37
Any one please help! 10:38
10:39 dncefan left 10:41 dncefan joined 10:42 p6bannerbot sets mode: +v dncefan
moritz RavBell: .parse expects to match the whole string 10:42
RavBell moritz: .subparse did not work either ... 10:43
10:45 dncefan left
timotimo could have to do with "token" and "rule" being "no backtracking"? 10:46
RavBell timotimo: Does not appear like that.
10:47 dncefan joined
RavBell I ran the code using Grammer::Tracer. 10:47
It seems to go all the way doing the right thing, almost.
10:47 p6bannerbot sets mode: +v dncefan
moritz RavBell: ok, I've figured out the problem 10:48
RavBell: <invoice-prelude-end>
wants to parse a <line>
but at that point in time, the <line> has already been parsed
timotimo but the line part of invoice-prelude is frugal?
RavBell moritz: <line>*? is used. Does that not work then? 10:51
moritz: What other better way could this rule be written then? 10:52
10:53 gregf_ left
moritz RavBell: sorry, I'm a bit distracted right now 10:53
RavBell moritz: No problem! I am just grateful that you are trying to help even in the middle of your busy schedule I guess! 10:55
moritz RavBell: I think you could simplify super-word to \S+ 10:57
RavBell moritz: that makes sense 11:00
11:03 domidumont left 11:12 lizmat joined, p6bannerbot sets mode: +v lizmat 11:18 domidumont joined, p6bannerbot sets mode: +v domidumont 11:29 lucasb joined, p6bannerbot sets mode: +v lucasb 11:30 dncefan left 11:32 sena_kun joined 11:33 p6bannerbot sets mode: +v sena_kun 11:39 molaf joined 11:40 p6bannerbot sets mode: +v molaf 11:41 dncefan joined 11:42 p6bannerbot sets mode: +v dncefan 11:57 pmurias left 12:01 satori__ joined 12:02 p6bannerbot sets mode: +v satori__ 12:03 reach_satori_ left
Xliff ===SORRY!=== 12:17
Missing serialize REPR function for REPR CStruct (GTK::Compat::RGBA)
^^ What does that mean?
I take it that effectively means that CStructs can't be constants?
lizmat yeah, there's no way to store them in a precomp file is what that means 12:18
AlexDaniel moritz: you can address bots by their name :) 12:22
unicodable6: A͜͡
unicodable6 AlexDaniel, U+0041 LATIN CAPITAL LETTER A [Lu] (A)
AlexDaniel, U+035C COMBINING DOUBLE BREVE BELOW [Mn] ( ͜)
AlexDaniel, U+0361 COMBINING DOUBLE INVERTED BREVE [Mn] ( ͡)
12:24 ZzZombo joined, p6bannerbot sets mode: +v ZzZombo, ZzZombo left 12:25 dncefan left 12:26 molaf left, dncefan joined, pmurias joined, p6bannerbot sets mode: +v pmurias, p6bannerbot sets mode: +v dncefan 12:29 satori__ left
pmurias lizmat: re $*FULL-PRECISION dynamic variable isn't the variable being applicable to external libraries also a *serious drawback*? either all libraries that use Rats will have to work with it set (either by accident or design) or if you call an external library with it set you will have to check stuff still works 12:29
lizmat pmurias: it's by design for me 12:30
AlexDaniel lizmat: also, is there a way to make $*FULL-PRECISION experimental? In case we want to change it later and people start using it in their modules or in their code
lizmat I guess we could put it under 6.e.PREVIEW 12:32
pmurias lizmat: by the "by design" I mean if you are writing a module and using some Rats (even if you don't use it) you will have to consider that someone might call your module with $*FULL-PRECISION set 12:33
lizmat why would you need to consider that ?
the only thing it will do, is give you *more* precision
if a library always expects to see Rats, it's already in trouble 12:34
12:39 zakharyas left
pmurias lizmat: because FatRats can grow arbitrarily large 12:40
12:41 domidumont left
pmurias lizmat: FatRats being passed unexpectedly is fair game, if the library creates it's own Rat now it has to expect them being either Rats or FatRats 12:42
lizmat but their use is completely transparent? 12:44
downgrading to float isn't
12:55 domidumont joined, p6bannerbot sets mode: +v domidumont 12:56 dncefan left 12:57 dncefan joined, p6bannerbot sets mode: +v dncefan
robertle_ perhaps we need an explicit slimrat? so that a library can deliberately choose low-precision but fast and small, no matter what the user selected for rat behavior? 13:00
lizmat robertle_: but precision stays at Rat if it doesn't go out of range 13:01
robertle_ right, but about everything goes out of range after a few divisions
lizmat and what should a slimrat do when it goes out of range? die ?
robertle_ loose precision 13:02
lizmat that's what a Rat is
it loses precision by converting to a Num
El_Che Don't call me a rat!
lizmat
.oO( Elizabeth Rattijsen :-)
13:03
El_Che lizmat: I haven't heard that one before :) 13:06
robertle_ right, but isn't your proposal to selectively change that so that all rats instead convert to fatrat on overflow? 13:08
perhaps I got that wrong
but the slimrat idea is rubbish anyway, because you typically do not construct a rat explicitely but by saying "1 / 7" 13:09
I am just saying that I would very much like a rat to convert to fatrat rather than num by default, simply because it is safer. but it is much slower as well, and in many cases you do not need the precision. so some way to say "even if the wider program wants precision, this part of the code is fine with degradation to num" 13:11
would be fab
timotimo actually i don't think there's a good reason not to implement a serialize/deserialize function for CStruct
13:28 satori__ joined 13:29 p6bannerbot sets mode: +v satori__ 13:32 kurahaupo joined 13:33 p6bannerbot sets mode: +v kurahaupo, molaf joined 13:34 p6bannerbot sets mode: +v molaf 13:36 molaf left
lizmat robertle_: that would imply a pragma, if you want lexical 13:41
which is problematic 13:42
13:53 kurahaupo_ joined 13:54 p6bannerbot sets mode: +v kurahaupo_ 13:56 kurahaupo left 14:00 abraxxa left 14:17 zakharyas joined 14:18 p6bannerbot sets mode: +v zakharyas 14:28 curan left 14:38 AlexDani` joined 14:39 p6bannerbot sets mode: +v AlexDani` 14:42 AlexDaniel left 14:44 AlexDani` is now known as AlexDaniel
Xliff Won't the IO::Handle version of spurt and slurp close automatically? 14:48
14:51 molaf joined, p6bannerbot sets mode: +v molaf
jnthn Don't think so 15:03
Xliff s/IO::Handle/IO::Path/ 15:04
jnthn hah 15:06
I think the IO::Path ones will :)
Since you never see the handle there. 15:07
Xliff OK. Docs don't make that clear, so I think I will add that wording.
docs.perl6.org/routine/slurp <-- see bottom
jnthn Yeah, worth clarifying 15:09
Xliff Oh, and thanks for the reset link! ;)
jnthn :) 15:10
15:12 molaf left
Xliff What's the best way to pass quoted strings to run? 15:14
m: run 'ls', '-l'
camelia total 136
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…
Xliff m: run 'touch', '"my file"' 15:15
camelia ( no output )
Xliff m: run 'ls', '-l'
camelia total 136
-rw-r--r-- 1 camelia users 0 Jan 11 16:15 "my file"
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…
Xliff :S
m: run 'cat', '"my file"'
camelia ( no output )
Xliff m: (run 'cat', '"my file", :out).out.say'
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in parenthesized expression; couldn't find final ')' (corresponding starter was at line 1)
at <tmp>:1
------> 3(run 'cat', '"my file", :out).out.say'7⏏5<EOL>
e…
Xliff m: (run 'cat', '"my file"', :out).out.say
camelia This pipe was opened for reading, not writing
in block <unit> at <tmp> line 1
Xliff m: (run 'cat', '"my file"', :out).out.say 15:16
camelia This pipe was opened for reading, not writing
in block <unit> at <tmp> line 1
Xliff OK. Trying this locally.
jnthn I think run will already quote them for you? 15:17
As in, it passes each thing as an individual argument to the program
Xliff OK, but I want "quoted string" to be passed as one string.
More like '"quoted string"'
Think embedded-spaces 15:18
OK, I get that error no matter what. Weird/. 15:20
jnthn $ perl6 -e 'run "perl6", "-e", "say 42"'
42
tobs Xliff: spaces only become a problem when you involve a shell. run doesn't start the program through a shell, so you should be fine without any quoting
jnthn If it was splitting that on spaces there, then you'd get an error, 'cus the 42 would be taken as a program argument, not as an argument to say
tobs explains it better :) 15:21
Xliff Yep! I think I have it. Thanks.
15:34 mowcat joined
Xliff m: my @a = <aaa bbb ccc>; for @a { if / .{3..3} / { s/{ $/.Str }/ZzZ/ }; }; @a.say 15:35
camelia [ZzZaaa ZzZbbb ZzZccc]
Xliff Why is that an append instead of a replace?
15:35 p6bannerbot sets mode: +v mowcat
Xliff m: my @a = <aaa bbb ccc>; for @a { if / .{3..3} / { s:x/{ $/.Str }/ZzZ/ }; }; @a.say 15:35
camelia [ZzZaaa ZzZbbb ZzZccc]
Xliff m: my @a = <aaa bbb ccc>; for @a { if / .{3..3} / { $/.Str.say; s:x/{ $/.Str }/ZzZ/ }; }; @a.say 15:36
camelia a
b
c
[ZzZaaa ZzZbbb ZzZccc]
Xliff m: my @a = <aaa bbb ccc>; for @a { if / ... / { $/.Str.say; s:x/{ $/.Str }/ZzZ/ }; }; @a.say
camelia aaa
bbb
ccc
[ZzZaaa ZzZbbb ZzZccc]
Xliff m: my @a = <aaa bbb ccc>; for @a { if / ... / { $/.Str.say; s/{ $/.Str }/ZzZ/ }; }; @a.say
camelia aaa
bbb
ccc
[ZzZaaa ZzZbbb ZzZccc]
Xliff m: my @a = <aaa bbb ccc>; for @a { if / (...) / { $/.Str.say; s/{ $/[0].Str }/ZzZ/ }; }; @a.say 15:37
camelia aaa
Use of Nil in string context
bbb
ccc
[ZzZaaa ZzZbbb ZzZccc]
in block at <tmp> line 1
Use of Nil in string context
in block at <tmp> line 1
Use of Nil in string context
in block at <tmp> line 1
Xliff m: my @a = <aaa bbb ccc>; for @a { if / (...) / { $/[0].Str.say; s/{ $/[0].Str }/ZzZ/ }; }; @a.say
camelia aaa
Use of Nil in string context
bbb
ccc
[ZzZaaa ZzZbbb ZzZccc]
in block at <tmp> line 1
Use of Nil in string context
in block at <tmp> line 1
Use of Nil in string context
in block at <tmp> line 1
Xliff m: my @a = <aaa bbb ccc>; for @a { if / (...) / { s/{ $/[0].Str }/ZzZ/ }; }; @a.say 15:38
camelia Use of Nil in string context
[ZzZaaa ZzZbbb ZzZccc]
in block at <tmp> line 1
Use of Nil in string context
in block at <tmp> line 1
Use of Nil in string context
in block at <tmp> line 1
15:38 MasterDuke joined, p6bannerbot sets mode: +v MasterDuke
Xliff m: my @a = <aaa bbb ccc>; for @a { if / (...) / { s/{ $/.Str }/ZzZ/ }; }; @a.say 15:38
camelia [ZzZaaa ZzZbbb ZzZccc]
Xliff m: my @a = <aaa bbb ccc>; for @a { / (...) /; s/{ $/.Str }/ZzZ/; }; @a.say 15:39
camelia [ZzZaaa ZzZbbb ZzZccc]
15:45 jme` left 16:04 haha joined, p6bannerbot sets mode: +v haha
haha JOIN 16:04
p6: say 3; 16:05
camelia 3
16:06 haha left 16:12 pmurias left 16:16 jmerelo joined 16:17 p6bannerbot sets mode: +v jmerelo 16:28 domidumont left 16:50 sjoshi joined, p6bannerbot sets mode: +v sjoshi 16:51 RavBell left 16:58 sjoshi left 17:06 zakharyas left
Xliff m: my $a = { :check, 'do' => -> { 1 } }; $a.gist.say 17:09
camelia {check => True, do => -> { #`(Block|81896440) ... }}
tobs :/ 17:11
oh, I misread that. I thought it created a Block, but it did create a hash 17:13
s:/:):
17:20 domidumont joined 17:21 p6bannerbot sets mode: +v domidumont
Geth doc: 98301ace31 | (Elizabeth Mattijsen)++ | doc/Type/Signature.pod6
Add documentation for Signature.new
17:28
synopsebot Link: doc.perl6.org/type/Signature
17:36 sjoshi joined, p6bannerbot sets mode: +v sjoshi 17:41 cfa joined, p6bannerbot sets mode: +v cfa 17:43 reportable6 left, shareable6 left, squashable6 left, committable6 left 17:44 releasable6 left, bisectable6 left, squashable6 joined 17:45 reportable6 joined, p6bannerbot sets mode: +v squashable6 17:46 p6bannerbot sets mode: +v reportable6, shareable6 joined, ChanServ sets mode: +v shareable6 17:47 p6bannerbot sets mode: +v shareable6, releasable6 joined, ChanServ sets mode: +v releasable6, bisectable6 joined, ufobat joined 17:48 p6bannerbot sets mode: +v releasable6, p6bannerbot sets mode: +v bisectable6, p6bannerbot sets mode: +v ufobat 17:49 committable6 joined, i1nfusion joined, p6bannerbot sets mode: +v committable6 17:50 p6bannerbot sets mode: +v i1nfusion
cfa 👋🏽 17:50
jmerelo cfa: hi!
cfa hey hey 17:51
18:10 guifa joined, p6bannerbot sets mode: +v guifa 18:11 xi- left 18:15 xi- joined, p6bannerbot sets mode: +v xi-
guifa Is there a way to get the invocant/self as rw without needing to tack on a parameter? Only way I could figure out was to say method ($invocant is rw: $dummy?) { ... } 18:16
yoleaux 10 Jan 2019 12:35Z <SmokeMachine> guifa: thanks!
10 Jan 2019 12:52Z <AlexDaniel> guifa: “There were two that are Inline::Perl5 for instance” – it's the same module
18:17 robertle_ left 18:18 leont joined 18:19 p6bannerbot sets mode: +v leont
guifa (I'm trying to do a "freeze" method for Regex that locks in place variables' values. Regex doesn't like self = rx/blah/, but it sure doesn't mind $invocant = rx/blah/ with the given method signature, but the parameter is superfluous but I couldn't get the invocant any other way other than self which keeps it not rw) 18:19
18:25 sauvin left
lizmat guifa: "self" is *always* the decontainerized object 18:27
18:27 remi_ness joined
lizmat what you did with $invocant is rw: 18:27
is indeed the way to do it 18:28
guifa I guess I just don't like the :$dummy? bit in the signature, that's all :-)
18:28 p6bannerbot sets mode: +v remi_ness
tobs m: class A { method freeze ($invocant is rw:) { $invocant = 42 } }; A.new.freeze.say 18:30
camelia Parameter '$invocant' expected a writable container, but got A value
in method freeze at <tmp> line 1
in block <unit> at <tmp> line 1
tobs m: class A { method freeze ($invocant is rw:) { $invocant = 42 } }; ($ = A.new).freeze.say 18:31
camelia 42
tobs guifa: you can stop with the signature after the colon
guifa tobs: ah perfect! 18:32
18:36 sjoshi left
jmerelo lizmat: will your Signature.new provide an answer to this? stackoverflow.com/questions/415313...-in-perl-6 18:37
lizmat if you're willing to also programatically create the MAIN sub, it might 18:39
but generally, I think moritz' answer still applies
18:41 xinming_ is now known as xinimng 18:51 w17t joined, p6bannerbot sets mode: +v w17t 18:52 w17t left
jmerelo lizmat++ 18:53
guifa Hrm, everything almost works. It seems the Attribute.new() doesn't automagically create the get_value and set_value. Probably going to be easiest to write a lightweight custom class 18:58
b2gills .tell RavBell You weren't dealing with a trailing space. I left some comments at gist.github.com/ravbell/d94b37f1a3...7d9eaf7c92 18:59
yoleaux b2gills: I'll pass your message to RavBell.
guifa Actually, no wait. Something else is going weird 19:06
19:18 dct left 19:19 dct joined, p6bannerbot sets mode: +v dct 19:25 guifa left 19:29 leont left
Geth doc: 764b1c2ee8 | (JJ Merelo)++ | doc/Language/glossary.pod6
Adds link and minor fixes
19:31
doc: 18b3e102d2 | (JJ Merelo)++ | 2 files
Minor reflow and rewriting
synopsebot Link: doc.perl6.org/language/glossary
19:33 i1nfusion left 19:35 i1nfusion joined, p6bannerbot sets mode: +v i1nfusion
Xliff m: %a = ( toggled => -> { 1 } ); %a.gist.say 19:39
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '%a' is not declared
at <tmp>:1
------> 3<BOL>7⏏5%a = ( toggled => -> { 1 } ); %a.gist.sa
Xliff m: my %a = ( toggled => -> { 1 } ); %a.gist.say
camelia {toggled => -> { #`(Block|85021944) ... }}
Xliff m: my $a = { toggled => -> { 1 } }; $a.gist.say 19:40
camelia {toggled => -> { #`(Block|83038656) ... }}
19:54 w17t joined, p6bannerbot sets mode: +v w17t 20:05 lizmat left 20:08 koto joined 20:09 p6bannerbot sets mode: +v koto 20:10 sena_kun left 20:12 jmerelo left 20:16 koto is now known as sena_kun 20:18 lizmat joined, p6bannerbot sets mode: +v lizmat 20:24 dct left 20:25 ufobat left, ufobat joined 20:26 p6bannerbot sets mode: +v ufobat 20:28 i1nfusion left 20:30 i1nfusion joined 20:31 p6bannerbot sets mode: +v i1nfusion 20:36 domidumont left 20:38 lucasb left 20:43 remi_ness left
Xliff What's the best way to eliminate the first frame when using Backtrace.new? 20:53
m: sub c { Backtrace.new[1..*].Str.say }; sub b { c(); } sub a { b() }]; a() 20:55
camelia 5===SORRY!5=== Error while compiling <tmp>
Strange text after block (missing semicolon or comma?)
at <tmp>:1
------> 3race.new[1..*].Str.say }; sub b { c(); }7⏏5 sub a { b() }]; a()
expecting any of:
infix
inf…
Xliff m: sub c { Backtrace.new[1..*].Str.say }; sub b { c() }; sub a { b() }; a()
camelia
pony m: say 001 => 1
camelia Potential difficulties:
Leading 0 has no meaning. If you meant to create an octal number, use '0o' prefix; like, '0o01'. If you meant to create a string, please add quotation marks.
at <tmp>:1
------> 3say 0017⏏5 => 1
1 => 1
Xliff m: sub c { Backtrace.new.Str.say }; sub b { c() }; sub a { b() }; a() 20:56
camelia in sub c at <tmp> line 1
in sub b at <tmp> line 1
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1
Xliff m: sub c { Backtrace.new.[1..*].Str.say }; sub b { c() }; sub a { b() }; a()
camelia
Xliff m: sub c { Backtrace.new[1..*].Str.say }; sub b { c() }; sub a { b() }; a()
camelia
Xliff m: sub c { Backtrace.new.list[1..*].Str.say }; sub b { c() }; sub a { b() }; a()
camelia in method new at SETTING::src/core/Backtrace.pm6 line 85
in sub c at <tmp> line 1
in sub b at <tmp> line 1
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1
Xliff m: sub c { Backtrace.new.list[2..*].Str.say }; sub b { c() }; sub a { b() }; a() 20:57
camelia in sub c at <tmp> line 1
in sub b at <tmp> line 1
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1
Xliff m: sub c { Backtrace.new.list[3..*].Str.say }; sub b { c() }; sub a { b() }; a()
camelia in sub b at <tmp> line 1
in sub a at <tmp> line 1
in block <unit> at <tmp> line 1
21:23 jme` joined 21:24 p6bannerbot sets mode: +v jme`, celeritas joined 21:25 p6bannerbot sets mode: +v celeritas 21:27 celeritas left 21:28 robertle left 21:39 Sgeo__ joined 21:40 zachk joined, p6bannerbot sets mode: +v Sgeo__ 21:41 p6bannerbot sets mode: +v zachk 21:42 Sgeo_ left
Xliff m: Array.^can('keys').say 21:44
camelia (Method+{is-nodal}.new Method+{is-nodal}.new)
21:45 zachk left, zachk joined, asimov.freenode.net sets mode: +v zachk
ufobat what is the difference between a X::NYI.new.throw vs ... in method? i know it is something else, but semantically 21:45
21:45 p6bannerbot sets mode: +v zachk
ufobat isnt ... ment to be implement but it is not yet there? 21:45
timotimo "stub code executed", yeah
is that actually the NYI ex type?
m: sub stubbed { ... }; try stubbed; say $!.perl
camelia X::StubCode.new(message => "Stub code executed")
timotimo ah, it's not
i don't think there'd be a difference between ...-ing and doing the .throw, except there'd be the extra stack frame from the ... sub 21:46
ufobat okay :)
Xliff m: my regex ab { <a> \v* }; my token b { 'b'+ }; my token a { 'a'+<b>* }; my $a = 'aaaabbaba'; my $m = $a ~~ /<ab>/; $m.gist.say 21:47
camelia No such method 'a' for invocant of type 'Match'. Did you mean 'at'?
in regex ab at <tmp> line 1
in block <unit> at <tmp> line 1
Xliff m: my regex a { ... }; my regex ab { <a> \v* }; my token b { 'b'+ }; my token a { 'a'+<b>* }; my $a = 'aaaabbaba'; my $m = $a ~~ /<ab>/; $m.gist.say
camelia 5===SORRY!5=== Error while compiling <tmp>
Redeclaration of method 'a'
at <tmp>:1
------> 3oken b { 'b'+ }; my token a { 'a'+<b>* }7⏏5; my $a = 'aaaabbaba'; my $m = $a ~~ /<a
Xliff m: my token a { ... }; my regex ab { <a> \v* }; my token b { 'b'+ }; my token a { 'a'+<b>* }; my $a = 'aaaabbaba'; my $m = $a ~~ /<ab>/; $m.gist.say 21:48
camelia 5===SORRY!5=== Error while compiling <tmp>
Redeclaration of method 'a'
at <tmp>:1
------> 3oken b { 'b'+ }; my token a { 'a'+<b>* }7⏏5; my $a = 'aaaabbaba'; my $m = $a ~~ /<a
timotimo you can't stub a token like that because ... is already valid regex syntax :D
Xliff m: my token b { 'b'+ }; my token a { 'a'+<b>* }; my regex ab { <a> \v* }; my $a = 'aaaabbaba'; my $m = $a ~~ /<ab>/; $m.gist.say
camelia 「aaaabb」
ab => 「aaaabb」
a => 「aaaabb」
b => 「bb」
Xliff m: my token b { 'b'+ }; my token a { 'a'+<b>* }; my regex ab { <a> \v* }; my $a = 'aaaabbaba'; my $m = $a ~~ /<ab>+/; $m.gist.say 21:49
camelia 「aaaabbaba」
ab => 「aaaabb」
a => 「aaaabb」
b => 「bb」
ab => 「ab」
a => 「ab」
b => 「b」
ab => 「a」
a => 「a」
Xliff m: my token b { 'b'+ }; my token a { 'a'+<b>* }; my regex ab { <a> \v* }; my $a = 'aaaabbaba'; my $m = $a ~~ /<ab>+/; $m<ab>.^name.say
camelia Array
timotimo i mean sub lookup is already deferred so that you can have subs post-declared 21:50
Xliff m: my token b { 'b'+ }; my token a { 'a'+<b>* }; my regex ab { <a> \v* }; my $a = 'aaaabbaba'; my $m = $a ~~ /<ab>+/; $m<ab><A>.^name.say
camelia Failure
timotimo so you don't need to stub subs
Xliff m: my token b { 'b'+ }; my token a { 'a'+<b>* }; my regex ab { <a> \v* }; my $a = 'aaaabbaba'; my $m = $a ~~ /<ab>+/; $m<ab><a>.^name.say
camelia Failure
timotimo and "my regex" is sub-like enough
Xliff m: my token b { 'b'+ }; my token a { 'a'+<b>* }; my regex ab { <a> \v* }; my $a = 'aaaabbaba'; my $m = $a ~~ /<ab>+/; $m<ab>[0]<a>.^name.say
camelia Match
Xliff m: my token b { 'b'+ }; my token a { 'a'+<b>* }; my regex ab { <a> \v* }; my $a = 'aaaabbaba'; my $m = $a ~~ /<ab>+/; $m<ab>[0]<a>.keys.say 21:51
camelia (b)
Xliff m: my token b { 'b'+ }; my token a { 'a'+<b>* }; my regex ab { <a> \v* }; my $a = 'aaaabbaba'; my $m = $a ~~ /<ab>+/; .^name.say for $m<ab> 22:00
camelia Match
Match
Match
Xliff timotimo: :-O 22:02
D'oh!
22:14 abaiste left 22:16 abaiste joined, abaiste left 22:23 i1nfusion left 22:27 i1nfusion joined 22:28 p6bannerbot sets mode: +v i1nfusion
Kaiepi i asked a question on stackoverflow that requires in-depth knowledge on how modules are compiled stackoverflow.com/questions/541547...hotpatched 22:31
if anyone can help that'd be great
22:32 rindolf left, abaiste joined, abaiste left
Xliff Kaiepi: The only way I can think of is to create a closure that module runs in. If you need to hotpatch, you clear the closure and create a new one. 22:33
I can't quite give you examples on how that is done, but I am doing something similar with grammars where it wouldn't work unless I ran the grammar in its own scope and dropped it later, for reloading. 22:34
22:34 rindolf joined 22:35 p6bannerbot sets mode: +v rindolf
Kaiepi can you give an example of what you mean? 22:35
Xliff Unfortunately, not. 22:38
I can't think of how you'd make a reusable closure that you could run code in.
22:39 random_yanek left
Xliff m: my $a = { try require ::('Color') }; say ::('Color') 22:39
camelia No such symbol 'Color'
in block <unit> at <tmp> line 1
Xliff m: my $a = { try require ::('Color'); say ::('Color') }; 22:40
camelia ( no output )
Xliff m: my $a = -> { try require ::('Color'); say ::('Color') };
camelia ( no output )
Xliff m: my $a = -> { try require ::('Color'); say ::('Color') }; $a()
camelia No such symbol 'Color'
in block <unit> at <tmp> line 1
Xliff m: my $a = -> { try require ::('NativeCall'); say ::('NativeCall') }; $a()
camelia (NativeCall)
22:40 patrickb left 22:41 random_yanek joined, p6bannerbot sets mode: +v random_yanek
ufobat this means you need to encapsulate all the code that uses a module in a closure 22:42
Xliff m: my $b; my $a = -> { try require ::('NativeCall'); $b = -> { say ::('NativeCall'); }; }; $b()
camelia Cannot find method 'Any' on object of type List
in block <unit> at <tmp> line 1
Xliff m: my $b; my $a = -> { try require ::('NativeCall'); $b = -> { say ::('NativeCall'); }; }; $a(); $b() 22:43
camelia (NativeCall)
ufobat use ( and i thikn requires as well ) is lexically scoped, isnt it?
Xliff m: my $b; my $a = -> { try require ::('NativeCall'); $b = -> { say ::('NativeCall'); }; }; $a(); $b(); $a = ''; $b()
camelia (NativeCall)
(NativeCall)
Xliff m: my $b; my $a = -> { try require ::('NativeCall'); $b = -> { say ::('NativeCall'); }; }; $a(); $b(); $a = $b = 0; $b
camelia WARNINGS for <tmp>:
(NativeCall)
Useless use of $b in sink context (line 1)
Xliff So now that closure is dropped. 22:44
To reload, you'd have to recreate both $a and $a recreates $b.
Something like that.
22:46 i1nfusion left 22:47 i1nfusion joined
tobs "reusable closure that you could run code in" -- isn't that what a class is? 22:48
22:48 p6bannerbot sets mode: +v i1nfusion
tobs sounded smart there for a moment and is going to sleep now o/ 22:49
Xliff LOL 22:51
23:14 molaf joined 23:15 p6bannerbot sets mode: +v molaf 23:28 leont joined 23:29 p6bannerbot sets mode: +v leont 23:30 molaf left
timotimo benchable6: compare HEAD my Int @foo = 1..10000; for ^1000 { say @foo.join(",").chars } ||| my int @foo = 1..10000; for ^1000 { say @foo.join(",").chars } 23:35
benchable6 timotimo, starting to benchmark the 1 given commit
timotimo, gist.github.com/7792664d1b22d3589c...823c5655f7 23:36
timotimo ha, d'oh
benchable6: compare HEAD my Int @foo = 1..10000; my $result = 0; for ^200 { $result += @foo.join(",").chars }; say $result; ||| my int @foo = 1..10000; my $result = 0; for ^200 { $result += @foo.join(",").chars }; say $result 23:37
benchable6 timotimo, starting to benchmark the 1 given commit
timotimo, gist.github.com/f9950c6779b9aade87...66d0c4829b
timotimo benchable6: compare HEAD my Int @foo = 1..10000; for ^1000 { } ||| my int @foo = 1..10000; for ^1000 { } 23:38
benchable6 timotimo, starting to benchmark the 1 given commit
timotimo, gist.github.com/2a0c5aad699683454a...e9fa415725
Xliff timotimo: \o 23:46
Working on a Grammar inspector. :D
timotimo oh, sweet 23:47
Xliff github.com/Xliff/p6-VisualGrammar 23:49
It's still very rough around the edges.
Write the grammar in the top left window, the test to test against in the right pane, and then select Grammar -> Refresh from the menu 23:50
23:51 DarthGandalf left, jme` left 23:53 ufobat left
timotimo btw i recently had someone tell me about "smem" 23:54
which is able to tell you what processes are responsible for memory usage in swap
TreyHarris Under what conditions does .WHAT correctly ne .^name? 23:58
sorry, ne "({.^name})" I should have said 23:59