»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
geekosaur suppose it doesn;t atter that much given we want a file on /dev/null anyway 00:00
also it just occurred to me this may not be very windows portable (although I'm not sure how much so ncurses itself is)
azawawi windows and ncurses... never heard of it 00:01
geekosaur there is definitely a port. I'm not sure how well (or even if) it handles newterm 00:03
azawawi PDCurses? 00:04
geekosaur on all versions of windows before the win10 'creators update', ansi escapes are not enough, you have to make device control calls
azawawi invisible-island.net/ncurses/ncurse...tvbuf_once # interesting 00:06
geekosaur the buffering issue here is the one with perl 6 filehandles, not C. unless moarvm (or libuv?) is failing to atexit() 00:07
however this specific issue is that, when the ncurses tests are run under prove, it outputs terminal control sequences that prove chokes on 00:08
and the buffering issue obscured that because they weren't being output 00:09
geekosaur except... it's C buffering, not perl's. so now I am confused. 00:09
azawawi im even more confused :) 00:10
AlexDaniel: just testing it again on a perl6 alpine docker and it is working on latest and 2017.07 00:11
s/testing/tested/
azawawi sleepy :)
AlexDaniel azawawi: it will work on all releases 00:12
it didn't work between 2017.08 and 2017.09 :)
*somewhere* between :) 00:13
azawawi :)
azawawi off to sleep :) 00:13
AlexDaniel well, between 4b02b8aad and 9073a4dc7 00:14
audiatorix Is there any way to see how many items are left in a Channel without dequeueing them? Is a Channel even the correct thing to be using (I want a thread-safe queue, and a channel is described as that) 00:17
AlexDaniel audiatorix: why do you want to know how many items are there? 00:18
audiatorix I am implementing a logging system, and I'd like to (but don't have to, if it's really too much trouble) report how many lines are left after reading some of it 00:20
AlexDaniel audiatorix: makes sense 00:34
audiatorix: maybe you can wrap a Channel into your own class, and use atomic ints to track the number of elements 00:35
uruwi hello 01:42
I need help – how do I create a regex dynamically? 01:43
skids From a string?
uruwi I want to divide a string into parts that are from a user-provided set of strings
skids Are the user strings rx or just patterns? 01:44
uruwi e. g. "si^ul" -> ["s", "i^u", "l"] given that the user specified that all three of those strings were in the alphabet
AlexDaniel what about / @alphabet / ?
skids It's just an array interpolation. 01:45
AlexDaniel yes, but why is that not enough?
uruwi Nope, that's not enough
p6: my @a = ["hi", "people"]; say /@a/
camelia /@a/
uruwi p6: my @a = ["hi", "people"]; say "hi" ~~ /@a/ 01:46
camelia 「hi」
uruwi oh wait
what
p6: sub f { my @a = ["hi", "people"]; return /@a/ }; "hi" ~~ f
camelia ( no output )
uruwi p6: sub f { my @a = ["hi", "people"]; return /@a/ }; say "hi" ~~ f
camelia 「hi」
uruwi p6: sub f { my @a = ["hi", "people"]; return /@a/ }; say "hipeoplehi".comb(f)
camelia (hi people hi)
uruwi p6: sub f { my @a = ["hi", "people"]; return /@a/ }; if True {say "hipeoplehi".comb(f) } 01:47
camelia (hi people hi)
uruwi p6: sub f { my @a = ["hi", "people"]; return /@a/ }; sub g { say "hipeoplehi".comb(f) }; g
camelia (hi people hi)
uruwi okay I think I fixed it 01:48
thanks anyway!
AlexDaniel :) 01:49
MasterDuke uruwi: if you need more complicated regex interpolation, you can use <{...code...}> and the result of running the code is interpolated into the regex 01:49
AlexDaniel MasterDuke: are you sure that it's the right description? 01:50
from that block right there you return a Str I think 01:51
and then the Str is EVALed
inside an anonymous regex
that's how I understand it… I may be wrong
so technically it's useless
because you probably return a Str with some arbitrary data which is then EVAL-ed 01:52
or am I wrong?
MasterDuke yeah, that's probably more correct, but the simple use case i think works like i said
AlexDaniel well… works except when it doesn't :) 01:53
MasterDuke m: say "a1b2c3" ~~ /a <{"hobo".chars - "hob".chars}> b/
camelia 「a1b」
AlexDaniel m: say "a1b2c3" ~~ /a <("hobo".chars - "hob".chars)> b/
camelia 5===SORRY!5===
Unrecognized regex metacharacter - (must be quoted to match literally)
at <tmp>:1
------> 3say "a1b2c3" ~~ /a <("hobo".chars7⏏5 - "hob".chars)> b/
Unable to parse regex; couldn't find final '/'
at <tmp>:1
------> 3sa…
AlexDaniel m: say "a1b2c3" ~~ /a $("hobo".chars - "hob".chars) b/ 01:54
camelia 「a1b」
AlexDaniel look! No EVAL and still works
skids There are some security restrictions on it, so you cannot run more closures or jump parsing. See S05-interpolation/regex-in-variable.t 01:55
uruwi is there a simple way to lexicographically compare two lists?
I could write it myself, but I don't want to write something complicated when there's a simpler way
AlexDaniel skids: I'm not saying that it's insecure, I'm saying that it simply doesn't work due to syntax errors in EVAL-ed code :) 01:56
uruwi: hmmm what about ~~ ? 01:57
m: say (‘foo’, ‘bar’) ~~ (‘foo’, ‘bar’)
camelia True
AlexDaniel m: say (‘foo’, ‘bar’) ~~ (‘foo’, ‘beer’)
camelia False
uruwi I mean less/equal/greater.
AlexDaniel m: say (‘foo’, ‘bar’) cmp (‘foo’, ‘bar’) # any ideas on what this does? 02:00
camelia Same
uruwi m: say (1, 2, 3) cmp (3, 2, 1) 02:01
camelia Less
uruwi oh thanks 02:02
AlexDaniel m: say (4, 3) cmp (3, 2, 1)
camelia More
uruwi I didn't know that cmp could be used on lists
AlexDaniel I still don't quite understand how it works 02:03
does it fall back to a.Stringy cmp b.Stringy ? 02:04
AlexDaniel uruwi: I don't think it does what you want 02:04
skids multi sub infix:<cmp>(@a, @b) { (@a Zcmp @b).first(&prefix:<?>) || @a <=> @b }
uruwi hmm 02:05
Aaronepower Is there an easy to test Hashs and have the difference printed out. 02:39
?*
By test I mean using the `Test` module. 02:40
ipatrol What is the name for the behavior where sub(object) automatically calls sub.object() ? 02:45
*object.sub()
sjn ipatrol: are you thinking about perl5's indirect object notation? 02:54
ipatrol no, I'm thinking about how split(pattern, str) calls str.split(pattern) 02:55
sjn oh, it's made into a method call? 02:57
ipatrol appears to be how it works 02:58
aaa123 Can anyone explain to me why this doesn't work with Bailador? gist.github.com/anonymous/73417fc1...4e8c64adeb 03:35
It used to work
MasterDuke aaa123: i don't know Bailador, so probably can't help, but it might be useful to run your script with --ll-exception (so the backtrace shows anything in rakudo's internals) 03:47
and also paste the output of perl6 --version 03:48
aaa123 MasterDuke: gist.github.com/anonymous/acb00941...34b9ad6467 03:51
MasterDuke hm, i don't know AUTOGEN, and i gotta get some sleep, but your perl6 is some random commit. using rakudobrew? maybe trying upgrading to 2017.09 (just released today) or 2017.08 03:59
MasterDuke sorry i couldn't be more help, you might have better luck earlier in the day tomorrow (a lot of people in the channel are in europe) 04:01
aaa123 tyvm 04:02
teatime oh nice, release day 04:58
AlexDaniel teatime: I didn't sleep yet, but mostly it was yesterday :) 05:04
AlexDaniel good ** everyone o/ 05:05
moritz \o * 05:10
u-ou- greet $_ for @channel; 05:11
aaa123 gist.github.com/anonymous/73417fc1...4e8c64adeb 05:28
Still having this problem
updated my perl6 too
gfldex jnthn++ # for having a plan to optimise all the things 08:19
piojo Is there a perl6 framework/plugin that's well-suited to provide a REST api but not web pages? 08:56
jnthn It's still a fairly young project, but cro.services/ was designed for building services primarily. 08:59
piojo I'm wondering whether perl6 would be a reasonable choice for a game server--single player, it'll mostly just track player data, but there will be some complex algorithms where using a nice programming language would be beneficial 09:00
jnthn Supports JSON message body parsing/serialization out of the box, tries to make it easy to give correct HTTP error codes, etc.
piojo jnthn: thanks, I'll have a look at cro
Zoffix weird. GitHub no longer highlights ```perl6 code blocks at all? github.com/perl6/roast/pull/324#is...-330181835 10:32
peteretep Hi 10:38
I have perl6.guru, perl6.guide, and perl6.io available to good homes
(for free, obv)
lizmat peteretep: argh, should have answered you sooner
:-)
peteretep lizmat: You still get first dibs on them, I'm sure :) 10:39
lizmat I'll take them
peteretep k. /me looks into how to do the transfer 10:39
peteretep I think you need to request from your existing host, and then I need to give you the codes 10:40
s/host/registrar/
lizmat well, I don't have a registrar for those domains, afaik 10:41
TLD's I meabn
*mean (sigh)
peteretep Who did you register dijkmat.nl with? 10:42
lizmat the only one possible: sidn.nl
peteretep ah
lizmat but they don't do .guru, .guide, .io afaik
peteretep If you create an account at Gandi.net, they can be transferred to you there
lizmat ok, Gandi I'm on
peteretep Highly recommend gandi.net
lizmat yeah, use that for almost all of our other domains 10:43
k, lemme look into that
am about to be less available in the coming hours because of $work, and then the P6W, so maybe tomorrow, ok?
peteretep for sure, no rush 10:46
Zoffix lulz... I made a haiku www.reddit.com/r/perl6/comments/70...t/dn5vzn2/ 10:53
Zoffix would be happier if knew why is everyone so obsessed with haikus 10:54
jeek Zoffix needs to chill. Haikus aren't worth the cycles. Go take a nice nap. 11:00
Zoffix :) 11:10
Zoffix reads haiku wikipedia 11:12
ends with 5 or 3 sylables. I don't get how that haiku bot got more than two sylables from "Perl 6" 11:13
piojo perl is a funny word 11:14
it sounds weird if you either try to stick it into one syllable, or if you try to split it into two
perlawhirl Zoffix: perl-6-smi-ley-face ? 11:32
Zoffix Ahhh 11:33
perlawhirl i'm guessing... i dunno how that bot counts syllables.
perlawhirl wonders if WordNet DB has a syllable count 11:34
Aaronepower When writing tests what is the best way for comparing hashs and printing what was different from the expected hash from the actual hash? 12:13
Zoffix is-deeply() will test it, but as for printing exactly what was different… I'm not aware if we have such a module yet 12:14
Aaronepower Zoffix: Thanks 12:25
Aaronepower Zoffix: I'm trying to make a function that prints the diff, but I'm getting a "Cannot convert string to number" error on the if statement. paste.rs/7qN 12:28
Zoffix Aaronepower: == and != are numeric operators. Did you mean eq to compare strings? 12:30
weabot or ~~ for some black magic to happen that'll probably give you the comparison you want 12:31
Zoffix It won't necessarily be the comparison you want. "foo" ~~ Str would give True, even though the values differ 12:33
Aaronepower Zoffix: Well why does `'10' == 5` not cause an error? I just want to compare the two variables if one is string and one is number it is just false. 12:34
Zoffix Aaronepower: because '10' gets converted to a number, but not all strings can be converted to numbers, hence the error you're getting
leont the == operator numifies 12:35
Zoffix Aaronepower: `eqv` op is a fair shot for what you want. Though even it won't compare everything (e.g. lazy lists cause it to throw0
Zoffix & 12:36
wictory[m] Is it possible to compile a perl6 program into a .moarvm to speed up start time? 13:25
Zoffix wictory[m]: not at the moment. Though modules are already pre-compiled, so just shove everything into a module 13:26
moritz wictory[m]: my last info on that was that you can only precompile modules
so if you change the main script to use TheModule; TheModule::run() or so, you nearly have the same benefits
jnthn And you can put a MAIN into a module and export it too 13:27
wictory[m] 👍 I will check it out, thanks! 13:28
timotimo input.fontbureau.com/info/ - this seems nice 13:48
Zoffix
.oO( surely misaligned lines being harder to read aren't a worthy tradeoff for spotting typos in repeated duplicate lines of data)
13:52
jast Input has proportional and monospace variants, so you can choose 14:01
timotimo Zoffix: don't really have an opinion on that suggestion 14:02
github.com/Bailador/Bailador/pull/264 - btw
Aaronepower What is the difference between these two? paste.rs/LKb 14:04
Zoffix Yeah, I saw it has monospace, but the example about spotting typos is so ridiculously convoluted 14:06
perlpilot Aaronepower: the expected thingy looks like a Hash, the got thing looks like a List to me. 14:08
Zoffix Aaronepower: looks like one is an object hash and the other is a scalarized list of pairs
m: my %h := :{ :amount(71.0328), :items("grated parmesan"), :unit("ml") }; dd %h 14:09
camelia :{:amount(71.0328), :items("grated parmesan"), :unit("ml")}
Zoffix m: my %h := :{ :amount(71.0328), :items("grated parmesan"), :unit("ml") }; dd $(%h.List)
camelia $(:items("grated parmesan"), :amount(71.0328), :unit("ml"))
Zoffix yup
Aaronepower Zoffix: How do I make the second a Hash? `.Hash` doesn't seem to work.
perlpilot m: dd $(:items("grated parmesan"), :amount(71.0328), :unit("ml")).hash 14:10
camelia Hash % = {:amount(71.0328), :items("grated parmesan"), :unit("ml")}
Zoffix m: my %h := :{ :amount(71.0328), :items("grated parmesan"), :unit("ml") }; dd Hash[Mu,Any].new: |$(%h.List) 14:11
camelia :{:amount(71.0328), :items("grated parmesan"), :unit("ml")}
Zoffix m: my %h := :{ :amount(71.0328), :items("grated parmesan"), :unit("ml") }; dd Hash[Mu,Any].new: $(%h.List)<> 14:12
camelia :{:amount(71.0328), :items("grated parmesan"), :unit("ml")}
Zoffix (first version slips it in, the second one just deconts) 14:13
Aaronepower m: :{ hello => 'world' } 14:14
camelia ( no output )
Aaronepower m: my $m = :{ hello => 'world' }; $m
camelia WARNINGS for <tmp>:
Useless use of $m in sink context (line 1)
Aaronepower m: my $m = :{ hello => 'world' }; $m.say; 14:15
camelia {hello => world}
Aaronepower Zoffix: What is the difference between `${}` and `:{}`? 14:16
Zoffix Aaronepower: ${} where?
:{} is an object Hash, ${} is a regular one in scalar container 14:17
Aaronepower Zoffix: paste.rs/SVu 14:17
Zoffix Aaronepower: yeah, what I said above
Aaronepower Zoffix: I don't understand the difference, and how do I convert? 14:18
Zoffix hm, looks like object hashes don't show their containerization
m: my %h := :{:42a}; my $h = %h; dd %h; dd $h 14:19
camelia :{:a(42)}
Hash[Mu,Any] $h = :{:a(42)}
Zoffix m: my %h := :{:42a}; my $h = %h; dd %h.perl; dd $h.perl
camelia ":\{:a(42)}"
":\{:a(42)}"
Zoffix m: my %h := Hash[Int,Str].new: "a" => 42; my $h = %h; dd %h.perl; dd $h.perl
camelia "(my Int \%\{Str} = :a(42))"
"(my Int \%\{Str} = :a(42))"
Zoffix Aaronepower: normal Hashes have Str as keys and Mu as values. You can change those defaults and use an "object hash". So, for example, you could have Mu as keys and only Ints as values 14:20
Aaronepower Zoffix: Everything I'm using is a normal hash. I never intentionally tried to make it something else. 14:21
Zoffix Aaronepower: and hashes are Iterable, if you write `for %some-hash { .say }` it'll iterate over its pairs, but if you shove it into a scalar container, it'll be thought of as a single item and `for $some-hash { .say }` in that case will iterate over just the hash itself
Aaronepower: well, above you're writing :{ } which creates an object hash. Did you mean to use { }? 14:22
Aaronepower Zoffix: Apparently. Thanks! 14:24
robertle is there a way to use one regex in another? I want something like my $expr1 = /'ofen'|'rohr'/; $input ~~ /$expr1 | $expr2 / , basically the ability to reuse configurable sub-expressing in my matchers. note that the sub-expression has "|" in it, I can of course reuse literal matches easily... 14:51
timotimo robertle: you may want to try protoregexes? 14:52
jnthn Easiest way from where you are now: /<$expr1> | <$expr2>/
jnthn But if you regex expr1 { ofen|rohr }; ... /<&expr1> | <&expr2>/ it'll perform better 14:53
robertle eh, that is quite cool! thanks! 14:55
need to understand what < and > really do in a regex though, apparently my view was a bit simplisitc...
skids They pop you into the "extensible regex" syntax. 14:56
So... they do lots of things. 14:57
jnthn You can tell what by the char immediately after the < though :) 14:58
robertle hmm, that seems to work with scalar variables as in m/<$test>/, but not if it's e.g. a hash lookup m/$test{$key}/, gives Unable to parse expression in metachar:sym<assert>; couldn't find final '>' 15:06
robertle which isn't really a problem for me, i's probably clearer to put these into well-names variables anyway, but it feels a bit odd 15:07
jnthn You'd have to write it as <{ $test{$key} }> for that to work out 15:08
robertle right! 15:10
Aaronepower In grammar's, is there any way to say that every proto token has to be whole word? 15:11
perlpilot Aaronepower: what do you mean by "whole word"? 15:12
Aaronepower: I suppose you could make your proto match « {*} » if that's what you want. 15:13
Aaronepower perlpilot: As if I have a token that matches 'g' it can't match against 'good'.
As in if*
perlpilot: What does that do? 15:14
Zoffix perlpilot: I don't think regexes in protos are implemented yet 15:16
perlpilot oh, could be.
Zoffix m: say grammar { token TOP { .+? <foo> .+ }; proto token foo { «{*}» }; token foo:sym<meow> { \d+ } }.parse: "a123bc|456|abc"} 15:17
camelia 5===SORRY!5=== Error while compiling <tmp>
Proto regex body must be {*} (or <*> or <...>, which are deprecated)
at <tmp>:1
------> 3token TOP { .+? <foo> .+ }; proto token 7⏏5foo { «{*}» }; token foo:sym<meow> { \d+
skids Aaronepower: g<|w> maybe? Depending on your definition of a "word" 15:18
Aaronepower My solution was to just have group where there has to be whitespace after the proto token. `<foo> [<bar> <.ws>]? <baz>` 15:19
Zoffix nadim: FWIW DDT was failing install earlier today; something about a missing dep Terminal::Print or something 15:20
perlpilot Aaronepower: If you didn't want to consume the whitespace, you could match a word boundary instead. I dunno if that's important to you or not. 15:21
perlpilot oh, skids already said that ... I need to stop going back and forth between windows. 15:23
cschwenz In gist.github.com/cschwenz/6edf195c0...5527e6e7d9 , why do the first and third regex work but the second and fourth regex fail to match? The only difference between the first and second regex is the inclusion of capturing parens (and likewise for the third and fourth regex). 15:45
Zoffix cschwenz: weird :/ 15:56
cschwenz yeah! :-(
cschwenz i am at a complete loss as to why i'm getting the results i am. 15:56
Zoffix Perhaps a bug that has to do with accessing a capture from whithin a capture. If I change [ $1 ] to [ '1234567' ] both regexes match 15:57
Zoffix Yup 15:58
m: say "11" ~~ /(\d)[$0]/
camelia 「11」
0 => 「1」
Zoffix m: say "11" ~~ /(\d)([$0])/
camelia Nil
Zoffix bisect: say "11" ~~ /(\d)([$0])/
bisectable6 Zoffix, On both starting points (old=2015.12 new=48a84d6) the exit code is 0 and the output is identical as well
Zoffix, Output on both points: «Nil»
Zoffix files it
cschwenz Zoffix++ :-)
Zoffix m: say "11" ~~ /(\d) {} :my $o = $0; ([$o])/ 15:59
camelia 「11」
0 => 「1」
1 => 「1」
Zoffix ^ potential workaround
lizmat vienna.pm.org/perl_6_jonathan_grant.html # whee!
cschwenz are you okay with me checking that gist test in to the rakudo repo?
Zoffix cschwenz: perhaps roast is a better location? 16:01
github.com/perl6/roast
cschwenz ah, that would be better
Zoffix Filed the ticket: rt.perl.org/Ticket/Display.html?id=132120 16:02
Vienna.pm++
cschwenz will put that test into roast after i get home.
Zoffix Thanks
cschwenz Vienna.pm++ :-D
virtualsue :-) 16:07
El_Che yeah vienna 16:08
perlpilot cschwenz: I changed the third grouping in your second if statement to be ( :my $x = $1; [ $x ]**2..* ) and the match succeeds, but the values are off. Feels like $0 and friends aren't always getting reset properly in the presence of backtracking. 16:30
jnthn Each (...) is a new Match object, and backreferences are talking about that 16:32
So in /(\d)([$0])/ that $0 would be talking about a $0 inside of the current (...), not a level up 16:33
Zoffix Oh wow.
perlpilot er ...
perlpilot I guess that's an implication, I never ran across. 16:34
jnthn m: say 'abc' ~~ /(.(.(.)))/
camelia 「abc」
0 => 「abc」
0 => 「bc」
0 => 「c」
jnthn m: say 'abc' ~~ /(.(.(.)))/.perl
camelia False
jnthn d'oh :)
jnthn well, I guess it's sorta clear from the gist 16:34
Zoffix Yeah 16:35
jnthn Just less so when it's not spread over multiple lines to see the indentation.
And yeah, this is one of the places "nested matches form a tree" pops up a bit surprisingly
moritz btw if you have more than one group, it might be time to use named captures
Zoffix .tell cschwenz I was wrong, it's not a bug: irclog.perlgeek.de/perl6/2017-09-18#i_15181692 16:36
yoleaux Zoffix: I'll pass your message to cschwenz.
Zoffix Is there a way to refer to outer match? 16:38
timotimo if there were more compact syntax for the "outer match object", that'd be nice 16:39
since you also can't work around it with named captures either
Zoffix timotimo: what's the less compact way?
jnthn Zoffix: Not that I know of, though you could assign it into a variable
timotimo the one already seen
Zoffix jnthn: thanks 16:40
lizmat m: $/ = 42; { dd OUTER::<$/> } # less compact way would be OUTER::<$/>[0] 16:40
camelia Int $/ = 42
timotimo i don't think you can refer to OUTER from within a regex
lizmat why not? It's all code, isn't it? or is there more than one level ? 16:41
moritz I've tried CALLER and CALLERS in regexes, they work there 16:42
lizmat ah, you're saying that a grouping is *not* a new frame ?
jnthn I think OUTER would work but you'd have to force the updating of $/ first, iirc
lizmat dinner& 16:43
timotimo m: say "hi hi" ~~ / (\w+) \s ( $OUTER::0 ) /
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$OUTER' is not declared
at <tmp>:1
------> 3say "hi hi" ~~ / (\w+) \s ( 7⏏5$OUTER::0 ) /
timotimo but how ... 16:44
jnthn m: say "hi hi" ~~ / (\w+) \s ( "$OUTER::<$/>[0]" ) / 16:46
camelia 5===SORRY!5=== Error while compiling <tmp>
Variable '$OUTER' is not declared
at <tmp>:1
------> 3say "hi hi" ~~ / (\w+) \s ( "7⏏5$OUTER::<$/>[0]" ) /
jnthn m: say "hi hi" ~~ / (\w+) \s ( $(OUTER::<$/>[0]) ) / 16:47
camelia Nil
jnthn m: say "hi hi" ~~ / (\w+) \s {} ( $(OUTER::<$/>[0]) ) /
camelia Nil
jnthn m: say "hi hi" ~~ / (\w+) \s {} ( $(CALLER::<$/>[0]) ) /
camelia Nil
jnthn Apparently not like this... 16:48
Zoffix Wouldn't that stuff reference all the things from where the regex is compiled rather than a nested thing/
jnthn ah, maybe 16:49
In that it's a thunk
Rather than a block
timotimo and i even forgot to put the {} in there even though you specifically pointed it out 16:50
jnthn away for a bit 16:54
Geth doc: 647b342e4f | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/regexes.pod6
Show a way to reference a capture from within a capture
16:55
timotimo Zoffix: is it supposed to end in "using var"? 16:57
Geth doc: f1a329c16a | lefth++ (committed by Zoffix Znet) | doc/Language/regexes.pod6
Make the "Regexes" page also searchable as "Regular Expressions". (#1563)
16:58
Zoffix Oh, whoops. That part wasn't supposed to get in at all, but I guess GitHub still keeps your changes after you refresh the page :/ 16:59
Zoffix deletes
timotimo ah 16:59
Geth doc: 755967d6cf | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Language/regexes.pod6
Delete accidentally committed text

This content was moved into a more appropriate section in github.com/perl6/doc/commit/647b342e4f and wasn't supposed to be committed
17:00
[Coke] aaand, I just used $this ~ "that" in a p5 module at work today. blah. 17:15
travis-ci Doc build passed. lefth 'Make the "Regexes" page also searchable as "Regular Expressions". (#1563)' 17:23
travis-ci.org/perl6/doc/builds/276942978 github.com/perl6/doc/compare/647b3...a329c16a90
sjn wow, cool that vienna.pm++ is sponsoring jnthn :D 17:24
travis-ci Doc build passed. Zoffix Znet 'Show a way to reference a capture from within a capture' 17:24
travis-ci.org/perl6/doc/builds/276941990 github.com/perl6/doc/compare/7f12d...7b342e4fe8
Xliff Yikes! I can understand the reasoning behind "say "11" ~~ /(\d) {} :my $c = $0; ($c)/;", but that syntax is horrendous. 17:27
It's nice to know how to do that, however.
Zoffy++
m: say "11" ~~ /(\d) {} :my $c = $0; ($c)/; 17:28
camelia 「11」
0 => 「1」
1 => 「1」
Zoffix Syntax? It's just a variable assignment :\
Xliff Yeah, but for some reason my mind wants to put the code inside the brackets. 17:29
And the :my is throwing me off.
Xliff I guess my brain just wants the code to be set off somehow from the rest of the regex. 17:29
Zoffix Code is part of regex :) 17:30
Xliff say "11" ~~ /(\d) <<my $c = $0;>> ($c)/; # Where << and >> can be anything. Helps me distinguish between code and regex. 17:31
Zoffix m: my $*c; say "11" ~~ /(\d) { $*c = $0 } ($*c)/;
camelia 「11」
0 => 「1」
1 => 「1」
Zoffix :)
Xliff Zoffix: BETTER! ;)
Thanks. 17:32
Xliff So that has to be a $* var, though? # $* == dynamic 17:32
Zoffix m: my $c; say "11" ~~ /(\d) { $c = $0 } ($c)/; 17:33
camelia 「11」
0 => 「1」
1 => 「1」
Zoffix Yeah, I guess it don't have to be dynamic :)
Xliff lol
Thanks.
Zoffix m: say "11" ~~ /(\d) { PROCESS::<$c> = $0 } ($*c)/; 17:34
camelia 「11」
0 => 「1」
1 => 「1」
timotimo m: say "hi hi" ~~ /(\w+) $1=[$0]/ 17:36
camelia Nil
timotimo m: say "hi hi" ~~ /(\w+) \s+ $1=[$0]/
camelia 「hi hi」
0 => 「hi」
1 => 「hi」
timotimo hey look
timotimo you can get around needing ( ) with this neat trick 17:36
Zoffix hah
timotimo Zoffix: wanna include that in the docs, too?
Zoffix Is it actually a supported and tested method? 17:37
timotimo hm, i can imagine problems with more ( ) after that 17:37
Zoffix I mean, being able to write to $\d variables
timotimo m: say "hi hi ho" ~~ /(\w+) \s+ $1=[$0] \s+ (\w+)/
camelia 「hi hi ho」
0 => 「hi」
1 => 「hi」
2 => 「ho」
timotimo whoa, it totally works, wtf this is awesome
Zoffix m: say "hi hi ho" ~~ /(\w+) \s+ $10=[$0] \s+ (\w+)/
camelia 「hi hi ho」
0 => 「hi」
10 => 「hi」
11 => 「ho」
Xliff Oooh!
timotimo++
Zoffix m: say "hi hi ho" ~~ /(\w+) \s+ $10=[$0] \s+ (\w+)/; dd $/.list 17:38
camelia 「hi hi ho」
0 => 「hi」
10 => 「hi」
11 => 「ho」
(Match.new(list => (), made => Any, pos => 2, hash => Map.new(()), orig => "hi hi ho", from => 0), Mu, Mu, Mu, Mu, Mu, Mu, Mu, Mu, Mu, Match.new(list => (), made => Any, pos => 5, hash…
Zoffix scary
grondilu Hello, if I define &infix:<cmp> for a class, can I rely on &infix:[<=] and cie to use it?
timotimo m: say "hi" ~~ / $100000000=(\w+) /
camelia (timeout) 17:39
Xliff timotimo: Now that... I dunno
Zoffix grondilu: no, it won't even be in the scope
Zoffix m: say "hi" ~~ / $10000000000000000000000000000000000000000000000000000000000000=(\w+) / 17:40
camelia 「hi」
-6917529027641081856 => 「hi」
Zoffix m: say "hi" ~~ / $10000000000000000000000000000000000000000000000000000000000000=(\w) (.)/
camelia 「hi」
-6917529027641081856 => 「h」
0 => 「i」
grondilu &infix:[<=>] then?
timotimo aaahahahaha
Xliff OK. That's buggered 17:40
Zoffix grondilu: none of them. Your custom operator will be available only in the lexical scope
timotimo might be something in output only, not in the data structuer itself?
grondilu Zoffix: I don't mind staying in the lexical scope 17:41
Zoffix grondilu: that's one of the problems with your idea, I mean. But I don't think there's any guarantees that core ops will definitelly use other core ops
grondilu: but it won't be in the lexical scope of the &infix:[<=] and the rest
grondilu m: class A {}; multi infix:[<=>](A, A) { Same }; say A.new <= A.new 17:42
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot override infix operator '=', as it is a special form handled directly by the compiler
at <tmp>:1
------> 3class A {}; multi infix:[<=>]7⏏5(A, A) { Same }; say A.new <= A.new
grondilu ??
m: class A {}; multi infix:<<<=>>>(A, A) { Same }; say A.new <= A.new
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3class A {}; multi infix:<<<=>>7⏏5>(A, A) { Same }; say A.new <= A.new
expecting any of:
new name to be defined
grondilu m: class A {}; multi infix:«<=>»(A, A) { Same }; say A.new <= A.new 17:43
camelia Cannot resolve caller Real(A: ); none of these signatures match:
(Mu:U \v: *%_)
in block <unit> at <tmp> line 1
timotimo grondilu: the problem is that operators declared in the setting will only look at their own lexical scope, which is the outer scope to your program
at some point we want to have core things to look at the caller's scope to find custom implementations
grondilu :/ 17:44
why isn't &[<=] just defined as $^a <=> $^b ~~ Less ?
timotimo i'd imagine performance issues 17:45
grondilu or rather { $^a <=> $^b ~~ Less|Same } or something like that
o_O
Zoffix Filed the regex capture thing as rt.perl.org/Ticket/Display.html?id=132121
grondilu: also, there's no current way to define it like that 17:46
Zoffix It needs special compiler parsing to support chaining 17:46
moritz because wa want rakudo to run, not crawl :-)
grondilu oh there is that indeed
Zoffix :)
moritz s/wa/we/
timotimo wait, what's the problem with chaining with that implementation? 17:47
grondilu that makes creating Numeric types a pain, though.
Zoffix timotimo: you can chain only one op, so you can't define a userland op that works with, say, 42 <= 5 == 7 >= 6
You can only chain as 42 <= 5 <= 7 <= 6 17:48
timotimo oh, really?
Zoffix Yeah
timotimo m: say 1 <= 5 > 3
camelia True
timotimo m: say 1 <= 5 > 10
camelia False
timotimo looks like it totally works
AlexDaniel timotimo: now create a userland op that does the same
Zoffix ^ that works because it has special compiler stuff
timotimo m: say 1 <= 5 == 5 > 3 < 99
camelia True
timotimo oh, is that the problem, okay
Zoffix You can't make your own ops that work that way by just defining subs
Yet 17:49
timotimo but the core could still implement these subs to go off of cmp - not that it helps you tremendously
AlexDaniel timotimo: it's also one of the reasons we finally got ≤ ≥ ≠
Zoffix I know TimToady++ was mentining we want to make it possible to do in userland
*mentioning
timotimo: ah yeah, I guess it could :)
But still, there's a performance issue :)
timotimo and it'll still not get cmp from your programs scope 17:50
grondilu ideally shouldn't the core be indistiguishable from userland?
Zoffix s: &infix:«<=», \(1, 2)
SourceBaby Zoffix, Sauce is at github.com/rakudo/rakudo/blob/4767...nt.pm#L358
El_Che timotimo: wouldn't it need to remove nqp for that?
timotimo El_Che: how do you mean?
Zoffix grondilu: ideally yes, but performance is our current biggest enemy. It's hard to argue for support of nicer custom user-land numerics in exchange for everything that's currently slow to be massively slower 17:51
timotimo imagines a register-comparison-op ... 17:51
El_Che I mean that a lot of stuff is done in nqp for performance, while the user-land (as in ops created by the user) normally won't use that 17:52
Zoffix grondilu: I know someone in the past mentioned the golden goal is for rakudo to be just written in pure Rakudo, with all the optimizers doing the legwork to make it fast. Dunno if that was just a dream or is actually achievable :)
grondilu well, I disagree but I concede I'm biased since I'm working on custom numeric types
El_Che (maybe I am missing the point, haven't read the backlog)
timotimo El_Che: well, the core would implement <= as a call to cmp and checking the return values of that 17:52
El_Che timotimo: ah, I see 17:52
timotimo there's the possibility for moarvm to be much smarter after inlining things 17:53
El_Che timotimo: would that mean an extra layer of indirection with speed consequences?
timotimo so that the code of <= could be effectively the same as the more optimized version
Zoffix What would a call to cmp be implemented as? :)
timotimo however we implement cmp right now 17:54
or do we implement cmp as using the other ops?
grondilu yeah, cmp could be the base other operators use
Zoffix cmp is for strings though, innit?
So why is <= using it?
timotimo isn't cmp the one about before and after?
strings is leg 17:55
grondilu yeah I meant <=>
Zoffix Ah, right. OK
s: &infix:<cmp>, \(1, 2)
SourceBaby Zoffix, Sauce is at github.com/rakudo/rakudo/blob/4767...der.pm#L46
grondilu basically the ones that return an Order should be used to define the ones that return a Bool
timotimo aye
once moar's spesh gets clever enough in some of the ops it could figure out how these comparisons against the Order enums work 17:56
i'd imagine spesh would want to be able to split tails of code in two at a merge point
grondilu does that have to be on optimization level? 17:57
timotimo how do you mean?
grondilu spesh is optimization, isn't it?
Zoffix Yes
timotimo yes
grondilu couldn't it be in the core?
timotimo spesh is a run-time optimization thing
oh, i suppose we can also just put optimized versions of <= and friends into the multi dispatch cache 17:58
unless the user code is derived from the existing types we optimize for
grondilu meh, it just seems to me that defining both the Order ones and the Bool ones creates redundancy and makes customizing hard. 17:59
timotimo you mean <= should become a macro that turns into something using <=> immediately?
grondilu maybe, dunno 18:00
timotimo that'll also automatically give you the user's scope, but only if the user code uses it directly and not hoping some other functions from other scopes to use it properly, too
that could lull users into a false sense of security
Zoffix m: use nqp; sub ORDER(int $i) { nqp::iseq_i($i,0) ?? Same !! nqp::islt_i($i,0) ?? Less !! More }; sub infix:<zcmp> { ORDER(nqp::cmp_I(nqp::decont($^a), nqp::decont($^b))) }; sub infix:<zold> { nqp::p6bool(nqp::isle_I(nqp::decont($^a), nqp::decont($^b))) }; sub infix:<zless> { nqp::p6bool(nqp::isle_i(($^a zcmp $^b), 0)) }; for ^500_000 { $ = rand.Int zless rand.Int }; say now - INIT now 18:01
camelia 0.935390
grondilu I don't get the problem with scopes here.
Zoffix m: use nqp; sub ORDER(int $i) { nqp::iseq_i($i,0) ?? Same !! nqp::islt_i($i,0) ?? Less !! More }; sub infix:<zcmp> { ORDER(nqp::cmp_I(nqp::decont($^a), nqp::decont($^b))) }; sub infix:<zold> { nqp::p6bool(nqp::isle_I(nqp::decont($^a), nqp::decont($^b))) }; sub infix:<zless> { nqp::p6bool(nqp::isle_i(($^a zcmp $^b), 0)) }; for ^500_000 { $ = rand.Int zold rand.Int }; say now - INIT now
camelia 0.7523957
Zoffix m: say .93/.75
camelia 1.24
Zoffix grondilu: so basically if <= were implemented in terms of `cmp` with our current optimizers that'd make <= about 25% slower 18:02
grondilu if you ask me I'd tell you it's worth it
Zoffix hehe
Zoffix goes for "definitely not"
grondilu: it still won't pick up your custom `cmp` ops, so I don't really see the benefit
grondilu why wouldn't it? 18:03
Zoffix because it's not in scope
grondilu oh, I think I understand
there has to be a clever OOP way to do this.
Zoffix There's a hack to make it work, yeah 18:04
timotimo operators are about the lexical language
Zoffix m: multi core-op1 { say 42 }; multi core-cmp { core-op1 }; { multi core-op1 { say 70 }; core-cmp }
camelia 42
grondilu make <=> virtual, have <=, <, > and >= us it, and implement <=> concretly in the main scope? 18:05
Zoffix grondilu: ^ there's the scoping issue illustrated. The "core-cmp" sub only sees the first "core-op1"; the second one is not in its lexical scope and that's the one you're redifining it from ujserland
timotimo m: multi core-op1 { say 42 }; multi core-cmp { CALLER::&core-op1() }; { multi core-op1 { say 70 }; core-cmp }
camelia 5===SORRY!5=== Error while compiling <tmp>
Malformed lookup of ::&core-op1; please use ::('&core-op1'), ::{'&core-op1'}, or ::<&core-op1>
at <tmp>:1
------> 3-op1 { say 42 }; multi core-cmp { CALLER7⏏5::&core-op1() }; { multi core-op1 { sa…
timotimo m: multi core-op1 { say 42 }; multi core-cmp { CALLER::('&core-op1')() }; { multi core-op1 { say 70 }; core-cmp }
camelia Ambiguous call to 'core-op1'; these signatures all match:
:()
:()
in sub core-cmp at <tmp> line 1
in block <unit> at <tmp> line 1
timotimo this is one proposed solution 18:06
though probably with CLIENT instead of CALLER there
AlexDaniel I feel like doing something…
Zoffix timotimo: so all core ops would call CALLER:: ?
or CLIENT rather
AlexDaniel looks at github.com/perl6/whateverable/issues/40
timotimo probably. and yes, that's really, really bad for performance, i imagine 18:07
timotimo AFKBBL
grondilu anyway, right now, if I want to overload &[<=], &[>=], &[>] and &[<], I have to define them all? 18:08
instead of just defining &[<=>]?
Zoffix m: class MyObj {}; sub install-it { CORE::<&infix:<eqv>>.add_dispatchee(multi sub infix:<eqv>(MyObj $l, MyObj $r --> Bool) { dd "w00t" }) }; insatll-it; say MyObj eqv MyObj 18:09
camelia 5===SORRY!5=== Error while compiling <tmp>
Undeclared routine:
insatll-it used at line 1. Did you mean 'install-it'?
Zoffix m: class MyObj {}; sub install-it { CORE::<&infix:<eqv>>.add_dispatchee(multi sub infix:<eqv>(MyObj $l, MyObj $r --> Bool) { dd "w00t" }) }; install-it; say MyObj eqv MyObj
camelia True
Zoffix huggable: extend core op :is: Hacking and (probably) unsupported way to extend core ops so they are seen even outside lexical scope: class MyObj {}; sub install-it { CORE::<&infix:<eqv>>.add_dispatchee(multi sub infix:<eqv>(MyObj $l, MyObj $r --> Bool) { dd "w00t" }) }; install-it; say MyObj eqv MyObj
huggable Zoffix, Added extend core op as Hacking and (probably) unsupported way to extend core ops so they are seen even outside lexical scope: class MyObj {}; sub install-it { CORE::<&infix:<eqv>>.add_dispatchee(multi sub infix:<eqv>(MyObj $l, MyObj $r --> Bool) { dd "w00t" }) }; install-it; say MyObj eqv MyObj
Zoffix grondilu: well, recall the thing I mentioned that you can't make ops like <= and > currently 18:10
timotimo the ruby folks don't have a problem with this kind of thing at all! nor the javascript folks
grondilu even if I don't mind that they won't be chaining?
timotimo you might not mind, but your users probably will? 18:11
grondilu :/
anyway, let me tell you that's LTA
performance is nice, but I don't see it as an excuse for that 18:12
Zoffix grondilu: performance is basically the only thing everyone ever talks about when they give reasons why they can't use Rakudo in production 18:12
grondilu is it still true though? Performance has made great progress lately. Isn't it enough now? 18:13
moritz no
perlpilot grondilu: no.
Zoffix And $10,000 or more has been spent this year by sponsors to improve it. Saying "it's not an excuse" is a bit off the mark
m: class Obj {}; multi infix:«<» (Obj, $) { "got it" }; say Obj < 42
camelia got it
Zoffix m: class Obj {}; multi infix:«<» (Obj, $) { "got it" }; say Obj < 42 < 72
camelia True
timotimo it's definitely not enough from my perspective as well 18:15
Zoffix m: class Obj { method Str { "Obj" } }; sub infix:«<» is assoc("list") { "got it [@_[]]" }; say Obj < 42 < 70
camelia got it [42 70]
Zoffix squints 18:16
Where did Obj go? :/
m: class Obj { method Str { "Obj" } }; sub infix:«zf» (*@a) is assoc("list") { ["got it", @a].perl }; say Obj zf 42 zf 70 18:17
camelia ["got it", [Obj, 42, 70]]
Zoffix m: class Obj { method Str { "Obj" } }; sub infix:«<» (*@a) is assoc("list") { ["got it", @a].perl }; say Obj < 42 < 70
camelia ["got it", [42, 70]]
Skarsnik_ yep, too slow x)
Zoffix Looks like the specialness of < interferes even there 18:18
grondilu: ^ so yeah, there's some options, but doesn't look like the work well
You could probably do a slang (which is unsupported and not unspecced ATM) 18:19
Zoffix s/not //; 18:19
grondilu can I at least hope it will be fixed *eventually*? 18:20
Zoffix Yeah, probably :)
grondilu so I guess meanwhile I will manually define the four infixes :/ 18:20
Zoffix I know TimToady mentioned we do want to make it possible to define ops like < in userland and from then I guess it'll mean our core `<` won't be magically special anymore
perlpilot m: "foofoo" ~~ / (foo) $10=[$0] /; say $/.elems; # I wonder if this will surprise people too? 18:21
camelia 11
perlpilot (sorry, just looking through scroolback)
grondilu suddenly realizes he will need the chaining behavior 18:22
moritz m: sub infix:<smaller>($a, $b) is assoc<chained> { $a < $b }; say 1 smaller 2
camelia True
moritz m: sub infix:<smaller>($a, $b) is assoc<chained> { $a < $b }; say 1 smaller 2 smaller 3
camelia False
Zoffix You can chain same ops.
You can't chain differring
moritz didn't seem to work here 18:23
Zoffix It's "chain" not "chained", according to docs, but it don't work either 18:25
grondilu has to wake up early tmrw so goes to sleep
Zoffix mc: m: sub infix:<smaller> is assoc<chain> { dd @_ }; say 1 smaller 2 smaller 3 18:26
committable6 Zoffix, ¦2015.12: «[2, 3]␤[1, Any]␤Nil»
Zoffix Oh, I think that's what is *meant* to work, but doesn't without compiler's specialness of adding <O(%chaining)> thing 18:29
moritz m: infix:<smaller> is assoc<chain> is equviv(&infix:<==>) { dd @_ }; say 1 smaller 2 smaller 3 18:33
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3infix:<smaller> is assoc<chain>7⏏5 is equviv(&infix:<==>) { dd @_ }; say 1
expecting any of:
infix
infix stopper
postfix…
moritz m: infix:<smaller>(@_) is assoc<chain> is equviv(&infix:<==>) { dd @_ }; say 1 smaller 2 smaller 3
camelia 5===SORRY!5=== Error while compiling <tmp>
Cannot use placeholder parameter @_ outside of a sub or block
at <tmp>:1
------> 3infix:<smaller>(@_7⏏5) is assoc<chain> is equviv(&infix:<==>)
moritz m: sub infix:<smaller>(@_) is assoc<chain> is equviv(&infix:<==>) { dd @_ }; say 1 smaller 2 smaller 3
camelia 5===SORRY!5=== Error while compiling <tmp>
Can't use unknown trait 'is equviv' in a sub+{precedence} declaration.
at <tmp>:1
expecting any of:
rw raw hidden-from-backtrace hidden-from-USAGE
pure default DEPRECATED inlina…
moritz m: sub infix:<smaller>(@_) is assoc<chain> is equiv(&infix:<==>) { dd @_ }; say 1 smaller 2 smaller 3
camelia Too many positionals passed; expected 1 argument but got 2
in sub infix:<smaller> at <tmp> line 1
in block <unit> at <tmp> line 1
moritz m: sub infix:<smaller>(*@_) is assoc<chain> is equiv(&infix:<==>) { dd @_ }; say 1 smaller 2 smaller 3
camelia [1, 2]
Nil
Skarsnik infix<piko>(Any, List) and infix(Any, Any) to have working junction I think? 18:34
Zoffix m: sub infix:<smaller>(*@_) is assoc<list> is equiv(&infix:<==>) { dd @_ }; say 1 smaller 2 smaller 3 18:35
camelia [1, 2]
Nil
Zoffix huh
m: sub infix:<smaller>(*@_) is assoc<list> { dd @_ }; say 1 smaller 2 smaller 3
camelia [1, 2, 3]
Nil
Zoffix is equiv copies other crap and overrides assoc
m: sub infix:<smaller>(*@_) is assoc<list> { [<] @_ }; say 1 smaller 2 smaller 3
camelia True
Zoffix ^ and that's a way to cheatsy-chain (works only with same ops)
Skarsnik m: sub infix<smaller>(Int $a, Int $b) { $a < $b}; sub infix<smaller>(Int $a, List $b) {dd $a}; say 1 smaller 2 smaller 3; 18:37
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing block
at <tmp>:1
------> 3sub infix7⏏5<smaller>(Int $a, Int $b) { $a < $b}; su
expecting any of:
new name to be defined
Skarsnik m: sub infix:<smaller>(Int $a, Int $b) { $a < $b}; sub infix:<smaller>(Int $a, List $b) {dd $a}; say 1 smaller 2 smaller 3;
camelia 5===SORRY!5=== Error while compiling <tmp>
Redeclaration of routine 'infix:<smaller>' (did you mean to declare a multi-sub?)
at <tmp>:1
------> 3infix:<smaller>(Int $a, List $b) {dd $a}7⏏5; say 1 smaller 2 smaller 3;
expecting any o…
Skarsnik m: sub infix:<smaller>(Int $a, Int $b) { $a < $b}; multi sub infix:<smaller>(Int $a, List $b) {dd $a}; say 1 smaller 2 smaller 3;
camelia 5===SORRY!5=== Error while compiling <tmp>
Redeclaration of routine 'infix:<smaller>' (did you mean to declare a multi-sub?)
at <tmp>:1
------> 3infix:<smaller>(Int $a, List $b) {dd $a}7⏏5; say 1 smaller 2 smaller 3;
expecting any o…
Skarsnik m: multi sub infix:<smaller>(Int $a, Int $b) { $a < $b}; multi sub infix:<smaller>(Int $a, List $b) {dd $a}; say 1 smaller 2 smaller 3;
camelia True
Skarsnik m: multi sub infix:<smaller>(Int $a, Int $b) { $a < $b}; multi sub infix:<smaller>(Int $a, List $b) {dd $a}; say 1 smaller 2 | 3; 18:38
camelia any(True, 3)
Zoffix m: BEGIN { $?LANG.refine_slang('MAIN', role { token infix:sym«smaller» { <sym> <O('prec', 'm=', 'assoc', 'left', 'dba', 'chaining', 'iffy', 1, 'diffy', 1, 'pasttype', 'chain')> } } )}; sub infix:<smaller> { $^a < $^b }; say 1 smaller 2 smaller 3 18:42
camelia True
Zoffix :)
.tell grondilu this uses non-standard features (slangs), but it makes chained ops work, I think: BEGIN { $?LANG.refine_slang('MAIN', role { token infix:sym«smaller» { <sym> <O('prec', 'm=', 'assoc', 'left', 'dba', 'chaining', 'iffy', 1, 'diffy', 1, 'pasttype', 'chain')> } } )}; sub infix:<smaller> { $^a < $^b }; say 1 smaller 2 smaller 3 18:43
yoleaux Zoffix: I'll pass your message to grondilu.
Skarsnik m: BEGIN { $?LANG.refine_slang('MAIN', role { token infix:sym«smaller» { <sym> <O('prec', 'm=', 'assoc', 'left', 'dba', 'chaining', 'iffy', 1, 'diffy', 1, 'pasttype', 'chain')> } } )}; sub infix:<smaller> { $^a < $^b }; say 1 smaller 2 > 0 18:43
camelia True
Skarsnik m: BEGIN { $?LANG.refine_slang('MAIN', role { token infix:sym«smaller» { <sym> <O('prec', 'm=', 'assoc', 'left', 'dba', 'chaining', 'iffy', 1, 'diffy', 1, 'pasttype', 'chain')> } } )}; sub infix:<smaller> { $^a < $^b }; say 1 smaller 2 > 3 18:44
camelia False
Geth whateverable: 45293f8473 | (Aleks-Daniel Jakimenko-Aleksejev)++ | bin/Squashable.p6
Ignore strong formatting

Not all dates may have a poster, and some dates may be simply in bold.
18:49
whateverable: 054a5f0041 | (Sylvain Colinet)++ (committed by Aleks-Daniel Jakimenko-Aleksejev) | bin/Nativecallable.p6
Some changes

Committing whatever we have live.
Zoffix Botacalypse 18:50
cschwenz .botsnack
synopsebot6 om nom nom
yoleaux :D
16:36Z <Zoffix> cschwenz: I was wrong, it's not a bug: irclog.perlgeek.de/perl6/2017-09-18#i_15181692
cschwenz aha, thanks Zoffix and jnthn 18:51
Skarsnik Oh yeah i changed stuff x)
Zoffix And workaround is basically just saving the capture into a variable before going inside the capture (last paragraph in this section: docs.perl6.org/language/regexes#Capture_numbers )
AlexDaniel 19:06
oops
AlexDaniel ⚠ Rakudo SQUASHathon 2017-10-07 github.com/rakudo/rakudo/wiki/Mont...Squash-Day 19:08
gfldex looks like I was right to golf httpd: blog.fuzzing-project.org/60-Option...emory.html 20:07
timotimo oh crap 20:09
mspo gdonald: you found that? 20:12
anyway nice one
gfldex wasn't me who found that 20:13
but that's clearly a bug that exists because of bloat
my first reaction was: Who the hell would need that feature?
mspo OPTIONS + Limit? 20:14
apache must support OPTIONS because it's http
gfldex options + limits and the ability to overrule that locally in any .htaccess
what makes that writeable to folk who don't got root 20:15
mspo firefox does options requests as a part of CORS/preflight
gdonald: .htaccess/<Directory> scope is a very misunderstood feature of apache :)
gfldex: ^^
anyway being super feature rich and crazy flexible is what makes apache so amazing 20:16
lizmat and yet another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2017/09/18/...me-booked/ 21:41
Juerd lizmat: Thanks :) 21:47
El_Che ah crap, I missed the new rakudo release. I'll release linux pkgs tomorrow 21:48
timotimo cool, El_Che++
that'll still be plenty fast :)
El_Che hehe 21:49
Geth doc: 3101569f05 | (Zoffix Znet)++ (committed using GitHub Web editor) | doc/Programs/00-running.pod6
List new scheduler debug vars
22:05
jnthn Zoffix++ 22:12
lizmat calls it a night 22:17
timotimo gnite lizmat
Zoffix .tell tadzik shot a small PR at you :) github.com/tadzik/Terminal-ANSIColor 22:46
yoleaux Zoffix: I'll pass your message to tadzik.
tadzik yolo!
yoleaux 22:46Z <Zoffix> tadzik: shot a small PR at you :) github.com/tadzik/Terminal-ANSIColor
tadzik thanks yolo
Zoffix Sucks that GitHub doesn't highlight Rakudo code blocks for some reason :/
tadzik++ thanks
tadzik: oh wait, I forget a version bump :) github.com/tadzik/Terminal-ANSIColor/pull/14 22:47
tadzik there's moar outstanding PRs :o
perl6 day is overdue
Zoffix :) 22:48
tadzik //o\
gottem
Zoffix m: 「 /o\ 」.flip.say
camelia \o/
tadzik Zoffix++; thanks for making things better!
Zoffix :) 22:49
tadzik ...aand I can't believe this works
japhb BTW, if you're using Terminal-ANSIColor coloring at high volume, it pays to cache the color escapes for anything but RGB mode; see github.com/ab5tract/Terminal-Print...rid.pm6#L8 for an example.
tadzik hmm 22:51
is there a standarized memoization I can use for color(), colored() etc these days?
tadzik (also: yay or nay for colour(), coloured() etc aliases? :P) 22:51
japhb Nay if it was my module, but it's yours. ;-) 22:52
tadzik: You might lose more performance by trying *not* to cache RGB values than you'd gain by doing it there. There was a significant cost just to be calling color() or colored(), when I really just wanted to pull from local cache on the caller side if it's available. 22:54
tadzik right 22:57
AlexDaniel . 23:04
AlexDaniel how can I get --version string from code? 23:34
AlexDaniel I know there's $*PERL and $*VM but how do I get output identical to --version? 23:35
MasterDuke say 23:36
evalable6 (exit code 1) 04===SORRY!04===
Argument to "say" seems to be malformed
at /t…
MasterDuke, Full output: gist.github.com/073359bc6651eaf75d...9b0f8e8224
MasterDuke say $*PERL.compiler.version
evalable6 v2017.09.27.gda.5.c.36.c.13
MasterDuke hm, guess that's not quite it either 23:39
Zoffix It's built here: github.com/rakudo/rakudo/blob/nom/....pl#L9-L40 23:41