»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
Set by moritz on 22 December 2015.
00:02 itaipu joined 00:11 itaipu left 00:12 itaipu joined 00:13 eliasr left 00:21 pierre_ joined 00:33 lambd0x left
AlexDaniel .tell mst wasn't it fixed? irclog.perlgeek.de/perl6/2016-09-04#i_13148724 00:37
yoleaux AlexDaniel: I'll pass your message to mst.
00:41 poohman left 00:43 poohman joined 00:55 buggable left 00:57 NeuralAnomaly left 00:58 buggable joined, itaipu left, huggable joined 00:59 NeuralAnomaly joined 01:03 poohman left
pierre_ Hi 01:06
01:06 Zoffix joined
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?
m: class c { has &.m; method m1() { say "boum!";}; method m2() { &!m = &self.m1; }; }; my $i = c.new; $i.m1(); $i.m2(); $i.m.()
camelia rakudo-moar e39ab8: OUTPUT«boum!␤Cannot invoke this object (REPR: Uninstantiable; Callable)␤ in block <unit> at <tmp> line 1␤␤»
01:07 poohman joined
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!␤»
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
Zoffix Does it? Why is there just one boum 01:09
pierre_ oh, right,
i misread
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)
camelia rakudo-moar e39ab8: OUTPUT«boum!␤»
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)
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␤␤»
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!␤»
Zoffix There may be a better way.
01:10 Zoffix left
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!␤»
pierre_ i can still use a closure for now, it will work indeed
01:12 rodarmor left 01:13 labster joined
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␤»
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")
camelia rakudo-moar e39ab8: OUTPUT«boum foo␤»
01:14 rodarmor joined
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:15 thundergnat left
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:16 pierre_ left 01:20 pierre_ joined
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␤»
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␤»
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")
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␤␤»
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␤␤»
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")
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 left, NeuralAnomaly joined 01:40 poohman left, poohman joined 01:42 TEttinger joined, BillSussman left 01:43 BillSussman joined 01:45 ilbot3 left
pierre_ A bit "sketchy", but, i should be able to go with 01:45
m: class c { has $.m; method m1($str) { say "boum! $str"; }; method m2() { $!m = "m1" } }; my $i = c.new; $i.m2; $i."{$i.m}"("test")
camelia rakudo-moar e39ab8: OUTPUT«boum! test␤»
pierre_ instead of affecting the method, i just get the name
01:47 ilbot3 joined 01:51 parabolize left 01:52 parabolize joined 01:53 zacts left
zengargoyle hrm, rakudobrew vs debian unstable is unhappy because of removal of '.' from @INC in perl5 01:56
02:01 poohman left
zengargoyle PERL_USE_UNSAFE_INC=1 tweaks /etc/perl/sitecustomize.pl for a quick workaround. 02:01
wondering if p6doc needs to put docs in ~/.perl6/doc ... why not site? 02:04
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 02:21 pierre_ left 02:24 zacts joined 02:26 zacts left, zacts joined 02:30 pierre_ joined 02:31 poohman left, Shantanu1 joined 02:34 noganex joined, pierre_ left 02:36 poohman joined 02:37 noganex_ left 02:38 pierre_ joined 02:41 cdg joined 02:49 poohman left 02:50 poohman joined 02:53 sammers joined 03:00 poohman left, wamba joined
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 ShimmerFairy left, poohman joined, AlexDaniel left
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) ... }␤»
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()
camelia rakudo-moar 77d9d4: OUTPUT«(Callable)␤»
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␤␤»
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
camelia rakudo-moar 77d9d4: OUTPUT«(Any)␤»
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
camelia rakudo-moar 77d9d4: OUTPUT«(Any)␤»
03:13 araujo__ joined 03:16 araujo_ left
sammers hi perl6 03:17
03:23 poohman left
shantanu sammers: Hi 03:25
03:26 poohman joined
shantanu Is there a imaging library binding available on Perl6 yet? GD preferably, Pango or ImageMagick? 03:32
sammers shantanu, take a look at these modules.perl6.org/#q=gd 03:33
03:34 cdg left
shantanu hah thanks! How did i miss that?? 03:34
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:35
shantanu ahh 03:36
does it support getting individual pixel data yet?
ahhh yeah it supports more "drawing" methods than "reading image data" methods. Unfortunately I need to read image data. 03:38
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:41
03:43 ShimmerFairy joined
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])␤»
sammers m: my Str @arr1 := "array", "of", "strings"; say @arr1.WHAT; sub expect-str-array(Str @arr) { @arr.WHAT.say }; expect-str-array(@arr1);
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␤␤»
sammers is there a way to bind a typed array? 03:53
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␤␤»
geekosaur hm, that doesn't seem like what I'd expect :/ 03:55
sammers yeah, I have been messing with these examples: rosettacode.org/wiki/Enforced_immu...ity#Perl_6
trying to make an immutable List / Array 03:56
I think there is probably a really obvious, simple way to accomplish this that I am just unaware of.
03:59 pierre_ left 04:06 grondilu joined 04:08 pierre_ joined 04:09 pierre_ left, pierre_ joined 04:11 Cabanossi left 04:14 Cabanossi joined 04:21 notbenh left, notbenh joined 04:22 notbenh left 04:23 llfourn left 04:25 bioduds left 04:26 notbenh joined
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
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
grondilu not sure if that is supposed to work. 04:50
seems like much to ask. 04:51
04:52 poohman left 04:53 poohman joined, cdg left
zengargoyle worth a shot, i'm still a bit confused about the type stuff. 04:54
04:54 wamba left, pierre_ left
sammers thanks zengargoyle, the Array[Str].new() version works, but... a little verbose. With regular item assignment we can do this: 04:57
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)␤»
sammers m: my Str $str := "I'm a string"; say $str.WHAT; sub expect-str(Str $str) { $str.WHAT.say }; expect-str($str);
camelia rakudo-moar 77d9d4: OUTPUT«(Str)␤(Str)␤»
sammers is there another way to create an immutable List / Array? 04:59
05:02 pierre_ joined 05:06 pierre_ left 05:08 perlawhirl joined 05:09 khw left
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
now, you can bind a List to a $var, and that list is immutable, but the $var container is not.
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␤␤»
perlawhirl m: my List $foo := List.new(1, 2, 3); say $foo.WHAT; $foo = < a new list >; say $foo;
camelia rakudo-moar 77d9d4: OUTPUT«(List)␤Cannot assign to an immutable value␤ in block <unit> at <tmp> line 1␤␤»
perlawhirl ok, so i'm jumping ahead of myself
i'm using binding there to lock in the value... but anyways. my point is... immutable != read-only 05:12
there is a read-only assignment op, but it's Not Yet Implemented)
once it's implemented, you will be able to do $var ::= 'value' and it will be read only
so what i meant to demonstrate above was this: my List $foo .= new(1, 2, 3) ; will create an immutable list inside foo 05:13
05:14 zacts left
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
i don't know... i guess one of the core developers could possibly answer that, but they're in a different timezone. 05:15
however
sammers also, thanks for the clarification on List vs Array as well
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
gist.github.com/0racle/985428b5579...5661018688
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
zengargoyle which is array-like-ish but i think immutable set of values.
perlawhirl yeah that could work. 05:18
zengargoyle or make an Array and have a 'but {something}' to take away the rw-ness. 05:19
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);
zengargoyle depends on how immutable you want immutable to be.
05:21 zacts joined
zengargoyle isn't that still a List of containers that happen to hold an Int? 05:21
perlawhirl ah yeah 05:22
zengargoyle so the containers could change contents.
perlawhirl so @foo[0] could still be changed
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:23
but it's been ages since i've poked around such things. 05:24
05:28 BenGoldberg left 05:36 buharin joined
buharin hi 05:36
:)
05:37 CIAvash joined 05:38 perlawhirl left 05:47 mcmillhj joined 05:57 Shantanu01 joined 06:00 Shantanu1 left 06:01 jonas1 joined 06:03 pierre_ joined 06:04 itaipu joined 06:07 pierre_ left 06:08 Actualeyes joined, domidumont joined 06:10 pierre_ joined 06:12 domidumont left 06:13 domidumont joined 06:16 firstdayonthejob joined
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␤␤»
nine sammers: ^^^
06:30 rindolf joined
ufobat good morning 06:31
06:31 Shantanu01 left, Shantanu1 joined
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:32
my \b = [ 'foo' ]; b = ['bar']; say b.perl; b[0]='baz'; say b.perl; 06:35
m: my \b = [ 'foo' ]; b = ['bar']; say b.perl; b[0]='baz'; say b.perl;
camelia rakudo-moar 1e2ecd: OUTPUT«["bar"]␤["baz"]␤»
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␤␤»
nine m: my \l = 1, 2, 3; l[1] = 1;
camelia rakudo-moar 1e2ecd: OUTPUT«Cannot modify an immutable Int␤ in block <unit> at <tmp> line 1␤␤»
nine sammers: ^^^
zengargoyle ah 06:37
06:40 itaipu left
grondilu m: (my \l = [1, 2, 3])[1] = pi; say l 06:40
camelia rakudo-moar 1e2ecd: OUTPUT«[1 3.14159265358979 3]␤»
nine The comma operator creates a List. Brackets create an Array with mutable elements. 06:41
grondilu nods
zengargoyle any way to mimic Array[Str] typechecking of List? 06:42
06:42 firstdayonthejob left
nine no 06:43
06:44 mcmillhj left
zengargoyle not sure if question was more about creating an immutable thing to pass to: sub expect-str-array(Str @arr) { ... } 06:44
or about just immutability howto. 06:45
06:47 sjohnsen joined 06:49 mcmillhj joined 06:52 poohman left 06:54 mcmillhj left, _slade_ left 06:55 dwarring left 06:56 araujo__ left 06:57 araujo joined, araujo left, araujo joined
woolfy hi buharin, welcome 07:03
07:06 labster left, labster joined
sammers nine, thanks, that looks good 07:07
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␤␤»
sammers nine, anyway to create a ro typed list? 07:10
nine sammers: no, because we don't have typed Lists
sammers ok, how about a ro Array?
...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?
moritz and if you really think you need everything[tm] typed, maybe use a statically typed programming language? 07:13
Perl 6 doesn't do static typing as good as a statically typed language does
it does it much better than most dynamically typed languages though
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:14
07:16 poohman joined
ShimmerFairy Now that I think of it, why exactly is Array but not List parameterized, again? 07:17
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.
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]?"
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:20
like why does := change the array to Positional[Str]? 07:21
moritz sammers: the @ sigil implies a type constraint of Positional
nine := doesn't change anything
moritz sammers: not of Array 07:22
sammers: and Array is only the default type for it
nine Array is just the default Positional type
zengargoyle i've always thought := as stripping the container of the LHS 07:23
moritz zengargoyle: yes, that's right 07:24
zengargoyle yay!
07:25 bjz joined
sammers ok, so what is this all about: 07:25
m: my Int @a = Array.new(1, 2, 3); @a.WHAT
camelia ( no output )
sammers m: my Int @a := Array.new(1, 2, 3); @a.WHAT
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␤␤»
zengargoyle the 1,2,3 aren't necessarily Ints. 07:26
sammers m: my Str $a = "string"; $a.WHAT
camelia ( no output )
sammers m: my Str $a = "string"; say $a.WHAT
camelia rakudo-moar 1e2ecd: OUTPUT«(Str)␤»
sammers m: my Str $a := "string"; say $a.WHAT
camelia rakudo-moar 1e2ecd: OUTPUT«(Str)␤»
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␤␤»
moritz m: m: my Int @a = Array[Int].new(1, 2, 3); @a.^name
camelia ( no output )
moritz m: m: my Int @a = Array[Int].new(1, 2, 3); say @a.^name
camelia rakudo-moar 1e2ecd: OUTPUT«Array[Int]␤»
sammers m: my Int @a = Array.new(1, 2, 3); say @a.WHAT
camelia rakudo-moar 1e2ecd: OUTPUT«(Array[Int])␤»
zengargoyle m: my Int @a := Array[Int].new(1.Int, 2.Int);
camelia ( no output )
zengargoyle m: my Int @a := Array[Int].new(1.Int, 2.Int); say @a.WHAT;
camelia rakudo-moar 1e2ecd: OUTPUT«(Array[Int])␤»
sammers so why does it change from Array[Int] to Positional[Int]?
moritz sammers: where exactly does it change? 07:28
sammers ok, let me do this again, clean slate...
m: my Int @a = Array.new(1, 2, 3); say @a.WHAT
camelia rakudo-moar 1e2ecd: OUTPUT«(Array[Int])␤»
sammers m: my Int @a := Array.new(1, 2, 3); say @a.WHAT
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␤␤»
sammers when using := 07:29
vs just =
moritz sammers: example?
zengargoyle = is checking that contents are Int later than := is checking contents are Int
sammers my Int @a = Array.new(1, 2, 3); say @a.WHAT; my Int @b := Array.new(1, 2, 3); say @b.WHAT
zengargoyle m: my Int @a := Array[Int].new(1.Int, 2.Int); say @a.WHAT; 07:30
camelia rakudo-moar 1e2ecd: OUTPUT«(Array[Int])␤»
sammers m: my Int @a = Array.new(1, 2, 3); say @a.WHAT; my Int @b := Array.new(1, 2, 3); say @b.WHAT
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␤␤»
zengargoyle explicit .Int makes it work.
sammers yeah
07:31 zakharyas joined
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)␤»
zengargoyle the "string" has to be a .Str because of "". 07:32
the 1 doesn't have to be Int, it could as easily be Str or Num or ...
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 07:34 pdcawley joined
zengargoyle i think of := as like a compile time alias. sorta... the LHS is just a different name for the RHS. 07:34
the = is an assignment type of thing, can the RHS fit in the LHS?
grondilu zengargoyle: Num is not a generic type for real numbers. There is Real for that.
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
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
07:36 darutoko joined
zengargoyle moritz: it seems like = will cast 1,2,3 into 1.Int, 2.Int, 3.Int automagically whereas := won't. 07:37
07:37 canopus left
moritz zengargoyle: example? 07:37
zengargoyle if the LHS is typed for Int
moritz oh, you mean list/array assignment
zengargoyle m: my Int @a := Array[Int].new(1.Int, 2.Int); say @a.WHAT;
camelia rakudo-moar 1e2ecd: OUTPUT«(Array[Int])␤» 07:38
zengargoyle m: my Int @a := Array[Int].new(1, 2); say @a.WHAT;
camelia rakudo-moar 1e2ecd: OUTPUT«(Array[Int])␤»
moritz well, array *assignment* is coercive. Binding isn't
07:38 mcmillhj left
moritz that's why you can assign (1, 2, 3) to Array[Int], but you can't bind it 07:38
07:40 bjz left, Shantanu1 left
moritz that's why you can assign a list to an array in the first place 07:40
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
camelia rakudo-moar 1e2ecd: OUTPUT«(Array[Int])␤»
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 07:45 mcmillhj joined 07:48 bjz joined 07:50 mcmillhj left 07:54 bjz left
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")␤»
ufobat is there a way to set @.a "correctly"?
07:57 bjz joined, leont joined
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
DrForr waves to jkva. Great, *another* channel to watch :) 08:03
08:03 dakkar joined
ufobat moritz: okay :) thanks... my %h<a> is set by a result of a subroutine call, so i need return what? 08:03
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:04 rindolf left 08:06 rindolf joined 08:09 alexm joined, RabidGravy joined 08:11 esh joined
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")␤»
CIAvash ufobat: ↑ ?
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:18
CIAvash ufobat: you can do it this way too(llfourn++): irclog.perlgeek.de/perl6/2016-06-28#i_12748382 08:19
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")␤»
ufobat okay cool :-) 08:21
08:23 Shantanu1 joined
sammers zengargoyle, nine, moritz: thanks for the discussion. 08:23
08:24 Shantanu1 left, Shantanu1 joined
ufobat thanks for the help, it is working now 08:24
CIAvash :) 08:25
08:36 wamba joined 08:46 mcmillhj joined
[ptc] \o/ the perl6-examples tests are passing again :-) 08:47
08:47 poohman left 08:48 poohman joined
moritz \o/ 08:48
[ptc]++
08:50 mcmillhj left 08:51 TEttinger left 08:58 elohmrow joined
elohmrow hallo! trying to build perl6 docs ... make html eventually leads to gist.github.com/elohmrow/e7c8aa1e8...9e6073984d ... possibly just my $ENV, or known atm? 09:01
09:02 xiaomiao left 09:03 mcmillhj joined
moritz elohmrow: that's the last build log from doc.perl6.org: docs.perl6.org/build-log/build-201...5+0000.log 09:04
elohmrow: so it seems there are combinations of rakudo version, installed modules and moon phase that work
09:04 cpage_ left
moritz elohmrow: what's your perl6 --version? 09:04
09:04 cpage_ joined
elohmrow moritz: This is Rakudo version 2016.02-105-ge1071b0 built on MoarVM version 2016.02-20-g78bd7cb implementing Perl 6.c. 09:05
09:06 user9 left
elohmrow oh, that's an old one on my local machine anyway 09:06
moritz elohmrow: the "official" build currently uses 2016.06 09:07
elohmrow: maybe try with that version
elohmrow: I think I recall a recent-ish fix regarding visibility of dynamic variables in threads, so that could be related
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
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 mcmillhj left
moritz huh, the fix I was thinking of went into 2015.12 09:08
09:16 mcmillhj joined 09:21 mcmillhj left 09:25 xiaomiao joined 09:29 cpage_ left 09:30 cpage_ joined 09:36 user9 joined
melezhik Hi all! 09:36
How to make a temporary file at perl6?
this is what I would do in perl5 with File::Temp module 09:37
timotimo why not use perl6's File::Temp module? 09:38
DrForr github.com/perlpilot/p6-File-Temp # or on modules.perl6.org
melezhik timotimo: I will , thanks 09:40
lizmat El_Che: did I miss you putting out a blog post ? 09:41
moritz: perhaps you are confusing this with giving each start block / thread its own $/ and $_ ? 09:42
timotimo there was a fix where we made sure that start will make dynamic variables available to the code 09:43
even though they are not in the actual dynamic scope of the block when it actually gets run 09:44
09:45 autarch left 09:46 pierre_ left 09:49 pierre_ joined
elohmrow moritz: ok, can confirm it works on 2016.07.1. 09:52
woolfy elohmrow++ 09:55
El_Che lizmat: yeah, I haven't had the time yet 09:57
lizmat El_Che: should I just mention github.com/nxadm/rakudo-pkg in the weekly ? 09:59
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:00
elohmrow El_Che: is the 'weekly' you are talking about the section that gets tacked into Gabor's weekly, or something else? 10:01
10:01 mcmillhj joined
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
timotimo it usually gets linked to from gabor's weekly, too
elohmrow wants to make sure he subscribes to (allthethings)
El_Che elohmrow: perl 6 weekly
elohmrow: p6weekly.wordpress.com/
elohmrow El_Che: answered my question before I asked it, good, thanks. 10:03
10:03 BillSussman left 10:04 AndyBotwin joined 10:06 mcmillhj left
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
but if you have one, that would also be excellent :-)
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 xiaomiao is now known as AmazingPudding
El_Che lizmat: I was in spirit :) 10:09
elohmrow esp. niner.name/talks/Perl%205%20and%20P...20team.pdf 10:10
lizmat: sorry - i don't know all the faces => id mappings ;)
jkva What's the most efficient way for me to submit patches to modules.perl6.org? 10:11
timotimo you mean you want to have a module you made listed on that site? 10:12
El_Che elohmrow: url is dead
timotimo or do you want to change how the site works or looks?
jkva timotimo: Some small modifications to the page html.
timotimo github.com/perl6/modules.perl6.org/ 10:13
jkva Awesome, thank you timotimo
timotimo easiest for us is github pull requests, but git format-patch also works, or git diff.
jkva PR sounds good.
10:14 g4 joined
nine El_Che: which url? 10:15
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, Shantanu01 joined
nine There were issues at YAPC::EU, too, but no idea why 10:17
El_Che host niner.name results in a timeout. No ipv6 on this cheap provider 10:18
10:19 Shantanu1 left 10:21 mcmillhj left 10:22 elohmrow_ joined, elohmrow left
El_Che nine: google's dns doesn't like you either 10:23
nine That's so very odd. Both DNS servers are answering correctly and are listed in the whois data 10:26
10:27 avalenn joined
nine According to www.whatsmydns.net/#A/niner.name most name servers resolve it correctly with few exceptions. Most notably Google's. 10:27
tadzik where do you host the domain? 10:29
10:31 labster left
moritz ;; ANSWER SECTION: 10:32
niner.name. 60 IN A 78.47.60.231
10:32 mcmillhj joined 10:34 Shantanu1 joined, Shantanu01 left
geekosaur it just resolved here, I use google dns 10:34
nine It is registered via DirectNIC and hosted on niner.name itself and our company DNS server. Everything looks ok, yet for example dnscheck.pingdom.com/?domain=niner.name claims inconsistent glue 10:35
10:37 mcmillhj left, wamba left 10:38 Actualeyes left 10:40 wamba joined, wamba left
El_Che lizmat: nxadm.wordpress.com/2016/09/05/rak...ng-docker/ 10:41
10:45 wamba joined 10:46 pierre_ left 10:48 AlexDaniel joined
lizmat El_Che++ 10:49
(added to P6W) 10:50
El_Che lizmat: just throwing ideas into the open 10:51
10:52 mcmillhj joined, Actualeyes joined
lizmat afk for some cycling / sightseeing& 10:55
Xliff *sigh*
More weirdness with custom EXPORT. BEGIN and INIT.
10:56 alexm left, mcmillhj left
Xliff gist.github.com/Xliff/fceb9354193e...68b991d6ec 11:03
Please read after "UPDATED" part. 11:04
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.
timotimo that's true 11:06
mst that would sound like what I'd expect BEGIN to do
yoleaux 00:37Z <AlexDaniel> mst: wasn't it fixed? irclog.perlgeek.de/perl6/2016-09-04#i_13148724
Xliff timotimo: Not "unit module" it's block module.
timotimo BEGIN works exactly like that
well, in part 1 it was
mst AlexDaniel: well, I don't know, I've no idea what this problem is and that's hardly a bug report
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
just put your code in the mainline
then it'll run every time the program that uses it runs
Xliff Huh
timotimo at least i think so?
AlexDaniel mst: fyi irclog.perlgeek.de/perl6/2014-01-15#i_8120520 11:09
nine timotimo: nope 11:10
timotimo oops
nine EXPORT is the only code we run automatically when loading a precompiled file
mst so INIT ... should not be used ... for initialization ... erm? 11:11
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
AlexDaniel: has anybody at any point actually tried reporting the problem, or just moaning in here and blaming RT? :)
AlexDaniel mst: well in order to get my account fixed I had to write to rt admins 11:13
so someone did fix my account, and if he did that then he probably knows about this problem
and I didn't get any feedback on what the problem actually is
mst well, please encourage those other people to actually report the problem they're having 11:14
11:14 poohman left
mst if there's a pattern here, then maybe that can be fixed 11:14
11:14 poohman joined
mst but they'll never realise it's not a one-off problem if only one person ever reports it 11:14
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…
Xliff nine: I'm with mst. What point does INIT serve, then?
mst AlexDaniel: I want you yto, when somebody mentions that, ask them to send an email in 11:18
I can chase up something that's been reported
I can't chase up two lines in an IRC log that nobody bothered to tell the RT admins about
AlexDaniel mst: which email address exactly? 11:19
ah I see
nvm
mst THE ONE ON THE FRONT PAGE THAT I ALREADY SAID IN CHANNEL
trout.me.uk/facepaw2.jpg
11:21 poohman left, bjz_ joined, bjz left
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:22
11:23 mcmillhj joined
nine Xliff: INIT runs right before the mainline code runs 11:23
11:23 poohman joined
mst AlexDaniel: if you can collect the ticket ids 11:24
basically, if I'm armed with 3 ticket ids I can go make sure one person looks at all three
stmuk if only there was a bug tracking system for RT!
11:24 wamba left
mst there is a bug tracking system. that's what he's emailing. 11:24
if you don't have anything constructive to say, please feel free to let the adults talk 11:25
AlexDaniel: if they haven't already spotted and fixed the pattern, I figure politely rubbing their face in it is probably the next step :)
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
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=127461
11:27 mcmillhj left
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?
Not in modules or packages?
nine Xliff: also modules as part of their compilation 11:28
mst geekosaur: hey, can you mail in re irclog.perlgeek.de/perl6/2016-09-04#i_13148724 as well please and get me the id 11:29
and can somebody poke the bot to say the same thing to danlei?
nine No, it's absolutely not. 11:31
err...wrong window
mst so I tied the chicken down but then I couldn't find the rubber gloves
AlexDaniel: can poke bot for me? 11:32
11:33 leont left
Xliff OK. Chicken and egg problem. 11:33
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
Xliff This is non-optimal
I can get part way there if I use a mainline block in a module.
However once I try to "require" in an EXPORT. rakudo blows its lid.
Which... actually... kinda makes sensew.
s/w '.' $// 11:35
However, I've never known that to be a problem in p5.
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
mst AlexDaniel: you had the bot point out the IRC log link to me
Xliff I will have to search phases again and see if I can move the naughty EXPORT code somewhere else.
mst AlexDaniel: make it tell danlei to submit a bug then tell me the ticket id 11:36
I don't know how to yoleaux 11:37
I'm used to people keeping their clients connected
11:37 mcmillhj joined
nine mst: .tell whoever your message 11:37
11:37 jakami joined
Xliff Wonder if POST EXPORT will work. 11:38
mst .tell danlei if you have a problem with RT still, please mail [email@hidden.address] as the rt.perl.org front page suggests and then /msg me the ticket id so I can chase it up
yoleaux mst: I'll pass your message to danlei.
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.
yoleaux AlexDaniel: I'll pass your message to danlei.
AlexDaniel oops
jakami what's a recommend way to access an element in an associative array -- via {} or <> ?
mst eh
now he'll get the right thign to do twice
AlexDaniel that's ok
mst REDUNDANT ARRAY OF IRRITATING DAMNIT I CAN'T THINK OF ANYTHING THAT STARTS WITH D OOH DELIVERIES
geekosaur jakami, <> for literal strings, {} for expressions
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.
AlexDaniel
.oO( that's what I wanted to avoid :D )
11:39
mst AlexDaniel: what, me making a joke?
I'm totally fine with him getting the same message twice
jakami geekosaur: could you elaborate? 11:40
AlexDaniel no, needless screaming
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}
mst it's just capital letters.
AlexDaniel ah ok
jakami I see
Xliff *sigh* -- Nope.
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
jakami then, can'it I access an element where a key is an experession via <> ?? %hash<$get-my-get> ?
Xliff The internet really could use an all access RTF layer.
AlexDaniel mst: OK I GOT IT. THANKS 11:42
mst ROGER
geekosaur jakami, that is what {} is for
jakami *can't
11:42 mcmillhj left
jakami I mean, %hash<$get-my-get> 11:42
mst Xliff: yeah, if I could reliably use bold, italic etc. that would be awesome
Xliff mst++
jakami where "get-my-key" is a function
11:42 kurahaupo joined
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.
mst I MEAN I CAN TOTALLY USE BOLD BUT ALEXDANIEL MAY HAVE A HEART ATTACK
Xliff mst: And if you are really a dick.... <BLINK> 11:43
mst well, IRC has pervasive colour support, but it's generally disabled
AlexDaniel 𝐍𝐎, 𝐈'𝐌 𝐓𝐎𝐓𝐀𝐋𝐋𝐘 𝐅𝐈𝐍𝐄 𝐖𝐈𝐓𝐇 𝐓𝐇𝐀𝐓
Xliff Of course, that might give AlexDaniel an aneurism.
jakami nine: then going back to my initial question: "what's a recommend way to access an element in an associative array -- via {} or <> ?"
mst and I've been known to "disable" it with a /kill on occasion
geekosaur jakami, I am trying to understand what difference you see betweenthe two
%foo{'bar'} is %foo<bar> 11:44
Xliff mst: Aww... you don't disable with "/ex-teeer-miiin-ate" like I do?
geekosaur they are not two different kinds of hasjes
jakami no difference, just what's recommended by convention? or what majoriy of developers use?
mst jakami: errr
geekosaur perl 5 used {} for both, which was confusing and sometimes bug-producing.
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}"
mst jakami: %foo<bar> is the short way to write %foo{'bar'}
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
nine jakami: your question is like "what's recommended by convention for multiplication? + or *?
mst jakami: then use %foo{...} for more complex lookups
nine: that's unfair
nine mst: what?
Any multiplication can be written as repeated addition. The * is a nice shortcut however. 11:46
AlexDaniel m: say ‘🅝🅞’.uninames
camelia rakudo-moar 1e2ecd: OUTPUT«(NEGATIVE CIRCLED LATIN CAPITAL LETTER N NEGATIVE CIRCLED LATIN CAPITAL LETTER O)␤»
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
nine ok
AlexDaniel m: say ‘🅽🅾’.uninames
camelia rakudo-moar 1e2ecd: OUTPUT«(NEGATIVE SQUARED LATIN CAPITAL LETTER N NEGATIVE SQUARED LATIN CAPITAL LETTER O)␤»
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
at some point you're going to need a factoid bot in here
for repeating answers that people are too bored of giving 11:48
geekosaur zoffix to provide bot in 5, 4, 3...
nine mst: I did repeat it _and_ tried it again using a metaphor ;)
mst had it been a good metaphor rather than a sarcastic one I'd've approved :P 11:49
AlexDaniel m: say 42
camelia rakudo-moar 1e2ecd: OUTPUT«42␤»
mst I'm the child of two eng. lit. grads
if you're going to metaphor in my earshot, do it well :D
nine But but but I did not try to be sarcastic. I actually thought it was a reasonable metaphor 11:50
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}
AlexDaniel feel free to rewrite it :P
and yes, this bot is by Zoffix
11:53 jakami left 11:54 CIAvash left 11:55 mcmillhj joined, eliasr joined
AlexDaniel huggable: source 11:55
huggable AlexDaniel, See github.com/zoffixznet/huggable
11:58 elohmrow_ left 11:59 mcmillhj left 12:01 CIAvash joined 12:02 AlexDaniel left 12:04 itaipu joined 12:05 shinobicl left
Woodi must say THAT stmuk message ($m ~~ m/RT!$/, for clarity) was perfect #perl6 message :) messages with traces of trolling for everyone ! 12:06
12:06 pierre_ joined 12:08 pierre_ left
El_Che wonder if comments on a static page like rakudo.org/how-to-get-rakudo/ is a good thing. IMHO they look terrible out of place 12:11
moritz and comments on the release announcements are typically questions about things other than the release 12:15
so I'd tend to disable comments on rakudo.org
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:17
nine melezhik: sub foo($bar is rw) 12:18
melezhik ahh, thanks!
12:19 wamba joined 12:21 mcmillhj joined
mst moritz: yeah, I'm unconvinced they're gaining anything 12:22
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:24
12:24 poohman left
nine melezhik: how do you expect it to work? You cannot write to "item($block-type)" 12:25
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 itaipu left, mcmillhj left
melezhik nine: ok 12:26
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
It's a central setting in base wordpress
But that won't apply to already-existing articles
You'll have to disable those manually 12:28
moritz jkva: where is that setting?
I'm not finding it on Settings->Discussion 12:29
jkva moritz: settings -> discussion -> "allow people to post comments on new articles"
Once you uncheck that
Any new articles won't have the comment form
And as I said, any existing articles you have to turn comments of for, in quick eit 12:30
*quick edit
But you can batch-apply that iirc
sjn \o
moritz jkva: ah, thanks
jkva np!
sjn hello, #perl6, how's it going? :)
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:31
nine sjn: Hi! Nice to read you! 12:32
melezhik: I don't understand your question. Can you re-phrase? 12:33
mst sub foo (@thing is rw) {
foo(@baz)
would work, no?
DrForr sub foo(@a is rw) { @a[2]++ }; my @x=1,2,3;foo(@x);say @x; 12:34
m: sub foo(@a is rw) { @a[2]++ }; my @x=1,2,3;foo(@x);say @x;
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␤»
moritz m: sub foo(@a) { @a.push: 42 }; my @x = 1, 2, 3: foo @a; say @a.perl
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␤»
DrForr Skritch.
moritz m: sub foo(@a) { @a.push: 42 }; my @x = 1, 2, 3: foo @a; say @a.perl
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␤»
moritz m: sub foo(@a) { @a.push: 42 }; my @x = 1, 2, 3; foo @a; say @a.perl
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␤»
moritz m: sub foo(@a) { @a.push: 42 }; my @x = 1, 2, 3; foo @x; say @x.perl
camelia rakudo-moar f49b38: OUTPUT«[1, 2, 3, 42]␤»
moritz not very concentrated
12:35 sufrostico joined 12:36 mcmillhj joined
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:36
mst ooh, hm 12:37
12:38 poohman joined
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?
melezhik I meant I can't just say ...
jkva moritz: Um, well 12:39
I'd probably add some CSS to set `#comments { display: none }`
moritz jkva: I guess I could unapprove them all in the spam filter, or something
jkva Which you can do by customising the theme you are using
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 ...
so won't be seen inside a function
jkva moritz: yeah, but then might as well use a mysql query 12:40
if you have that kind of access
moritz melezhik: for scalars, it works with 'is rw'
jkva: no, I have only access to the admin web frontend
jkva moritz: ok, then you either bulk disapprove or amend your theme css
12:40 mcmillhj left
melezhik moritz: what about arrays? 12:41
which way should I choose to modify an array? pass is as arrayref?
foo ($arrayref is rw) { @($arrayref).push: 'New value'} ? 12:42
foo(item (@baz))
? 12:43
12:43 pierre_ joined
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]␤»
nine melezhik: ^^^
moritz melezhik: yes, that should work
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.
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]␤»
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
melezhik ok, will try to pass array directly
moritz melezhik: then use @multiline-block
mst I didn't realise arrays were always 'is rw' 12:47
that seems a bit odd to me
nine mst: they are not
mst (admittedly I try and avoid having rw parameters at all)
nine @x = 2, 3 is equal to @x.STORE(2,3)
mst nine: then why did this work: < moritz> m: sub f(@x) { @x = 2, 3 }; f my @a = 1, 2, 3; dd @a
yeah, that's still writeable, is what I mean
moritz mst: there's a very deep technical problem underneath that 12:48
mst: an Array is just an object; how do you make an object lexically immutable to pass it to a routine?
nine I dare say it's a consequence of not wanting to copy arrays and hashes passed to functions. While scalar containers are cheap.
mst I've not managed to blow a foot off with it so far
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);
moritz mst: there have been very long discussions about this on p6l and possibly p6c, without any good proposals 12:49
there are some proposals that come with a very hefty performance penalty
melezhik nine: moritz: - thanks )))
jnthn I think most languages have settled on "worse is better" on this issue. :)
12:50 itaipu joined 12:51 mcmillhj joined 12:54 wamba left
El_Che hi sjn 12:54
mst is there a way to declare a static array up front?
mst usually wants things to be single-assignment anyway 12:55
12:55 pdcawley left 12:56 mcmillhj left
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␤␤»
moritz m: constant MY_STUFF = (1, 2, 3); say MY_STUFF
camelia rakudo-moar f49b38: OUTPUT«(1 2 3)␤»
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.
pierre_ just using a list might work as well, no?
ShimmerFairy *can't subtype
mst no, I don't want compile time
12:57 poohman left
mst I just want 'my @foo = (1, $x+7, 3);' 12:57
pierre_ m: my @a = (1,2,3); @a.pop
camelia ( no output )
nine m: my
camelia rakudo-moar f49b38: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed my␤at <tmp>:1␤------> 3my7⏏5<EOL>␤»
mst and then @foo to be immutable
12:58 poohman joined
moritz ShimmerFairy: huh? Arrays subtypes list, so that clearly works 12:58
nine m: my \foo = 1,2,3; foo[2] = 1;
camelia rakudo-moar f49b38: OUTPUT«Cannot modify an immutable Int␤ in block <unit> at <tmp> line 1␤␤»
ShimmerFairy moritz: I mean parameterization
nine mst: ^^^
pierre_ m: my $a = (1,2,3); $a.pop
camelia rakudo-moar f49b38: OUTPUT«Cannot call 'pop' on an immutable 'List'␤ in block <unit> at <tmp> line 1␤␤»
mst nine: and then I could pass that to something that expects an array with subname(foo) ?
12:58 itaipu left
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␤␤»
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
camelia rakudo-moar f49b38: OUTPUT«Cannot modify an immutable Int␤ in sub foo at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»
ShimmerFairy m: my $a = 42; my $list = (1,2,$a); $list[2] = 1; say $list; say $a # lists aren't perfect, though :<
camelia rakudo-moar f49b38: OUTPUT«(1 2 1)␤1␤»
mst const my @foo => (1, 2, 3); # use Const::Fast in perl5
is kinda easier
nine mst: why is const my @foo => (1, 2, 3) easier than my $a = (1, 2, 3);?
13:01 AlexDaniel joined
nine or my \a = (1, 2, 3); 13:01
jnthn m: my @a := 1,2,3; @a.push(4}
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}␤»
jnthn m: my @a := 1,2,3; @a.push(4)
camelia rakudo-moar f49b38: OUTPUT«Cannot call 'push' on an immutable 'List'␤ in block <unit> at <tmp> line 1␤␤»
jnthn m: my @a := 1,2,3; @a[2] = 4
camelia rakudo-moar f49b38: OUTPUT«Cannot modify an immutable Int␤ in block <unit> at <tmp> line 1␤␤»
jnthn Why not just bind a list?
mst aha 13:02
that looks like it actually has normal syntax
which was the thing I cared about
nine: all the other solutions required me to do something odd, i.e. rewrite every reference to the array
ShimmerFairy: I can live with the scalar still being mutable, if I didn't already make it immutable some other way, my problem
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)␤»
ShimmerFairy mst: fair enough, and at least in that case you have to near-explicitly ask for it :)
13:05 itaipu joined 13:06 AlexDaniel left 13:10 pdcawley joined 13:15 AlexDaniel joined 13:20 AlexDaniel left
pierre_ Is it possible to handle method as Callable? 13:21
an exemple with subs:
m: sub foo { return "bar";}; my &baz = &foo; baz();
camelia ( no output )
pierre_ m: sub foo { return "bar";}; my &baz = &foo; say baz();
camelia rakudo-moar f49b38: OUTPUT«bar␤»
pierre_ but with methods: 13:22
class c { has &.baz; method foo() { return "bar"; }; method affect() { &!baz = &self.foo} }; my $i = c.new(); $i.affect(); say $i.baz()
m: class c { has &.baz; method foo() { return "bar"; }; method affect() { &!baz = &self.foo} }; my $i = c.new(); $i.affect(); say $i.baz()
camelia rakudo-moar f49b38: OUTPUT«(Callable)␤»
timotimo you need to $i.^find_method('baz') 13:23
13:25 jervo left, cpage_ left, dakkar left, cpage_ joined, buharin left, dakkar joined, jervo joined
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 ( no output )
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')
camelia rakudo-moar f49b38: OUTPUT«baz␤»
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
camelia rakudo-moar f49b38: OUTPUT«(Method)␤»
timotimo you also need to $!baz = self.^find_method('foo')
13:27 rba_ joined
MasterDuke this PR seems relevant: github.com/rakudo/rakudo/pull/866 13:28
timotimo ah, could be 13:29
pierre_ timo, i was hoping that after a few hours i would see more clearly, but still a mistery :) 13:30
timotimo i don't know what your code is supposed to do so i don't know what you need to change 13:31
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
not really clear
timotimo a bit like an interpreter? 13:33
pierre_ i received bytes one by one
the value of one byte, will dictate what should be the action to take on the next one
i wanted to do something like method process($byte) { if &!next.defined { return self!next($byte) } given $byte { when xxx { &!next = self.something} } } 13:35
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().()
pierre_ some kind of "method currying"
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␤»
nine pierre_: also this ^^^
pierre_ oh! thanks
i was really close to that at one point, missing one bit, i was at method affect() { &!baz = &{ self.foo } } 13:38
but with a closure, would it work if i pass paramter
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
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
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␤»
nine pierre_: better ^^^
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')
camelia rakudo-moar f49b38: OUTPUT«aaa␤»
pierre_ |c will flatten @_ ? 13:45
13:45 leont joined
nine read docs.perl6.org/type/Capture 13:45
also docs.perl6.org/type/Signature#Capt...Parameters 13:47
pierre_ thanks, i finally inderstand the | i was seeing with multi dispatch and proto 13:49
13:57 mcmillhj joined 13:58 vytas left 14:02 mcmillhj left 14:07 buharin left 14:09 autarch joined 14:12 itaipu left 14:13 itaipu joined, domidumont left 14:14 domidumont joined 14:15 rindolf left, vytas joined
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*
arnsholt: this is the correct attitude from which to approach openssl
ShimmerFairy what's up with OpenSSL?
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
arnsholt ShimmerFairy: The docs are extremely unhelpful, to the point of being misleading for example 14:20
My current frustration being that everything is documented as being functions, even if it's *actually* a macro
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
arnsholt A point which is rather important when you're calling it over FFI
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
leont Yeah 14:22
gregf_ m: sub foo(*@a){ @a.say };my &bl = -> |c { foo(|c) }; &bl.(1..10)
camelia rakudo-moar f49b38: OUTPUT«[1 2 3 4 5 6 7 8 9 10]␤»
leont The OpenSSL API is clearly terrible
arnsholt mst: Thankfully Visual Studio is free these days, so I have an IDE to help me (being on Windows at $work)
And there's pretty much only low-level API docs, not really any high-level overview docs
mst I mostly had "going out for a joint at lunch" to help me
ShimmerFairy
.oO(macro-macronomics)
arnsholt So you have to figure out what to do by Googling for example code 14:23
14:23 buharin joined
leont Part of me believes that a rewrite from scratch may be the viable solution for much of it :-/ 14:23
arnsholt Possibly
ilmari make foo.i # may or may not be your friend
leont: isn't that what gnutls and nss are?
mst I'm hoping libressl/boringssl will manage to do a decent refactor
once they run out of code to delete 14:24
arnsholt ilmari: What does that do?
ilmari arnsholt: gives you the preprocessed C code
arnsholt Ah, right
ilmari i.e. expands all the macros
leont gnutls is terrible in its own way
ShimmerFairy having alternative implementations would only be beneficial, methinks.
ilmari has occasionally found that useful on the perl5 guts, but it gets unweildy fast
arnsholt That might be overkill in this case. I speak C well enough that source and header spelunking generally work fine
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
arnsholt Probably not terribly easy either though
ShimmerFairy leont: yeah, that does sound bad. Why not at the very least use std::string? (...wait) 14:26
leont It doesn't help that TLS is an insane standard for historical reasons 14:27
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:28
And unlike Telegram they actually understood crypto so didn't invent their own cryptographic mode but actually combined pieces in a sensible way 14:30
14:31 buharin left 14:32 domidumont left 14:33 bioduds joined
bioduds hi guys 14:33
timotimo greetings
bioduds anyone gave a try on the install script? I'm curious to know if it works in MAC
hi timotimo
14:34 k-man left
timotimo i don't think people call it MAC :) 14:34
ilmari isn't it macOS these days?
bioduds OSX 14:35
67.205.136.118/install.sh
14:35 k-man joined
ilmari en.wikipedia.org/wiki/MacOS_Sierra # yeah, it's being renamed as of the next release 14:36
bioduds :)
curl 67.205.136.118/install.sh | sh;. ~/rakudo/setpath.sh
the line
14:38 khw joined
timotimo "spec ops: the line" ? 14:38
bioduds it has to be a 2-liner condensed into 1 14:39
timotimo in that case, i'd rather recommend && over ; 14:40
if rakudo doesn't compile, there's no reason to try to source setpath.sh
bioduds yep, it wont anyway 14:41
cause the path will not exist
timotimo but the user will get an error at the bottom that is misleading
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
because that's the last line that has "error" in it 14:42
bioduds what do you suggest?
cause im not sure it will print an error
timotimo well, if you make that &&, it won't even try to source if the installation didn't succeed
bioduds i believe it wont
oh
so it would be
curl 67.205.136.118/install.sh | sh && . ~/rakudo/setpath.sh 14:43
is this it?
timotimo yeah, i think so
bioduds oh, great
let me test that
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
bioduds oh, ok 14:47
let me add that
14:47 buharin joined
bioduds 67.205.136.118/install.sh 14:49
there we go
testing
thing is, after installing, I can test for perl6 14:50
should I rm rakudo dir if perl6 fails?
or should I rm rakudo on every fresh install? 14:51
or none of the above?
timotimo if you just rm it, that makes it harder to diagnose what went wrong
14:51 skids joined
bioduds correct, but if i dont it wont accept new tries 14:51
timotimo oh
bioduds meteor installation removes it 14:52
i guess I should too
cause this is meant to be the first install
14:53 domidumont joined
bioduds if this fails, user should try a manual install, I guess 14:53
what do you think?
dalek c: 07f21bc | coke++ | doc/Type/UInt.pod6:
remove trailing whitespace
14:54
14:59 pierre_ left 15:00 g4 left 15:03 mcmillhj joined 15:08 mcmillhj left
Ulti if I want to left pad a string with a character is there an obvious method for that? 15:11
upto a given length 15:12
is there just sprintf equivalent I'm forgetting about
15:13 lichtkind_ joined
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␤␤»
timotimo m: my $desired-len = 80; my $char = "@"; my $input = "hello there"; say $char x ($desired-len - $input.chars) ~ $input
camelia rakudo-moar f49b38: OUTPUT«@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@hello there␤»
15:14 wamba joined
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
there's a reason why left-pad was such a popular module
because it did those exact things "right"
15:17 lichtkind left 15:19 rudi_s left
Ulti timotimo: yeah I know how I *could* do it 15:19
its more is there a built in
15:19 domidumont left 15:20 rudi_s joined
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:20
bioduds didn't work with && 15:21
timotimo didn't work? :o 15:25
15:27 poohman__ joined
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:27
bioduds cause that wouldn't be a one liner 15:28
15:28 sakuya joined
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
El_Che stmuk: yeah, much of the rakudo install culture give unix people heartache (SHA1 paths!) 15:29
timotimo yeah, that'll be fun
i once had a PATH that was like 10 lines when printed in my terminal
15:30 poohman left 15:32 poohman__ left
CIAvash Ulti: not exactly what you want but there is indent docs.perl6.org/routine/indent 15:32
bioduds goal is to have a direct install line that should install perl6
El_Che bioduds: where is setpath.sh called after installation? 15:33
bioduds on the line itself
stmuk externally to the script
bioduds curl 67.205.136.118/install.sh | sh;. ~/rakudo/setpath.sh
15:33 thundergnat joined
El_Che I mean after the user logs out 15:33
that's the calling shell
bioduds once it is sourced, it stays there, no? 15:34
El_Che no
it goes with the shell it runs
bioduds so I believe it should also put it in .bashrc
El_Che . means: this and child shells
maybe does star add stuff there
stmuk it doesn't 15:35
bioduds perhaps it should only put in the .bashrc
El_Che then it will be gone after the shell is closed
bioduds and source the .bashrc
stmuk how do you know what login shell is in use? not everyone uses bash (I don't)
bioduds sorry, i didn't understand the question 15:36
15:36 jonas1 left
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
timotimo fish
El_Che users of advances shell will know how to change a path
stmuk El_Che: yes which is exactly what happens anyway
mst local::lib has support for sh, csh, cmd, fish 15:37
you could steal from it
15:37 mcmillhj joined
bioduds not sure exactly what you are telling me to do, mst 15:37
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:38
bioduds ok, what about this: i prompt the user to let me add path to the .bashrc 15:39
if yes, I put it there and source it
if no, I leave as is printing only the paths that should be added
thundergnat Ulti: As long as the pad character is a zero there is a built in.
m: say 'hello there'.fmt('%080s') # arguably a bug
camelia rakudo-moar f49b38: OUTPUT«000000000000000000000000000000000000000000000000000000000000000000000hello there␤»
El_Che bioduds: metacpan.org/pod/local::lib#SYNOPSIS 15:40
the is an example of PATH. It prints commands that you can run or add to your shell config
bioduds: have a look at metacpan.org/pod/local::lib#The-bo...-technique 15:41
bioduds: for questions, ask mst. He's the author :)
(sorry mst, I gave you away ;) ) 15:42
bioduds thanks, im gonna try to understand it
El_Che understand mst? oh, wait
15:42 mcmillhj left
gregf_ m: printf("%.5s%s","foobarbaz", "quux"); #Ulti 15:42
camelia rakudo-moar f49b38: OUTPUT«foobaquux»
timotimo whoa 15:43
15:43 lizmat_ joined 15:44 darutoko- joined, user10 joined, john51_ joined, zhmylove_ joined
stmuk github.com/rakudo/star/blob/master...ile.in#L82 15:44
Rakudo Star already prints information about PATH after installation 15:45
bioduds yes it does
15:45 user9 left 15:46 AngeloMichael_ joined
bioduds but that doesn't help beginners 15:46
a beginner needs something he can copy paste or write in shell and have it installed after that
15:47 Spot___ joined, avalenn_ joined 15:48 NEveD_ joined
bioduds if a decision is necessary on the installation proceedure, it must be prompted to the beginner with a default usage 15:48
15:48 perlpilot joined, xiaomiao joined, user10 left, sergot joined, zhmylove left, notbenh left, ssm left 15:49 avalenn left, AmazingPudding left, lizmat left, mtj_ left, john51 left, w4and0er96 left, chee left, AngeloMichael left, geekosaur left, abruanese left, dylanwh left, avar left, NEveD left, darutoko left, xinming_ left, sergot_ left, xinming joined, abruanese joined
bioduds this is why beginners dont go with ruby on rails 15:49
they give up on the installation process
15:49 damnlie joined 15:50 ssm joined
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
15:50 mtj_ joined, AngeloMichael_ is now known as AngeloMichael
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:50
15:51 committable6 left
bioduds without knowing what happened during installation 15:51
15:51 Spot___ is now known as Spot__, committable6 joined, geekosaur joined
AlexDaniel m: say 25 xx Inf 15:52
camelia rakudo-moar f49b38: OUTPUT«(...)␤»
AlexDaniel m: say (25 xx Inf)[^20]
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)␤»
mst this is why what I suggested was to -first- make it work by -telling- the user what to add
15:52 user9 joined, roguelazer joined
mst and -then- once that's stable, you can add an option to do it automatically 15:52
AlexDaniel m: say 25 x Inf
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
mst bioduds: are you detecting the shell and doing: echo 'To set this up globally, add this line to your .bashrc:' yet? 15:52
because that's the next step
newbies should be able to copy and paste a line into a file 15:53
15:53 notbenh joined
El_Che bioduds: <PATH INFO>. Do you want me to add this to your $shell.rc? <y|n> (default no) 15:53
15:54 mcmillhj joined
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
15:54 chansen_ joined
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
El_Che anyway, as stmuk says, rakudo star already prints the path info
so you get that for free :)
15:56 poohman joined, TheLemonMan joined
bioduds yes 15:56
default yes
El_Che (please don't confuse constructive criticism with grumpyness <-- just checking)
15:57 cog__ joined, poohman43 left 15:58 poohman_ joined, mcmillhj left
bioduds im going to try 15:58
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 github.com/rakudo/rakudo/blob/nom/...ion.pm#L52
15:59 AlexDaniel left 16:00 cog_ left, domidumont joined, poohman left 16:03 w4and0er96 joined
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:04
16:06 mcmillhj joined
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
on my system: /bin/sh -> dash 16:07
16:07 autarch left
El_Che you could replace the command part by which: which perl >/dev/null || ... 16:08
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
mst timotimo: I Gnore, They Gnore, You Gnore, We Gnore 16:11
16:11 mcmillhj left
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
something like that
bioduds like so? export PATH=$HOME/rakudo/rakudo-star-2016.07/install/bin:$HOME/rakudo/rakudo-star-2016.07/install/share/perl6/site/bin:$PATH
El_Che yeah 16:12
bioduds ok
done
do you think this here is better? 67.205.136.118/install.sh 16:13
ops wait
stmuk I would add an "if" to check the $SHELL is bash around that 16:14
16:14 dylanwh joined
bioduds now 16:14
67.205.136.118/install.sh 16:15
is this better?
where should i add the if?
stmuk around the while loop
bioduds if $SHELL == bash 16:16
if $SHELL == bash; then
timotimo needs [ ] i think?
bioduds if [$SHELL == bash]; then 16:17
timotimo and i thnik you have to use eq for strings rather than == ?
bioduds if [ “$stringvar” == “tux” ]; then 16:18
mst if [ "$SHELL" == "bash" ];
timotimo: no, that's perl5
timotimo: shell is opposite
16:18 zacts left
stmuk I don't think the "rm -rf ~/rakudo 16:18
is a good idea just exit if the directory exists 16:19
16:21 mcmillhj joined
grondilu -eq 16:21
16:22 poohman_ left 16:23 poohman joined
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 ;)
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
nine: shhh, you're a minirity ;)
bioduds how about this 67.205.136.118/install.sh 16:25
grondilu oh yeah in shell, -eq is for numeric values and = is for strings. Weird.
timotimo i do that development in ~/perl6
stmuk shows his age stick an "echo + + > .rhosts" in as well (*joke*)
16:25 mcmillhj left
geekosaur probably because the shell is very string-y and numeric comparison was added sometime after = 16:26
grondilu yeah
16:27 grondilu left
bioduds testing 16:33
timotimo who was asking me for a coverage report again?
16:35 mcmillhj joined
stmuk there is an interesting video of Stephen Bourne at a recent BSD Con explaining and regretting some of his design decisions 16:35
16:36 zakharyas left
geekosaur we were all young once :) 16:39
16:39 mcmillhj left
El_Che rhosts, lol. It used to be my colleages (at a previous job) favorite tool :) 16:39
16:39 dakkar left
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 :)
geekosaur digs out his old openssh t-shirt, the one with the gravestones (epitaph for rsh: "+ +")
El_Che hehe
dogbert17 .seen Frameless
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
timotimo hack.p6c.org/~timo/coverage/ - a rough coverage report of the core setting
bioduds what are the possibilities in echo $SHELL? 16:42
dogbert17 .seen BrokenRobot
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: gist.github.com/zoffixznet/b7e1e11...768e12c874
dogbert17 so, which nick is Zoffix using today?
El_Che geekosaur: www.openbsd.org/images/tshirt-9b.jpg that one? 16:43
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 ...
stmuk they missed rexd!
geekosaur rexec was insecure even for an r-command >.> 16:45
bioduds this here didnt work 16:46
if [ "$SHELL" == "/bin/bash" ]; then
sh: 37: [: /bin/bash: unexpected operator
i didnt understand
geekosaur it should be = 16:47
bioduds only =
geekosaur == is for [[ ]] (ksh and formerly POSIX version, with somewhat saner behavior)
bioduds oh, how weird
stmuk this is why people use perl! :)
bioduds :) 16:48
El_Che that works on my shell: if [ "$SHELL" == "/bin/bash" ]; then echo foo; fi
bioduds eq is also weird man
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 :)
bioduds for now, with my current knowlege, i can only ask if if /bin/bash and act accordingly 16:50
ask if wants to write to .bashrc
opened to all suggestions
El_Che write it in perl and use Moose
El_Che ducks
bioduds no
geekosaur if it's bash then it's not guaranteed to behave the same way
16:51 mcmillhj joined
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
gregf_ bioduds: Perl is available on most OS's 16:52
MasterDuke timotimo: i was asking about the coverage report
bioduds not actually
fedora for isntance
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)
bioduds not there
El_Che bioduds: welcome: deeper-down-the-rabbit-hole.com/wp-...1099_o.jpg
bioduds lol 16:53
yes
i actually feel more like Neo right now :)
El_Che but you took both pills?
:)
MasterDuke timotimo: has it been updated recently?
bioduds kkkkkk 16:54
geekosaur g02.a.alicdn.com/kf/HTB1jWQjJXXXXXc...tion-E.jpg
bioduds the pill you took is part of a trace program
ugexe what is this meant to offer over something like
curl raw.githubusercontent.com/tadzik/r...rakudobrew && perl rakudobrew/bin/rakudobrew build moar-blead-nom
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
what does that mean?
El_Che ugexe: haha. I have *exact* that edition in my shelf
bioduds it means buckle your seat belt dorothy cause kansas is going bye bye
:) 16:56
El_Che :)
food
bbl
stmuk Evi Nemeth was lost at sea :(
geekosaur yes :(
16:56 mcmillhj left
ugexe a new user is just copy and pasting that line anyway 16:56
16:56 benchable6 left
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
dalek c: 71fde8d | (Jan-Olof Hendig)++ | doc/Type/IO/Handle.pod6:
Added doc for the :close adverb in slurp-rest
16:57
TheLemonMan ugexe, why does zef throw an exception (and exits) when a module's already installed ? 16:58
ugexe rakudo throws an exception 16:59
zef could hide that, sure. but rakudo throws it
17:00 benchable6_ left, benchable6 joined 17:05 mcmillhj joined 17:06 AlexDaniel joined
bioduds damn, got an infinite loop on prompt 17:09
$yn = "y"
sh: 39: =: not found
gosh
please, help 17:10
17:10 mcmillhj left
bioduds what is wrong here: $yn = "y" 17:10
good lord, is yn 17:12
what a bizarre language
El_Che bioduds: spaces 17:16
17:17 cooper joined
timotimo gosh is a shell writenn in go? or with go syntax? 17:18
El_Che :) 17:19
you forgot to test for the error!
:)
17:19 firstdayonthejob joined, cooper left, cooper joined
El_Che you have to type it after each command :) 17:19
17:20 mcmillhj joined
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:25 mcmillhj left
bioduds im overwhelmed 17:31
17:32 Actualeyes left
dalek pan style="color: #395be5">perl6-examples: acc163b | paultcochrane++ | categories/euler/prob463-shlomif.p6:
Indent curlies consistently
17:33
pan style="color: #395be5">perl6-examples: 3da8055 | paultcochrane++ | categories/euler/prob463-shlomif.p6:
Make debuging code selectable with a flag
17:36 mcmillhj joined 17:37 avar joined 17:39 Shantanu1 left 17:41 perturbation joined, mcmillhj left 17:45 Shantanu1 joined
masak bioduds: any way we can help? 17:46
17:48 domidumont left 17:56 mcmillhj joined
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
17:57 zacts joined
Xliff Nappy time. 17:57
geekosaur o/O 17:59
18:01 _slade_ joined, mcmillhj left 18:04 skids left 18:13 go|dfish left 18:27 mcmillhj joined 18:28 spider-mario joined 18:29 lambd0x joined
lambd0x Hi everyone! 18:29
18:31 domidumont joined 18:32 mcmillhj left 18:37 ZoffixLappy joined
[ptc] timotimo: did you get any further with Coverity? 18:38
lizmat_ lambd0x o/
18:38 lizmat_ is now known as lizmat, rba_ left 18:39 mcmillhj joined 18:40 TimToady left 18:41 go|dfish joined 18:42 TimToady joined 18:45 mcmillhj left 18:47 rindolf joined 18:49 firstdayonthejob left 18:50 thundergnat left 18:51 TEttinger joined 18:54 LegalResale left 18:57 ChoHag left 19:01 Roamer` left, Roamer` joined
timotimo [ptc]: haven't scanned a recent built, but many issues are still to be fixed 19:01
it'd be nice if the issues could be publically available
19:02 domidumont left 19:04 zacts left 19:06 darutoko- left 19:14 labster joined 19:17 firstdayonthejob joined 19:18 andrzejku joined
[ptc] timotimo: I agree; the issues should be publically available 19:25
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
[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:26
elohmrow what in p6 is like File::Next from p5 land? 19:27
19:29 ChoHag joined, aries_liuxueyang left, aries_liuxueyang joined
lizmat elohmrow: what does File::Next do again ? 19:29
elohmrow iterates a tree, returning all files and some meta
ZoffixLappy Seems to be an iterator for a directory tree metacpan.org/pod/File::Next
elohmrow liz: ^
arnsholt has discovered pycparser 19:30
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
lizmat I see... well, I don't see anything covering that functionality in modules.perl6.org 19:32
so I would say, go for it
should be relatively easy, afaics
elohmrow lizmat: i don't see it either. the functionality itself, should be easy i think yes
El_Che ack is awesome 19:33
elohmrow El_Che: yep
masak I basically stopped using `ack` and switched completely to `git grep` for everything
TheLemonMan El_Che, ag is even faster if you don't mind it being written in C rather than perl
El_Che 2 new things to try :)
19:34 andrzejku left
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 :-)
elohmrow ;) 19:35
tadzik elohmrow: File::Find may satisfy your needs :)
El_Che lizmat: async will be easy. Putting the output together... less so :)
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 19:36 sufrostico left
lizmat El_Che: well, fwiw, generally I don't care about the order of the output of ack 19:36
19:36 nige1 joined
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:36
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> ...
:)
lizmat ah, like that 19:38
19:38 vike left
El_Che problem now several have you 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
think that should work pretty well
El_Che go func() { messages <- "ping" }() 19:39
:)
19:41 canopus left
ZoffixLappy "Private multi-methods are not supported" :/ really? 19:42
ZoffixLappy wonders why 19:43
Doesn't matter, I guess
mst odd
El_Che ZoffixLappy: an API is all about the façade :) 19:44
19:45 tushar joined
nige1 hi 19:45
ZoffixLappy hey 19:46
19:46 canopus joined
nige1 HI Zoffix 19:46
mst hrmf
nige1 - I think there is an opportunity for promoting Perl 6 via search engine
s
ZoffixLappy oh boy
nige1, what is it?
19:47 vike joined
nige1 I gave this lightning talk at yapc: www.slideshare.net/trexy/seopan-tal...gehamilton 19:47
basically - it distills what stackoverflow does
providing answer to questions - except in the case of code - that's problems -> solutions 19:48
ZoffixLappy nige1, so what's your suggestion? 19:49
to what we should be doing... to promote and whatnot
mst hm 19:50
where would I look in the docs
nige1 - a heavily SEOed site for providing Perl6 problems -> solutions
mst to grok the difference between 'my $foo = [];' and 'my @foo;'
given $foo[0] and @foo[0] etc. work the same
nige1 so for example: "how do a I parse a csv file"
timotimo mst: i'd go with $foo.WHAT and @foo.WHAT
nige1 we provide a cut-n-pastable perl 6 snippe that does just that
timotimo and then look at the page for the class in question? 19:51
mst timotimo: both say (Array)
19:51 girafe2 joined
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?
things like "how do they behave in for loops" and such?
nige1 the code there is under a GPL 'documentation licence' 1.2 - and could be used in the SEO site
mst I don't know which differences I'm interested in because I don't know what the difference *are* yet
ZoffixLappy nige1, what exactly is a "seo site"?
19:53 girafe left
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
mst what I mean, I think, is "other than the sigil, what's going to behave differently?"
and was hoping there'd be an FM to R for this
ZoffixLappy I'm not aware of it... though it's on my TODO to write a blog post about
timotimo mst: good point
nige1 certainly learning lessons from SO - but creating a separate standalone solutions directory site 19:54
an overlay to cpan/modules.perl.org
timotimo docs.perl6.org/language/variables#Sigils_ :)
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" ;)
ZoffixLappy isn't too happy with "copy-pasteable solutions" 19:55
There are enough PHP "programmers" out there.
nige1 well - they get a bad rep ;-) but when I do searches on Google - that's what gets rank
timotimo docs.perl6.org/language/list - also a good thing to read
docs.perl6.org/language/containers...sty_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?
I'm unsure what this would do to "promote Perl" really.
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
my @bar := @foo.map: 1+*
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
timotimo what was the site called that collected perl snippets and is hugely infamous for it? :)
nige1 anyone searching google
mst perlmonks?
timotimo mst: if you want to keep the iteratory thing, it's best to just assign to a scalar container
nige1 someone who is looking to a parse a csv file for example
timotimo nope, not that one
mst timotimo: I don't want to
El_Che timotimo: Matt's archvie
(An other one)
mst timotimo: I just want to be read-only
timotimo that could be the one
mst argh argh FormMail.PL argh 19:59
never have I been so unhappy to be called Matt
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?
El_Che wonders how many mails mst got with support request for formmail
timotimo because Array == List + Scalar Containers for each element
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?
mst timotimo: my @bar = @foo.map(1+*).List; works, yes
timotimo and then it won't mutate? 20:00
mst gah
timotimo: my @bar := @foo.map(1+*).List; works, yes, and won't mutate
timotimo sounds good
mst but that offends me, since it's almost as much typing as in perl5
and I was hoping given a more advanced language I could get "no, everything is readonly after first assignment" more easily ;)
timotimo well, you're not using >>+>> 1
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
and one way it can do that is by providing some copy-pasta
mst I think a library of copy-pastable snippets for common tasks is a good thing anyway
newbies often find copy-paste-edit a good way to get started
ZoffixLappy doesn't
Unless it's a proper module 20:02
mst 'baby perl' is something we're intentionally trying to make possible
20:02 nebuchad` joined
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
lizmat m: constant @a = ^10; @a[0] = 42 # mst ???
camelia rakudo-moar bdd469: OUTPUT«Cannot modify an immutable Int␤ in block <unit> at <tmp> line 1␤␤»
20:02 cygx joined
cygx o/ 20:02
m: my @foo = <1 2 3>; say WHAT list @foo.map: 1+*
camelia rakudo-moar bdd469: OUTPUT«(Seq)␤»
profan more like, "here is how to write idiomatic perl" rather than "how to solve problem x"
cygx ^ bug?
mst timotimo: huh
timotimo: my @bar := @foo >>+>> 1; # yep 20:03
so my only real problem here is map hating me
because of the seq return
it's just kinda *fnrrrgh* that '=' works to get a mutable array out the Seq, but ':=' doesn't
20:03 Jonis_ joined
timotimo that's the difference between list and List :) 20:03
20:03 sammers_ joined
timotimo List coerces to a List object, list gives you something that can list 20:03
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
leont Well, if you use :=, I'd assume you want that sort of thing on purpose
cygx timotimo: interesting, I did not know that
mst leont: I'm trying to do 'single assignment'
ZoffixLappy nige1, cool. When will we see the first demo? :)
timotimo who knows if it's actually correct, though :)
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
:= was one of the suggestions, and I've been playing with it
leont At least, when I use := that often means I want the Seq instead of the List, because I want the laziness
nige1 :-) - well was just putting the idea out there
timotimo in any case, $ goes with := much better than @ and % do
leont Yeah
mst nige1: as ever, if you don't make a start, other people are less likely to come play :)
20:05 itaipu_ joined
ZoffixLappy nige1, :) well, you're most familiar with that idea? Why not try to start something? 20:05
nige1 yes - mst - understood 20:06
cygx well, according to the docs, Any.list should return a list
I would have expecte &list to behave the same way
*should return a List
20:06 elohmrow left
ZoffixLappy m: my $x = 42; my $b := $x; $b = 72; dd $x; 20:06
camelia rakudo-moar bdd469: OUTPUT«Int $x = 72␤»
20:06 kaare_ left 20:07 _slade_ left
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
though >>+>> is freaking cool
ZoffixLappy »+» is cooler :P 20:08
cygx has used the 'fish operator' <<=><<
20:08 cyphase_eviltwin joined 20:09 yossarian joined, yossarian left, yossarian joined
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]␤»
ZoffixLappy heh
20:10 prussian left, benchable6 left, mtj_ left, Spot__ left, itaipu left, sammers left, dalek left, cyphase left, SourceBaby left, stigo left, PotatoGim left, tbrowder left, kent\n left, olinkl left, peteretep left, nebuchadnezzar left, cgfbee left, Jonis left, notbenh_ left, woodruffw left, timeless left, synopsebot6 left
timotimo ZoffixLappy: why the hell would you put prefix++ at the end there? o_O 20:11
20:11 benchable6 joined, Spot__ joined, dalek joined, SourceBaby joined, stigo joined, PotatoGim joined, tbrowder joined, kent\n joined, olinkl joined, peteretep joined, notbenh_ joined, timeless joined, synopsebot6 joined, hitchcock.freenode.net sets mode: +v dalek 20:12 timeless left, PotatoGim left
ZoffixLappy timotimo, because I can :) 20:12
(•_•)
( •_•)>⌐■-■
(⌐■_■)
20:12 mtj_ joined 20:13 cgfbee joined, ggherdov left 20:14 peteretep left
mst ZoffixLappy: hm, could I make an anon method with that 20:14
@foo>>.&meth(*+1) or something?
timotimo subs will definitely work
ZoffixLappy m: my @foo = ^10; my @bar := [[&prefix:<++>]] @foo; dd @bar
camelia rakudo-moar 74f1ed: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤ in block <unit> at <tmp> line 1␤␤»
timotimo meths ought to work, too. 20:15
mst well, how would I stick an anon sub after the dot?
ZoffixLappy mst, the .&blah calls a sub with the first arg set to the invocant
oh
m: say 42.&(*+1)
camelia rakudo-moar 74f1ed: OUTPUT«43␤»
ZoffixLappy m: say ^10 >>.&(*+1)
camelia rakudo-moar 74f1ed: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed postfix call␤at <tmp>:1␤------> 3say ^10 >>.7⏏5&(*+1)␤»
ZoffixLappy m: say (^10)>>.&(*+1) 20:16
camelia rakudo-moar 74f1ed: OUTPUT«(1 2 3 4 5 6 7 8 9 10)␤»
20:16 Spot__ left
mst HAH 20:16
ZoffixLappy :)
mst my @bar := @foo>>.&(*+2)
much nicer than .List
... I'm going to make people cry, aren't I?
mst thinks he's going to have to read docs.perl6.org from end to end at some point 20:17
then I can harass zoffix at a higher level
20:18 hankache joined
ZoffixLappy :D 20:18
mst anyway, my turn to ->pub
&
20:19 cdg joined 20:21 zacts left, timeless joined
lizmat and another Perl 6 Weekly hits the Net: p6weekly.wordpress.com/2016/09/05/...ao-perl-6/ 20:22
ZoffixLappy \o/
20:23 Spot__ joined
hankache lizmat++ 20:23
hello #perl6
ZoffixLappy lizmat++ good weekly 20:24
\o hankache
20:24 peteretep joined
hankache hello ZoffixLappy 20:24
20:26 PotatoGim joined 20:27 ggherdov joined
[ptc] lizmat++ 20:36
20:36 woolfy left 20:38 hankache left
masak lizmat++ # p6weekly.wordpress.com/2016/09/05/...ao-perl-6/ 20:41
20:42 ggherdov left 20:43 ggherdov joined, woolfy joined 20:44 ggherdov left, nige1 left, ggherdov joined 20:48 CIAvash left 20:49 cdg left, sufrostico joined 20:52 nige1 joined 20:53 eliasr left 20:56 sufrostico left 20:59 Ven_ joined 21:02 ChoHag left
El_Che lizmat++ 21:12
21:20 aries_liuxueyang left 21:22 aries_liuxueyang joined 21:23 cygx left 21:24 ChoHag joined
ZoffixLappy Is there a use for Junctions other than collapsing them in Boolean context? 21:25
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 21:29 itaipu_ left 21:35 zacts joined
lizmat eh, but what about: 21:35
m: sub a($a) { $a }; dd a(1|2|3) 21:36
camelia rakudo-moar e5d7a1: OUTPUT«any(1, 2, 3)␤»
ZoffixLappy m: sub a($a) { $a.say }; dd a(1|2|3)
camelia rakudo-moar e5d7a1: OUTPUT«1␤2␤3␤any(Bool::True, Bool::True, Bool::True)␤»
ZoffixLappy :o
lizmat well, I guess that's still collapsing in the end :-)
ZoffixLappy lizmat++
lizmat I guess if you're executing a() for its side-effects, you're abusing the junction :-) 21:41
or are you?
21:41 nige1 left
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
rather than 1|2|3
masak lizmat: nope; they all run conceptually "in parallel"
lizmat so we're always sure that they will all be run ? 21:43
even on an any ?
masak aye
lizmat TIL :-)
masak hm
lizmat I guess it's different in the collapsing code
ZoffixLappy masak, why action at a distance? I see little difference between foo 2|3 and foo for 2, 3
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
21:44 grondilu joined
ZoffixLappy nods 21:44
ZoffixLappy still writes in this use into the article :}
masak lizmat: I might have stated things too strongly, I dunno. maybe junctions do reserve the right to short-circuit.
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
which is causing a collapse
no?
21:46 leont left
masak looks like it's not sink context; it's `dd` printing the value 21:46
ZoffixLappy m: gist.github.com/zoffixznet/4eac24f...7902168720
camelia rakudo-moar e5d7a1: OUTPUT«5 is a prime␤42 is an even number␤10000000 is an even number␤10000000 is pretty big␤»
21:47 Ven_ left
masak 'night, #perl6 21:48
ZoffixLappy night
lizmat good night, masak 21:49
ZoffixLappy m: gist.github.com/zoffixznet/1b860cd...c2a3d8df97
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␤»
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
m: gist.github.com/zoffixznet/05df82a...80e209db1a 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␤»
ZoffixLappy hm
Oh yeah, I just wrote the stuff wrong 21:54
m: gist.github.com/zoffixznet/7c41841...308def539b
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␤»
ZoffixLappy m: gist.github.com/zoffixznet/df4d6ef...000b0c9c95 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␤»
ZoffixLappy that's interesting 21:57
Why is `an even number` missing?
And it's curious that's specifying an explicit Junction argument produces different behaviour.
m: say Junction ~~ Any; say Junction ~~ Mu 21:58
camelia rakudo-moar e5d7a1: OUTPUT«False␤True␤»
ZoffixLappy Ah. Now that makes sense.
geekosaur because two are?
22:00 kurahaupo left
ZoffixLappy Two are? 22:01
geekosaur "one" junction asserts exactly one of the superposed values qualifies, no? both 42 and 10000000 are even. 22:02
so it can't one(). it could any()
ZoffixLappy But does it know I'm `say`ing anything? 22:03
m: gist.github.com/zoffixznet/0d1cc56...d2b3d67431 22:04
camelia rakudo-moar e5d7a1: OUTPUT«one(1, 5, 42) is a prime␤one(1, 5, 42) is an even number␤»
ZoffixLappy Apparently it does...
geekosaur ? $n autothreads in $n %% 2
ZoffixLappy backs away from this black magic
geekosaur the result is not compatible with one(), because not exactly one superposed value is true
ZoffixLappy geekosaur++ pointing out another awesome usecase in my article :d
geekosaur (after the autothread)
ZoffixLappy s/in/for/; 22:05
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␤»
ZoffixLappy
.oO( using a Junctioned sub to perform a DB lookup... ???... profit! )
22:11
22:22 labster left
lizmat good night, #perl6! 22:22
ZoffixLappy night 22:23
22:28 wamba left
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 22:43 lue joined 22:44 ShimmerFairy left 22:49 RabidGravy left, rindolf left 22:52 spider-mario left 22:57 parabolize left 23:00 brrt joined 23:02 firstdayonthejob left 23:03 BenGoldberg joined 23:04 lambd0x left 23:08 tushar left
ZoffixLappy New blog post "Perl 6's Schrödinger-Certified Junctions": perl6.party/post/Perl-6-Schrodinger...-Junctions 23:08
dalek c: 81ef09b | titsuki++ | doc/Language/faq.pod6:
Add some indexes for FAQ
23:09
c: dfd4257 | titsuki++ | doc/Language/faq.pod6:
Merge pull request #886 from titsuki/index-faq

Add some indexes for FAQ
23:19 heatsink joined 23:21 benji joined, benji is now known as Guest44202 23:22 TheLemonMan left
Guest44202 how would I read a certain number of characters from a file for each iteration of a loop 23:24
so I could just get 16 or 32 characters per iteration while reading a file's contents
ZoffixLappy naively suggests .comb(16)[0] and .comb(32)[0] 23:25
There's likely a betetr away
23:25 perturbation left
ZoffixLappy Looking at 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
23:26 aries_liuxueyang left
ZoffixLappy m: my @nothing-to-see; say "yeah, it's in 'ere" if @nothing-to-see.any == 42 23:26
camelia ( no output )
ZoffixLappy Oh... the other theory is that I'm too drunk to think straight :P 23:27
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
camelia rakudo-moar e5d7a1: OUTPUT«yeah, it's in 'ere␤»
23:28 aries_liuxueyang joined
ZoffixLappy Guest44202, there's readchars method, so it's likely something like .readchars(16): docs.perl6.org/type/IO$COLON$COLON..._readchars 23:29
23:29 ZoffixLappy left
Guest44202 would using the comb routine like you said be wrong? 23:30
23:30 bjz_ left 23:32 Guest44202 left 23:46 benji_ joined
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:47 benji_ left
TimToady m: "😺".ord 23:48
camelia ( no output )
TimToady m: "😺".ord.base(16).ord
camelia ( no output )
TimToady m: "😺".ord.base(16).say
camelia rakudo-moar e5d7a1: OUTPUT«1F63A␤»
23:48 Zoffix joined, benji_ joined
Zoffix m: say '♥'.ord.base: 16 23:48
camelia rakudo-moar e5d7a1: OUTPUT«2665␤»
Zoffix TimToady, are you sure slurping the entire file is involved? .lines doesn't slurp
TimToady but then you're slurping each line, and .chars(16) can't cross a line boundary 23:49
Zoffix Ah
Zoffix tests 23:51
if .lines can do it, why can't .comb do it :/
23:52 killbill joined
Zoffix Seems .comb reads lazily: gist.github.com/zoffixznet/8062a6f...a292d72a68 23:55
I have just 4GB RAM on that box and it's a 10GB file
TimToady .comb is a string method, but we really need lazy strings (Cat) before we can do incremental regex against them
and .comb(/regex/) is really the main design point, .comb(10) is an add-on 23:56
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 :)
23:59 killbill left