»ö« 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
lizmat m: $_ = 42; when 42 { say "foo" }
camelia foo
jkramer m: $_ = 'lolasd'; when 'test' { say "yo" }; when 'lol' { say "yay" }; default { say 'meh' }
camelia meh
jkramer Nice, I didn't know that :) 09:30
sarna El_Che: yeah I know that. it's my childhood nickname though, and any other nick sounds off
El_Che :)
sarna (means roe deer in Polish) 09:31
masak m: sub vowel($l) { $l ∈ "aeiou".comb }; for "this is just an example phrase, carry on" { .say when &vowel }
camelia ( no output )
masak hm, got something wrong there...
jkramer m: $_ = 'lol'; when 'test' { say "yo" }; when 'lol' { proceed; say "yay" }; default { say 'meh' }
camelia meh
masak m: sub vowel($l) { $l ∈ "aeiou".comb }; for "this is just an example phrase, carry on".comb { .say when &vowel }
camelia i
i
u
a
e
a
e
a
e
a
o
jkramer m: $_ = 'lol'; when 'test' { say "yo" }; when 'lol' { succeed; say "yay" }; default { say 'meh' }
camelia ( no output )
masak there we go
El_Che that's a lot of vocals for polish ;)
jast m: when 'abc' eq 'abc' { say "'if' is overrated" } 09:32
camelia 'if' is overrated
sarna we use vowels too, contrary to the popular opinion
masak they're just frowned upon
jast yeah well, Polish isn't Czech ;)
El_Che Does Polish speak using polish notation? 09:33
that makes no sense, you you get the gist
(there is a .gist method in rakudo!)
jast forward polish notation
masak I love the Slovenian word "čmrlj". I love pronouncing it in all its non-vowelly glory 09:34
jast gesundheit
masak means "bumblebee"
El_Che m: my %h = :a(1), :b(2); say %h.gist 09:35
camelia {a => 1, b => 2}
masak and it actually has a "pseudo-vowel" between the first and the second consonant, just to make it possible to pronounce
moritz he, we just had a čmrlj in our meeting room :)
masak what a čmrljoincidence!
lizmat
.oO( mumblebee )
09:36
damnlie Promo-time :) (we would like to ppl to come) twitter.com/MelindaK1983/status/10...05217?s=19
moritz retweets 09:39
sarna "trzmiel" is "bumblebee" in Polish
it's a consonant heavy word
Polish got that opinion because many of the basic words are consonant heavy (I'm sorry - przepraszam) 09:40
damnlie Thanks moritz ;)
09:40 psychoslave joined 09:41 markoong left, wamba joined
jkramer I like the german word for bumblebee, "Hummel". The word sounds like what the bumblebee does - tumble around midair and make humming noises :) 09:44
09:44 robertle joined
ilmari it's "humle" in norwegian, which is also the word for "hops" (as in the plant used in beer) 09:46
jkramer Ha, apparently the scientific name is "bombus", which also kinda fits because of their body shape and how they sometimes crash into stuff/people :) 09:47
El_Che norwegian
it sounds like a place where all the death metal bands come from
:)
masak sarna: "trzmiel" is clearly related to "čmrlj"
jkramer El_Che: I think that's Finland :)
sarna yes 09:48
ilmari: hei :^)
masak jkramer: though "bombus" seems to not have to do with shape etymologically, but with buzzing/humming 09:49
ilmari jkramer: correct. norway is fourth: jakubmarian.com/number-of-metal-ba...in-europe/
09:50 kurahaupo left
masak jkramer: from Ancient Greek βόμβος - "any deep, hollow sound, humming, buzzing, booming, rumbling" 09:50
so kind of related to "BOOM" more than to "bomb"
jkramer :D
ilmari sarna: moi 09:51
masak uh, but "bomb" seems to have the same origin, so
anyway, the bumblebee is so named because of its sound, not its shape
sarna ilmari: Moi i Lund?
sarna is off to run some errands 09:54
ilmari sarna: your nick sounded finnish to me :) (I'm half/half finnish/norwegian) 09:56
"moi" is hi in finnish
moritz but not with french pronounciation, right :) 09:57
jast afaik in finnish you just pronounce everything whatever way you like... so, for instance, "moi" could be pronounced "čmrlj" 09:58
moritz as long as you do it with a low voice and do it slowly :)
ilmari finnish pronounciation is entirely regular, each letter is pronounced the same regardless of context 10:00
jast how boring ;)
moritz how cool for learning
jast there's enough other things to learn, or so I've heard 10:01
moritz since the grammar is so fucking complicated, at least one thing that's easy :)
El_Che ilmari: it sounds like spanish 10:02
10:19 domidumont left 10:27 Guest18 left
masak moritz: I don't think "complicated" is a fitting description for Finnish grammar -- some bits of it seem quite elegant 10:28
moritz: or, I think Finnish grammar is complicated mostly in the sense that *all* natural language grammars are complicated ;) 10:29
10:33 Xliff left 10:35 llfourn joined
Geth doc: 20fb6ce685 | (Elizabeth Mattijsen)++ | doc/Type/Attribute.pod6
is DEPRECATED on attributes works now
10:35
synopsebot_ Link: doc.perl6.org/type/Attribute
sarna ilmari: ah! I wanted to learn Finnish for some time, it was too hard though :( 10:42
ilmari El_Che: only as long as you consider 'll' and 'ch' single letters 10:58
masak: re. finnish grammar: there's lots of it, but again, it's very regular
the regularity (especially of the spelling/pronounciation) is down to the fact that the writing system was created by one guy in the 16th centruy 11:00
11:00 Summertime left
ilmari en.wikipedia.org/wiki/Finnish_lang...ing_system 11:00
11:01 Summertime joined 11:10 HaraldJoerg joined
lizmat
.oO( grammar Finnish is complicated { } )
11:15
a new trait is born :-)
huf somehow i think all natural languages are equally complicated 11:18
doing a constant brownian motion around the limit
lizmat
.oO( "we got the best language" :-)
11:19
11:23 psychoslave left, hankache joined, vike left
El_Che ilmari: good point, they *used* to be single letter 11:23
ilmari: the last to go was ch, very recently 11:24
(it had an apart entry in the dictionary: a, b, c, ch, d, e...
ilmari but now it just goes betwen cg and ci? 11:26
hankache .tell AlexDaniel You have mine regarding "do you give your permission to publish #p6dev logs (that may contain messages sent by you + join events) for the 2016-03-15 .. 2016-05-20 period? (the topic on that channel never said that it is being logged, which is why I ask)"
yoleaux hankache: I'll pass your message to AlexDaniel.
11:27 wamba left 11:28 Celelibi left
AlexDaniel . 11:29
yoleaux 11:26Z <hankache> AlexDaniel: You have mine regarding "do you give your permission to publish #p6dev logs (that may contain messages sent by you + join events) for the 2016-03-15 .. 2016-05-20 period? (the topic on that channel never said that it is being logged, which is why I ask)"
AlexDaniel thanks!
El_Che ilmari: no, the ch is dead 11:31
it's c+h
ll is interesting, as its pronounciation is region dependent 11:32
ilmari El_Che: yes, that's what I meant
El_Che ilmari: in that case, yes :)
damnlie: retweeted 11:36
damnlie Thanks El_Che :)
El_Che I feel like a hero, now 11:37
11:37 raschipi joined
El_Che good luck with the new location 11:38
11:38 vike joined
Geth perl6.org: hankache++ created pull request #115:
Convert remaining webchat.freenode.net links from http to https
11:38
perl6.org: 5b52bc0cd1 | (Naoum Hankache)++ | 2 files
Convert remaining webchat.freenode.net links from http to https
11:39
perl6.org: 27c9083a11 | (Elizabeth Mattijsen)++ (committed using GitHub Web editor) | 2 files
Merge pull request #115 from hankache/master

Convert remaining webchat.freenode.net links from http to https
damnlie El_Che: Hehe yeah. Maybe next yeae Utrecht again :) 11:41
11:42 psychoslave joined 11:43 hankache left 11:51 zakharyas left 11:52 Celelibi joined 11:56 AlexDaniel left 12:03 alpha6 left 12:04 alpha6 joined 12:09 imcsk8_ joined 12:13 imcsk8 left 12:16 Actualeyes left 12:21 silug joined 12:35 kurahaupo joined 12:43 subroot joined 12:44 psychoslave left, scovit joined 12:58 sarna left 13:00 mcmillhj joined 13:02 AlexDaniel joined 13:05 psychoslave joined
[Coke] reviews all the bee stuff here, and coincidentally saw a FB friend talking about the word hummadruz, which I had never heard of before today 13:25
jkramer [Coke]: And what does it mean? 13:31
Oh is it about that hum phenomena?
13:34 DeepIO left 13:36 mcmillhj left
[Coke] "Hummadruz is a low buzzing sound, typically heard outside.". most of his post is about how no one else seems to have this word for insect (typically bee) noise, but he grew up with it. 13:37
jkramer Well the mystery apparently has been solved. www.independent.co.uk/environment/...82111.html 13:38
13:38 AlexDaniel left 13:39 skids joined 13:40 AlexDaniel joined 13:48 mcmillhj joined 13:52 zakharyas joined, mcmillhj left, molaf joined 13:54 eliasr joined 13:57 noganex left 13:58 curan left, mcmillhj joined 14:03 mcmillhj left 14:04 mcmillhj joined 14:10 wamba joined 14:24 mcmillhj left 14:32 mcmillhj joined 14:37 mcmillhj left 14:42 silug left 14:43 mcmillhj joined 14:45 sarna joined 14:53 mcmillhj left 14:57 DeepIO joined, DeepIO left 15:06 mcmillhj joined 15:11 silug joined
El_Che I heard "Learning Perl6" is being sent to the printer in a few days. I only have the "get the product when it's fnished" perk from the kickstart campaign. In case rakudo-pkg would be mentioned, can someone ping me if something would need to be adapted? 15:13
15:18 robertle left 15:22 psychoslave left 15:24 noganex joined 15:38 Actualeyes joined 15:45 abraxxa joined 15:53 stee3 joined
buggable New CPAN upload: Sparrowdo-VSTS-YAML-Build-0.0.1.tar.gz by MELEZHIK cpan.metacpan.org/authors/id/M/ME/...0.1.tar.gz 15:55
New CPAN upload: Sparrowdo-VSTS-YAML-Build-0.0.2.tar.gz by MELEZHIK cpan.metacpan.org/authors/id/M/ME/...0.2.tar.gz
15:56 Zoffix joined 15:57 stee left
Zoffix El_Che: yeah, on 18th. Looking at the latest draft copy, I don't see rakudo-pkg mentioned at all. The Getting Rakudo section is barely a page long and just shows docker and choco install commands 15:58
yoleaux 11:04Z <jnthn> Zoffix: Commit access granted :)
16:01 wamba left 16:10 mcmillhj left 16:17 mcmillhj joined
ingy e: class Foo{}; my $f = Foo.new(); $f.sum(1,2,3) 16:20
evalable6 (exit code 1) Too many positionals passed; expected 1 argument but got 4
in block <unit> at /tmp/S0tgnZSrf5 line 1
ingy wtf
(why troubled Foo)
Zoffix ingy: sum takes a single arg, a list 16:21
e: class Foo{}; my $f = Foo.new(); $f.sum: (1,2,3)
evalable6 (exit code 1) Too many positionals passed; expected 1 argument but got 2
in block <unit> at /tmp/Muyrglqx_g line 1
Zoffix :(
Right, routine does :)
ingy zakharyas: sum is an undefined method of Foo
Zoffix: ^ 16:22
Zoffix ingy: it's inherited from Any
ingy that's so bad
Zoffix I kno
16:22 mcmillhj left
ingy ok 16:22
Zoffix Basically all List methods are available on all objects to support the "everything is a list" semantics
Some discussion on the topic in R#1575 16:23
synopsebot_ R#1575 [open]: github.com/rakudo/rakudo/issues/1575 [6.d][@LARRY] Arbitrary drift of methods to `Mu` and `Any`
ingy e: class Foo{}; my $f = Foo.new(); $f.join(1,2,3)
evalable6 (exit code 1) Too many positionals passed; expected 1 or 2 arguments but got 4
in block <unit> at /tmp/hl1ALj1EDP line 1
[Coke] m: e: class Foo{}; my $f = Foo.new(); $f.sum.say
camelia Cannot resolve caller Numeric(Foo: ); none of these signatures match:
(Mu:U \v: *%_)
in block <unit> at <tmp> line 1
16:23 robertle joined, domidumont joined
Zoffix e: class Foo { method Numeric { 42 } }; my $f = Foo.new; $f.sum.say 16:24
evalable6 42
Zoffix And lists are Cool, so all Cool methods are in Any too
ingy thanks for the info. back to the salt mines... 16:26
16:26 mcmillhj joined 16:27 huggable joined, ChanServ sets mode: +v huggable
raschipi m: say ().abs; Any.abs; # I can't call Cool methods on Any... 16:27
camelia 0
No such method 'abs' for invocant of type 'Any'
in block <unit> at <tmp> line 1
16:28 lizmat left 16:29 [Sno] left 16:31 mcmillhj left
Zoffix Yeah, I guess not all 16:33
16:34 AlexDaniel left
raschipi The error above is LTA, though. 16:35
Zoffix Why?
jnthn Cool methods aren't in Any 16:36
m: say Cool ~~ Any
camelia True
jnthn m: say Any ~~ Cool
camelia False
raschipi Oh no, it's not, sorry, I was confused.
Zoffix m: say List ~~ Cool 16:37
camelia True
16:37 Celelibi left
Zoffix And if we do "any value is a one-element list", then it's violated here. 16:37
raschipi Zoffix: So?
Why? 16:38
Zoffix (FWIW, I don't want to fattify Any with Cool methods, just saying).
m: my $list = <foo bar>; say $list.substr: 4
camelia bar
Zoffix m: my $list = class {}.new; say $list.substr: 4
camelia No such method 'substr' for invocant of type '<anon|1>'
in block <unit> at <tmp> line 1
Zoffix raschipi: ^ because it's not a list there. If a list has a substr, but I can't call substr. 16:39
16:39 dakkar left, Celelibi joined
raschipi I see, you mean we should stop pretending single values are just one element lists. 16:39
Zoffix No, that'd be pretty annoying in lots of cases. 16:40
But the cases like substr are in the same group. It's just there are fewer reasons to call .substr on a list than, say, .elems, so people don't notice it
16:40 mcmillhj joined
Zoffix And I guess this all points back to: Lists being Cool is slightly weird. 16:41
raschipi I see, lists are cool and (even one-element) Any is a list, therefore Any is cool 16:42
16:45 mcmillhj left
raschipi Not being able to cast Lists to Numeric or Str is not very good, if that's what you are suggesting. 16:48
Zoffix mhm 16:49
16:50 sarna_ joined 16:51 mcmillhj joined, mcmillhj left
raschipi If I may pick on you, I would guess you really want the language to not be "Perl". 16:52
Zoffix hehe. In some ways, I do want to get rid of all the magical special-cased DWIMMery and have as few special cases as possible. I suppose that is a goal away from "Perl". But above I was "mhm"ing to "not very good" part. I agree that lacking auto-coercion to Numeric would be annoying... To Str, dunno, less so. But when you get to something like .contains that actually treats the List as a Str instead of checking 16:55
the elements, that's where it becoems weird.
17:00 mcmillhj joined
raschipi You are proposing not having the following: 17:00
m: (1, 2, 3).say #? 17:01
camelia (1 2 3)
Zoffix That would still exist. .say/.print are Mu methods and .Str/.gist on List would still exist
17:02 sarna_ left
Zoffix m: say (1, 2, 3).uc 17:02
camelia 1 2 3
Zoffix This would be gone
Well, I'm not proposing anything. I think it's too late for such a huge change, but I'm just saying. If there were some new language.... ZofLang... 17:03
17:05 cognominal left 17:11 lizmat joined
buggable New CPAN upload: Perl6-US-ASCII-0.6.4.tgz by RONALDWS cpan.metacpan.org/authors/id/R/RO/...-0.6.4.tgz 17:15
17:15 sarna_ joined
El_Che Zoffix: thx for looking it up! 17:16
rindolf Hi all! would there be interest in a single git repo concentrating my pypy-vs-perl6 benchmarks?
El_Che rindolf: certainly
rindolf El_Che: ok 17:17
El_Che: i'll get to it?
El_Che: i'll get to it.
El_Che now; El_Che: i'll get to it! 17:18
:)
17:20 sno joined
Zoffix .seen FROGGZ 17:27
yoleaux I haven't seen FROGGZ around.
Zoffix .seen FROGGS
yoleaux I saw FROGGS 18 May 2018 13:46Z in #moarvm: <FROGGS> .tell lizmat This works in some way: github.com/FROGGS/P5__DATA__
rindolf El_Che: github.com/shlomif/perl6-benchmarks 17:36
sarna_ hey guys I can't install linenoise with zef
"use of Nil in string context", points to line 15
El_Che sarna_: what OS do you use? 17:37
sarna_ El_Che: opensuse tumbleweed 17:38
Zoffix New blog post: "A Call to Action: Polish Perl 6 First Steps Experience": rakudo.party/post/A-Call-To-Action...Experience
timotimo i think i've seen that message pop up a couple of times before?
El_Che sarna_: It's a know bug (I reported it here: github.com/hoelzro/p6-linenoise/issues/25) 17:39
sarna_: there are 2 alternatives, though
ingy echo '$*OUT.flush();' > test.t; prove --exec=perl6 test.t
test.t .. Cannot flush handle: Failed to flush filehandle: Operation not supported
El_Che you can run "rlwrap perl6" 17:40
ingy that reproduces the flush problem I had the other day
El_Che or install Readline
sarna_ alright, thanks :^)
ingy seems to fail under prove
Zoffix doesn't fail for me, sadly :(
ingy what OS?
Zoffix Bodhi Linux 17:41
El_Che sarna_: however, if your distro uses libreadline7, you'll need a work around. I reported this here: github.com/drforr/perl6-readline/issues/22
in short: zef install github.com/nxadm/perl6-readline.git
my fork for a patched readline module for recent distros
Zoffix e: BEGIN chdir '/tmp'; shell 「echo '$*OUT.flush();' > test.t; prove --exec=perl6 test.t」
El_Che (is call libreadline7
evalable6 (exit code 1) test.t ..
No subtests run

Test Summary Report
-------------------
test.t …
El_Che s)
evalable6 Zoffix, Full output: gist.github.com/45de700c0d6b6c91fe...962020c729
ingy seems to fail under prove on OSX
mcmillhj You can also install Linenoise I beleive 17:42
believe*
sarna_ El_Che: that works, thank you so much
timotimo rlwrap has some bonus extra features that are very nice
ingy Zoffix: my error message looks literal 17:43
timotimo for example if you're asynchronously printing stuff to the console, it won't split your input line in half
ingy I guess it can be tracked down
El_Che I hope drforr can look at the issue soon. Maybe after yapce
sarna_ o
Zoffix ingy: you mean where it is in the sauce?
ingy: I know where.
ingy url?
Zoffix ingy: " FWIW, this is the C code that does the flushing: github.com/MoarVM/MoarVM/blob/mast...#L224-L240 and MVM_platform_fsync is just mapped to fsync: github.com/MoarVM/MoarVM/blob/mast...rm/io.h#L8 " 17:44
sarna_ by the way, what do you guys recommend after reading perl6intro?
Zoffix perl6.party ! :) 17:45
El_Che moritz wrote Perl 6 fundamentals
from apress
Zoffix sarna_: dunno, there are a bunch of resources listed on perl6.org/resources/ I'm voting for: write some code as the next step :)
sarna_ alright, I'll check them out 17:46
also, I'll try to write some code, but that's the hard part
Zoffix ingy: and in Rakudo itself, it's just being flushed in IO::Handle.flush method here: github.com/rakudo/rakudo/blob/mast...e.pm6#L728
17:46 zachk joined 17:47 zachk left, zachk joined
ingy I wonder what sync is in github.com/MoarVM/MoarVM/blob/mast...ile.c#L227 17:47
El_Che we're not the only ones bitten by the readline changes: utcc.utoronto.ca/~cks/space/blog/l...adlineMess 17:48
sarna_ `[*] @1,2,3` - can I put custom functions in the brackets? 17:49
Zoffix sarna_: yes, as long as there are no spaces
sarna_ woo!
ingy Zoffix: the line before it does the flush, so I bet that prove turns on 'sync' whatever that is
Zoffix m: say [*.flip] <foo bar ber>
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing required term after infix
at <tmp>:1
------> 3say [*.flip] <foo bar ber>7⏏5<EOL>
expecting any of:
prefix
term
lizmat m: say [&flip] <foo bar ber>
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing required term after infix
at <tmp>:1
------> 3say [&flip] <foo bar ber>7⏏5<EOL>
expecting any of:
prefix
term
17:50
lizmat m: say [&flip] <foo bar ber>;
camelia 5===SORRY!5=== Error while compiling <tmp>
Missing required term after infix
at <tmp>:1
------> 3say [&flip] <foo bar ber>7⏏5;
expecting any of:
prefix
term
Zoffix sarna_: oh, and I guess it has to start with & too... This is a bit of an edge case in parsing, as it's ambiguous with the array constructor
m: say [[&{$^b~$^a}]] <foo bar ber> 17:51
camelia 5===SORRY!5=== Error while compiling <tmp>
Unable to parse expression in bracketed infix; couldn't find final ']' (corresponding starter was at line 1)
at <tmp>:1
------> 3say [[&7⏏5{$^b~$^a}]] <foo bar ber>
Zoffix :P 17:52
sarna_ Zoffix: why are <> used?
Zoffix m: say [[&substr]] <foo 2 ber>
camelia Cannot convert string to number: base-10 number must begin with valid digits or '.' in '3⏏5ber' (indicated by ⏏)
in block <unit> at <tmp> line 1
Zoffix bah, I give up :D
sarna_: <foo bar ber> is somewhat equivalent to ('foo', 'bar', 'ber'). except it's a lot easier to type
sarna_ Zoffix: can't I just ['foo', 'bar', 'ber'] as well? 17:53
Zoffix sarna_: yeah, though that's an Array, while with <foo bar ber> and ('foo', 'bar', 'ber') are Lists
sarna_ Zoffix: ah! thanks 17:54
Zoffix ingy: does this crash too? echo "foo" | perl6 -e '$*OUT.flush'
ingy: if sync is "this handle needs syncing", then we don't do buffering on STDOUT by default only if it's a TTY 17:55
and then making it a non a TTY would make sync true
17:56 cognominal joined
Zoffix m: sub foo { $^b ~ $^a }; say [[&foo]] <foo bar ber> 17:56
camelia berbarfoo
17:57 Zoffix left 18:00 abraxxa left 18:12 mcmillhj left 18:18 mcmillhj joined 18:20 domidumont left 18:24 sauvin left
buggable New CPAN upload: Perl6-US-ASCII-0.6.tar.gz by RONALDWS cpan.metacpan.org/authors/id/R/RO/...0.6.tar.gz 18:25
New CPAN upload: Perl6-US-ASCII-0.6.4.tar.gz by RONALDWS cpan.metacpan.org/authors/id/R/RO/...6.4.tar.gz
18:25 sena_kun left 18:28 AlexDaniel joined 18:31 sarna_ left 18:33 sarna_ joined 18:41 dogbert17 joined, zakharyas left 18:42 abraxxa joined 18:43 noganex left, abraxxa left 18:44 abraxxa joined 18:46 mcmillhj left
sarna_ are roles like interfaces? 18:46
raschipi sarna_: No.
El_Che sarna_: closer to abstract classes (if you have a java background) 18:47
raschipi Interfaces are interfaces. They're orthogonal to each other.
El_Che (closer != not the same)
sarna_ raschipi: ah, I haven't quite got to interfaces yet 18:48
El_Che: I don't know any Java ^^ but I think I'll figure it out
El_Che sarna_: it allows to compose behaviour
instead of inheritence
sarna_ El_Che: there are no interfaces in perl6 though, are there? 18:49
geekosaur not in the strict sense 18:50
El_Che sarna_: docs.perl6.org/language/glossary#i...-Interface
docs.perl6.org/language/glossary#Abstract_Class
sarna_ El_Che: I see, thanks :) 18:51
I'm not really good with OO
El_Che geekosaur: I don't feel like what's on the doc is 100% correct though
TimToady you can use roles as interfaces, but we also use them for several other things
geekosaur that's what I meant by strict sense
El_Che I see
geekosaur you can get most if not all of what people use interfaces for this way, but they're not 100% equal to interfaces as such
El_Che well, my remark is similar to your 18:52
s
geekosaur but this is confusing mechanism and design
sarna_ TimToady: like better multiple inheritance?
El_Che in java, eg you adhere to an interface
geekosaur mm, not quite what I am trying to say :(
El_Che in perl6 this stubbed interface give you some behaviour
so the other way around
hence, same-same but different 18:53
geekosaur note that the compiler does to some extent recognize stubbed-only methods and will give compile time rather than runtime errors if something is not implemented
El_Che adhere to interface <-> apply role (that requires extra behaviour)
I like roles better as it's easier to understand for me 18:54
less abstract
(ok, bad pun)
:)
TimToady basically, roles give you a knob you can tweak all the way from interfaces to generics
sarna_ o!
El_Che There Are Two Ways To Turn It 18:55
sarna_ that sounds really perly
TimToady and they can be used either at compile-time or run-time
at compile time they're like Smalltalk traits, while at run time they're mixins 18:56
El_Che \o/ 18:57
18:58 mcmillhj joined
TimToady so maybe it's more like a joystick than a knob... 18:58
timotimo i'd like to think of it as a Space Explorer 3d mouse
El_Che I like trackballs
19:00 espadrine joined
raschipi I will have eye tracking, thanks. 19:00
timotimo mhhh focus follows gaze
raschipi Well, focus follow focus. 19:01
follows*
timotimo focus follows function?
geekosaur wonders how that interacts with sometimes seeing saccades…
timotimo just debounce your eyeball 19:02
19:02 wamba joined
raschipi That's what calculus is for. 19:02
19:03 eliasr left, pecastro left
TimToady Doctors and dentists don't like calculus... 19:05
19:05 sarna left
ingy e: my $s = 'ohai'; my $r = rx/<$s>/; die $r.perl 19:05
evalable6 (exit code 1) rx/<$s>/
in block <unit> at /tmp/h_MjU6ucjy line 1
19:05 mr_ron joined
ingy is there a way I can see $r with $s expanded? 19:05
timotimo e: my $s = 'ohai'; my $r = EVAL "rx/$s/"; die $r.perl 19:06
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/pJTNjBeu4G
EVAL is…
timotimo, Full output: gist.github.com/c98ca57cc7ec764f9d...64b555d020
moritz I don't think so, just like you can't see a closed with the variables that it closes over expanded
timotimo e: use MONKEY; my $s = 'ohai'; my $r = EVAL "rx/$s/"; die $r.perl
evalable6 (exit code 1) rx/ohai/
in block <unit> at /tmp/6hidUmMqtz line 1
moritz *closure
ingy timotimo: if I make $r in one class and dump it in another, where do I put the Monkey? 19:08
19:09 comborico1611 joined
ingy realizes that so far perl6 for him is all about "Where do I put the Monkey?" 19:09
timotimo it goes where you use EVAL
i'd recommend putting it in the same curly block that does the eval
so its effect is limited
raschipi ingy: why do you need wonky features so much? 19:10
TimToady and if you put it in a real program, spell it out: use MONKEY-SEE-NO-EVAL;
ingy I'm writing a language in Perl6
with a full type system that needs to be in parity with perl6
19:11 gtodd joined, gtodd left
ingy you can see my talk on it at $yapc next tuesday 19:11
El_Che ingy: seen this? twitter.com/vmbrasseur/status/1005...4824916992
ingy El_Che: yeah :] 19:12
timotimo: can I compile time use that stuff, based on a env var? 19:13
19:13 sarna_ left
ingy that would work out good for me right now 19:13
I got the type system passing all test btw. Just a handful of tests to finish until the p6 version is fully caught up with the rest 19:14
timotimo you can always put a BEGIN block in most places 19:15
ingy btw has anyone written a pcre to p6rules converter module?
how would I use MONKEY based on env var 19:16
timotimo oh, no, that's not possible
ingy sorry for asking but it seems tricky
oh
timotimo i mean, it's possible, it just wouldn't make any sense
19:17 darutoko left
ingy why not? 19:17
timotimo because if you disable it, the code will just refuse to compile
so it'd be easier to BEGIN die "error" unless %*ENV<THE_ENV_VAR>
ingy I would put the eval code in one block with monkey and the no eval code in another
timotimo ok, but why would the MONKEY have to be disabled then? 19:18
19:18 bjht left
ingy I just want to set TESTML_DEVEL=1 to turn on certain debugging things 19:18
I don't need MONKEY after it's working
timotimo that's why the MONKEY goes in the block, so that it has no effect outside of there 19:19
an alternative is to have two modules and you load one or the other based on if the env var is set or not
ingy ok, MONKEY has no other bad effects?
timotimo or there's just one module that monkey-patches the function, then you have two MONKEYs, but it'd be fine 19:20
MONKEY just allows you to use certain features
ingy I'll just comment out the MONKEY when it all works
cool. thanks
timotimo well, the MONKEY and the EVAL
mr_ron The Dist source and repository links for my CPAN US-ASCII dist are broken. Any suggestions where to look for problems? modules.perl6.org/dist/US-ASCII:cpan:RONALDWS 19:21
19:23 noganex joined
timotimo hm, the build log isn't very enlightening. though perhaps it's confused because it's both on the ecosystem and on cpan? 19:23
19:30 cpage left 19:31 Schepeers left 19:33 Schepeers joined
ingy btw has anyone written a pcre to p6rules converter module? I could use that... Or I could write one. 19:34
timotimo i seem to recall two different projects to do code translation, there's probably some regex pieces in there
19:34 abraxxa left
ingy or just a general pcre p6rules grammar 19:34
raschipi There goes ingy, writing another compiler.
geekosaur used to do that too. he got over it :p
ingy I write 6 compilers before breakfast 19:35
timotimo do you perhaps want to instead add more features to perl6's pcre impl?
ingy at least that's not a new language
jnthn The grammar that's behind the :P5 regex support can be found in the NQP repository
19:36 dct joined
ingy timotimo: actually last time I checked here :P5 wasn't even in rakudo 19:36
so whaat I really want right now is to see how that works!
geekosaur m: say "abracadabra" ~~ m:P5/c.d/ 19:37
camelia 「cad」
ingy e: "I like pcre" ~~ m:P5/ke pc/
evalable6
geekosaur looks there to me
timotimo wow, that must have been really long ago
ingy it was over a year for sure 19:38
timotimo :P5 has already been partially there when i came to the project
ingy e: "I like pcre" ~~ m:P5/ke\spc/
evalable6
timotimo was a portion of it added by froggs when he was working on v5?
ingy e: "I like pcre" ~~ m:P5/ke.pc/ 19:39
evalable6
timotimo you want to output something?
ingy thanks
e: say "I like pcre" ~~ m:P5/ke.pc/
evalable6 「ke pc」
ingy e: say "I like pcre" ~~ m:P5/ke pc/
evalable6 「ke pc」
ingy this is payback for 2 days of suffering. thanks!!! 19:40
timotimo it's missing a bunch of things, though
ingy and yes, if I hack on anything in rakudo it will likely be that
maybe I can repay you at the hackathon next week 19:41
e: my $r = rx:P5/ke pc/; say "I like pcre" $r 19:43
evalable6 (exit code 1) 04===SORRY!04=== Error while compiling /tmp/LLRlArPD9g
Two ter…
ingy, Full output: gist.github.com/d9d8121bf29cbbcba6...d5b7adb437
ingy e: my $r = rx:P5/ke pc/; say "I like pcre" ~~ $r
evalable6 「ke pc」
19:45 robertle left 19:46 damnlie left
Geth perl6-mode: cc28223bb7 | (Tom Browder)++ | 2 files
add new name categories and other improvements

  + add regex, token, rule, and grammar categories for Perl 6
  + allow '::' in identifiers in certain positions
  + add appropriate regexes for the new categories
  + add new categories to the menu list
  + add new categories to the Perl 6 test file
19:46
19:49 damnlie joined 19:50 abraxxa joined 19:51 Zoffix joined
Zoffix mr_ron: it's a bug on modules site. 1 sec 19:55
19:59 cpage joined
Geth modules.perl6.org: 469084c55f | (Zoffix Znet)++ (committed using GitHub Web editor) | lib/ModulesPerl6/DbBuilder/Dist/Source/CPAN.pm
Normalize `git@github.com:` meta urls for repo URLs
19:59
ingy e: my $s = 'ke pc'; my $r = rx:P5/$s/; say "I like pcre" ~~ $r 20:00
evalable6 「ke pc」
ingy e: my $s = 'ke pc'; my $r = rx:P5/<$s>/; say "I like pcre" ~~ $r
evalable6 Nil
tbrowder_ for emacs users, perl6-mode (on github/perl6) has had a bit of love, testing by other users would be very welcome. 20:01
Zoffix e: my $s = 'ke pc'; my $r = rx:P5/<$s>/; say "I li<ke pc>re" ~~ $r
evalable6 「<ke pc>」
20:02 sarna joined
Zoffix mr_ron: heh, well, that got rid of the colon but not much else... I'm gonna fix it in about 1½ hours. 20:03
|2hr modules.perl6.org bug bruh
|2h modules.perl6.org bug bruh
ZofBot Zoffix, Will remind you on 2018-06-13T18:03:37.637098-04:00 about modules.perl6.org bug bruh
20:03 Zoffix left
mr_ron If you need me to remove from ecosystem let me know ... 20:04
20:05 pecastro joined
ingy all regex tests passing! 20:13
next...
20:23 mcmillhj left 20:24 pecastro left 20:27 mcmillhj joined
Geth doc: 724d2ddcca | (Tom Browder)++ (committed using GitHub Web editor) | doc/Language/syntax.pod6
index Identifier(s)
20:32
synopsebot_ Link: doc.perl6.org/language/syntax
20:38 |oLa| joined 20:48 jmerelo joined 20:50 pecastro joined
buggable New CPAN upload: FINALIZER-0.0.1.tar.gz by ELIZABETH cpan.metacpan.org/authors/id/E/EL/...0.1.tar.gz 20:55
lizmat wee! Zoffix++ ^^^ 20:56
Geth doc: 534afbc9d5 | (JJ Merelo)++ | doc/Language/syntax.pod6
Some reflow and rephrasing
21:00
synopsebot_ Link: doc.perl6.org/language/syntax
21:05 cognominal left
jmerelo Well 21:07
raschipi Spring 21:08
geekosaur hole in the ground? 21:09
21:10 MasterDuke joined, cognominal joined, Schepeers left
jmerelo goes afk. Have a good night/evening/whatever 21:11
lizmat jmerelo: good night!
21:11 Schepeers joined, pecastro left
buggable New CPAN upload: FINALIZER-0.0.2.tar.gz by ELIZABETH cpan.metacpan.org/authors/id/E/EL/...0.2.tar.gz 21:15
21:15 jmerelo left
rindolf github.com/shlomif/perl6-benchmarks - this repo has two benchmarks now as well as Readme and license files 21:16
MasterDuke rindolf: have you seen github.com/japhb/perl6-bench ? maybe you could extend it to support python/pypy and merge your repo in 21:21
yoleaux 11:05Z <jnthn> MasterDuke: I've granted you push access to the Rakudo repo; please let me know if any problems :)
MasterDuke .tell jnthn great, thanks! 21:22
yoleaux MasterDuke: I'll pass your message to jnthn.
rindolf MasterDuke: no, i didnt see this
21:29 raschipi left 21:30 mcmillhj left 21:42 skids left 21:45 markoong joined
ingy I find myself wanting to mutate a var declared in a method signature quite often 21:50
is there a prevalent style for that?
geekosaur if you want it mutable only locally, 'is copy'; if it's to be visible to the caller, 'is rw' 21:51
ingy sub foo ($a=Nil) { $a = " - $a" if $a; ... }
how would I add is... to that? 21:52
geekosaur ($a is copy = Nil)
ingy yay. thx!
geekosaur m: sub foo ($a is copy = Nil) { $a = 5 }
camelia ( no output )
21:53 rindolf left
ingy :) 21:53
22:01 HaraldJoerg1 joined
lizmat ingy: sub foo ($a = Nil) { ... } doesn't make much sense, as $a will still be (Any) if the parameter is not specified 22:01
ingy: is that what you were going for ? 22:02
22:03 HaraldJoerg left
Geth ecosystem: dcfaf58c52 | (Ronald Schmidt)++ (committed using GitHub Web editor) | META.list
Update META.list move US-ASCII to CPAN
22:04
geekosaur I had considered asking about that 22:05
Nil on something without a declared type doesn't seem useful 22:06
22:09 aindilis left 22:10 aindilis joined, imcsk8_ left 22:12 sarna left, wamba left 22:13 |oLa| left, Railalis joined
Railalis Hello, I am having an issue trying to create a 2D array which belongs to a class. 22:14
how is `has UInt @.arr[24;2] is rw;` invalid? rakudo wants me to use the kv method..? 22:15
22:16 |oLa| joined
El_Che m: class FooBar { has UInt @.arr[24;2] is rw }; say FooBar.new 22:16
camelia FooBar.new(arr => Array[UInt].new(:shape(24, 2), [UInt, UInt], [UInt, UInt], [UInt, UInt], [UInt, UInt], [UInt, UInt], [UInt, UInt], [UInt, UInt], [UInt, UInt], [UInt, UInt], [UInt, UInt], [UInt, UInt], [UInt, UInt], [UInt, UInt], [UInt, UInt], [UInt,…
Railalis that's not the output I get hmm.
b2gills ingy: Nil is the reset to default value, and the return this if I don't know what else to return value
22:18 imcsk8 joined
El_Che m: say $*VM 22:18
camelia moar (2018.05.121.g.6302.ca.74.e)
b2gills Basically `= Nil` doesn't do anything in a signature
El_Che I am running 2018.05 22:19
Railalis Ok, I figured it out, apparently I had a syntax error. Thanks El_Che
El_Che Railalis: I just copypasted what you had :) 22:20
Railalis Yea the syntax error was somewhere else and was giving the same error as before, so the line number changed and I didn't notice.
El_Che ah ok 22:21
buggable New CPAN upload: FINALIZER-0.0.3.tar.gz by ELIZABETH modules.perl6.org/dist/FINALIZER:cpan:ELIZABETH 22:25
22:31 mcmillhj joined 22:35 dct left 22:36 mcmillhj left 22:38 lizmat left
Railalis Is there a constructor I can overwrite or a function I can hook into on a classes instantiation? 22:43
or do I just need to call some public method immediately after doing so?
Juerd Railalis: Each of those options is available. 22:44
22:45 Grrrr left
Railalis how? I'm looking through documentation but I think I'm on the wrong page.. 22:45
Juerd docs.perl6.org/language/classtut
Railalis ty
Juerd If you're okay with the default object construction and just want some code to be run after the object is instantiated, provide a method called TWEAK 22:46
Railalis well.. I guess I should have guessed that.
Well, it's going be ran everytime the class instanciates so
it's not really a tweak persay 22:47
Juerd Do you want to change the object construction itself? 22:48
Railalis oh I see.. it's so you don't have to deal with passing in parameters and creating the object.
I don't have any parameters, just some logic that needs to be done.
Juerd I find that most of the time I just want to let the default mechanisms handle construction of the new object, after which I come in and ruin^Wrun some extra code :)
Railalis I guess tweak works.
yea 22:49
22:49 Grrrr joined
Juerd If you want to do things with side-effects (like establishing a connection), you may want to consider just letting the user of your class call a method instead. 22:50
Railalis I'm not doing anything that advanced :)
Juerd Not yet :)
Railalis Yup. I have to learn perl6 first 22:51
22:54 lizmat joined, zachk left 23:01 wamba joined
Railalis How do you do multiple constraints on a subset type? 23:10
timotimo usually making a junction with & works
Railalis A tut I am looking at says use multiple where keywords but I'm getting an error with that. 23:11
the junction errored saying that the operator was useless
timotimo can you show the code?
Railalis m: subset Test of UInt where * <= 6 && * > 0; 23:12
camelia WARNINGS for <tmp>:
Useless use of ">" in expression "* > 0" in sink context (line 1)
Railalis m: subset Test of UInt where * <= 6 where * > 0;
camelia 5===SORRY!5=== Error while compiling <tmp>
Two terms in a row
at <tmp>:1
------> 3subset Test of UInt where * <= 67⏏5 where * > 0;
expecting any of:
infix
infix stopper
postfix
statement en…
MasterDuke m: subset Test of UInt where 0 < * <= 6; 23:13
camelia ( no output )
Railalis that's different
thanks MasterDuke 23:14
timotimo a junction would have been with & instead of &&
but that could also have not worked
in any case, for more complicated situations, where also takes a block
MasterDuke m: subset Test of UInt where { $_ <= 6 && $_ > 0 }
camelia ( no output )
Railalis Good to know. 23:15
MasterDuke fyi, multiple *s usually (always?) each refer to their own thing, not the same thing 23:17
Railalis What do you mean?
MasterDuke (that was worded very poorly)
Juerd In the expression "* <= 6 && * > 0", the first * and the second * are not the same parameter. 23:18
23:18 skids joined
Railalis Because multiple parameters can be passed in? Or there can be modified? 23:18
or it can be8 23:19
geekosaur each one will be a separate parameter
Railalis man my typing is on point today
timotimo MasterDuke: there's at least the case with postcircumfix:<[ ]>, aka array access, where it asks the WhateverCode how many parameters it takes and it feeds the same value into every parameter
MasterDuke Juerd++, better wording
23:19 mcmillhj joined
timotimo better wording through chemistry? 23:19
Juerd Railalis: "* > 5" is short for "{ $^a > 5 }", and "* > 5 && * < 9" is short for "{ $^a > 5 && $^b < 9 }" 23:20
MasterDuke timotimo++, i thought there was an exception, but couldn't think of it
Railalis I see
Juerd Railalis: For a where clause on a UInt, I don't think a second parameter makes much sense, but I may be mistaken.
Railalis UInt can be 0, it's a non-negative
0 isn't negative or positive
that said, it's overkill for what I am doing 23:21
MasterDuke i think he means two different parameters don't make sense, not two conditionals on one parameter
Railalis I wasn't trying to do two parameters at all, I'm just a noob. 23:23
23:23 mcmillhj left
Juerd Railalis: But you did have two parameters, because you used * twice in the same expression :) 23:24
timotimo actually i'd call 0 positive, just because there's also -0
Juerd Railalis: It's hard for me to guess whether that was a mistake, or whether I misinterpret what you wanted to do
Railalis It makes sense. I just thought it would be like conditionals in other languages. Need more? pipe it. But that's not really what is going on. 23:25
Naw, zero is neither. Because positive and negative is defined by zero. 23:26
Juerd Railalis: You can definitely use && to provide two conditionals, but not with "*"
Railalis So what about something like subset Bit of UInt where * == 0 | * == 1
Juerd Actually, considering the amount of people that guess the meaning of * wrong, I'm beginning to think this language feature is in violation of the principle of least surprise :)
Railalis not that I'd ever write that. 23:27
Juerd Railalis: Assuming you meant numeric bitwise OR, that's written as +| in Perl 6
| creates a junction (as in $foo == 5 | 6, which evaluates to True if $foo == 5 or $foo == 6)
Railalis yea 23:28
so you would do * == 6 | 5
geekosaur but it's still two *s so two separate parameters
Railalis hmm
Juerd Railalis: To use the same parameter twice, you can't use * for it. Instead, use a block with {} and the ^ twigil (e.g. $^a) to refer to the parameter.
23:28 HaraldJoerg1 left
Juerd Railalis: "where { $^a <= 6 && $a > 0 }" is an option. 23:29
(The second time, the ^ can be left out.)
TimToady or just use $_ both times
Railalis that makes no sense imo
yea I was wondering if I could do that Tim
timotimo why would 0 <= * <= 6 not work? 23:30
Railalis it does
timotimo or 0..6?
Juerd TimToady: My mind won't remember which things topicalize and which won't...
TimToady or just write a full-on lambda with -> $x { $x <= 6 && $x > 0 }
timotimo OK
Railalis so unrelated question
23:31 mcmillhj joined, wamba left
Railalis has Str @.arr[5] is rw, doesn't let me modify the strings within methods 23:31
but needs to be public
timotimo from within the class you can access the attribute directly with @!arr rather than go through the accessor it makes for you under the name @.arr 23:32
Railalis regardless of how it is declared? 23:33
that's nice.
timotimo (because @.arr is sugar for @(self.arr))
TimToady the rw refers to the attribute as a whole, so is enabling @.arr = @foo
or some such
Railalis So can the values ever be changed outside of the class?
TimToady but what timotimo said about @!arr
you don't want to go through the virtual interface on every array access 23:34
geekosaur Juerd, not "can be", "must be'
which I still consider a misfeature, but every time I bring up a misfeature it turns out that I am expected todownload some dev's brain before using it because it makes perfect sense to that dev
and is therefore supposed to be intuitively obvious to me 23:35
Juerd geekosaur: I remember not leaving it out, and discovering on irc that it could be left out.
Railalis geekosaur, you're saying you don't like filing away in your brain a million facts on how two very specific things operate with eachother?
geekosaur Juerd, backwards
23:36 mcmillhj left
geekosaur use $^a tewice and you get a redeclaration error, at least in recent rakudo 23:36
Juerd m: { say "$^a/$^a $^b/$^b" }(4, 2)
camelia 4/4 2/2
geekosaur oh, so that has been changed. I definitely got redeclaration the other day, as did someone else who was trying it
it's on one of the mailing lists
Railalis so what is $!var sugar for?
if $.var = $(self.var) 23:37
geekosaur it;s not sugar, it's the actual name of the private var
MasterDuke geekosaur: that rings a bell, but i don't remember the specific situation
TimToady for direct access to the storage location inside the method
Railalis oh ok
Juerd Railalis: It's actually the syntax "has $.var" that's sugar :)
geekosaur $.var is sugar for an accessor method on the corresponding $!var
Railalis got it
geekosaur MasterDuke, Todd copy-pasted a sort function and git that error 23:38
goot
then I got it while trying to fix the original
*got
sheesh
I was … not amused.
jnthn ah, finally figured 23:40
yoleaux 21:22Z <MasterDuke> jnthn: great, thanks!
jnthn uh, wrong window
TimToady figures 23:41
23:41 abraxxa left, markoong left
geekosaur Railalis, it was more the attitude I got back that was frustrating 23:41
"it makes sense to me, its supposed to make sense to you" with implied "…moron" in the tone of the response 23:42
Railalis Hmm?
What are we talking about?
geekosaur [13 23:35:39] <Railalis> geekosaur, you're saying you don't like filing away in your brain a million facts on how two very specific things operate with eachother?
every language has its own behaviors and its own itches.
Railalis Oh no no, I was being sarcastic 23:43
geekosaur attitude when replying to someone mentioning same counts for something
TimToady I took it as mere irony
geekosaur I might have if that hadn't been like the 3rd time it had happened to me (plus several others aimed at other people)
MasterDuke m: my @a = (^5).pick(*); dd @a; @a .= sort({ $^a.uc and $^a.lc }); dd @a # geekosaur, seems to work ok here
camelia Array @a = [1, 0, 4, 2, 3]
Array @a = [0, 1, 2, 3, 4]
geekosaur there's a reason I don;t hang out in the p5 community and attitudes like that are a large part of it
Railalis We shouldn't have to do that, a lot of languages or computer science as a whole kind of accepts it, but it shouldn't be. 23:44
geekosaur disagree, there
everyone has different conventions, and...
in p6 dev there's a saying: every DWIM comes with a WAT
make it work "as expected" for one person, you'll produce weird behavior in some other case and/or break someone else's brain 23:45
Railalis that's fair
23:45 mcmillhj joined
Railalis but I think we should keep it simple 23:45
TimToady we also have the DIHWIDT principle 23:46
geekosaur simple in what dimension?
that one's not as easy as it sounds either
Railalis TimToady: idk that one 23:47
geekosaur "doctor, it hurts wen I do this"
("well, don't do that then", as the old joke goes)
*when
MasterDuke TimToady: are you the one who coined the phrase "water-bed theory of complexity"?
Railalis haha
that's an image 23:48
TimToady actually, it was one of our linguistic professors at college
but I stole it
Railalis (I'm going to steal it) 23:49
23:50 mcmillhj left
Railalis So within a method I'm making I still can't change the value of a string in an array. 23:51
which means I'm probably going about this the wrong way, for @!arr -> $i { $i = ""; } 23:52
23:53 w_richard_w joined
TimToady for @!arr -> $i is rw { $i = "" } 23:53
or
Railalis tried that
TimToady for @!arr <-> $i { $i = "" }
Railalis says Str is immutable
idk that operator let me look it up
TimToady then you didn't actually initialize an array there, but probably bound a list
how did you set up the original value?
geekosaur Railalis, you want "pointy blocks" 23:54
it's not an operator as such
Railalis the original value hasn't been set
so <-> = -> bar is rw ?
yes 23:55
MasterDuke m: class A { has @.a[4]; method foo() { for @!a -> $a is rw { $a = "a" } } }; my $b = A.new; $b.foo; dd $b.a
camelia Array.new(:shape(4,), ["a", "a", "a", "a"])
TimToady sounds like your array is directly full of Str rather than Scalar containers 23:56
Railalis Probably.
class Stupidgame { subset Point of Str where *.chars <= 5; has Point @.board[24] is rw; } 23:57
essentially
MasterDuke m: class A { subset Point of Str where *.chars <= 5; has Point @.a[4]; method foo() { for @!a -> $a is rw { $a = "a" } } }; my $b = A.new; $b.foo; dd $b.a 23:58
camelia Array[A::Point].new(:shape(4,), ["a", "a", "a", "a"])
MasterDuke Railalis: fwiw, you don't need the 'is rw' 23:59
TimToady are you trying to do this in a BUILD method?
Juerd Railalis: Note that the default signature for for is "$_ is rw", so you can just write "for @!a { $_ = "x" }"
Railalis that works