»ö« 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 Zoffix on 25 May 2018.
00:00 MilkmanDan joined 00:01 w_richard_w left, w_richard_w joined
MasterDuke [Coke]: thanks 00:02
00:09 sarna left
ingy e: try { die 42; CATCH { .say } }; 43.say 00:09
evalable6 (exit code 1) 42
in block <unit> at /tmp/H7rLjO9_x_ line 1

42
in block <unit> at /tmp/H7rLjO9_x_ line 1
ingy e: try { die 42; CATCH { .message.say } }; 43.say 00:10
evalable6 (exit code 1) 42
42
in block <unit> at /tmp/4XjBiWVo9_ line 1
00:10 MilkmanDan left 00:11 MilkmanDan joined
ingy e: my $e; try { die 'ack'; CATCH { $e = .message } }; say $e.perl 00:11
evalable6 (exit code 1) ack
in block <unit> at /tmp/H7X20TPLdY line 1
ingy e: my $e; try { die 'ack'; CATCH { $e = .message } }; say ">>>{$e.perl}<<<" 00:12
evalable6 (exit code 1) ack
in block <unit> at /tmp/vMkcxO6gT7 line 1
ingy e: my $e; try { die 'ack'; CATCH { $e = .message; .resume } }; say ">>>{$e.perl}<<<"
evalable6 >>>"ack"<<<
ingy e: use JSON::Tiny; say from-json: '[42' 00:14
evalable6 (exit code 1) ===SORRY!===
Could not find JSON::Tiny at line 1 in:
/home/bisectable/gi…
ingy, Full output: gist.github.com/2f40bd736a2c67dc04...b319e0c382
MasterDuke .ask robertle is your program (the one with all the regexes) available somewhere online?
yoleaux MasterDuke: I'll pass your message to robertle.
MasterDuke ingy: there is a way to use modules
ingy ? 00:15
MasterDuke AlexDaniel: ^^^
ingy MasterDuke: you're not sure how?
MasterDuke ingy: with evalable. don't remember the exact path to include 00:16
Xliff MasterDuke: Do you know if jnthn is still working on GTK::Simple?
ingy ok
e: 1/0
evalable6
perlawhi1l hi perly people 00:17
MasterDuke Xliff: not sure, but if i had to guess i'd say timotimo had done work more recently
ingy e: sub foo {1/0}; foo
evalable6
ingy e: sub foo {1/0}; foo.perl
evalable6
00:17 Hotkeys left
perlawhi1l i was slurping a 39180 line file and got "Malformed UTF-8". apart from process of elimination, is there an easy way to find out where the character is that it had troupble with 00:18
ingy what's something that will cause an error besides die?
loading bad json came to mind
MasterDuke e: use lib 'sandbox'; use JSON::Tiny; say from-json: '[42' 00:19
evalable6 (exit code 1) ===SORRY!===
Could not find JSON::Tiny at line 1 in:
/home/bisectable/gi…
MasterDuke, Full output: gist.github.com/bdc471d78bc9ff064c...29a0c30d17
ingy /home/bisectable/git/whateverable/sandbox 00:20
MasterDuke e: use lib 'data/all-modules/cpan/MORITZ/JSON-Tiny/lib'; use JSON::Tiny; say from-json: '[42' 00:21
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/galrooGe4F
Calling…
00:22
MasterDuke, Full output: gist.github.com/0348afb914173e3e26...cf947fa7e8
00:22 Xliff left
ingy MasterDuke: thx 00:23
MasterDuke perlawhi1l: can you just do .lines instead of slurping?
ingy e: use lib 'data/all-modules/cpan/MORITZ/JSON-Tiny/lib'; use JSON::Tiny; my $e; try { say from-json: '[42'; CATCH { $e = .message; .resume } }; say ">>>{$e.perl}<<<" 00:24
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/gMHPM4EJWm
Calling…
ingy, Full output: gist.github.com/521a8183a045f853b6...95c979915e
ingy e: use lib 'data/all-modules/cpan/MORITZ/JSON-Tiny/lib'; use JSON::Tiny; my $e; try { say from-json('[42'); CATCH { $e = .message; .resume } }; say ">>>{$e.perl}<<<" 00:25
evalable6 (exit code 1) This exception is not resumable
in block at /tmp/KqTdvF80aW line 1
in block <unit> at /tmp/KqTdvF80aW line 1
MasterDuke that's a compile-time error, you won't be able to try/catch it 00:26
00:26 lance_w[m] joined, CIAvash[m] joined, ilmari[m] joined, wictory[m] joined, unclechu joined, AlexDaniel`` joined, mirlur[m] joined
ingy what's the compile time error? 00:26
00:26 Garland_g[m] joined, mienaikage joined
MasterDuke the ones with '===SORRY!===' 00:27
00:27 AlexDaniel left, AlexDaniel joined
ingy the last one isn't SORRY 00:27
e: use lib 'data/all-modules/cpan/MORITZ/JSON-Tiny/lib'; use JSON::Tiny; my $e; try { from-json('[42'); CATCH { $e = .message; .resume } }; say ">>>{$e.perl}<<<" 00:28
evalable6 (exit code 1) This exception is not resumable
in block at /tmp/69q8XzUkeX line 1
in block <unit> at /tmp/69q8XzUkeX line 1
ingy where does .resume try to resume from
all I want to do is catch my error and continue 00:29
like any other lang
e: use lib 'data/all-modules/cpan/MORITZ/JSON-Tiny/lib'; use JSON::Tiny; my $e; try { from-json('[42'); CATCH { $e = .message } }; say ">>>{$e.perl}<<<"
evalable6 (exit code 1) Input (3 characters) is not a valid JSON string
in sub from-json at /home/…
ingy, Full output: gist.github.com/71d0353a0395d65e20...4cafa07880
ingy e: use lib 'data/all-modules/cpan/MORITZ/JSON-Tiny/lib'; use JSON::Tiny; my $e; try { from-json('[42'); CATCH { default { $e = .message } } }; say ">>>{$e.perl}<<<" 00:30
evalable6 >>>"Input (3 characters) is not a valid JSON string"<<<
MasterDuke e: use lib 'data/all-modules/cpan/MORITZ/JSON-Tiny/lib'; use JSON::Tiny; my $e; from-json('[42'); CATCH { $e = .message }; say ">>>{$e.perl}<<<"
evalable6 (exit code 1) Input (3 characters) is not a valid JSON string
in sub from-json at /home/…
MasterDuke, Full output: gist.github.com/8e53df9d9d769d6452...54edeefaf8
ingy my last one worked as I hoped
I get to the say">>> with my $e set 00:31
timotimo .tell xliff i haven't done anything on gtk::simple itself in a long while, others have helped a bunch since i last did much to it. especially azawawi comes to mind
yoleaux timotimo: I'll pass your message to xliff.
00:32 mcmillhj joined, mike_sw joined, kaare_ joined 00:36 mcmillhj left 00:40 mike_sw left 00:41 cognominal left 00:43 Actualeyes left
ingy e: "foo\nbar\n".chomp.split("\n") 00:44
evalable6
00:44 kjk joined
ingy e: "foo\nbar\n".chomp.split(rx/\n/) 00:44
evalable6
ingy e: "foo\nbar\n".chomp
evalable6
00:45 zachk left
MasterDuke e: "foo\nbar\n".chomp.split("\n").say 00:45
evalable6 (foo bar)
geekosaur "oh say can you see" :p 00:46
ingy e: "foo\nbar\n".chomp.split("\n").WHAT 00:47
evalable6
ingy e: "foo\nbar\n".chomp.split("\n").WHAT.say
evalable6 (Seq)
ingy e: say ["foo\nbar\n".chomp.split("\n")].perl
evalable6 ["foo", "bar"]
ingy e: say ["foo\nbar\n".chomp.split("\n")].WHAT
evalable6 (Array)
ingy e: say ["foo\nbar\n".chomp.split("\n")].elems
evalable6 2
kjk p6: sub x(**@a, :$b) { 123 }; &x.assuming(:!b) 00:48
camelia 5===SORRY!5=== Error while compiling /home/camelia/EVAL_2
Redeclaration of symbol '@a'
at /home/camelia/EVAL_2:1
------> 3$res = (my proto __PRIMED_ANON (*@a, *@a7⏏5, Any :b($b) --> Mu) { {*} });
expecting any of:
shape…
kjk bug? ^^^^
ingy e: $text = "line 1\nline 2\nline 3\n"; say [$text.chomp.split("\n")] 00:49
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/ZLVP61mA3o
Variabl…
ingy, Full output: gist.github.com/43d6f994a109693df3...6e8a3cd91f
ingy e: my $text = "line 1\nline 2\nline 3\n"; say [$text.chomp.split("\n")]
evalable6 [line 1 line 2 line 3]
ingy I'm getting this error for the above in my program: 00:50
Uncaught Error: Cannot resolve caller split(TestML::StdLib, Str, Str); Routine does not have any candidates. Is only the proto defined?
well obviosuly not that exact code but... 00:51
geekosaur sounds like you may be trying to split what you think is a string but isn't
TestML::StdLib looks … suspicious
might need to ~ it
(or explicit .Str on it) 00:52
ingy I printed $text and it is (Str)
and is "line 1\nline 2\nline 3\n"
method lines($text) { [$text.chomp.split("\n")]; } # is the method in TestML::StdLib 00:53
timotimo you're not doing something dangerously multithreaded are you? :) 00:54
ingy and .chomp returns a Str right?
no
timotimo m: say "hello".chomp.^name
camelia Str
geekosaur or they have a local definition of one of those methods?
which iirc doesn;t work well currently
ingy I might have that
nope 00:55
geekosaur proto and impls currently have to be in the same module or weird things happen, iirc
ingy I have no chomp or split method in there
geekosaur actually, hm. did you mean method or sub there? 00:56
ingy method
but hold on a sec
how do I get the stack trace from a caught error? 00:57
geekosaur because you don;'t seem to be using whatever object it's supposed to be a method of, and that makes me wonder if you have confused them somewhere
timotimo m: die "oh what"; CATCH { say .^methods } 00:58
camelia (message Numeric from-slurpy payload BUILDALL is-compile-time gist Str vault-backtrace reset-backtrace resume fail die backtrace rethrow throw BUILDALL)
oh what
in block <unit> at <tmp> line 1
timotimo m: die "oh what"; CATCH { say .backtrace }
camelia Backtrace(3 frames)
oh what
in block <unit> at <tmp> line 1
geekosaur in such a way that you're getting the object as a parameter instead of as an invocant
lookatme kjk, seems like a bug :)
geekosaur kjk, for what it's worth, that looks like a bug exercising a corner case nobody had considered 00:59
lookatme you can see __PREIME_ANON (*@, *@ ...
geekosaur yeh, that's the manufactured routine that .assuming creates
which is doing the wrong thing, possibly because it doesn;t expect a **@ in the original's signature 01:00
lookatme hmm
kjk want me to file a bug report? 01:02
geekosaur I would, yes
01:03 Xliff joined
Xliff \o again. 01:03
yoleaux 00:31Z <timotimo> Xliff: i haven't done anything on gtk::simple itself in a long while, others have helped a bunch since i last did much to it. especially azawawi comes to mind
Xliff timotimo++ -- Thanks for the info
What is the best way to alias a method within its own class? There was a trait for that, but I think it was not included in core perl6 01:04
ingy timotimo, geekosaur: I just wrote that code so assumed it was where it bombed. but looks like it was a problem elsewhere, made worse by my try/catch implementation
sorry about that 01:05
01:05 raschipi joined
ingy that was my first stdlib method that returns an array 01:08
perl6 is a struggle but I keep inching forward 01:09
TimToady Xliff: method bar(|c) { self.foo(|c) } will get inlined rather quickly
01:09 Schepeers left
ingy I'm halfway through the test suite 01:09
the hard half I hope :)
Xliff TimToady++ -- That was the method I decided on. Thanks for answering.
MasterDuke Xliff: lizmat had an experimental 'is aka' or something like that a while ago. is that what you were thinking of? 01:10
kjk FYI bug report created: github.com/rakudo/rakudo/issues/1918 thanks 01:11
01:14 Schepeers joined, Schepeers left 01:16 Zoffix joined 01:17 Schepeers joined, Schepeers left
Xliff MasterDuke: Yes, that's the one. I think FROGGS had it in his libxml project. 01:18
Zoffix TimToady: it's like 10x slower tho
yoleaux 12 Jun 2018 20:04Z <cono> Zoffix: 20:03 < cono> but anyway thinking that converting to fractional value should give us exception, but stringification should show that we have numerator/denominator
Xliff I think it stopped working a bit ago. Don't know if that was fixed or not.
Zoffix Even slower if it's a multi with a bunch of candidates
01:18 mcmillhj joined
Xliff Zoffix: So you recommend the trait method? 01:19
is the aka trait mod still in rakudo?
Zoffix Xliff: no, and hasn't been for almost half a decade
How come this makes the original method slower?
m: my $o := class { method foo { }; BEGIN ::?CLASS.^add_method: 'bar', ::?CLASS.^lookup: 'foo' }; { for ^2000_000 { $o.foo; Nil }; say now - ENTER now }
camelia 1.014655
Zoffix m: my $o := class { method foo { }; }; { for ^2000_000 { $o.foo; Nil }; say now - ENTER now } 01:20
camelia 0.141756
Zoffix Also, how come this doesn't make `.bar` as fast as `.foo`?
m: my $o := class { method foo { }; ::?CLASS.^add_method: 'bar', ::?CLASS.^lookup: 'foo' }; { for ^2000_000 { $o.bar; Nil }; say now - ENTER now }
camelia 2.266414
01:21 Schepeers joined, Schepeers left, Guest18 joined 01:23 mcmillhj left 01:25 Schepeers joined, Schepeers left, fascinum joined
Xliff The version of the aka trait I am using looks to be for Routine objects. 01:27
How would I do that for a Method>
timotimo m: say Method ~~ Routine
camelia True
Xliff Is there a way you can go $method.class.^add_method?
So would Routine.package.^add_method work for methods? 01:28
nm. Tried it. It works. Thanks!
01:31 Schepeers joined 01:32 Schepeers left 01:35 Schepeers joined, Schepeers left 01:36 mcmillhj joined
Zoffix Filed my questions as R#1919 just in case 01:40
synopsebot_ R#1919 [open]: github.com/rakudo/rakudo/issues/1919 .^add_method causes perf loss I can't explain
01:41 mcmillhj left 01:42 Schepeers joined 01:43 Schepeers left 01:48 Schepeers joined, Schepeers left
timotimo perl6 -e 'm: my $o := class { method foo { }; BEGIN ::?CLASS.^add_method: \'bar\', ::?CLASS.^lookup: \'foo\' }; { for ^20_000_000 { $o.foo; Nil }; say now - ENTER now }' 01:49
1.1131873
perl6 -e 'm: my $o := class { method foo { } }; { for ^20_000_000 { $o.foo; Nil }; say now - ENTER now }'
1.105267
Zoffix: am i doing something wrong?
01:50 Schepeers joined 01:51 Schepeers left
timotimo i cannot measure a difference between these two lines, even with an up-to-date moar/nqp/rakudo 01:53
Zoffix m: my $o := class { method foo { }; BEGIN ::?CLASS.^add_method: 'bar', ::?CLASS.^lookup: 'foo' }; { for ^2000_000 { $o.foo; Nil }; say now - ENTER now } 01:55
camelia 1.04641469
Zoffix timotimo: hm, I can't repro locally either, with 2018.05-43-gc80ea2f28 rakudo
timotimo so could just be bot's system being busy doing other stuff in between? 01:56
Zoffix m: my $o := class { method foo { }; }; { for ^2000_000 { $o.foo; Nil }; say now - ENTER now }
camelia 0.13585399
Zoffix m: my $o := class { method foo { }; BEGIN ::?CLASS.^add_method: 'bar', ::?CLASS.^lookup: 'foo' }; { for ^2000_000 { $o.foo; Nil }; say now - ENTER now }
camelia 0.98466594
Zoffix m: my $o := class { method foo { }; }; { for ^2000_000 { $o.foo; Nil }; say now - ENTER now }
camelia 0.1384156
Zoffix m: my $o := class { method foo { }; BEGIN ::?CLASS.^add_method: 'bar', ::?CLASS.^lookup: 'foo' }; { for ^2000_000 { $o.foo; Nil }; say now - ENTER now }
camelia 0.9869376
Zoffix seems it's too consistently slower for it to be just that 01:57
timotimo the last code is noticably slower on my end, too
the one that calls the added method
the code goes through Metamodel.nqp:1105, find_method, 2 million times 01:58
Zoffix It probably doesn't get added to normal things because it's added at runtime, after composition, eh?
Zoffix has no idea how any of this stuff works :(
geekosaur there's .^compose
timotimo that seems likely
geekosaur but not sure that helps here 01:59
runtime changes Id expect to deopt a bit
timotimo it does
immediately makes it 30x faster
to call .^compose once
Zoffix oh, OK, one mystery solved 02:00
02:00 molaf left, Schepeers joined, Schepeers left
Zoffix Yeah, I can't repro the other slowness on bleed-built rakudo locally either 02:02
02:02 Schepeers joined
Zoffix k, gonna close the issue. 02:02
02:03 Schepeers left
Zoffix e: my $o := class { method foo { }; BEGIN ::?CLASS.^add_method: 'bar', ::?CLASS.^lookup: 'foo' }; { for ^2000_000 { $o.foo; Nil }; say now - ENTER now } 02:03
evalable6 0.13757994
02:03 mcmillhj joined 02:04 Schepeers joined 02:05 Schepeers left 02:08 mcmillhj left 02:09 Actualeyes joined 02:11 espadrine left, Schepeers joined, Schepeers left 02:13 molaf joined 02:17 Schepeers joined 02:21 jast joined 02:22 benjikun joined
kjk how do you directly get a hold of a method without binding it to an invocant and arguments and without invoking it? With a sub it's just the name of the sub with a &, but how to do it for a method? say Str's substr method 02:27
raschipi m: my $x = Int.&abs; say $x(-3) 02:34
camelia Invocant of method 'Bridge' must be an object instance of type 'Int', not a type object of type 'Int'. Did you forget a '.new'?
in block <unit> at <tmp> line 1
raschipi m: my $x = &Int.abs; say $x(-3) 02:35
camelia 5===SORRY!5=== Error while compiling <tmp>
Illegally post-declared type:
Int used at line 1
kjk I know I can get a list of methods or candidates and the filter on that but that seems too much work 02:36
Zoffix kjk: you mean like .^lookup?
m: my $meth := "".^lookup: "substr"; $meth("foobar", 3).say 02:37
camelia bar
kjk Zoffix: cool, that works!
Zoffix m: my $meth := "".^lookup: "substr"; $meth.^name.say
camelia Method
Zoffix cool
kjk thanks 02:38
02:40 Zoffix left 02:49 shareable6 joined 02:50 Actualey` joined, Actualeyes left 02:57 mcmillhj joined 03:01 mcmillhj left 03:02 subroot joined 03:15 mcmillhj joined 03:20 mcmillhj left 03:21 fascinum left 03:24 benjikun left 03:37 raschipi left 03:41 subroot left 03:53 mcmillhj joined 03:54 Actualey` left 03:58 mcmillhj left 04:00 Summertime left 04:06 Summertime joined 04:08 jmerelo joined
Xliff Pardon me, but what does ::?CLASS do? 04:10
04:12 molaf left 04:17 Xliff left 04:19 MasterDuke left
geekosaur docs.perl6.org/language/variables#...3A%3FCLASS 04:20
with :: acting as the "sigil" and ? twigil indicating compile-time
jmerelo m: class I'm { method in { say ::?CLASS} }; I'm.in 04:21
camelia (I'm)
04:26 mcmillhj joined 04:28 jmerelo left 04:30 Guest18 left 04:31 mcmillhj left 04:33 Guest18 joined 04:39 mcmillhj joined
skids m: class I'm { method in { say ::?CLASS} }; I'm.in; class You're is I'm { }; You're .in; 04:40
camelia (I'm)
(I'm)
04:43 mcmillhj left
geekosaur right. compile time constant, won;t handle that 04:57
m: class Foo { method iam { self.^name } }; class Bar is Foo {}; say Bar.new.iam
camelia Bar
geekosaur (was testing in shell, so no ' silliness)
04:58 curan joined 05:11 Todd joined 05:12 mcmillhj joined
Todd I am trying to turn "01.02.03" into "1.2.3". What am I doing wrong? p6 'my $x="01.02.03"; $x ~~ s:global/ (0)(\d) / $1 /; say "<$0>\n<$1>\n<$x>"' 05:12
geekosaur you're trying to use $(number) with two different meanings at the same time 05:15
m: my $x="01.02.03"; $x ~~ s:global/ (0)(\d) / $1 /; say $/
camelia (「01」
0 => 「0」
1 => 「1」 「02」
0 => 「0」
1 => 「2」 「03」
0 => 「0」
1 => 「3」)
Todd How do I fix it? What is the `\d` for an alpha that looks like a number?
05:16 xtreak joined
geekosaur \d isn't related, won't help. the problem is what $0, $1, $2, etc. mean with :g 05:16
05:17 mcmillhj left, sauvin joined
Todd uh oh. g mean advance the $# each time its finds a match 05:17
geekosaur m: my $x="01.02.03"; $x ~~ s:global/ (0)(\d) / $1 /; say "<$/[0][1]> <$/[1][1]> <$/[2][1]>"
camelia <1> <2> <3> 05:18
geekosaur no, it's an array
one element per match
Todd the string to alter will vary all over the place. I would just clobber the zeros, but 0.0.3 is legitmate 05:19
geekosaur well, list. and the [0] oof that is always 0 because you parenthesized it for some reason, telling it to capture it
Todd What I need is: if a number is preceeded with a zero, remove the zero. If the nubmer is a zero by itself, leave it alone 05:20
geekosaur m: my $x="01.0.3"; $x ~~ s:global/ 0*(\d) / $0 /; say "<$/[0][0]> <$/[1][0]> <$/[2][0]>"
camelia <1> <0> <3>
Todd no joy. $ p6 'my $x="01.0.3.06.10"; $x ~~ s:global/ 0*(\d) / $0 /; say "<$/[0][0]> <$/[1][0]> <$/[2][0]>"' 05:21
05:21 hcit left
geekosaur you'd get only the first 3 from that, if that's what you mean. because that's what you said at first so what I used 05:21
Todd maybe I have to do a split on "." and then do a recombine?
geekosaur but it's a list, it can be indexed or each-d 05:22
Todd Sorry. wasn't specific enough
05:22 squashable6 joined
geekosaur but I would probably comb on '.' if that's guaranteed, then .Int each 05:22
Todd what do you mean?
05:22 Guest18 left
geekosaur m: my $x = '01.0.3.06.10'; my @y = $x.comb('.')>>.Int; say @y 05:23
camelia Cannot convert string to number: radix point must be followed by one or more valid digits in '3.⏏' (indicated by ⏏)
in block <unit> at <tmp> line 1
geekosaur whoops, sorry
05:23 Guest18 joined
geekosaur m: my $x = '01.0.3.06.10'; my @y = $x.comb(/\d+/)>>.Int; say @y 05:23
camelia [1 0 3 6 10]
05:23 ChoHag_ joined
geekosaur backewards 05:23
the >> means to apply what follows to each element of the resulting list, and what follows is the .Int method to turn a Str into the corresponding Int 05:24
comb makes a list of all the things in the Str you apply it to, that match the pattern you give it
Todd I can work with that. Thank you! 05:26
geekosaur m: my $x = '01.0.3.06.10'; my @y = $x.comb(/\d+/)>>.Int; say @y.join('.')
camelia 1.0.3.6.10
05:26 ChoHag left
geekosaur probably easier to work with than trying to do it all in place 05:26
and then having to deal with $0 etc. being lists instead of single values, etc. 05:27
05:27 xtreak left 05:29 mahafyi_ joined
geekosaur m: my $x = '01.0.3.06.10'; say ($x.comb(/\d+/)>>.Int).join('.') 05:29
camelia 1.0.3.6.10
05:30 troys left, mahafyi left
geekosaur looks like parens aren't needed there, even 05:30
m: my $x = '01.0.3.06.10'; say $x.comb(/\d+/)>>.Int.join('.')
camelia 1.0.3.6.10
05:30 mahafyi_ is now known as mahafyi 05:31 Guest9306 left
geekosaur but it's a bit more confusing because the .Int is applied with the >> but the .join is applied to the whole result 05:31
Todd that worked! $ p6 'my $x = "01.0.3.06.10"; say ($x.comb(/\d+/)>>.Int).join(".");' 1.0.3.6.10 05:33
Thank yo! Signing out for the night 05:35
05:35 Todd left 05:42 mcmillhj joined 05:43 giraffe joined, giraffe is now known as Guest28040 05:47 domidumont joined, mcmillhj left 05:50 kjk left 05:51 skids left 05:52 domidumont left 05:53 domidumont joined 05:58 wamba joined 06:13 domidumont left 06:14 mcmillhj joined 06:19 mcmillhj left, sarna joined
sarna AlexDaniel: what does that big peak mean? Oo 06:23
and sorry I was sleeping
El_Che .tell jmerelo bdefoy seemed agitated, "attitude" seems somwhat exagerated 06:25
yoleaux El_Che: I'll pass your message to jmerelo.
06:28 robertle joined 06:31 psychoslave joined
AlexDaniel sarna: these tests are performed on dev commits, so it could be anything 06:33
sarna: but it's probably a fluke (maybe there was something wrong with the machine where these benchmarks are performed) 06:34
sarna AlexDaniel: ah, I see. but the big picture looks promising :)
AlexDaniel sarna: on the graph, lower is better
so yeah, generally rakudo is getting a bit faster all the time
El_Che there are Tux CSV stats 06:35
sarna btw, which editor do you guys use?
El_Che vim and atom for perl6, vim for perl5, intellij for go 06:36
vim for all the rest
06:37 Actualeyes joined
sarna atom is really slow on my machine :( 06:37
I guess I'll try out vim for the nth time 06:38
AlexDaniel sarna: another interesting thing regarding performance: twitter.com/zoffix/status/955290358434451456
sarna AlexDaniel: awesome! 06:39
AlexDaniel I'd guess this prediction is a bit off now, half a year later
06:39 mcmillhj joined
AlexDaniel almost 06:39
the curve I mean
but it's still interesting that you can totally expect rakudo to be around X% faster year later, at least for that benchmark :) 06:40
AlexDaniel & 06:41
06:41 darutoko joined
sarna :) 06:43
06:44 mcmillhj left
sarna well, there isn't any official style guide for perl6, is there? 06:44
El_Che not that I know off 06:47
AlexDaniel there was this attempt: github.com/moritz/perl6-wtop 06:50
years ago
sarna: oh yeah, not a style guide, but this page is useful for people who are looking for a style guide: docs.perl6.org/language/traps 06:52
it lists some don'ts and be-carefuls :) 06:53
sarna AlexDaniel: thanks :)
06:56 domidumont joined 07:03 rindolf joined 07:05 AlexDaniel left 07:09 DeepIO joined, wamba left 07:13 Xliff joined 07:16 mcmillhj joined 07:21 mcmillhj left 07:28 psychoslave left, psychoslave joined 07:32 mcmillhj joined 07:36 sena_kun joined 07:37 mcmillhj left
sarna I'm halfway done with perl6 into, and I must say it's a really fun language :D 07:42
s/into/intro
07:44 jmerelo joined
jmerelo O/ 07:44
yoleaux 06:25Z <El_Che> jmerelo: bdefoy seemed agitated, "attitude" seems somwhat exagerated
jmerelo .tell El_Che it was a mistake, my mistake. A simple "you're still not saying anything about non-existing files" would have been enough. 07:46
yoleaux jmerelo: I'll pass your message to El_Che.
07:58 aborazmeh joined, aborazmeh left, aborazmeh joined 07:59 markoong joined 08:01 jmerelo left, mcmillhj joined
sarna does that bot wait for a person to go online? 08:02
jast it waits until the next time they say something
08:03 lizmat left
sarna ah! sweet 08:04
08:06 mcmillhj left, wamba joined 08:07 dakkar joined 08:11 lizmat joined 08:12 psychoslave left 08:14 silug left 08:21 aborazmeh left 08:23 zakharyas joined 08:26 cognominal joined 08:50 mcmillhj joined 08:52 AlexDaniel joined 08:54 mcmillhj left 08:55 robertle left 09:11 wamba left 09:17 AlexDaniel`` left, AlexDaniel`` joined
masak sarna: hi! new here? welcome! 09:19
masak is not a bot, but plays one on TV 09:20
El_Che masak: we're not sure you're a bot or not 09:21
yoleaux 07:46Z <jmerelo> El_Che: it was a mistake, my mistake. A simple "you're still not saying anything about non-existing files" would have been enough.
El_Che some people have seen you irl --some even liked you a lot--, but there is a theory that you may be a great android
09:22 w_richard_w left
masak I'm not sure either 09:22
all I know is that *if* I'm an android, I'm not all that great
El_Che masak: pretty much the plot of blade runner :)
lizmat masak: do you dream of electric sheep ? 09:23
jast I think people read way too much into blade runner
sarna masak: yeah I'm new, thanks :) 09:24
El_Che sarna: masak is our reception bot, pretty much Hotel California style
masak you can `git checkout` anytime... 09:25
sarna :D
El_Che lol
masak sarna: pro tip: the best way to learn is to try stuff out driven by interest, and then just show up on the channel and ask a question about a golfed example that you run on camelia
like so:
m: say "hi sarna"
camelia hi sarna
masak m: .say given "hi sarna"
camelia hi sarna
masak m: say "hi s$($_)rn$($_)" given "a" 09:26
camelia hi sarna
sarna what does `given` mean?
masak it's a topicalizer
sarna D:
masak docs.perl6.org/language/control#given
jast in plain words, it sets the "default thing" for the associated code 09:27
masak let me show you with some more short examples
m: my $name = "masak"; given $name { say $_ }
camelia masak
masak m: my $name = "masak"; say $_ given $name
camelia masak
masak m: my $name = "masak"; .say given $name
camelia masak
masak so, in essence, what `given` does is set $_ to an expression you care about 09:28
jast for instance, .say is a method call on the default thing, a.k.a. $_
it's a shortcut for $_.say
masak it's like "hey, we're now going to talk about this thing a lot, so let's make it the topic of discussion"
sarna ohhh I get it now, thanks
masak in short, a topicalizer :)
sarna Perl is so funky :D
masak word. 09:29
jkramer Wait a second, does that mean that I don't need a given {} block around `when`s?
jast just wait until you discover hyper operators :D
09:29 scovit left
masak jkramer: yes! 09:29
El_Che funky like scabies (sarna: scabies in Spanish)!
jkramer m: $_ = 'lol'; when 'test' { say "yo" }; when 'lol' { say "yay" }; default { say 'meh' }
camelia yay