»ö« 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.
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}
vrurg Can't find how to create a link to another module in a pod... 04:00
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
RavBell Test message. Sending first time. 05:03
pony True 05:07
lookatme_q RavBell, True 05:21
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
RavBell Am I missing something in my understanding? 06:25
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
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
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?/
moritz .uni A͜͡ 08:05
moritz too old to remember bot usage
moritz m: say lc samemark ' ', 'A͜͡' 08:06
camelia ͜͡
moritz m: say lc samemark 'A͜͡', ' '
camelia a
moritz Kaiepi: ^^ like this?
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
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
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
masak pmurias: go on :) 09:01
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
gfldex lolibloggedalittle: gfldex.wordpress.com/2019/01/11/it...he-finish/ 09:55
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
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
pmurias masak: if we take it to a logical extreme would such a tranform make sense with actuall extending of the syntax? 10:31
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…
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
moritz RavBell: .parse expects to match the whole string 10:42
RavBell moritz: .subparse did not work either ... 10:43
timotimo could have to do with "token" and "rule" being "no backtracking"? 10:46
RavBell timotimo: Does not appear like that.
RavBell I ran the code using Grammer::Tracer. 10:47
It seems to go all the way doing the right thing, almost.
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
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
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] ( ͡)
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
pmurias lizmat: because FatRats can grow arbitrarily large 12:40
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
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
lizmat robertle_: that would imply a pragma, if you want lexical 13:41
which is problematic 13:42
Xliff Won't the IO::Handle version of spurt and slurp close automatically? 14:48
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
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.
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?
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
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]
haha JOIN 16:04
p6: say 3; 16:05
camelia 3
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:/:):
Geth doc: 98301ace31 | (Elizabeth Mattijsen)++ | doc/Type/Signature.pod6
Add documentation for Signature.new
17:28
synopsebot Link: doc.perl6.org/type/Signature
cfa 👋🏽 17:50
jmerelo cfa: hi!
cfa hey hey 17:51
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
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
lizmat guifa: "self" is *always* the decontainerized object 18:27
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 :-)
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
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
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
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
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) ... }}
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
Xliff m: Array.^can('keys').say 21:44
camelia (Method+{is-nodal}.new Method+{is-nodal}.new)
ufobat what is the difference between a X::NYI.new.throw vs ... in method? i know it is something else, but semantically 21:45
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!
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
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
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.
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)
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.
tobs "reusable closure that you could run code in" -- isn't that what a class is? 22:48
tobs sounded smart there for a moment and is going to sleep now o/ 22:49
Xliff LOL 22:51
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
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