Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-09-05

Perl 6 | Reference Documentation | Rakudo

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:02 itaipu joined #perl6
00:12 itaipu joined #perl6
00:21 pierre_ joined #perl6
00:37 AlexDaniel .tell mst wasn't it fixed? http://irclog.perlgeek.de/p​erl6/2016-09-04#i_13148724
00:37 yoleaux AlexDaniel: I'll pass your message to mst.
00:43 poohman joined #perl6
00:58 buggable joined #perl6
00:58 huggable joined #perl6
00:59 NeuralAnomaly joined #perl6
01:06 pierre_ Hi
01:06 Zoffix joined #perl6
01:06 Zoffix Is Daniel Leidisch around?
01:06 pierre_ is there anyway to put a reference to a method in an attribute and calling it afterward?
01:06 pierre_ m: class c { has &.m; method m1() { say "boum!";}; method m2() { &!m = &self.m1; };  }; my $i = c.new; $i.m1(); $i.m2(); $i.m.()
01:06 camelia rakudo-moar e39ab8: OUTPUT«boum!␤Cannot invoke this object (REPR: Uninstantiable; Callable)␤  in block <unit> at <tmp> line 1␤␤»
01:07 poohman joined #perl6
01:07 Zoffix m: class c { has &.m; method m1() { say "boum!";}; method m2() { &!m = self.^find_method('m1'); };  }; my $i = c.new; $i.m1(); $i.m2(); $i.m()
01:07 camelia rakudo-moar e39ab8: OUTPUT«boum!␤»
01:08 Zoffix Oh, never mind. RT was hiding part of the ticket... I now see what the issue reported by Daniel is.
01:08 pierre_ hum, indeed, the find_method work
01:09 Zoffix Does it? Why is there just one boum
01:09 pierre_ oh, right,
01:09 pierre_ i misread
01:09 Zoffix m: class c { has &.m; method m1() { say "boum!";}; method m2() { &!m = self.^find_method('m1'); };  }; my $i = c.new; $i.m2(); $i.m.($i)
01:09 camelia rakudo-moar e39ab8: OUTPUT«boum!␤»
01:09 Zoffix m: class c { has &.m; method m1() { say "boum!";}; method m2() { &!m = sub { self.m1 }; };  }; my $i = c.new; $i.m2(); $i.m.($i)
01:09 camelia rakudo-moar e39ab8: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤  in sub  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
01:10 Zoffix m: class c { has &.m; method m1() { say "boum!";}; method m2() { &!m = sub { self.m1 }; };  }; my $i = c.new; $i.m2(); $i.m.()
01:10 camelia rakudo-moar e39ab8: OUTPUT«boum!␤»
01:10 Zoffix There may be a better way.
01:10 Zoffix left #perl6
01:11 pierre_ m: class c { has &.m is rw; }; sub foo { say "Boum!";}; my $i = c.new; $i.m = &foo; $i.m.()
01:11 camelia rakudo-moar e39ab8: OUTPUT«Boum!␤»
01:11 pierre_ i can still use a closure for now, it will work indeed
01:13 labster joined #perl6
01:13 pierre_ m: class c { has &.m; method m1($what) { say "boum $waht"; }; method m2() { &!m = sub { self.m1(@_) }; }; };my $i = c.new; $i.m2(); $i.m.("foo")
01:13 camelia rakudo-moar e39ab8: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$waht' is not declared. Did you mean '$what'?␤at <tmp>:1␤------> 3{ has &.m; method m1($what) { say "boum 7⏏5$waht"; }; method m2() { &!m = sub { sel␤»
01:13 pierre_ m: class c { has &.m; method m1($what) { say "boum $what"; }; method m2() { &!m = sub { self.m1(@_) }; }; };my $i = c.new; $i.m2(); $i.m.("foo")
01:13 camelia rakudo-moar e39ab8: OUTPUT«boum foo␤»
01:14 rodarmor joined #perl6
01:14 pierre_ m: class c { has &.m; has $.bar="baz"; method m1($what) { say "boum $what $.bar"; }; method m2() { &!m = sub { self.m1(@_) }; }; };my $i = c.new; $i.m2(); $i.m.("foo")
01:14 camelia rakudo-moar e39ab8: OUTPUT«boum foo baz␤»
01:16 pierre_ m: class c { has &.m; has $.bar="baz"; method m1($what) { say "boum $what $.bar"; }; method m2() { &!m = sub { self.m1 }; }; };my $i = c.new; $i.m2(); $i.m.("foo")
01:16 camelia rakudo-moar e39ab8: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤  in sub  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
01:20 pierre_ joined #perl6
01:27 pierre_ m: class c { has &.m; has $.bar="baz"; method m1() { say "boum $.bar"; }; method m2() { &!m = &{self.m1};} };my $i = c.new; $i.m2(); my $callable = $i.m; $i.$callable()
01:27 camelia rakudo-moar e39ab8: OUTPUT«boum baz␤»
01:28 pierre_ m: class c { has &.m; has $.bar="baz"; method m1() { say "boum $.bar"; }; method m2() { &!m = &{self.m1};} };my $i = c.new; $i.m2(); $i.m.()
01:28 camelia rakudo-moar e39ab8: OUTPUT«boum baz␤»
01:28 pierre_ m: class c { has &.m; has $.bar="baz"; method m1( $str ) { say "boum $.bar $str"; }; method m2() { &!m = &{self.m1};} };my $i = c.new; $i.m2(); $i.m.("Test")
01:28 camelia rakudo-moar e39ab8: OUTPUT«Too few positionals passed; expected 2 arguments but got 1␤  in method m1 at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
01:29 pierre_ m: class c { has &.m; has $.bar="baz"; method m1( $str ) { say "boum $.bar $str"; }; method m2() { &!m = &{self.m1};} };my $i = c.new; $i.m2(); $i.{$i.m}("Test")
01:29 camelia rakudo-moar e39ab8: OUTPUT«Type c does not support associative indexing.␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
01:29 pierre_ m: class c { has &.m; has $.bar="baz"; method m1( $str ) { say "boum $.bar $str"; }; method m2() { &!m = &{self.m1};} };my $i = c.new; $i.m2(); $i.&{$i.m}("Test")
01:29 camelia rakudo-moar e39ab8: OUTPUT«Too many positionals passed; expected 0 or 1 arguments but got 2␤  in block <unit> at <tmp> line 1␤␤»
01:30 NeuralAnomaly joined #perl6
01:40 poohman joined #perl6
01:46 TEttinger joined #perl6
01:46 BillSussman joined #perl6
01:47 ilbot3 joined #perl6
01:47 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:52 parabolize joined #perl6
01:56 zengargoyle hrm, rakudobrew vs debian unstable is unhappy because of removal of '.' from @INC in perl5
02:01 zengargoyle PERL_USE_UNSAFE_INC=1 tweaks /etc/perl/sitecustomize.pl for a quick workaround.
02:04 zengargoyle wondering if p6doc needs to put docs in ~/.perl6/doc ... why not site?
02:06 zengargoyle zef install Task::Star fails even though all dependencies installed.
02:06 * zengargoyle random graaaaaring after not having played with p6 much in a few months. :)
02:10 poohman joined #perl6
02:24 zacts joined #perl6
02:26 zacts joined #perl6
02:30 pierre_ joined #perl6
02:31 Shantanu1 joined #perl6
02:34 noganex joined #perl6
02:36 poohman joined #perl6
02:38 pierre_ joined #perl6
02:41 cdg joined #perl6
02:50 poohman joined #perl6
02:53 sammers joined #perl6
03:00 wamba joined #perl6
03:03 BenGoldberg m: class c { has &.m; method m1() { say "boum!";}; method m2() { &!m = &self.m1; };  }; my $i = c.new; $i.m1(); $i.m2(); $i.m.($i)
03:03 camelia rakudo-moar 77d9d4: OUTPUT«boum!␤Cannot invoke this object (REPR: Uninstantiable; Callable)␤  in block <unit> at <tmp> line 1␤␤»
03:03 poohman joined #perl6
03:04 BenGoldberg m: class c { has &.m; method m1() { say "boum!";}; method m2() { &!m = &self.m1; };  }; my $i = c.new; say &{$i.m}
03:04 camelia rakudo-moar 77d9d4: OUTPUT«-> ;; $_? is raw { #`(Block|79794864) ... }␤»
03:04 BenGoldberg m: class c { has &.m; method m1() { say "boum!";}; method m2() { &!m = &self.m1; };  }; my $i = c.new; my $c = &{$i.m}; say $c()
03:04 camelia rakudo-moar 77d9d4: OUTPUT«(Callable)␤»
03:05 BenGoldberg m: class c { has &.m; method m1() { say "boum!";}; method m2() { &!m = &self.m1; };  }; my $i = c.new; my $c = &{$i.m}; say $c()()
03:05 camelia rakudo-moar 77d9d4: OUTPUT«Cannot invoke this object (REPR: Uninstantiable; Callable)␤  in block <unit> at <tmp> line 1␤␤»
03:05 BenGoldberg m: class c { has &.m; method m1() { say "boum!";}; method m2() { &!m = &self.m1; };  }; my $i = c.new; my $c = &$i::m; say $c
03:05 camelia rakudo-moar 77d9d4: OUTPUT«(Any)␤»
03:05 BenGoldberg m: class c { has &.m; method m1() { say "boum!";}; method m2() { &!m = &self.m1; };  }; my $i = c.new; my $c = &$i::m1; say $c
03:05 camelia rakudo-moar 77d9d4: OUTPUT«(Any)␤»
03:13 araujo__ joined #perl6
03:17 sammers hi perl6
03:25 shantanu sammers: Hi
03:26 poohman joined #perl6
03:32 shantanu Is there a imaging library binding available on Perl6 yet? GD preferably, Pango or ImageMagick?
03:33 sammers shantanu, take a look at these http://modules.perl6.org/#q=gd
03:34 shantanu hah thanks! How did  i miss that??
03:35 sammers I have played around with the first one on the list, perl6-GD, it works, but is missing a bit. you might have you `panda --force --notests install GD` to get it installed
03:36 shantanu ahh
03:36 shantanu does it support getting individual pixel data yet?
03:38 shantanu ahhh yeah it supports more "drawing" methods than "reading image data" methods. Unfortunately I need to read image data.
03:41 sammers yeah, that is what I was running into, it is pretty easy to add to however. I ended up just using `run` and the gd commands for a quick script I was working on.
03:43 ShimmerFairy joined #perl6
03:52 sammers m: my Str @arr1 = "array", "of", "strings"; say @arr1.WHAT; sub expect-str-array(Str @arr) { @arr.WHAT.say }; expect-str-array(@arr1);
03:52 camelia rakudo-moar 77d9d4: OUTPUT«(Array[Str])␤(Array[Str])␤»
03:52 sammers m: my Str @arr1 := "array", "of", "strings"; say @arr1.WHAT; sub expect-str-array(Str @arr) { @arr.WHAT.say }; expect-str-array(@arr1);
03:52 camelia rakudo-moar 77d9d4: OUTPUT«Type check failed in binding; expected Positional[Str] but got List ($("array", "of", "str...)␤  in block <unit> at <tmp> line 1␤␤»
03:53 sammers is there a way to bind a typed array?
03:54 geekosaur m: my Str @arr1 := ["array", "of", "strings"]; say @arr1.WHAT; sub expect-str-array(Str @arr) { @arr.WHAT.say }; expect-str-array(@arr1);
03:54 camelia rakudo-moar 77d9d4: OUTPUT«Type check failed in binding; expected Positional[Str] but got Array ($["array", "of", "str...)␤  in block <unit> at <tmp> line 1␤␤»
03:55 geekosaur hm, that doesn't seem like what I'd expect :/
03:55 sammers yeah, I have been messing with these examples: https://rosettacode.org/wiki/​Enforced_immutability#Perl_6
03:56 sammers trying to make an immutable List / Array
03:56 sammers I think there is probably a really obvious, simple way to accomplish this that I am just unaware of.
04:06 grondilu joined #perl6
04:08 pierre_ joined #perl6
04:09 pierre_ joined #perl6
04:14 Cabanossi joined #perl6
04:21 notbenh joined #perl6
04:26 notbenh joined #perl6
04:27 zengargoyle m: my @arr1 := Array[Str].new('array','of','string');sub expect-str-array(Str @arr) { @arr.WHAT.say };expect-str-array(@arr1);
04:27 camelia rakudo-moar 77d9d4: OUTPUT«(Array[Str])␤»
04:31 llfourn joined #perl6
04:31 zengargoyle m: say ['arr','of','str'].Array[Str].WHAT;
04:31 camelia rakudo-moar 77d9d4: OUTPUT«Use of Nil in string context␤  in block <unit> at <tmp> line 1␤Indexing requires an instance, tried to do: [ (Str) ]␤  in block <unit> at <tmp> line 1␤␤»
04:48 cdg joined #perl6
04:50 grondilu not sure if that is supposed to work.
04:51 grondilu seems like much to ask.
04:53 poohman joined #perl6
04:54 zengargoyle worth a shot, i'm still a bit confused about the type stuff.
04:57 sammers thanks zengargoyle, the Array[Str].new() version works, but... a little verbose. With regular item assignment we can do this:
04:58 sammers m: my $str := "I'm a string"; say $str.WHAT; sub expect-str(Str $str) { $str.WHAT.say }; expect-str($str);
04:58 camelia rakudo-moar 77d9d4: OUTPUT«(Str)␤(Str)␤»
04:58 sammers m: my Str $str := "I'm a string"; say $str.WHAT; sub expect-str(Str $str) { $str.WHAT.say }; expect-str($str);
04:58 camelia rakudo-moar 77d9d4: OUTPUT«(Str)␤(Str)␤»
04:59 sammers is there another way to create an immutable List / Array?
05:02 pierre_ joined #perl6
05:08 perlawhirl joined #perl6
05:10 perlawhirl sammers: just to clarrify... List and Array are types. List are immutable (ie. this is a list < foo bar baz >) it exists only when you create it... once you assign it to a @var, it becomes an Array, which is mutable by default
05:10 perlawhirl now, you can bind a List to a $var, and that list is immutable, but the $var container is not.
05:11 perlawhirl m: my List $foo := List.new(1, 2, 3); say $foo.WHAT; $foo = 5; $foo = < a new list >; say $foo;
05:11 camelia rakudo-moar 77d9d4: OUTPUT«(List)␤Cannot assign to an immutable value␤  in block <unit> at <tmp> line 1␤␤»
05:11 perlawhirl m: my List $foo := List.new(1, 2, 3); say $foo.WHAT; $foo = < a new list >; say $foo;
05:11 camelia rakudo-moar 77d9d4: OUTPUT«(List)␤Cannot assign to an immutable value␤  in block <unit> at <tmp> line 1␤␤»
05:11 perlawhirl ok, so i'm jumping ahead of myself
05:12 perlawhirl i'm using binding there to lock in the value... but anyways. my point is... immutable != read-only
05:12 perlawhirl there is a read-only assignment op, but it's Not Yet Implemented)
05:12 perlawhirl once it's implemented, you will be able to do $var ::= 'value' and it will be read only
05:13 perlawhirl so what  i meant to demonstrate above was this: my List $foo .= new(1, 2, 3) ; will create an immutable list inside foo
05:14 sammers perlawhirl, thanks, any ETA on when that will be implemented? Is there anywhere I can track its progress?
05:14 perlawhirl it's immutable because the list can't be edited, and you can't assign an Int  (or whatever) to $foo because we've declared it's a List.... but $foo container is not read-only, so rakudo will still let you assign a new list to it
05:15 perlawhirl i don't know... i guess one of the core developers could possibly answer that, but they're in a different timezone.
05:15 perlawhirl however
05:15 sammers also, thanks for the clarification on List vs Array as well
05:16 perlawhirl i've been toying with the idea of using a Proxy as a way to get a read-only var. i've not played with this idea much, so ymmv
05:16 perlawhirl https://gist.github.com/0racle/9​85428b55796a621d366e65661018688
05:17 zengargoyle closest thing that immediately pops to mind might be an Enum
05:17 perlawhirl a Proxy has 2 methods, FETCH and  STORE... so i just throw an exception on STORE. Not entirely sure if this works on Arrays
05:17 zengargoyle which is array-like-ish but i think immutable set of values.
05:18 perlawhirl yeah that could work.
05:19 zengargoyle or make an Array and have a 'but {something}' to take away the rw-ness.
05:20 zengargoyle but the strings inside would need the same sort of treatment somewhow to make them immutable also.
05:20 perlawhirl The closest thing to what you probably want is what i showed originally... something like: my @foo := List.new(1, 2, 3);
05:20 zengargoyle depends on how immutable you want immutable to be.
05:21 zacts joined #perl6
05:21 zengargoyle isn't that still a List of containers that happen to hold an Int?
05:22 perlawhirl ah yeah
05:22 zengargoyle so the containers could change contents.
05:22 perlawhirl so @foo[0] could still be changed
05:23 zengargoyle yeah... i think there's probably a verbose way to de-container a whole list of things, but think a Str would still be mutable without more work.
05:24 zengargoyle but it's been ages since i've poked around such things.
05:36 buharin joined #perl6
05:36 buharin hi
05:36 buharin :)
05:37 CIAvash joined #perl6
05:47 mcmillhj joined #perl6
05:57 Shantanu01 joined #perl6
06:01 jonas1 joined #perl6
06:03 pierre_ joined #perl6
06:04 itaipu joined #perl6
06:08 Actualeyes joined #perl6
06:08 domidumont joined #perl6
06:10 pierre_ joined #perl6
06:13 domidumont joined #perl6
06:16 firstdayonthejob joined #perl6
06:23 nine m: my \a = 1; a = 2;
06:23 camelia rakudo-moar 1e2ecd: OUTPUT«Cannot modify an immutable Int␤  in block <unit> at <tmp> line 1␤␤»
06:23 nine sammers: ^^^
06:30 rindolf joined #perl6
06:31 ufobat good morning
06:31 Shantanu1 joined #perl6
06:32 zengargoyle nine: i think sammers wanted: @a = [ 'foo', 'bar' ];  where @a can't be modified at all and @a[0] can't be modified at all.
06:35 zengargoyle my \b = [ 'foo' ]; b = ['bar']; say b.perl; b[0]='baz'; say b.perl;
06:35 zengargoyle m: my \b = [ 'foo' ]; b = ['bar']; say b.perl; b[0]='baz'; say b.perl;
06:35 camelia rakudo-moar 1e2ecd: OUTPUT«["bar"]␤["baz"]␤»
06:36 nine m: my \l = 1, 2, 3; l = 1, 2;
06:36 camelia rakudo-moar 1e2ecd: OUTPUT«Cannot modify an immutable Int␤  in block <unit> at <tmp> line 1␤␤»
06:36 nine m: my \l = 1, 2, 3; l[1] = 1;
06:36 camelia rakudo-moar 1e2ecd: OUTPUT«Cannot modify an immutable Int␤  in block <unit> at <tmp> line 1␤␤»
06:36 nine sammers: ^^^
06:37 zengargoyle ah
06:40 grondilu m: (my \l = [1, 2, 3])[1] = pi; say l
06:40 camelia rakudo-moar 1e2ecd: OUTPUT«[1 3.14159265358979 3]␤»
06:41 nine The comma operator creates a List. Brackets create an Array with mutable elements.
06:41 * grondilu nods
06:42 zengargoyle any way to mimic Array[Str] typechecking of List?
06:43 nine no
06:44 * zengargoyle not sure if question was more about creating an immutable thing to pass to: sub expect-str-array(Str @arr) { ... }
06:45 zengargoyle or about just immutability howto.
06:47 sjohnsen joined #perl6
06:49 mcmillhj joined #perl6
06:57 araujo joined #perl6
06:57 araujo joined #perl6
07:03 woolfy hi buharin, welcome
07:06 labster joined #perl6
07:07 sammers nine, thanks, that looks good
07:09 sammers m: my Str \l = "list", "of", "strings";
07:09 camelia rakudo-moar 1e2ecd: OUTPUT«Type check failed in binding; expected Str but got List ($("list", "of", "stri...)␤  in block <unit> at <tmp> line 1␤␤»
07:10 sammers nine, anyway to create a ro typed list?
07:10 nine sammers: no, because we don't have typed Lists
07:10 sammers ok, how about a ro Array?
07:11 sammers ...a ro typed Array?
07:11 nine sammers: we don't have that either. What you possibly could do is subtype Array to provide the required behavior, but that's most probably not worth it. What is you use case anyway?
07:13 moritz and if you really think you need everything[tm] typed, maybe use a statically typed programming language?
07:13 moritz Perl 6 doesn't do static typing as good as a statically typed language does
07:13 moritz it does it much better than most dynamically typed languages though
07:14 sammers just trying to see how it is done. Sometimes I want ro variables, some languages support this. I guess when ::= is implemented this should be possible.
07:16 poohman joined #perl6
07:17 ShimmerFairy Now that I think of it, why exactly is Array but not List parameterized, again?
07:18 zengargoyle i wonder if it could be typed, but it would be like a thing that is Positional containing Lists of Chars or some sort vs Array[Str] since Array is mutable and Str is mutable.
07:18 sammers moritz, I think that is where I am at with p6. just trying to figure out why the inconsistency when using := with a Str item vs Str array.
07:18 nine sammers: typed lists are kinda difficult in any language. They bring the old question like "if Array is a subtype of List, is Array[Str] a subtype of List[Str]?" or "is List[Str] a subtype of List[Any]?"
07:20 sammers nine, yeah, when I pass a typed list as a parameter if I have defined it as "my Str @arr :=" then I guess I expect to be able to use it in a sub as mysub(Str @arr) { ... } like I can with a item variable.
07:21 sammers like why does := change the array to Positional[Str]?
07:21 moritz sammers: the @ sigil implies a type constraint of Positional
07:21 nine := doesn't change anything
07:22 moritz sammers: not of Array
07:22 moritz sammers: and Array is only the default type for it
07:22 nine Array is just the default Positional type
07:23 zengargoyle i've always thought := as stripping the container of the LHS
07:24 moritz zengargoyle: yes, that's right
07:24 zengargoyle yay!
07:25 bjz joined #perl6
07:25 sammers ok, so what is this all about:
07:25 sammers m: my Int @a = Array.new(1, 2, 3); @a.WHAT
07:25 camelia rakudo-moar 1e2ecd: ( no output )
07:25 sammers m: my Int @a := Array.new(1, 2, 3); @a.WHAT
07:25 camelia rakudo-moar 1e2ecd: OUTPUT«Type check failed in binding; expected Positional[Int] but got Array ($[1, 2, 3])␤  in block <unit> at <tmp> line 1␤␤»
07:26 zengargoyle the 1,2,3 aren't necessarily Ints.
07:26 sammers m: my Str $a = "string"; $a.WHAT
07:26 camelia rakudo-moar 1e2ecd: ( no output )
07:26 sammers m: my Str $a = "string"; say $a.WHAT
07:26 camelia rakudo-moar 1e2ecd: OUTPUT«(Str)␤»
07:26 sammers m: my Str $a := "string"; say $a.WHAT
07:26 camelia rakudo-moar 1e2ecd: OUTPUT«(Str)␤»
07:27 sammers m: my Int @a := Array.new(1, 2, 3); say @a.WHAT
07:27 camelia rakudo-moar 1e2ecd: OUTPUT«Type check failed in binding; expected Positional[Int] but got Array ($[1, 2, 3])␤  in block <unit> at <tmp> line 1␤␤»
07:27 moritz m: m: my Int @a = Array[Int].new(1, 2, 3); @a.^name
07:27 camelia rakudo-moar 1e2ecd: ( no output )
07:27 moritz m: m: my Int @a = Array[Int].new(1, 2, 3); say @a.^name
07:27 camelia rakudo-moar 1e2ecd: OUTPUT«Array[Int]␤»
07:27 sammers m: my Int @a = Array.new(1, 2, 3); say @a.WHAT
07:27 camelia rakudo-moar 1e2ecd: OUTPUT«(Array[Int])␤»
07:27 zengargoyle m: my Int @a := Array[Int].new(1.Int, 2.Int);
07:27 camelia rakudo-moar 1e2ecd: ( no output )
07:27 zengargoyle m: my Int @a := Array[Int].new(1.Int, 2.Int); say @a.WHAT;
07:27 camelia rakudo-moar 1e2ecd: OUTPUT«(Array[Int])␤»
07:27 sammers so why does it change from Array[Int] to Positional[Int]?
07:28 moritz sammers: where exactly does it change?
07:28 sammers ok, let me do this again, clean slate...
07:28 sammers m: my Int @a = Array.new(1, 2, 3); say @a.WHAT
07:28 camelia rakudo-moar 1e2ecd: OUTPUT«(Array[Int])␤»
07:28 sammers m: my Int @a := Array.new(1, 2, 3); say @a.WHAT
07:28 camelia rakudo-moar 1e2ecd: OUTPUT«Type check failed in binding; expected Positional[Int] but got Array ($[1, 2, 3])␤  in block <unit> at <tmp> line 1␤␤»
07:29 sammers when using :=
07:29 sammers vs just =
07:29 moritz sammers: example?
07:29 zengargoyle = is checking that contents are Int later than := is checking contents are Int
07:29 sammers my Int @a = Array.new(1, 2, 3); say @a.WHAT; my Int @b := Array.new(1, 2, 3); say @b.WHAT
07:30 zengargoyle m: my Int @a := Array[Int].new(1.Int, 2.Int); say @a.WHAT;
07:30 camelia rakudo-moar 1e2ecd: OUTPUT«(Array[Int])␤»
07:30 sammers m: my Int @a = Array.new(1, 2, 3); say @a.WHAT; my Int @b := Array.new(1, 2, 3); say @b.WHAT
07:30 camelia rakudo-moar 1e2ecd: OUTPUT«(Array[Int])␤Type check failed in binding; expected Positional[Int] but got Array ($[1, 2, 3])␤  in block <unit> at <tmp> line 1␤␤»
07:30 zengargoyle explicit .Int makes it work.
07:30 sammers yeah
07:31 zakharyas joined #perl6
07:31 sammers m: my Str $a = "string"; say $a.WHAT; my Str $b := "string"; say $b.WHAT;
07:31 camelia rakudo-moar 1e2ecd: OUTPUT«(Str)␤(Str)␤»
07:32 zengargoyle the "string" has to be a .Str because of "".
07:32 zengargoyle the 1 doesn't have to be Int, it could as easily be Str or Num or ...
07:33 zengargoyle just wait untill you can't pass an Int to a function expecting a Num... :)
07:33 sammers ok, but I guess I don't understand why the Array example behaves that way. I mean, there might be a technical reason, but should it behave the same for the developer regardless of using = or := ?
07:33 mcmillhj joined #perl6
07:34 pdcawley joined #perl6
07:34 zengargoyle i think of := as like a compile time alias.  sorta...  the LHS is just a different name for the RHS.
07:34 zengargoyle the = is an assignment type of thing, can the RHS fit in the LHS?
07:34 grondilu zengargoyle: Num is not a generic type for real numbers.  There is Real for that.
07:35 sammers yeah, is this the expected behavior? or just the way p6 works now until some other feature is available?
07:35 moritz zengargoyle: := is very much run time
07:36 zengargoyle grondilu: i forget the details... i just remember parsing and passing some number like things that one would expect to just work and they didn't without a .Cast of some sort.
07:36 darutoko joined #perl6
07:37 zengargoyle moritz: it seems like = will cast 1,2,3 into 1.Int, 2.Int, 3.Int automagically whereas := won't.
07:37 moritz zengargoyle: example?
07:37 zengargoyle if the LHS is typed for Int
07:37 moritz oh, you mean list/array assignment
07:37 zengargoyle m: my Int @a := Array[Int].new(1.Int, 2.Int); say @a.WHAT;
07:37 camelia rakudo-moar 1e2ecd: OUTPUT«(Array[Int])␤»
07:38 zengargoyle m: my Int @a := Array[Int].new(1, 2); say @a.WHAT;
07:38 camelia rakudo-moar 1e2ecd: OUTPUT«(Array[Int])␤»
07:38 moritz well, array *assignment* is coercive. Binding isn't
07:38 moritz that's why you can assign (1, 2, 3) to Array[Int], but you can't bind it
07:40 moritz that's why you can assign a list to an array in the first place
07:42 sammers Lists are immutable by default, right? but when you pass it as a parameter it loses its immutability?
07:42 zengargoyle m: my Int @b = 1, 3; say @b.WHAT
07:42 camelia rakudo-moar 1e2ecd: OUTPUT«(Array[Int])␤»
07:43 zengargoyle m: my Int @b := 1, 3; say @b.WHAT
07:43 camelia rakudo-moar 1e2ecd: OUTPUT«Type check failed in binding; expected Positional[Int] but got List ($(1, 3))␤  in block <unit> at <tmp> line 1␤␤»
07:44 canopus joined #perl6
07:45 mcmillhj joined #perl6
07:48 bjz joined #perl6
07:56 ufobat m: class Foo {has @.a; has $.b}; my %h = (a => [1..3], b => "scalar"); my $f = Foo.new(|%h); say $f.perl
07:56 camelia rakudo-moar 1e2ecd: OUTPUT«Foo.new(a => [[1, 2, 3],], b => "scalar")␤»
07:56 ufobat is there a way to set @.a "correctly"?
07:57 bjz joined #perl6
07:57 leont joined #perl6
07:59 moritz m: class Foo {has @.a; has $.b}; my %h = (a => (1..3),  b => "scalar"); my $f = Foo.new(|%h); say $f.perl
07:59 camelia rakudo-moar 1e2ecd: OUTPUT«Foo.new(a => [1..3,], b => "scalar")␤»
08:02 jkva joined #perl6
08:03 * DrForr waves to jkva. Great, *another* channel to watch :)
08:03 dakkar joined #perl6
08:03 ufobat moritz: okay :) thanks... my %h<a> is set by a result of a subroutine call, so i need return what?
08:04 ufobat m: sub foo {my @a = (1..3); return @a};class Foo {has @.a; has $.b}; my %h = (a => foo(),  b => "scalar"); my $f = Foo.new(|%h); say $f.perl;
08:04 camelia rakudo-moar 1e2ecd: OUTPUT«Foo.new(a => [[1, 2, 3],], b => "scalar")␤»
08:06 rindolf joined #perl6
08:09 alexm joined #perl6
08:09 RabidGravy joined #perl6
08:11 esh joined #perl6
08:14 CIAvash m: sub foo {my @a = (1..3); return @a};class Foo {has @.a; has $.b}; my %h = b => "scalar"; %h<a> := foo; my $f = Foo.new(|%h); say $f.perl;
08:14 camelia rakudo-moar 1e2ecd: OUTPUT«Foo.new(a => [1, 2, 3], b => "scalar")␤»
08:14 CIAvash ufobat: ↑ ?
08:18 ufobat cool! right now i am creating my hash in that way: %h = @something.map: { ....; $key => $value}. i would need to change that, but thats fine :-)
08:19 CIAvash ufobat: you can do it this way too(llfourn++): http://irclog.perlgeek.de/p​erl6/2016-06-28#i_12748382
08:20 CIAvash m: sub foo {my @a = (1..3); return @a};class Foo {has @.a; has $.b}; my %h := Map.new: (a => foo), (b => "scalar"); my $f = Foo.new(|%h); say $f.perl;
08:20 camelia rakudo-moar 1e2ecd: OUTPUT«Foo.new(a => [1, 2, 3], b => "scalar")␤»
08:21 ufobat okay cool :-)
08:23 Shantanu1 joined #perl6
08:23 sammers zengargoyle, nine, moritz: thanks for the discussion.
08:24 Shantanu1 joined #perl6
08:24 ufobat thanks for the help, it is working now
08:25 CIAvash :)
08:36 wamba joined #perl6
08:46 mcmillhj joined #perl6
08:47 [ptc] \o/ the perl6-examples tests are passing again :-)
08:48 poohman joined #perl6
08:48 moritz \o/
08:48 moritz [ptc]++
08:58 elohmrow joined #perl6
09:01 elohmrow hallo! trying to build perl6 docs ... make html eventually leads to https://gist.github.com/elohmrow/​e7c8aa1e87ecf2b030b6f09e6073984d ... possibly just my $ENV, or known atm?
09:03 mcmillhj joined #perl6
09:04 moritz elohmrow: that's the last build log from doc.perl6.org: https://docs.perl6.org/build-log​/build-2016-09-04T08:55+0000.log
09:04 moritz elohmrow: so it seems there are combinations of rakudo version, installed modules and moon phase that work
09:04 moritz elohmrow: what's your perl6 --version?
09:04 cpage_ joined #perl6
09:05 elohmrow moritz: This is Rakudo version 2016.02-105-ge1071b0 built on MoarVM version 2016.02-20-g78bd7cb implementing Perl 6.c.
09:06 elohmrow oh, that's an old one on my local machine anyway
09:07 moritz elohmrow: the "official" build currently uses 2016.06
09:07 moritz elohmrow: maybe try with that version
09:07 moritz elohmrow: I think I recall a recent-ish fix regarding visibility of dynamic variables in threads, so that could be related
09:07 elohmrow moritz: right.  my problem is i have a diff version on 3 diff machines ... so i guess getting those to parity so i know what to expect, is a useful task
09:08 moritz (2016.07 or 2016.08 should work as well)
09:08 elohmrow moritz: ok; thanks.  i'll try again later on a newer version
09:08 moritz huh, the fix I was thinking of went into 2015.12
09:16 mcmillhj joined #perl6
09:25 xiaomiao joined #perl6
09:30 cpage_ joined #perl6
09:36 user9 joined #perl6
09:36 melezhik Hi all!
09:36 melezhik How to make a temporary file at perl6?
09:37 melezhik this is what I would do in perl5 with File::Temp module
09:38 timotimo why not use perl6's File::Temp module?
09:38 DrForr https://github.com/perlpilot/p6-File-Temp # or on modules.perl6.org
09:40 melezhik timotimo: I will , thanks
09:41 lizmat El_Che: did I miss you putting out a blog post ?
09:42 lizmat moritz: perhaps you are confusing this with giving each start block / thread its own $/ and $_ ?
09:43 timotimo there was a fix where we made sure that start will make dynamic variables available to the code
09:43 timotimo even though they are not in the actual dynamic scope of the block when it actually gets run
09:49 pierre_ joined #perl6
09:52 elohmrow moritz: ok, can confirm it works on 2016.07.1.
09:55 woolfy elohmrow++
09:57 El_Che lizmat: yeah, I haven't had the time yet
09:59 lizmat El_Che: should I just mention https://github.com/nxadm/rakudo-pkg in the weekly ?
10:00 El_Che lizmat: yeah, the readme is pretty clear I think. Create native perl6 packages with docker. New OSes needed (atm Ubuntu amd64/i386, centos7)
10:01 elohmrow El_Che: is the 'weekly' you are talking about the section that gets tacked into Gabor's weekly, or something else?
10:01 mcmillhj joined #perl6
10:02 timotimo we have our own weekly
10:02 El_Che lizmat: of course it's more of a meta thing. The thing that will be usefull for users are the packages that they can install. There is not much benefit for users to built the packages themselves
10:02 timotimo it usually gets linked to from gabor's weekly, too
10:02 * elohmrow wants to make sure he subscribes to (allthethings)
10:02 El_Che elohmrow: perl 6 weekly
10:02 El_Che elohmrow: https://p6weekly.wordpress.com/
10:03 elohmrow El_Che: answered my question before I asked it, good, thanks.
10:04 AndyBotwin joined #perl6
10:04 AndyBotwin joined #perl6
10:08 El_Che lizmat: writing a small blog post so you have something to link
10:08 lizmat El_Che: I just linked to the repo as a blog post
10:08 lizmat but if you have one, that would also be excellent  :-)
10:09 elohmrow lizmat: El_Che: maybe some words about the p6 talks that happened in Innsbruck
10:09 lizmat well, El_Che wasn't there
10:09 El_Che lizmat: I was in spirit :)
10:10 elohmrow esp. http://niner.name/talks/Perl%205%20and%20P​erl%206%20-%20a%20great%20team/Perl%205%20​and%20Perl%206%20-%20a%20great%20team.pdf
10:10 elohmrow lizmat: sorry - i don't know all the faces => id mappings ;)
10:11 jkva What's the most efficient way for me to submit patches to modules.perl6.org?
10:12 timotimo you mean you want to have a module you made listed on that site?
10:12 El_Che elohmrow: url is dead
10:12 timotimo or do you want to change how the site works or looks?
10:12 jkva timotimo: Some small modifications to the page html.
10:13 timotimo https://github.com/perl6/modules.perl6.org/
10:13 jkva Awesome, thank you timotimo
10:13 timotimo easiest for us is github pull requests, but git format-patch also works, or git diff.
10:13 jkva PR sounds good.
10:14 g4 joined #perl6
10:15 nine El_Che: which url?
10:16 El_Che nine's slides
10:16 nine Works fine here. Do you have IPv6 access? Does your DNS resolve niner.name?
10:17 mcmillhj joined #perl6
10:17 Shantanu01 joined #perl6
10:17 nine There were issues at YAPC::EU, too, but no idea why
10:18 El_Che host niner.name results in a timeout. No ipv6 on this cheap provider
10:21 elohmrow_ joined #perl6
10:23 El_Che nine: google's dns doesn't like you either
10:26 nine That's so very odd. Both DNS servers are answering correctly and are listed in the whois data
10:27 avalenn joined #perl6
10:27 nine According to https://www.whatsmydns.net/#A/niner.name most name servers resolve it correctly with few exceptions. Most notably Google's.
10:29 tadzik where do you host the domain?
10:32 moritz ;; ANSWER SECTION:
10:32 moritz niner.name.             60      IN      A       78.47.60.231
10:32 mcmillhj joined #perl6
10:34 Shantanu1 joined #perl6
10:34 geekosaur it just resolved here, I use google dns
10:35 nine It is registered via DirectNIC and hosted on niner.name itself and our company DNS server. Everything looks ok, yet for example http://dnscheck.pingdom.com/?domain=niner.name claims inconsistent glue
10:39 wamba joined #perl6
10:41 El_Che lizmat: https://nxadm.wordpress.com/2016/09/05/rakudo-pkg-​create-os-packages-for-rakudo-perl-6-using-docker/
10:45 wamba joined #perl6
10:48 AlexDaniel joined #perl6
10:49 lizmat El_Che++
10:50 lizmat (added to P6W)
10:51 El_Che lizmat: just throwing ideas into the open
10:52 mcmillhj joined #perl6
10:52 Actualeyes joined #perl6
10:55 lizmat afk for some cycling / sightseeing&
10:55 Xliff *sigh*
10:55 Xliff More weirdness with custom EXPORT. BEGIN and INIT.
10:56 alexm left #perl6
11:03 Xliff https://gist.github.com/Xliff/f​ceb9354193e3b2d1d9c1968b991d6ec
11:04 Xliff Please read after "UPDATED" part.
11:05 timotimo Xliff: i'm pretty sure you're not allowed to put a unit module after a sub declaration
11:05 Xliff The only thing I can think of is that BEGIN truly is only run at compile time, and once precompiled it doesn't run again.
11:06 timotimo that's true
11:06 mst that would sound like what I'd expect BEGIN to do
11:06 yoleaux 00:37Z <AlexDaniel> mst: wasn't it fixed? http://irclog.perlgeek.de/p​erl6/2016-09-04#i_13148724
11:06 Xliff timotimo: Not "unit module" it's block module.
11:06 timotimo BEGIN works exactly like that
11:06 timotimo well, in part 1 it was
11:06 mst AlexDaniel: well, I don't know, I've no idea what this problem is and that's hardly a bug report
11:07 Xliff OK, so that leaves INIT as the only way I can get something to run every time I start the code... correct?
11:07 timotimo no
11:07 timotimo just put your code in the mainline
11:07 timotimo then it'll run every time the program that uses it runs
11:07 Xliff Huh
11:07 timotimo at least i think so?
11:09 AlexDaniel mst: fyi http://irclog.perlgeek.de/​perl6/2014-01-15#i_8120520
11:10 nine timotimo: nope
11:10 timotimo oops
11:10 nine EXPORT is the only code we run automatically when loading a precompiled file
11:11 mst so INIT ... should not be used ... for initialization ... erm?
11:12 mst AlexDaniel: ok, so, rt.perl.org has always said: If you have any questions about rt.perl.org, feel free to send mail to perlbug-admin at perl.org we'll do our best to get back to you.
11:12 mst AlexDaniel: has anybody at any point actually tried reporting the problem, or just moaning in here and blaming RT? :)
11:13 AlexDaniel mst: well in order to get my account fixed I had to write to rt admins
11:13 AlexDaniel so someone did fix my account, and if he did that then he probably knows about this problem
11:13 AlexDaniel and I didn't get any feedback on what the problem actually is
11:14 mst well, please encourage those other people to actually report the problem they're having
11:14 mst if there's a pattern here, then maybe that can be fixed
11:14 poohman joined #perl6
11:14 mst but they'll never realise it's not a one-off problem if only one person ever reports it
11:15 Xliff OK. So no more error, but still weird behavior with previously existing routines that have not changes since last commit.
11:16 AlexDaniel do you want me open a ticket saying “some users are redirected to SelfService”? That's all I know. And I couldn't know more…
11:16 Xliff nine: I'm with mst. What point does INIT serve, then?
11:18 mst AlexDaniel: I want you yto, when somebody mentions that, ask them to send an email in
11:18 mst I can chase up something that's been reported
11:18 mst I can't chase up two lines in an IRC log that nobody bothered to tell the RT admins about
11:19 AlexDaniel mst: which email address exactly?
11:19 AlexDaniel ah I see
11:19 AlexDaniel nvm
11:19 mst THE ONE ON THE FRONT PAGE THAT I ALREADY SAID IN CHANNEL
11:19 mst http://trout.me.uk/facepaw2.jpg
11:21 bjz_ joined #perl6
11:22 AlexDaniel mst: so at 2016-02-05 I've sent an email to perlbug-admin at perl.org saying that I have this problem and it was fixed for me. MasterDuke did the same thing around May of the same year. Not sure how many emails you need but I'll do my best to get more, thank you.
11:23 mcmillhj joined #perl6
11:23 nine Xliff: INIT runs right before the mainline code runs
11:23 poohman joined #perl6
11:24 mst AlexDaniel: if you can collect the ticket ids
11:24 mst basically, if I'm armed with 3 ticket ids I can go make sure one person looks at all three
11:24 stmuk if only there was a bug tracking system for RT!
11:24 mst there is a bug tracking system. that's what he's emailing.
11:25 mst if you don't have anything constructive to say, please feel free to let the adults talk
11:25 mst AlexDaniel: if they haven't already spotted and fixed the pattern, I figure politely rubbing their face in it is probably the next step :)
11:26 nine mst: I can understand your frustration. Please try to maintain the constructive tone that a lot of people worked hard to establish here.
11:26 AlexDaniel mst: well fwiw mine was #127461, I'm not sure if I can view other tickets (can't even find how to view mine), so that's all I have right now
11:26 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=127461
11:27 mst nine: I'm not frustrated, I'm just cutting off stmuk's trolling before it starts.
11:27 Xliff nine: But that appears to only be in mainline script, right?
11:27 Xliff Not in modules or packages?
11:28 nine Xliff: also modules as part of their compilation
11:29 mst geekosaur: hey, can you mail in re http://irclog.perlgeek.de/p​erl6/2016-09-04#i_13148724 as well please and get me the id
11:29 mst and can somebody poke the bot to say the same thing to danlei?
11:31 nine No, it's absolutely not.
11:31 nine err...wrong window
11:31 mst so I tied the chicken down but then I couldn't find the rubber gloves
11:32 mst AlexDaniel: can poke bot for me?
11:33 Xliff OK. Chicken and egg problem.
11:34 Xliff I can get what I am trying to do to work if I use "no precompilation" and force the module to compile every time it is run.
11:34 DrForr Tie me chicken down, sport
11:34 Xliff This is non-optimal
11:34 Xliff I can get part way there if I use a mainline block in a module.
11:34 Xliff However once I try to "require" in an EXPORT. rakudo blows its lid.
11:34 Xliff Which... actually... kinda makes sensew.
11:35 Xliff s/w '.' $//
11:35 Xliff However, I've never known that to be a problem in p5.
11:35 AlexDaniel mst: Um… I'm not sure what exactly you want me to do. And I'm afraid of being screamed at again if I get it wrong
11:35 mst AlexDaniel: you had the bot point out the IRC log link to me
11:35 Xliff I will have to search phases again and see if I can move the naughty EXPORT code somewhere else.
11:36 mst AlexDaniel: make it tell danlei to submit a bug then tell me the ticket id
11:37 mst I don't know how to yoleaux
11:37 mst I'm used to people keeping their clients connected
11:37 mcmillhj joined #perl6
11:37 nine mst: .tell whoever your message
11:37 jakami joined #perl6
11:38 Xliff Wonder if POST EXPORT will work.
11:38 mst .tell danlei if you have a problem with RT still, please mail perlbug-admin@perl.org as the rt.perl.org front page suggests and then /msg me the ticket id so I can chase it up
11:38 yoleaux mst: I'll pass your message to danlei.
11:38 AlexDaniel .tell danlei This problem is rather common. In order to fix it, please write an email to perlbug-admin at perl.org with as many details you have (but chances are you don't have many, that's ok). When it's fixed, you'll get an email with a ticket id. Please this ticket ID to me or mst, so that we have more chances to track the problem down.
11:38 yoleaux AlexDaniel: I'll pass your message to danlei.
11:38 AlexDaniel oops
11:38 jakami what's a recommend way to access an element in an associative array -- via {} or <> ?
11:38 mst eh
11:38 mst now he'll get the right thign to do twice
11:38 AlexDaniel that's ok
11:38 mst REDUNDANT ARRAY OF IRRITATING DAMNIT I CAN'T THINK OF ANYTHING THAT STARTS WITH D OOH DELIVERIES
11:38 geekosaur jakami, <> for literal strings, {} for expressions
11:38 nine Btw. I'd actually like some way to run code after loading a precompiled module. It's required if we are to get precompilation of Inline::Perl5's users working.
11:39 AlexDaniel .oO( that's what I wanted to avoid :D )
11:39 mst AlexDaniel: what, me making a joke?
11:39 mst I'm totally fine with him getting the same message twice
11:39 jakami geekosaur: could you elaborate?
11:40 AlexDaniel no, needless screaming
11:40 nine jakami: depends on how exactly you access. Use <> for a static string as in %hash<key> or {} for accessing via expression as in %hash{$some-key}
11:40 mst it's just capital letters.
11:40 AlexDaniel ah ok
11:40 jakami I see
11:40 Xliff *sigh* -- Nope.
11:41 Xliff OK. I am done for a bit. Have a good morning, #perl6
11:41 mst if you equate SOMEBODY USES CAPITALS FOR EMPHASIS with 'screaming' you're going to find the internet really confusing
11:41 jakami then, can'it I access an element  where a key is an experession via <> ??           %hash<$get-my-get>     ?
11:41 Xliff The internet really could use an all access RTF layer.
11:42 AlexDaniel mst: OK I GOT IT. THANKS
11:42 mst ROGER
11:42 geekosaur jakami, that is what {} is for
11:42 jakami *can't
11:42 jakami I mean, %hash<$get-my-get>
11:42 mst Xliff: yeah, if I could reliably use bold, italic etc. that would be awesome
11:42 Xliff mst++
11:42 jakami where "get-my-key" is a function
11:42 kurahaupo joined #perl6
11:42 nine jakami: <> vs {} is exactly so Perl 6 knows exactly whether you mean a string or an expression and doesn't have to guess.
11:42 Xliff mst: And colors... can't forget the colors.
11:42 mst I MEAN I CAN TOTALLY USE BOLD BUT ALEXDANIEL MAY HAVE A HEART ATTACK
11:43 Xliff mst: And if you are really a dick.... <BLINK>
11:43 mst well, IRC has pervasive colour support, but it's generally disabled
11:43 AlexDaniel 𝐍𝐎, 𝐈'𝐌 𝐓𝐎𝐓𝐀𝐋𝐋𝐘 𝐅𝐈𝐍𝐄 𝐖𝐈𝐓𝐇 𝐓𝐇𝐀𝐓
11:43 Xliff Of course, that might give AlexDaniel an aneurism.
11:43 jakami nine: then going back to my initial question:  "what's a recommend way to access an element in an associative array -- via {} or <> ?"
11:43 mst and I've been known to "disable" it with a /kill on occasion
11:43 geekosaur jakami, I am trying to understand what difference you see betweenthe two
11:43 geekosaur %foo{'bar'} is %foo<bar>
11:44 Xliff mst: Aww... you don't disable with "/ex-teeer-miiin-ate" like I do?
11:44 geekosaur they are not two different kinds of hasjes
11:44 jakami no difference, just what's recommended by convention? or what majoriy of developers use?
11:44 mst jakami: errr
11:44 geekosaur perl 5 used {} for both, which was confusing and sometimes bug-producing.
11:44 nine jakami: going back to my original answer: "Use <> for a static string as in %hash<key> or {} for accessing via expression as in %hash{$some-key}"
11:44 mst jakami: %foo<bar> is the short way to write %foo{'bar'}
11:44 Xliff For when you really want to /kill in an ammusing way? ---  /assassinate
11:45 mst jakami: if what you're writing *can* be written as %foo<bar> you probably should, by default
11:45 nine jakami: your question is like "what's recommended by convention for multiplication? + or *?
11:45 mst jakami: then use %foo{...} for more complex lookups
11:45 mst nine: that's unfair
11:45 nine mst: what?
11:46 nine Any multiplication can be written as repeated addition. The * is a nice shortcut however.
11:46 AlexDaniel m: say ‘🅝🅞’.uninames
11:46 camelia rakudo-moar 1e2ecd: OUTPUT«(NEGATIVE CIRCLED LATIN CAPITAL LETTER N NEGATIVE CIRCLED LATIN CAPITAL LETTER O)␤»
11:46 mst nine: I've found plenty of perl5 style guides that insist on using $hash{'foo'} instead of $hash{foo} - so his asking which is preferred is reasonable, and not really comparable to the multiplication case
11:46 nine ok
11:46 AlexDaniel m: say ‘🅽🅾’.uninames
11:46 camelia rakudo-moar 1e2ecd: OUTPUT«(NEGATIVE SQUARED LATIN CAPITAL LETTER N NEGATIVE SQUARED LATIN CAPITAL LETTER O)␤»
11:46 nine I was however a bit irritated as I've already answered that exact question :)
11:47 mst true. but you could've repasted it rather than making a bad metaphor
11:47 mst at some point you're going to need a factoid bot in here
11:48 mst for repeating answers that people are too bored of giving
11:48 geekosaur zoffix to provide bot in 5, 4, 3...
11:48 nine mst: I did repeat it _and_ tried it again using a metaphor ;)
11:49 mst had it been a good metaphor rather than a sarcastic one I'd've approved :P
11:49 AlexDaniel m: say 42
11:49 camelia rakudo-moar 1e2ecd: OUTPUT«42␤»
11:49 mst I'm the child of two eng. lit. grads
11:49 mst if you're going to metaphor in my earshot, do it well :D
11:50 nine But but but I did not try to be sarcastic. I actually thought it was a reasonable metaphor
11:51 AlexDaniel huggable: %hash{'foo'} vs %hash<foo> :is: Depends on how exactly you access. Use <> for a static string as in %hash<key> or {} for accessing via expression as in %hash{$some-key}
11:51 huggable AlexDaniel, Added %hash{'foo'} vs %hash<foo> as Depends on how exactly you access. Use <> for a static string as in %hash<key> or {} for accessing via expression as in %hash{$some-key}
11:51 AlexDaniel feel free to rewrite it :P
11:51 AlexDaniel and yes, this bot is by Zoffix
11:55 mcmillhj joined #perl6
11:55 eliasr joined #perl6
11:55 AlexDaniel huggable: source
11:55 huggable AlexDaniel, See https://github.com/zoffixznet/huggable
12:01 CIAvash joined #perl6
12:04 itaipu joined #perl6
12:06 * Woodi must say THAT stmuk message ($m ~~ m/RT!$/, for clarity) was perfect #perl6 message :)  messages with traces of trolling for everyone !
12:06 pierre_ joined #perl6
12:11 * El_Che wonder if comments on a static page like http://rakudo.org/how-to-get-rakudo/ is a good thing. IMHO they look terrible out of place
12:15 moritz and comments on the release announcements are typically questions about things other than the release
12:15 moritz so I'd tend to disable comments on rakudo.org
12:17 melezhik Hi ! How can I pass a reference to scalar to function, so that it will mutate a referenced value ?, foo(item $bar) gives "Cannot assign to a readonly variable or a value" error
12:18 nine melezhik: sub foo($bar is rw)
12:18 melezhik ahh, thanks!
12:19 wamba joined #perl6
12:21 mcmillhj joined #perl6
12:22 mst moritz: yeah, I'm unconvinced they're gaining anything
12:24 melezhik nine: this is error I got though. self!flush-multiline-block( item($block-type), item(@multiline-block), Nil); method  !flush-multiline-block ($block-type is rw, $multiline-block is rw, $line) { ... }; Parameter '$block-type' expected a writable container, but got Match value
12:25 nine melezhik: how do you expect it to work? You cannot write to "item($block-type)"
12:25 nine melezhik: I guess you actually don't want to mutate a "referenced value" but simply be able to write to the $block-type variable. Use $block-type is copy for that.
12:26 melezhik nine: ok
12:27 moritz bah, it seems one needs a plugin to disable comments globally in wordpress :(
12:27 jkva moritz: no, you don't need a plugin
12:27 jkva It's a central setting in base wordpress
12:27 jkva But that won't apply to already-existing articles
12:28 jkva You'll have to disable those manually
12:28 moritz jkva: where is that setting?
12:29 moritz I'm not finding it on Settings->Discussion
12:29 jkva moritz: settings -> discussion -> "allow people to post comments on new articles"
12:29 jkva Once you uncheck that
12:29 jkva Any new articles won't have the comment form
12:30 jkva And as I said, any existing articles you have to turn comments of for, in quick eit
12:30 jkva *quick edit
12:30 jkva But you can batch-apply that iirc
12:30 sjn \o
12:30 moritz jkva: ah, thanks
12:30 jkva np!
12:30 sjn hello, #perl6, how's it going? :)
12:31 melezhik nine: what if I want to pass an array to a function, so that to modify an array, should I use foo ( item(@baz))? and also @baz is a local scope, so won't be seen at foo function ...
12:32 nine sjn: Hi! Nice to read you!
12:33 nine melezhik: I don't understand your question. Can you re-phrase?
12:33 mst sub foo (@thing is rw) {
12:33 mst foo(@baz)
12:33 mst would work, no?
12:34 DrForr sub foo(@a is rw) { @a[2]++ }; my @x=1,2,3;foo(@x);say @x;
12:34 DrForr m: sub foo(@a is rw) { @a[2]++ }; my @x=1,2,3;foo(@x);say @x;
12:34 camelia rakudo-moar f49b38: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Can only use 'is rw' on a scalar ('$' sigil) parameter␤at <tmp>:1␤»
12:34 moritz m: sub foo(@a) { @a.push: 42 }; my @x = 1, 2, 3: foo @a; say @a.perl
12:34 camelia rakudo-moar f49b38: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 3oo(@a) { @a.push: 42 }; my @x = 1, 2, 3:7⏏5 foo @a; say @a.perl␤    expecting any of:␤        colon pair␤»
12:34 DrForr Skritch.
12:34 moritz m: sub foo(@a) { @a.push: 42 }; my @x = 1, 2, 3: foo @a; say @a.perl
12:34 camelia rakudo-moar f49b38: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 3oo(@a) { @a.push: 42 }; my @x = 1, 2, 3:7⏏5 foo @a; say @a.perl␤    expecting any of:␤        colon pair␤»
12:34 moritz m: sub foo(@a) { @a.push: 42 }; my @x = 1, 2, 3; foo @a; say @a.perl
12:34 camelia rakudo-moar f49b38: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '@a' is not declared␤at <tmp>:1␤------> 3) { @a.push: 42 }; my @x = 1, 2, 3; foo 7⏏5@a; say @a.perl␤»
12:34 moritz m: sub foo(@a) { @a.push: 42 }; my @x = 1, 2, 3; foo @x; say @x.perl
12:34 camelia rakudo-moar f49b38: OUTPUT«[1, 2, 3, 42]␤»
12:34 * moritz not very concentrated
12:34 sufrostico joined #perl6
12:36 mcmillhj joined #perl6
12:36 melezhik mst: method  !flush-multiline-block ($block-type is rw, @multiline-block is rw, $line) { ... } gives a "Can only use 'is rw' on a scalar ('$' sigil) parameter" error
12:37 mst ooh, hm
12:37 poohman joined #perl6
12:38 melezhik nine: I want to pass a array to a function so this function will modify an array, the array has a lexical scope, and I can say just @bar = ('New value') inside a foo function
12:38 moritz jkva: do you happen to know if I can hide all comments without deleting them?
12:38 melezhik I meant I can't just say ...
12:39 jkva moritz: Um, well
12:39 jkva I'd probably add some CSS to set `#comments { display: none  }`
12:39 moritz jkva: I guess I could unapprove them all in the spam filter, or something
12:39 jkva Which you can do by customising the theme you are using
12:39 melezhik the same thing with scalar, I want to pass a string to function, so that function will modify this string, sting has a lexical scope ...
12:39 melezhik so won't be seen inside a function
12:40 jkva moritz: yeah, but then might as well use a mysql query
12:40 jkva if you have that kind of access
12:40 moritz melezhik: for scalars, it works with 'is rw'
12:40 moritz jkva: no, I have only access to the admin web frontend
12:40 jkva moritz: ok, then you either bulk disapprove or amend your theme css
12:41 melezhik moritz: what about arrays?
12:41 melezhik which way should I choose to modify an array? pass is as arrayref?
12:42 melezhik foo ($arrayref is rw) { @($arrayref).push: 'New value'} ?
12:42 melezhik foo(item (@baz))
12:43 melezhik ?
12:43 pierre_ joined #perl6
12:43 nine m: my @a = 1, 2, 3; sub foo(@arr) { @arr.push: 4 }; foo(@a); say @a;
12:43 camelia rakudo-moar f49b38: OUTPUT«[1 2 3 4]␤»
12:43 nine melezhik: ^^^
12:43 moritz melezhik: yes, that should work
12:44 moritz melezhik: arrays and hashes don't need 'is rw', so you can just use them directly
12:44 nine melezhik: your textual description seems to indicate that you want to replace the whole Array while your code only modifies the Array.
12:45 moritz m: sub f(@x) { @x = 2, 3 }; f my @a = 1, 2, 3; dd @a
12:45 camelia rakudo-moar f49b38: OUTPUT«Array @a = [2, 3]␤»
12:46 melezhik method  !flush-multiline-block ($block-type is rw, $multiline-block is rw, $line) { ... } self!flush-multiline-block( $block-type, item(@multiline-block), Nil); gives a "Parameter '$multiline-block' expected a writable container, but got Array value"
12:46 mst oh
12:46 melezhik ok, will try to pass array directly
12:46 moritz melezhik: then use @multiline-block
12:47 mst I didn't realise arrays were always 'is rw'
12:47 mst that seems a bit odd to me
12:47 nine mst: they are not
12:47 mst (admittedly I try and avoid having rw parameters at all)
12:47 mst nine: then why did this work: < moritz> m: sub f(@x) { @x = 2, 3 }; f my @a = 1, 2, 3; dd @a
12:47 nine @x = 2, 3 is equal to @x.STORE(2,3)
12:47 mst yeah, that's still writeable, is what I mean
12:48 moritz mst: there's a very deep technical problem underneath that
12:48 moritz mst: an Array is just an object; how do you make an object lexically immutable to pass it to a routine?
12:48 nine I dare say it's a consequence of not wanting to copy arrays and hashes passed to functions. While scalar containers are cheap.
12:48 mst I've not managed to blow a foot off with it so far
12:48 melezhik moritz: a final working for me version is method  !flush-multiline-block ($block-type is rw, @multiline-block , $line) { ... } self!flush-multiline-block( $block-type, @multiline-block, Nil);
12:49 moritz mst: there have been very long discussions about this on p6l and possibly p6c, without any good proposals
12:49 moritz there are some proposals that come with a very hefty performance penalty
12:49 melezhik nine: moritz: - thanks )))
12:49 jnthn I think most languages have settled on "worse is better" on this issue. :)
12:50 itaipu joined #perl6
12:51 mcmillhj joined #perl6
12:54 El_Che hi sjn
12:54 mst is there a way to declare a static array up front?
12:55 * mst usually wants things to be single-assignment anyway
12:56 nine m: constant @a = 1,2,3; @a[1] = 2;
12:56 camelia rakudo-moar f49b38: OUTPUT«Cannot modify an immutable Int␤  in block <unit> at <tmp> line 1␤␤»
12:56 moritz m: constant MY_STUFF = (1, 2, 3); say MY_STUFF
12:56 camelia rakudo-moar f49b38: OUTPUT«(1 2 3)␤»
12:57 moritz mst: though 'constant' is evaluated at compile time; not sure if you want that
12:57 ShimmerFairy mst: aside from forcing a List and hoping it doesn't contain Scalars (since you can subtype a List(!)), I'm not sure how you'd accomplish it.
12:57 pierre_ just using a list might work as well, no?
12:57 ShimmerFairy *can't subtype
12:57 mst no, I don't want compile time
12:57 mst I just want 'my @foo = (1, $x+7, 3);'
12:57 pierre_ m: my @a = (1,2,3); @a.pop
12:57 camelia rakudo-moar f49b38: ( no output )
12:57 nine m: my
12:57 camelia rakudo-moar f49b38: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed my␤at <tmp>:1␤------> 3my7⏏5<EOL>␤»
12:57 mst and then @foo to be immutable
12:58 poohman joined #perl6
12:58 moritz ShimmerFairy: huh? Arrays subtypes list, so that clearly works
12:58 nine m: my \foo = 1,2,3; foo[2] = 1;
12:58 camelia rakudo-moar f49b38: OUTPUT«Cannot modify an immutable Int␤  in block <unit> at <tmp> line 1␤␤»
12:58 ShimmerFairy moritz: I mean parameterization
12:58 nine mst: ^^^
12:58 pierre_ m: my $a = (1,2,3); $a.pop
12:58 camelia rakudo-moar f49b38: OUTPUT«Cannot call 'pop' on an immutable 'List'␤  in block <unit> at <tmp> line 1␤␤»
12:58 mst nine: and then I could pass that to something that expects an array with subname(foo) ?
12:59 nine m: my $a = (1, 2, 3); sub foo(@a) { @a[1] = 2; }; foo($a);
12:59 camelia rakudo-moar f49b38: OUTPUT«Cannot modify an immutable Int␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
13:00 mst bah
13:00 nine m: my \a = (1, 2, 3); sub foo(@a) { @a[1] = 2; }; foo(a); # so you can't even write to a $a
13:00 camelia rakudo-moar f49b38: OUTPUT«Cannot modify an immutable Int␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
13:00 ShimmerFairy m: my $a = 42; my $list = (1,2,$a); $list[2] = 1; say $list; say $a  # lists aren't perfect, though :<
13:00 camelia rakudo-moar f49b38: OUTPUT«(1 2 1)␤1␤»
13:00 mst const my @foo => (1, 2, 3); # use Const::Fast in perl5
13:00 mst is kinda easier
13:00 nine mst: why is const my @foo => (1, 2, 3) easier than my $a = (1, 2, 3);?
13:01 AlexDaniel joined #perl6
13:01 nine or my \a = (1, 2, 3);
13:01 jnthn m: my @a := 1,2,3; @a.push(4}
13:01 camelia rakudo-moar f49b38: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' ␤at <tmp>:1␤------> 3my @a := 1,2,3; @a.push(47⏏5}␤»
13:01 jnthn m: my @a := 1,2,3; @a.push(4)
13:01 camelia rakudo-moar f49b38: OUTPUT«Cannot call 'push' on an immutable 'List'␤  in block <unit> at <tmp> line 1␤␤»
13:01 jnthn m: my @a := 1,2,3; @a[2] = 4
13:01 camelia rakudo-moar f49b38: OUTPUT«Cannot modify an immutable Int␤  in block <unit> at <tmp> line 1␤␤»
13:01 jnthn Why not just bind a list?
13:02 mst aha
13:02 mst that looks like it actually has normal syntax
13:02 mst which was the thing I cared about
13:02 mst nine: all the other solutions required me to do something odd, i.e. rewrite every reference to the array
13:02 mst ShimmerFairy: I can live with the scalar still being mutable, if I didn't already make it immutable some other way, my problem
13:03 pierre_ m: my $a=2; my $l := 1,2,$a; say $l; $l[2] = 5; say $l;
13:03 camelia rakudo-moar f49b38: OUTPUT«(1 2 2)␤(1 2 5)␤»
13:03 ShimmerFairy mst: fair enough, and at least in that case you have to near-explicitly ask for it :)
13:05 itaipu joined #perl6
13:10 pdcawley joined #perl6
13:15 AlexDaniel joined #perl6
13:21 pierre_ Is it possible to handle method as Callable?
13:21 pierre_ an exemple with subs:
13:21 pierre_ m: sub foo { return "bar";}; my &baz = &foo; baz();
13:21 camelia rakudo-moar f49b38: ( no output )
13:21 pierre_ m: sub foo { return "bar";}; my &baz = &foo; say baz();
13:21 camelia rakudo-moar f49b38: OUTPUT«bar␤»
13:22 pierre_ but with methods:
13:22 pierre_ class c { has &.baz; method foo() { return "bar"; }; method affect() { &!baz = &self.foo} }; my $i = c.new(); $i.affect(); say $i.baz()
13:22 pierre_ m: class c { has &.baz; method foo() { return "bar"; }; method affect() { &!baz = &self.foo} }; my $i = c.new(); $i.affect(); say $i.baz()
13:22 camelia rakudo-moar f49b38: OUTPUT«(Callable)␤»
13:23 timotimo you need to $i.^find_method('baz')
13:25 cpage_ joined #perl6
13:25 dakkar joined #perl6
13:25 jervo joined #perl6
13:26 pierre_ m: class c { has &.baz; method foo() { return "bar"; }; method affect() { &!baz = &self.foo} }; my $i = c.new(); $i.affect(); $i.^find_method('baz')
13:26 camelia rakudo-moar f49b38: ( no output )
13:26 pierre_ m: class c { has &.baz; method foo() { return "bar"; }; method affect() { &!baz = &self.foo} }; my $i = c.new(); $i.affect(); say $i.^find_method('baz')
13:26 camelia rakudo-moar f49b38: OUTPUT«baz␤»
13:26 pierre_ m: class c { has &.baz; method foo() { return "bar"; }; method affect() { &!baz = &self.foo} }; my $i = c.new(); $i.affect(); say $i.^find_method('baz').WHAT
13:26 camelia rakudo-moar f49b38: OUTPUT«(Method)␤»
13:26 timotimo you also need to $!baz = self.^find_method('foo')
13:27 rba_ joined #perl6
13:28 MasterDuke this PR seems relevant: https://github.com/rakudo/rakudo/pull/866
13:29 timotimo ah, could be
13:30 pierre_ timo, i was hoping that after a few hours i would see more clearly, but still a mistery :)
13:31 timotimo i don't know what your code is supposed to do so i don't know what you need to change
13:32 pierre_ i want to do a king of generator, i receive a value from a Supply, and each value will gave me what i need to do on the next step
13:32 pierre_ not really clear
13:33 timotimo a bit like an interpreter?
13:33 pierre_ i received bytes one by one
13:33 pierre_ the value of one byte, will dictate what should be the action to take on the next one
13:35 pierre_ i wanted to do something like method process($byte) { if &!next.defined { return self!next($byte) } given $byte { when xxx { &!next = self.something} } }
13:36 nine pierre_: mind that $i.baz() calls the generated accessor method for the &.baz attribute, not the code stored in the attribute. $i.baz()() would do that
13:36 timotimo you don't need to push around callables for that, but when you're assigning, you have to use .^find_method and when you try to call the contents of your attribute you need to self.attribute().()
13:36 pierre_ some kind of "method currying"
13:37 nine m: class c { has &.baz; method foo() { return "bar"; }; method affect() { &!baz = { self.foo } } }; my $i = c.new(); $i.affect(); say $i.baz()()
13:37 camelia rakudo-moar f49b38: OUTPUT«bar␤»
13:37 nine pierre_: also this ^^^
13:37 pierre_ oh! thanks
13:38 pierre_ i was really close to that at one point, missing one bit, i was at method affect() { &!baz = &{ self.foo } }
13:38 pierre_ but with a closure, would it work if i pass paramter
13:39 pierre_ m: class c { has &.baz; method foo($txt) { return "$txt"; }; method affect() { &!baz = { self.foo } } }; my $i = c.new(); $i.affect(); say $i.baz()('aaa')
13:39 camelia rakudo-moar f49b38: OUTPUT«Too few positionals passed; expected 2 arguments but got 1␤  in method foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
13:39 lichtkind joined #perl6
13:39 pierre_ m: class c { has &.baz; method foo($txt) { return "$txt"; }; method affect() { &!baz = { self.foo(@_) } } }; my $i = c.new(); $i.affect(); say $i.baz()('aaa')
13:39 camelia rakudo-moar f49b38: OUTPUT«aaa␤»
13:43 buharin joined #perl6
13:44 nine m: class c { has &.baz; method foo($a, :$b) { return "bar$a$b"; }; method affect() { &!baz = -> |c { self.foo(|c) } } }; my $i = c.new(); $i.affect(); say $i.baz()(1, :b<2>)
13:44 camelia rakudo-moar f49b38: OUTPUT«bar12␤»
13:44 nine pierre_: better ^^^
13:44 pierre_ m: class c { has &.baz; method foo($txt) { return "$txt"; }; method affect() { &!baz = self.^find_method('foo') } }; my $i = c.new(); $i.affect(); say $i.baz().($i, 'aaa')
13:44 camelia rakudo-moar f49b38: OUTPUT«aaa␤»
13:45 pierre_ |c will flatten @_ ?
13:45 leont joined #perl6
13:45 nine read https://docs.perl6.org/type/Capture
13:47 nine also https://docs.perl6.org/type/​Signature#Capture_Parameters
13:49 pierre_ thanks, i finally inderstand the | i was seeing with multi dispatch and proto
13:57 mcmillhj joined #perl6
14:09 autarch joined #perl6
14:13 itaipu joined #perl6
14:14 domidumont joined #perl6
14:15 vytas joined #perl6
14:19 arnsholt mst: Since you commented on my diplomatic turn of phrase regarding OpenSSL recently, I'm now turning towards active hatred =)
14:19 mst arnsholt: *grins*
14:19 mst arnsholt: this is the correct attitude from which to approach openssl
14:19 ShimmerFairy what's up with OpenSSL?
14:19 mst well, active hatred for the code, pity for the devs who've been maintaining it for years without a realistic way to fund refactoring
14:20 arnsholt ShimmerFairy: The docs are extremely unhelpful, to the point of being misleading for example
14:20 arnsholt My current frustration being that everything is documented as being functions, even if it's *actually* a macro
14:21 arnsholt Only careful reading of the prose description will reveal if it's a macro or not
14:21 ShimmerFairy eek, that's what those in the security business currently call "asking for trouble", I'd assume :P
14:21 arnsholt A point which is rather important when you're calling it over FFI
14:21 mst usually it's a macro calling a macro calling a macro calling a macro calling a fuck I can't find the next one HELP HELP SEND MORE PARAMEDICS
14:21 AlexDaniel joined #perl6
14:21 leont Yeah
14:22 gregf_ m: sub foo(*@a){ @a.say };my &bl = -> |c { foo(|c) }; &bl.(1..10)
14:22 camelia rakudo-moar f49b38: OUTPUT«[1 2 3 4 5 6 7 8 9 10]␤»
14:22 leont The OpenSSL API is clearly terrible
14:22 arnsholt mst: Thankfully Visual Studio is free these days, so I have an IDE to help me (being on Windows at $work)
14:22 arnsholt And there's pretty much only low-level API docs, not really any high-level overview docs
14:22 mst I mostly had "going out for a joint at lunch" to help me
14:22 ShimmerFairy .oO(macro-macronomics)
14:23 arnsholt So you have to figure out what to do by Googling for example code
14:23 buharin joined #perl6
14:23 leont Part of me believes that a rewrite from scratch may be the viable solution for much of it :-/
14:23 arnsholt Possibly
14:23 ilmari make foo.i # may or may not be your friend
14:23 ilmari leont: isn't that what gnutls and nss are?
14:23 mst I'm hoping libressl/boringssl will manage to do a decent refactor
14:23 mst once they run out of code to delete
14:24 arnsholt ilmari: What does that do?
14:24 ilmari arnsholt: gives you the preprocessed C code
14:24 arnsholt Ah, right
14:24 ilmari i.e. expands all the macros
14:24 leont gnutls is terrible in its own way
14:24 ShimmerFairy having alternative implementations would only be beneficial, methinks.
14:24 * ilmari has occasionally found that useful on the perl5 guts, but it gets unweildy fast
14:24 arnsholt That might be overkill in this case. I speak C well enough that source and header spelunking generally work fine
14:25 arnsholt I think one approach would be to build a sane API, first as a wrapper around OpenSSL and then progressively replacing bits of it with new code
14:25 leont In particular, it has a few too many null-terminated string arguments, making validations more painful than strictly necessary
14:25 arnsholt Probably not terribly easy either though
14:26 ShimmerFairy leont: yeah, that does sound bad. Why not at the very least use std::string?    (...wait)
14:27 leont It doesn't help that TLS is an insane standard for historical reasons
14:28 leont Signal did the sensible thing by ignore all existing standards and coming up with a much simpler one of their own, based on two trusted primitives (Curve-25519 and AES)
14:30 leont And unlike Telegram they actually understood crypto so didn't invent their own cryptographic mode but actually combined pieces in a sensible way
14:33 bioduds joined #perl6
14:33 bioduds hi guys
14:33 timotimo greetings
14:33 bioduds anyone gave a try on the install script? I'm curious to know if it works in MAC
14:33 bioduds hi timotimo
14:34 timotimo i don't think people call it MAC :)
14:34 ilmari isn't it macOS these days?
14:35 bioduds OSX
14:35 bioduds http://67.205.136.118/install.sh
14:35 k-man joined #perl6
14:36 ilmari https://en.wikipedia.org/wiki/MacOS_Sierra # yeah, it's being renamed as of the next release
14:36 bioduds :)
14:36 bioduds curl http://67.205.136.118/install.sh | sh;. ~/rakudo/setpath.sh
14:36 bioduds the line
14:38 khw joined #perl6
14:38 timotimo "spec ops: the line" ?
14:39 bioduds it has to be a 2-liner condensed into 1
14:40 timotimo in that case, i'd rather recommend && over ;
14:40 timotimo if rakudo doesn't compile, there's no reason to try to source setpath.sh
14:41 bioduds yep, it wont anyway
14:41 bioduds cause the path will not exist
14:41 timotimo but the user will get an error at the bottom that is misleading
14:41 timotimo you can't imagine how often i've seen (during my gentoo time) people just copy-pasting the "Make: exiting due to error (1)" line and nothing above it
14:42 timotimo because that's the last line that has "error" in it
14:42 bioduds what do you suggest?
14:42 bioduds cause im not sure it will print an error
14:42 timotimo well, if you make that &&, it won't even try to source if the installation didn't succeed
14:42 bioduds i believe it wont
14:42 bioduds oh
14:42 bioduds so it would be
14:43 bioduds curl http://67.205.136.118/install.sh | sh && . ~/rakudo/setpath.sh
14:43 bioduds is this it?
14:43 timotimo yeah, i think so
14:43 bioduds oh, great
14:43 bioduds let me test that
14:45 stmuk the path in the script also needs to set "install/share/perl6/site/bin/" otherwise panda etc arent in the path
14:45 timotimo oh, good point
14:47 bioduds oh, ok
14:47 bioduds let me add that
14:47 buharin joined #perl6
14:49 bioduds http://67.205.136.118/install.sh
14:49 bioduds there we go
14:49 bioduds testing
14:50 bioduds thing is, after installing, I can test for perl6
14:50 bioduds should I rm rakudo dir if perl6 fails?
14:51 bioduds or should I rm rakudo on every fresh install?
14:51 bioduds or none of the above?
14:51 timotimo if you just rm it, that makes it harder to diagnose what went wrong
14:51 skids joined #perl6
14:51 bioduds correct, but if i dont it wont accept new tries
14:51 timotimo oh
14:52 bioduds meteor installation removes it
14:52 bioduds i guess I should too
14:52 bioduds cause this is meant to be the first install
14:53 domidumont joined #perl6
14:53 bioduds if this fails, user should try a manual install, I guess
14:53 bioduds what do you think?
14:54 dalek doc: 07f21bc | coke++ | doc/Type/UInt.pod6:
14:54 dalek doc: remove trailing whitespace
14:54 dalek doc: review: https://github.com/perl6/doc/commit/07f21bccfb
15:03 mcmillhj joined #perl6
15:11 Ulti if I want to left pad a string with a character is there an obvious method for that?
15:12 Ulti upto a given length
15:12 Ulti is there just sprintf equivalent I'm forgetting about
15:13 lichtkind_ joined #perl6
15:14 timotimo m: my $desired-len = 80; my $char = "@"; my $input = "hello there"; say $char x ($desired-len - $input.graphs) ~ $input
15:14 camelia rakudo-moar f49b38: OUTPUT«Method 'graphs' not found for invocant of class 'Str'␤  in block <unit> at <tmp> line 1␤␤»
15:14 timotimo m: my $desired-len = 80; my $char = "@"; my $input = "hello there"; say $char x ($desired-len - $input.chars) ~ $input
15:14 camelia rakudo-moar f49b38: OUTPUT«@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@​@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@hello there␤»
15:14 wamba joined #perl6
15:14 timotimo if you have more than one character in $char, that obviously fails and you have to take care that you don't end up with extra chars in total
15:15 timotimo there's a reason why left-pad was such a popular module
15:15 timotimo because it did those exact things "right"
15:19 Ulti timotimo: yeah I know how I *could* do it
15:19 Ulti its more is there a built in
15:20 rudi_s joined #perl6
15:20 Ulti format print in C can do this for example so if Perl 6 support all C style format strings then that's probably nicer than x and ~
15:21 bioduds didn't work with &&
15:25 timotimo didn't work? :o
15:27 poohman__ joined #perl6
15:27 El_Che bioduds: I am not too fond of the setpath bit. Why not just printing the PATH line and ask the user to put it in their .bashrc?
15:28 bioduds cause that wouldn't be a one liner
15:28 sakuya joined #perl6
15:28 stmuk El_Che: rakudo star does that anyway
15:28 El_Che bioduds: and adding the contents of PATH twice will results in putting the contents twice
15:29 poohman43 joined #perl6
15:29 timotimo yeah, that'll be fun
15:29 El_Che stmuk: yeah, much of the rakudo install culture give unix people heartache (SHA1 paths!)
15:29 timotimo i once had a PATH that was like 10 lines when printed in my terminal
15:32 CIAvash Ulti: not exactly what you want but there is indent https://docs.perl6.org/routine/indent
15:32 bioduds goal is to have a direct install line that should install perl6
15:33 El_Che bioduds: where is setpath.sh called after installation?
15:33 bioduds on the line itself
15:33 stmuk externally to the script
15:33 bioduds curl http://67.205.136.118/install.sh | sh;. ~/rakudo/setpath.sh
15:33 thundergnat joined #perl6
15:33 El_Che I mean after the user logs out
15:33 El_Che that's the calling shell
15:34 bioduds once it is sourced, it stays there, no?
15:34 El_Che no
15:34 El_Che it goes with the shell it runs
15:34 bioduds so I believe it should also put it in .bashrc
15:34 El_Che . means: this and child shells
15:34 El_Che maybe does star add stuff there
15:35 stmuk it doesn't
15:35 bioduds perhaps it should only put in the .bashrc
15:35 El_Che then it will be gone after the shell is closed
15:35 bioduds and source the .bashrc
15:35 stmuk how do you know what login shell is in use? not everyone uses bash (I don't)
15:36 bioduds sorry, i didn't understand the question
15:36 bioduds im very newbie with shell
15:36 El_Che stmuk: that's my point indeed. Print usefull format so the user can add it to it's shell. Maybe sh/kort, bash, zsh
15:36 timotimo fish
15:36 El_Che users of advances shell will know how to change a path
15:36 stmuk El_Che: yes which is exactly what happens anyway
15:37 mst local::lib has support for sh, csh, cmd, fish
15:37 mst you could steal from it
15:37 mcmillhj joined #perl6
15:37 bioduds not sure exactly what you are telling me to do, mst
15:38 El_Che bioduds: people (me!) are very fond of their shell setup. They don't like apps or scripts install random stuff in it. So maybe something to consider
15:39 bioduds ok, what about this: i prompt the user to let me add path to the .bashrc
15:39 bioduds if yes, I put it there and source it
15:39 bioduds if no, I leave as is printing only the paths that should be added
15:39 thundergnat Ulti: As long as the pad character is a zero there is a built in.
15:39 thundergnat m: say 'hello there'.fmt('%080s') # arguably a bug
15:39 camelia rakudo-moar f49b38: OUTPUT«0000000000000000000000000000000000​00000000000000000000000000000000000hello there␤»
15:40 El_Che bioduds: https://metacpan.org/pod/local::lib#SYNOPSIS
15:40 El_Che the is an example of PATH. It prints commands that you can run or add to your shell config
15:41 El_Che bioduds: have a look at https://metacpan.org/pod/local::​lib#The-bootstrapping-technique
15:41 El_Che bioduds: for questions, ask mst. He's the author :)
15:42 El_Che (sorry mst, I gave you away ;) )
15:42 bioduds thanks, im gonna try to understand it
15:42 El_Che understand mst? oh, wait
15:42 gregf_ m: printf("%.5s%s","foobarbaz", "quux"); #Ulti
15:42 camelia rakudo-moar f49b38: OUTPUT«foobaquux»
15:43 timotimo whoa
15:43 lizmat_ joined #perl6
15:44 darutoko- joined #perl6
15:44 user10 joined #perl6
15:44 john51_ joined #perl6
15:44 zhmylove_ joined #perl6
15:44 stmuk https://github.com/rakudo/star/blob​/master/tools/build/Makefile.in#L82
15:45 stmuk Rakudo Star already prints information about PATH after installation
15:45 bioduds yes it does
15:46 AngeloMichael_ joined #perl6
15:46 bioduds but that doesn't help beginners
15:46 bioduds a beginner needs something he can copy paste or write in shell and have it installed after that
15:47 Spot___ joined #perl6
15:47 avalenn_ joined #perl6
15:48 NEveD_ joined #perl6
15:48 bioduds if a decision is necessary on the installation proceedure, it must be prompted to the beginner with a default usage
15:48 perlpilot joined #perl6
15:48 xiaomiao joined #perl6
15:48 sergot joined #perl6
15:49 xinming joined #perl6
15:49 abruanese joined #perl6
15:49 bioduds this is why beginners dont go with ruby on rails
15:49 bioduds they give up on the installation process
15:49 damnlie joined #perl6
15:49 ssm joined #perl6
15:50 bioduds if the beginner has no clue as to what a PATH means and what should he do with it, then he is not using Perl6
15:50 mtj_ joined #perl6
15:50 bioduds but if the install does by default the full installation, prompting the user, then at least he will be able to use it
15:51 bioduds without knowing what happened during installation
15:51 committable6 joined #perl6
15:51 geekosaur joined #perl6
15:52 AlexDaniel m: say 25 xx Inf
15:52 camelia rakudo-moar f49b38: OUTPUT«(...)␤»
15:52 AlexDaniel m: say (25 xx Inf)[^20]
15:52 camelia rakudo-moar f49b38: OUTPUT«(25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25 25)␤»
15:52 mst this is why what I suggested was to -first- make it work by -telling- the user what to add
15:52 user9 joined #perl6
15:52 roguelazer joined #perl6
15:52 mst and -then- once that's stable, you can add an option to do it automatically
15:52 AlexDaniel m: say 25 x Inf
15:52 camelia rakudo-moar f49b38: OUTPUT«Cat object not yet implemented. Sorry. ␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
15:52 chee joined #perl6
15:52 mst bioduds: are you detecting the shell and doing: echo 'To set this up globally, add this line to your .bashrc:' yet?
15:52 mst because that's the next step
15:53 mst newbies should be able to copy and paste a line into a file
15:53 notbenh joined #perl6
15:53 El_Che bioduds: <PATH INFO>. Do you want me to add this to your $shell.rc? <y|n> (default no)
15:54 mcmillhj joined #perl6
15:54 El_Che but in that case you'll need to figure out which shell and which config files the user is using (bash has a zillion options)
15:54 chansen_ joined #perl6
15:55 El_Che there is nothing more annoying that automagically stuff that does not work on your setup
15:55 bioduds doing right now i guess
15:55 El_Che anyway, as stmuk says, rakudo star already prints the path info
15:55 El_Che so you get that for free :)
15:56 poohman joined #perl6
15:56 TheLemonMan joined #perl6
15:56 bioduds yes
15:56 bioduds default yes
15:56 El_Che (please don't confuse constructive criticism with grumpyness <-- just checking)
15:57 cog__ joined #perl6
15:58 poohman_ joined #perl6
15:58 bioduds im going to try
15:59 bioduds I only know the basic linux shell
15:59 ugexe AlexDaniel: maybe of interest to your shebang gist, but all installed perl6 module's bin/ scripts get a shebang in their wrapper https://github.com/rakudo/rakudo/blob/nom/src​/core/CompUnit/Repository/Installation.pm#L52
16:00 domidumont joined #perl6
16:03 w4and0er96 joined #perl6
16:04 El_Che bioduds: I could be wrong, but I think command is a bash builtin (so it may not work on other shells if the don't have it builtin"
16:05 mcmillhj joined #perl6
16:06 stmuk the curl line should probably say "bash" not "sh" since they are no longer the same on many linux distros
16:06 El_Che bioduds: and you need to put the echo command in one command for not repeating dirs in paths
16:07 El_Che on my system: /bin/sh -> dash
16:08 El_Che you could replace the command part by which: which perl >/dev/null || ...
16:09 stmuk it probably should also check for the presence of gcc
16:09 timotimo my rakudo folder has a folder "GNOREME" in it %)
16:09 autarch joined #perl6
16:10 mst timotimo: I Gnore, They Gnore, You Gnore, We Gnore
16:11 bioduds sorry
16:11 El_Che for i in perl make gcc; do if [ -z $(which $i) ]; then echo "$i not present" && exit 1; fi; done
16:11 El_Che something like that
16:11 bioduds like so? export PATH=$HOME/rakudo/rakudo-star-2016.07/i​nstall/bin:$HOME/rakudo/rakudo-star-201​6.07/install/share/perl6/site/bin:$PATH
16:12 El_Che yeah
16:12 bioduds ok
16:12 bioduds done
16:13 bioduds do you think this here is better? http://67.205.136.118/install.sh
16:13 bioduds ops wait
16:14 stmuk I would add an "if" to check the $SHELL is bash around that
16:14 dylanwh joined #perl6
16:14 bioduds now
16:14 bioduds http://67.205.136.118/install.sh
16:15 bioduds is this better?
16:15 bioduds where should i add the if?
16:15 stmuk around the while loop
16:16 bioduds if $SHELL == bash
16:16 bioduds if $SHELL == bash; then
16:16 timotimo needs [ ] i think?
16:17 bioduds if [$SHELL == bash]; then
16:17 timotimo and i thnik you have to use eq for strings rather than == ?
16:18 bioduds if [ “$stringvar” == “tux” ]; then
16:18 mst if [ "$SHELL" == "bash" ];
16:18 mst timotimo: no, that's perl5
16:18 mst timotimo: shell is opposite
16:18 stmuk I don't think the "rm -rf ~/rakudo
16:18 stmuk is a good idea just exit if the directory exists
16:21 mcmillhj joined #perl6
16:21 grondilu -eq
16:23 poohman joined #perl6
16:23 stmuk of course you could just write the script in perl anyway since perl needs to be installed anyway
16:23 nine As someone who actually develops in ~/rakudo I'm glad that I'm also someone who first looks at shell scripts before piping them to sh ;)
16:24 El_Che I love it when you start with a 1 liner and you end with a huge perl script for all the corner cases ;)
16:24 El_Che nine: shhh, you're a minirity ;)
16:25 bioduds how about this http://67.205.136.118/install.sh
16:25 grondilu oh yeah in shell, -eq is for numeric values and = is for strings.  Weird.
16:25 timotimo i do that development in ~/perl6
16:25 * stmuk shows his age stick an "echo + + > .rhosts" in as well (*joke*)
16:26 geekosaur probably because the shell is very string-y and numeric comparison was added sometime after =
16:26 grondilu yeah
16:33 bioduds testing
16:33 timotimo who was asking me for a coverage report again?
16:35 mcmillhj joined #perl6
16:35 stmuk there is an interesting video of Stephen Bourne at a recent BSD Con explaining and regretting some of his design decisions
16:38 geekosaur we were all young once :)
16:39 El_Che rhosts, lol. It used to be my colleages (at a previous job) favorite tool :)
16:41 dogbert17 o/ #perl6
16:41 El_Che they had 2 deployment ways. rsh and a tar through ftp unpacked with a cron job. Those were the days. They almost died when I closed telnet, r* and ftp :)
16:41 * geekosaur digs out his old openssh t-shirt, the one with the gravestones (epitaph for rsh: "+ +")
16:41 El_Che hehe
16:41 dogbert17 .seen Frameless
16:41 yoleaux I saw Frameless 19 Jul 2016 15:51Z in #perl6: <Frameless> And now you made me think I should pick a new nick :P
16:41 timotimo http://hack.p6c.org/~timo/coverage/  -  a rough coverage report of the core setting
16:42 bioduds what are the possibilities in echo $SHELL?
16:42 dogbert17 .seen BrokenRobot
16:42 yoleaux I saw BrokenRobot 2 Aug 2016 15:28Z in #perl6: <BrokenRobot> harmil_wk: I have a private list of ticket tags and I have these marked as "Easy"... they may or may not be easy, but take a look: https://gist.github.com/zoffixznet​/b7e1e119d14bb652fda313768e12c874
16:42 dogbert17 so, which nick is Zoffix using today?
16:43 El_Che geekosaur: https://www.openbsd.org/images/tshirt-9b.jpg that one?
16:44 geekosaur yep!
16:44 timotimo i'm not looking forward to investigating why some lines that immediately follow each other don't end up green even though there's not really a way that red ones can be not executed and then some green lines could be run ...
16:44 stmuk they missed rexd!
16:45 geekosaur rexec was insecure even for an r-command >.>
16:46 bioduds this here didnt work
16:46 bioduds if [ "$SHELL" == "/bin/bash" ]; then
16:46 bioduds sh: 37: [: /bin/bash: unexpected operator
16:46 bioduds i didnt understand
16:47 geekosaur it should be =
16:47 bioduds only =
16:47 geekosaur == is for [[ ]] (ksh and formerly POSIX version, with somewhat saner behavior)
16:47 bioduds oh, how weird
16:47 stmuk this is why people use perl! :)
16:48 bioduds :)
16:48 El_Che that works on my shell: if [ "$SHELL" == "/bin/bash" ]; then echo foo; fi
16:48 bioduds eq is also weird man
16:49 huf El_Che: but is your shell 1) your /bin/sh and 2) is it running in the same mode as /bin/sh?
16:49 El_Che huf: of course not :)
16:50 bioduds for now, with my current knowlege, i can only ask if if /bin/bash and act accordingly
16:50 bioduds ask if wants to write to .bashrc
16:50 bioduds opened to all suggestions
16:50 El_Che write it in perl and use Moose
16:50 * El_Che ducks
16:50 bioduds no
16:50 geekosaur if it's bash then it's not guaranteed to behave the same way
16:51 mcmillhj joined #perl6
16:51 bioduds my script actually checks if there is perl
16:51 geekosaur [ ] behavior is implementation defined, and bash generally does *not* stick to traditional /bin/sh like e.g. dash does
16:52 gregf_ bioduds: Perl is available on most OS's
16:52 MasterDuke timotimo: i was asking about the coverage report
16:52 bioduds not actually
16:52 bioduds fedora for isntance
16:52 geekosaur (sadly, while [[ ]] was standardized, POSIX decided it wasn't needed any more --- opening up the possibility that its behavior will diverge in the future, or even go away (although I think not even bash will remove it. but I will not promise)
16:52 bioduds not there
16:52 El_Che bioduds: welcome: http://deeper-down-the-rabbit-hole.com/wp-​content/uploads/2011/04/209101_21555374179​5047_215532938463794_993548_8201099_o.jpg
16:53 bioduds lol
16:53 bioduds yes
16:53 bioduds i actually feel more like Neo right now :)
16:53 El_Che but you took both pills?
16:53 El_Che :)
16:53 MasterDuke timotimo: has it been updated recently?
16:54 bioduds kkkkkk
16:54 geekosaur http://g02.a.alicdn.com/kf/HTB1jWQjJXXXXXc2XVXX​q6xXFXXXe/-font-b-UNIX-b-font-font-b-System-b-f​ont-Administration-Handbook-3rd-Edition-E.jpg
16:54 bioduds the pill you took is part of a trace program
16:54 ugexe what is this meant to offer over something like
16:54 ugexe curl https://raw.githubusercontent.com/tad​zik/rakudobrew/master/bin/rakudobrew && perl rakudobrew/bin/rakudobrew build moar-blead-nom
16:55 mst ugexe: reducing the level of thinking involved for new users
16:55 bioduds it is designed to disrupt your signal so we can pinpoint your location
16:55 bioduds what does that mean?
16:55 El_Che ugexe: haha. I have *exact* that edition in my shelf
16:55 bioduds it means buckle your seat belt dorothy cause kansas is going bye bye
16:56 bioduds :)
16:56 El_Che :)
16:56 El_Che food
16:56 El_Che bbl
16:56 stmuk Evi Nemeth was lost at sea :(
16:56 geekosaur yes :(
16:56 ugexe a new user is just copy and pasting that line anyway
16:56 ugexe just like they would be with `xxx | sh foo`
16:56 * geekosaur still loves how they snuck a middle finger into that cover
16:57 benchable6_ joined #perl6
16:57 dalek doc: 71fde8d | (Jan-Olof Hendig)++ | doc/Type/IO/Handle.pod6:
16:57 dalek doc: Added doc for the :close adverb in slurp-rest
16:57 dalek doc: review: https://github.com/perl6/doc/commit/71fde8d0a1
16:58 TheLemonMan ugexe, why does zef throw an exception (and exits) when a module's already installed ?
16:59 ugexe rakudo throws an exception
16:59 ugexe zef could hide that, sure. but rakudo throws it
17:00 benchable6 joined #perl6
17:05 mcmillhj joined #perl6
17:06 AlexDaniel joined #perl6
17:09 bioduds damn, got an infinite loop on prompt
17:09 bioduds $yn = "y"
17:09 bioduds sh: 39: =: not found
17:09 bioduds gosh
17:10 bioduds please, help
17:10 bioduds what is wrong here: $yn = "y"
17:12 bioduds good lord, is yn
17:12 bioduds what a bizarre language
17:16 El_Che bioduds: spaces
17:17 cooper joined #perl6
17:18 timotimo gosh is a shell writenn in go? or with go syntax?
17:19 El_Che :)
17:19 El_Che you forgot to test for the error!
17:19 El_Che :)
17:19 firstdayonthejob joined #perl6
17:19 cooper joined #perl6
17:19 El_Che you have to type it after each command :)
17:20 mcmillhj joined #perl6
17:21 timotimo :D
17:21 TheLemonMan ugexe, if I try 'uninstall zef:auth' I get a warning about Any being used in a Str context
17:31 bioduds im overwhelmed
17:33 dalek perl6-examples: acc163b | paultcochrane++ | categories/euler/prob463-shlomif.p6:
17:33 dalek perl6-examples: Indent curlies consistently
17:33 dalek perl6-examples: review: https://github.com/perl6/perl​6-examples/commit/acc163b4ff
17:33 dalek perl6-examples: 3da8055 | paultcochrane++ | categories/euler/prob463-shlomif.p6:
17:33 dalek perl6-examples: Make debuging code selectable with a flag
17:33 dalek perl6-examples: review: https://github.com/perl6/perl​6-examples/commit/3da805532c
17:36 mcmillhj joined #perl6
17:37 avar joined #perl6
17:41 perturbation joined #perl6
17:45 Shantanu1 joined #perl6
17:46 masak bioduds: any way we can help?
17:56 mcmillhj joined #perl6
17:57 Xliff Wheee! I have calibre running again, but this after needing to run a few commands the developer says is in the User's Manual, but aren't.
17:57 zacts joined #perl6
17:57 Xliff Nappy time.
17:59 geekosaur o/O
18:01 _slade_ joined #perl6
18:27 mcmillhj joined #perl6
18:28 spider-mario joined #perl6
18:29 lambd0x joined #perl6
18:29 lambd0x Hi everyone!
18:31 domidumont joined #perl6
18:37 ZoffixLappy joined #perl6
18:38 [ptc] timotimo: did you get any further with Coverity?
18:38 lizmat_ lambd0x o/
18:39 mcmillhj joined #perl6
18:41 go|dfish joined #perl6
18:42 TimToady joined #perl6
18:47 rindolf joined #perl6
18:51 TEttinger joined #perl6
19:01 Roamer` joined #perl6
19:01 timotimo [ptc]: haven't scanned a recent built, but many issues are still to be fixed
19:01 timotimo it'd be nice if the issues could be publically available
19:14 labster joined #perl6
19:17 firstdayonthejob joined #perl6
19:18 andrzejku joined #perl6
19:25 [ptc] timotimo: I agree; the issues should be publically available
19:25 [ptc] I set it up on my own account since I didn't have admin access to MoarVM/MoarVM on GitHub and wanted to start checking Coverity for problems
19:25 elohmrow joined #perl6
19:26 [ptc] maybe it's just a case of getting the MoarVM/MoarVM admin to add the project to coverity.  At least then things would be decoupled from my account.
19:27 elohmrow what in p6 is like File::Next from p5 land?
19:29 ChoHag joined #perl6
19:29 aries_liuxueyang joined #perl6
19:29 lizmat elohmrow: what does File::Next do again ?
19:29 elohmrow iterates a tree, returning all files and some meta
19:29 ZoffixLappy Seems to be an iterator for a directory tree https://metacpan.org/pod/File::Next
19:29 elohmrow liz: ^
19:30 * arnsholt has discovered pycparser
19:31 arnsholt Which looks veeery interesting for various things
19:31 elohmrow lizmat: back story - i was looking at list of most wanted modules, as a way to really dive in to a project.  found App::Ack in there, which is something i have used a bunch.  asked author if he wanted to do it for p6, he said i should try it.  File::Next is part of App::Ack's foundation
19:32 lizmat I see...  well, I don't see anything covering that functionality in modules.perl6.org
19:32 lizmat so I would say, go for it
19:32 lizmat should be relatively easy, afaics
19:32 elohmrow lizmat: i don't see it either.  the functionality itself, should be easy i think yes
19:33 El_Che ack is awesome
19:33 elohmrow El_Che: yep
19:33 masak I basically stopped using `ack` and switched completely to `git grep` for everything
19:33 TheLemonMan El_Che, ag is even faster if you don't mind it being written in C rather than perl
19:33 El_Che 2 new things to try :)
19:34 elohmrow well i guess i will start putting a plan together then ... i think putting together App::Ack would be a good trial for a non perl6 guy like me :)
19:34 lizmat elohmrow: I particularly look forward to App::Ack going through dirs asynchronously  :-)
19:34 elohmrow ;)
19:35 tadzik elohmrow: File::Find may satisfy your needs :)
19:35 El_Che lizmat: async will be easy. Putting the output together... less so :)
19:35 elohmrow tadzick: maybe.  a lot of things might, i guess it depends on the amount of meta data that comes with the find
19:35 zacts joined #perl6
19:36 lizmat El_Che: well, fwiw, generally I don't care about the order of the output of ack
19:36 nige1 joined #perl6
19:36 elohmrow ok, i have a sink to fix.  just wanted to check if it sounded useful and if anyone had any knowledge of a WIP
19:37 elohmrow lizmat: El_Che: thanks, and, good night!
19:37 El_Che <some green stuff> found files 3 match: <some green stuff> ackp6 <som<some gre stu>een stuf> ...
19:37 El_Che :)
19:38 lizmat ah, like that
19:38 El_Che problem now several have you
19:38 El_Che :)
19:38 lizmat but the output would only be sent by the controlling thread, getting it as a result of the Promise of the start block
19:38 lizmat think that should work pretty well
19:39 El_Che go func() { messages <- "ping" }()
19:39 El_Che :)
19:42 ZoffixLappy "Private multi-methods are not supported" :/ really?
19:43 * ZoffixLappy wonders why
19:43 ZoffixLappy Doesn't matter, I guess
19:43 mst odd
19:44 El_Che ZoffixLappy: an API is all about the façade :)
19:45 tushar joined #perl6
19:45 nige1 hi
19:46 ZoffixLappy hey
19:46 canopus joined #perl6
19:46 nige1 HI Zoffix
19:46 mst hrmf
19:46 nige1 - I think there is an opportunity for promoting Perl 6 via search engine
19:46 nige1 s
19:46 ZoffixLappy oh boy
19:46 ZoffixLappy nige1, what is it?
19:47 vike joined #perl6
19:47 nige1 I gave this lightning talk at yapc: http://www.slideshare.net/tre​xy/seopan-talkbynigehamilton
19:47 nige1 basically - it distills what stackoverflow does
19:48 nige1 providing answer to questions - except in the case of code - that's problems ->  solutions
19:49 ZoffixLappy nige1, so what's your suggestion?
19:49 ZoffixLappy to what we should be doing... to promote and whatnot
19:50 mst hm
19:50 mst where would I look in the docs
19:50 nige1 - a heavily SEOed site for providing Perl6 problems -> solutions
19:50 mst to grok the difference between 'my $foo = [];' and 'my @foo;'
19:50 mst given $foo[0] and @foo[0] etc. work the same
19:50 nige1 so for example: "how do a I parse a csv file"
19:50 timotimo mst: i'd go with $foo.WHAT and @foo.WHAT
19:50 nige1 we provide a cut-n-pastable perl 6 snippe that does just that
19:51 timotimo and then look at the page for the class in question?
19:51 mst timotimo: both say (Array)
19:51 girafe2 joined #perl6
19:52 nige1 I noticed there is already a reasonable answer to parse a csv file on rosetta code - in perl 6
19:52 timotimo ok, so which differences are you interested in?
19:52 timotimo things like "how do they behave in for loops" and such?
19:52 nige1 the code there is under a GPL 'documentation licence' 1.2 - and could be used in the SEO site
19:52 mst I don't know which differences I'm interested in because I don't know what the difference *are* yet
19:52 ZoffixLappy nige1, what exactly is a "seo site"?
19:53 nige1 search engine optimised - for dealing with code related searches on Google et al
19:53 ZoffixLappy nige1, from what I gather so far, you're proposing we create a bunch of "fake" questions on Stack Overflow that we answer with copy-pasteable examples
19:53 mst what I mean, I think, is "other than the sigil, what's going to behave differently?"
19:53 mst and was hoping there'd be an FM to R for this
19:53 ZoffixLappy I'm not aware of it... though it's on my TODO to write a blog post about
19:53 timotimo mst: good point
19:54 nige1 certainly learning lessons from SO - but creating a separate standalone solutions directory site
19:54 nige1 an overlay to cpan/modules.perl.org
19:54 timotimo https://docs.perl6.org/language/variables#Sigils_ :)
19:54 mst timotimo: sorry, I'm at "I don't know enough to know which parts of what I don't know are things I want to know" ;)
19:55 * ZoffixLappy isn't too happy with "copy-pasteable solutions"
19:55 ZoffixLappy There are enough PHP "programmers" out there.
19:55 nige1 well - they get a bad rep ;-) but when I do searches on Google - that's what gets rank
19:55 timotimo https://docs.perl6.org/language/list - also a good thing to read
19:55 timotimo https://docs.perl6.org/language/contain​ers#Scalar_containers_and_listy_things  -  also very helpful
19:56 ZoffixLappy nige1, but to what end? I can google PHP solutions that will introduce security vulnerability into my code if I use them. Why would such a 'directory site' be desirable for Perl 6?
19:56 ZoffixLappy I'm unsure what this would do to "promote Perl" really.
19:57 nige1 well there is an audience of coders - looking to solve computing problems
19:57 mst timotimo: this came out of my discovering I can't
19:57 mst my @bar := @foo.map: 1+*
19:58 ZoffixLappy nige1, what kind of coders? Have they decided to use Perl 6 already?
19:58 * mst is trying very hard to do single-assignment
19:58 timotimo what was the site called that collected perl snippets and is hugely infamous for it? :)
19:58 nige1 anyone searching google
19:58 mst perlmonks?
19:58 timotimo mst: if you want to keep the iteratory thing, it's best to just assign to a scalar container
19:58 timotimo nope, not that one
19:58 nige1 someone who is looking to a parse a csv file for example
19:58 mst timotimo: I don't want to
19:58 El_Che timotimo: Matt's archvie
19:58 El_Che (An other one)
19:58 mst timotimo: I just want to be read-only
19:58 timotimo that could be the one
19:59 mst argh argh FormMail.PL argh
19:59 mst never have I been so unhappy to be called Matt
19:59 timotimo i think the only way you can have a read-only array-y thing is to .List it? somehow get it to become a List rather than an Array?
19:59 * El_Che wonders how many mails mst got with support request for formmail
19:59 timotimo because Array == List + Scalar Containers for each element
19:59 ZoffixLappy nige1, so your assumption is that a person searching google will be choose to use Perl 6 for their project, as opposed to, say, PHP, as long as Perl 6's copy-pasteable solution comes up first in search results than PHP's one?
19:59 mst timotimo: my @bar = @foo.map(1+*).List; works, yes
20:00 timotimo and then it won't mutate?
20:00 mst gah
20:00 mst timotimo: my @bar := @foo.map(1+*).List; works, yes, and won't mutate
20:00 timotimo sounds good
20:00 mst but that offends me, since it's almost as much typing as in perl5
20:00 mst and I was hoping given a more advanced language I could get "no, everything is readonly after first assignment" more easily ;)
20:00 timotimo well, you're not using >>+>> 1
20:01 nige1 I think google prefers to show pages that solves the users search problem - and the Perl 6 page will not appear above the php one unless it helps to do that
20:01 nige1 and one way it can do that is by providing some copy-pasta
20:01 mst I think a library of copy-pastable snippets for common tasks is a good thing anyway
20:01 mst newbies often find copy-paste-edit a good way to get started
20:01 * ZoffixLappy doesn't
20:02 ZoffixLappy Unless it's a proper module
20:02 mst 'baby perl' is something we're intentionally trying to make possible
20:02 nebuchad` joined #perl6
20:02 timotimo how is babby perled
20:02 profan i wouldnt say for "common tasks" but i would think a repository of examples would be nice to have
20:02 lizmat m: constant @a = ^10; @a[0] = 42   # mst ???
20:02 camelia rakudo-moar bdd469: OUTPUT«Cannot modify an immutable Int␤  in block <unit> at <tmp> line 1␤␤»
20:02 cygx joined #perl6
20:02 cygx o/
20:02 cygx m: my @foo = <1 2 3>; say WHAT list @foo.map: 1+*
20:02 camelia rakudo-moar bdd469: OUTPUT«(Seq)␤»
20:02 profan more like, "here is how to write idiomatic perl" rather than "how to solve problem x"
20:02 cygx ^ bug?
20:02 mst timotimo: huh
20:03 mst timotimo: my @bar := @foo >>+>> 1; # yep
20:03 mst so my only real problem here is map hating me
20:03 mst because of the seq return
20:03 mst it's just kinda *fnrrrgh* that '=' works to get a mutable array out the Seq, but ':=' doesn't
20:03 Jonis_ joined #perl6
20:03 timotimo that's the difference between list and List :)
20:03 sammers_ joined #perl6
20:03 timotimo List coerces to a List object, list gives you something that can list
20:04 timotimo is how i think about it
20:04 nige1 yes - so I'd suggest the solution/example pages - should be focussed so they answer the problem
20:04 leont Well, if you use :=, I'd assume you want that sort of thing on purpose
20:04 cygx timotimo: interesting, I did not know that
20:04 mst leont: I'm trying to do 'single assignment'
20:04 ZoffixLappy nige1, cool. When will we see the first demo? :)
20:04 timotimo who knows if it's actually correct, though :)
20:05 timotimo mst: i'm not sure := is what'll give you what you want
20:05 mst leont: i.e. readonly-after-I-first-set-the-variable
20:05 mst := was one of the suggestions, and I've been playing with it
20:05 leont At least, when I use := that often means I want the Seq instead of the List, because I want the laziness
20:05 nige1 :-) - well was just putting the idea out there
20:05 timotimo in any case, $ goes with := much better than @ and % do
20:05 leont Yeah
20:05 mst nige1: as ever, if you don't make a start, other people are less likely to come play :)
20:05 itaipu_ joined #perl6
20:05 ZoffixLappy nige1, :) well, you're most familiar with that idea? Why not try to start something?
20:06 nige1 yes - mst - understood
20:06 cygx well, according to the docs, Any.list should return a list
20:06 cygx I would have expecte &list to behave the same way
20:06 cygx *should return a List
20:06 ZoffixLappy m: my $x = 42; my $b := $x; $b = 72; dd $x;
20:06 camelia rakudo-moar bdd469: OUTPUT«Int $x = 72␤»
20:07 nige1 I don't think that anyone would object to seeding the site with some common rosetta code example - but please contact me if you think there would be an issue
20:07 mst I start to suspect that my usual approach in perl5 of "stop worrying about it and just slap anybody who sends a patch mutating things" will be easiest for the moment
20:07 mst though >>+>> is freaking cool
20:08 ZoffixLappy »+» is cooler :P
20:08 * cygx has used the 'fish operator' <<=><<
20:08 cyphase_eviltwin joined #perl6
20:09 yossarian joined #perl6
20:09 yossarian joined #perl6
20:09 ZoffixLappy m: my @foo = ^10; my @bar := @foo».&prefix:<++>; dd @bar
20:09 camelia rakudo-moar bdd469: OUTPUT«[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]␤»
20:09 ZoffixLappy heh
20:10 prussian left #perl6
20:11 timotimo ZoffixLappy: why the hell would you put prefix++ at the end there? o_O
20:11 benchable6 joined #perl6
20:11 Spot__ joined #perl6
20:11 dalek joined #perl6
20:11 SourceBaby joined #perl6
20:11 stigo joined #perl6
20:11 PotatoGim joined #perl6
20:11 tbrowder joined #perl6
20:11 kent\n joined #perl6
20:11 olinkl joined #perl6
20:11 peteretep joined #perl6
20:11 notbenh_ joined #perl6
20:11 timeless joined #perl6
20:11 synopsebot6 joined #perl6
20:12 ZoffixLappy timotimo, because I can :)
20:12 ZoffixLappy (•_•)
20:12 ZoffixLappy ( •_•)>⌐■-■
20:12 ZoffixLappy (⌐■_■)
20:12 mtj_ joined #perl6
20:13 cgfbee joined #perl6
20:14 mst ZoffixLappy: hm, could I make an anon method with that
20:14 mst @foo>>.&meth(*+1) or something?
20:14 timotimo subs will definitely work
20:14 ZoffixLappy m: my @foo = ^10; my @bar := [[&prefix:<++>]] @foo; dd @bar
20:14 camelia rakudo-moar 74f1ed: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤  in block <unit> at <tmp> line 1␤␤»
20:15 timotimo meths ought to work, too.
20:15 mst well, how would I stick an anon sub after the dot?
20:15 ZoffixLappy mst, the .&blah calls a sub with the first arg set to the invocant
20:15 ZoffixLappy oh
20:15 ZoffixLappy m: say 42.&(*+1)
20:15 camelia rakudo-moar 74f1ed: OUTPUT«43␤»
20:15 ZoffixLappy m: say ^10 >>.&(*+1)
20:15 camelia rakudo-moar 74f1ed: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed postfix call␤at <tmp>:1␤------> 3say ^10 >>.7⏏5&(*+1)␤»
20:16 ZoffixLappy m: say (^10)>>.&(*+1)
20:16 camelia rakudo-moar 74f1ed: OUTPUT«(1 2 3 4 5 6 7 8 9 10)␤»
20:16 mst HAH
20:16 ZoffixLappy :)
20:16 mst my @bar := @foo>>.&(*+2)
20:16 mst much nicer than .List
20:16 mst ... I'm going to make people cry, aren't I?
20:17 * mst thinks he's going to have to read docs.perl6.org from end to end at some point
20:17 mst then I can harass zoffix at a higher level
20:18 hankache joined #perl6
20:18 ZoffixLappy :D
20:18 mst anyway, my turn to ->pub
20:18 mst &
20:19 cdg joined #perl6
20:21 timeless joined #perl6
20:22 lizmat and another Perl 6 Weekly hits the Net: https://p6weekly.wordpress.com/2016/​09/05/2016-36-introducao-ao-perl-6/
20:22 ZoffixLappy \o/
20:23 Spot__ joined #perl6
20:23 hankache lizmat++
20:23 hankache hello #perl6
20:24 ZoffixLappy lizmat++ good weekly
20:24 ZoffixLappy \o hankache
20:24 peteretep joined #perl6
20:24 hankache hello ZoffixLappy
20:26 PotatoGim joined #perl6
20:27 ggherdov joined #perl6
20:36 [ptc] lizmat++
20:41 masak lizmat++ # https://p6weekly.wordpress.com/2016/​09/05/2016-36-introducao-ao-perl-6/
20:43 ggherdov joined #perl6
20:43 woolfy joined #perl6
20:44 ggherdov joined #perl6
20:49 sufrostico joined #perl6
20:52 nige1 joined #perl6
20:59 Ven_ joined #perl6
21:12 El_Che lizmat++
21:22 aries_liuxueyang joined #perl6
21:24 ChoHag joined #perl6
21:25 ZoffixLappy Is there a use for Junctions other than collapsing them in Boolean context?
21:26 moritz not really; if you try to use it in another way, it's more abuse than ues
21:26 ZoffixLappy Thanks.
21:27 sufrostico joined #perl6
21:35 zacts joined #perl6
21:35 lizmat eh, but what about:
21:36 lizmat m: sub a($a) { $a }; dd a(1|2|3)
21:36 camelia rakudo-moar e5d7a1: OUTPUT«any(1, 2, 3)␤»
21:36 ZoffixLappy m: sub a($a) { $a.say }; dd a(1|2|3)
21:36 camelia rakudo-moar e5d7a1: OUTPUT«1␤2␤3␤any(Bool::True, Bool::True, Bool::True)␤»
21:36 ZoffixLappy :o
21:36 lizmat well, I guess that's still collapsing in the end  :-)
21:36 ZoffixLappy lizmat++
21:41 lizmat I guess if you're executing a() for its side-effects, you're abusing the junction  :-)
21:41 lizmat or are you?
21:42 masak arguably whenever junctions get passed to something with observable side-effects, it counts as action at a distance.
21:42 lizmat I guess if you want to make sure all states are executed, you would need to do 1&2&3
21:42 lizmat rather than 1|2|3
21:42 masak lizmat: nope; they all run conceptually "in parallel"
21:43 lizmat so we're always sure that they will all be run ?
21:43 lizmat even on an any ?
21:43 masak aye
21:43 lizmat TIL  :-)
21:43 masak hm
21:43 lizmat I guess it's different in the collapsing code
21:43 ZoffixLappy masak, why action at a distance? I see little difference between foo 2|3 and foo for 2, 3
21:44 masak anyway, the assumption that when you call something once it runs once is pretty strong one. breaking it makes for hard-to-understand code.
21:44 grondilu joined #perl6
21:44 * ZoffixLappy nods
21:44 * ZoffixLappy still writes in this use into the article :}
21:44 masak lizmat: I might have stated things too strongly, I dunno. maybe junctions do reserve the right to short-circuit.
21:45 masak lizmat: but the evaluation order between the elements is definitely not guaranteed. just like with hypers.
21:45 lizmat well, in my example a() was called in sink context
21:45 lizmat which is causing a collapse
21:45 lizmat no?
21:46 masak looks like it's not sink context; it's `dd` printing the value
21:46 ZoffixLappy m: https://gist.github.com/zoffixznet​/4eac24fbd0074d6f9497bd7902168720
21:46 camelia rakudo-moar e5d7a1: OUTPUT«5 is a prime␤42 is an even number␤10000000 is an even number␤10000000 is pretty big␤»
21:48 masak 'night, #perl6
21:48 ZoffixLappy night
21:49 lizmat good night, masak
21:49 ZoffixLappy m: https://gist.github.com/zoffixznet​/1b860cd78ebf1406e142f5c2a3d8df97
21:49 camelia rakudo-moar e5d7a1: OUTPUT«5 is a prime␤42 is an even number␤10000000 is an even number␤10000000 is pretty big␤a square of a value if larger than 1e10␤»
21:50 lizmat ZoffixLappy: that's just the current behaviour, just like >>.
21:50 * ZoffixLappy is OK with disavowing side-effects from Junction sub calls, but... avowing modification of Junctioned values with such subs
21:52 ZoffixLappy m: https://gist.github.com/zoffixznet​/05df82a4d8566d06de0f2c80e209db1a
21:52 camelia rakudo-moar e5d7a1: OUTPUT«5 is a prime␤42 is an even number␤10000000 is an even number␤10000000 is pretty big␤not EXACTLY ONE square is larger than 50␤»
21:52 ZoffixLappy hm
21:54 ZoffixLappy Oh yeah, I just wrote the stuff wrong
21:54 ZoffixLappy m: https://gist.github.com/zoffixznet​/7c418411a4f82a1e79af57308def539b
21:54 camelia rakudo-moar e5d7a1: OUTPUT«5 is a prime␤42 is an even number␤10000000 is an even number␤10000000 is pretty big␤not EXACTLY ONE square is larger than 50␤»
21:56 ZoffixLappy m: https://gist.github.com/zoffixznet​/df4d6eff35eb7a6064e58d000b0c9c95
21:56 camelia rakudo-moar e5d7a1: OUTPUT«one(1, 5, 42, 10000000) is a prime␤one(1, 5, 42, 10000000) is pretty big␤EXACTLY ONE square is larger than 1e10␤»
21:57 ZoffixLappy that's interesting
21:57 ZoffixLappy Why is `an even number` missing?
21:57 ZoffixLappy And it's curious that's specifying an explicit Junction argument produces different behaviour.
21:58 ZoffixLappy m: say Junction ~~ Any; say Junction ~~ Mu
21:58 camelia rakudo-moar e5d7a1: OUTPUT«False␤True␤»
21:58 ZoffixLappy Ah. Now that makes sense.
21:58 geekosaur because two are?
22:01 ZoffixLappy Two are?
22:02 geekosaur "one" junction asserts exactly one of the superposed values qualifies, no? both 42 and 10000000 are even.
22:02 geekosaur so it can't one(). it could any()
22:03 ZoffixLappy But does it know I'm `say`ing anything?
22:04 ZoffixLappy m: https://gist.github.com/zoffixznet​/0d1cc5690270a6358335edd2b3d67431
22:04 camelia rakudo-moar e5d7a1: OUTPUT«one(1, 5, 42) is a prime␤one(1, 5, 42) is an even number␤»
22:04 ZoffixLappy Apparently it does...
22:04 geekosaur ? $n autothreads in $n %% 2
22:04 * ZoffixLappy backs away from this black magic
22:04 geekosaur the result is not compatible with one(), because not exactly one superposed value is true
22:04 ZoffixLappy geekosaur++ pointing out another awesome usecase in my article :d
22:04 geekosaur (after the autothread)
22:05 ZoffixLappy s/in/for/;
22:06 geekosaur m: my $n = one(1, 5, 42, 1e7.Int); say $n %% 2; say so $n %% 2
22:06 camelia rakudo-moar e5d7a1: OUTPUT«one(False, False, True, True)␤False␤»
22:11 ZoffixLappy .oO( using a Junctioned sub to perform a DB lookup... ???... profit! )
22:22 lizmat good night, #perl6!
22:23 ZoffixLappy night
22:29 ZoffixLappy m: sub do-stuff (Junction() $n) {}(42)
22:29 camelia rakudo-moar e5d7a1: OUTPUT«Method 'Junction' not found for invocant of class 'Int'␤  in sub do-stuff at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
22:37 labster joined #perl6
22:43 lue joined #perl6
23:00 brrt joined #perl6
23:03 BenGoldberg joined #perl6
23:08 ZoffixLappy New blog post "Perl 6's Schrödinger-Certified Junctions": http://perl6.party/post/Perl-6-​Schrodinger-Certified-Junctions
23:09 dalek doc: 81ef09b | titsuki++ | doc/Language/faq.pod6:
23:09 dalek doc: Add some indexes for FAQ
23:09 dalek doc: review: https://github.com/perl6/doc/commit/81ef09bb51
23:09 dalek doc: dfd4257 | titsuki++ | doc/Language/faq.pod6:
23:09 dalek doc: Merge pull request #886 from titsuki/index-faq
23:09 dalek doc:
23:10 dalek doc: Add some indexes for FAQ
23:10 dalek doc: review: https://github.com/perl6/doc/commit/dfd4257f1d
23:19 heatsink joined #perl6
23:21 benji joined #perl6
23:24 Guest44202 how would I read a certain number of characters from a file for each iteration of a loop
23:24 Guest44202 so I could just get 16 or 32 characters per iteration while reading a file's contents
23:25 * ZoffixLappy naively suggests .comb(16)[0] and .comb(32)[0]
23:25 ZoffixLappy There's likely a betetr away
23:26 ZoffixLappy Looking at https://docs.perl6.org/type/Junction, the any junction seems not entirely accurate; it states "at least one value evaluates to True", but that's not true
23:26 ZoffixLappy m: my @nothing-to-see; say "yeah, it's in 'ere" if @nothing-to-see.any == 42
23:26 camelia rakudo-moar e5d7a1: ( no output )
23:27 ZoffixLappy Oh... the other theory is that I'm too drunk to think straight :P
23:27 ZoffixLappy m: my @nothing-to-see; say "yeah, it's in 'ere" if @nothing-to-see.all == 42 # I was thinking of `any` whose description is perfectly good
23:27 camelia rakudo-moar e5d7a1: OUTPUT«yeah, it's in 'ere␤»
23:28 aries_liuxueyang joined #perl6
23:29 ZoffixLappy Guest44202, there's readchars method, so it's likely something like .readchars(16): https://docs.perl6.org/type/IO$CO​LON$COLONHandle#method_readchars
23:30 Guest44202 would using the comb routine like you said be wrong?
23:46 benji_ joined #perl6
23:47 TimToady depends on whether slurping the whole file before doing .comb is a problem or not
23:47 benji_ How do I convert a character to the unicode number
23:48 TimToady m: "😺".ord
23:48 camelia rakudo-moar e5d7a1: ( no output )
23:48 TimToady m: "😺".ord.base(16).ord
23:48 camelia rakudo-moar e5d7a1: ( no output )
23:48 TimToady m: "😺".ord.base(16).say
23:48 camelia rakudo-moar e5d7a1: OUTPUT«1F63A␤»
23:48 Zoffix joined #perl6
23:48 benji_ joined #perl6
23:48 Zoffix m: say '♥'.ord.base: 16
23:48 camelia rakudo-moar e5d7a1: OUTPUT«2665␤»
23:48 Zoffix TimToady, are you sure slurping the entire file is involved? .lines doesn't slurp
23:49 TimToady but then you're slurping each line, and .chars(16) can't cross a line boundary
23:49 Zoffix Ah
23:51 * Zoffix tests
23:51 Zoffix if .lines can do it, why can't .comb do it :/
23:52 killbill joined #perl6
23:55 Zoffix Seems .comb reads lazily: https://gist.github.com/zoffixznet​/8062a6f662a48aee05e285a292d72a68
23:55 Zoffix I have just 4GB RAM on that box and it's a 10GB file
23:55 TimToady .comb is a string method, but we really need lazy strings (Cat) before we can do incremental regex against them
23:56 TimToady and .comb(/regex/) is really the main design point, .comb(10) is an add-on
23:57 TimToady in fact, I'm not entirely sure we shouldn't've used a different method name for that, but it snuck in without me noticing :)
23:57 Zoffix :)

| Channels | #perl6 index | Today | | Search | Google Search | Plain-Text | summary

Perl 6 | Reference Documentation | Rakudo