»ö« 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.
skink Alright, time to guess what's terrible wrong 00:02
my Pointer $hProv .= new; 00:03
my $ctx_ret = CryptAcquireContextA(&$hProv ...
skink wonders if CryptAcquireContextA(Pointer[Pointer]...) is also wrong
geraud TimToady: for some value of "NC" 00:06
sortiz skink, use: "class HCP is repr('CPointer') { };" and then "CryptAccquireContextA(HCP is rw,…)", and call with "my HCP $h .= new; …($h,…)" 00:10
sortiz That way you have a typed pointer that can be safely in other calls with for the same type, and as a Handler you even can define methods for it in the class. Ie that sub can be the constructor in the class. 00:16
hotel just saw an ad with what I assume was a failed XSS attack in it lol 00:23
something like print '<scri' + 'pt>'
skink Thanks sortiz. I was both trying to figure out the custom type and wondering about is rw instead of the other pointer previously 00:24
That combines the two
sortiz++
Bot1 Sup 00:32
sortiz skink, Take that with a grain of salt, some years have passed since the last time I wrote for Windows. And I don't have my Windows at hand :-) 00:32
skink Oh my god what. 00:34
All tests successful.
It's a miracle!
timotimo cool
sortiz nice 00:35
hotel what kind of project can I do in perl6? looking for ideas I guess 00:51
MadcapJake servers, text processing, nativecall bindings, lots of stuff! The only limiting factor right now is it should be something not very expensive (in terms of performance) 00:56
ugexe software for manipulating emissions is pretty hot right now 00:57
hotel did VW write that in perl 6? kek 00:58
MadcapJake ugexe: lol
not just VW now! Fiat and Mitsubishi too 00:59
geekosaur they should have written it in php so they;d have plausible deniability >.>
hotel oh really? hadn't heard that 01:00
ugexe i hear dracony worked for toyota and thats how that happened
hotel m: my $supply = Supplier.new.Supply; $supply.tap(-> $v { say 'this car is fuel-efficient and eco-friendly! }); $supply.emit('CO2 >> normal values') # `emissions` manipulation 01:03
camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5=== Error while compiling /tmp/HQCPRTABs5␤Two terms in a row␤at /tmp/HQCPRTABs5:1␤------> 3ent and eco-friendly! }); $supply.emit('7⏏5CO2 >> normal values') # `emissions` man␤ expecting any of:␤ infix␤ infi…»
hotel well if I had closed the quote it would have been better 01:04
MadcapJake I'm guessing they wrote it in Lua and just thought it was 0-based indices ;)
hotel m: my $supply = Supplier.new.Supply; $supply.tap(-> $v { say 'this car is fuel-efficient and eco-friendly!' }); $supply.emit('CO2 >> normal values') # `emissions` manipulation
camelia rakudo-moar 9c8989: OUTPUT«Method 'emit' not found for invocant of class 'Supply'␤ in block <unit> at /tmp/SdeW8G8GGX line 1␤␤»
skink sortiz, timotimo: Well that didn't last long :D 01:04
Bytecode validation error
hotel >=| you get the point
MadcapJake (funny enough Lua evolved from Sol a language designed for petroleum engineers)
hotel that's hilarious 01:05
TEttinger I thought it was a full rewrite because sol was impossible to read
hotel iirc lua was developed in brazil while sol was made by the us navy 01:06
MadcapJake www.lua.org/history.html 01:07
TEttinger ah, yeah, del was the unreadable one
hotel looks like they tried to follow the KISS design philosophy 01:09
hotel one-letter control codes are usually a good idea 01:09
skink Hm... Very odd. Changed some params from uint64 to uint32 for consistency and the whole thing exploded 01:10
skink operand type 160 does not match register type 152 01:10
sortiz skink, Are you using native types in named arguments? 01:11
skink Nope
sortiz Umm, so a different bug. 01:12
skink github.com/skinkade/crypt-random/c...2ae222f4eb 01:14
sortiz I've seen that error but only with named args: 01:21
m: sub Foo(uint32 :$bar) { say $bar }; Foo(:bar(4));
camelia rakudo-moar 9c8989: OUTPUT«Bytecode validation error at offset 40, instruction 6:␤operand type 160 does not match register type 152␤ in block <unit> at /tmp/BXyC79IP3f line 1␤␤»
sortiz Isn't NC related, is codegen related. 01:22
skink It works with uint32 though 01:25
er, 64
skink m: sub Foo(uint64 $x) { say $x; }; Foo(4); 01:26
camelia rakudo-moar 9c8989: OUTPUT«4␤»
skink m: sub Foo(uint32 $x) { say $x; }; Foo(4);
camelia rakudo-moar 9c8989: OUTPUT«4␤»
skink ... Interesting
m: sub Foo(uint64 :$bar) { say $bar }; Foo(:bar(4));
camelia rakudo-moar 9c8989: OUTPUT«4␤»
skink m: sub Foo(uint32 $x = 4) { say $x; }; Foo(); 01:27
camelia rakudo-moar 9c8989: OUTPUT«Bytecode validation error at offset 40, instruction 6:␤operand type 160 does not match register type 152␤ in block <unit> at /tmp/PKlFkvKzRc line 1␤␤»
hotel so uint32 is broken
skink sortiz, Not just named types, also default values
named params*
sortiz Ok, can you add that example to RT#127813 ? 01:28
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=127813
sortiz Yep, also for default values, and for all native types not in(int64, num64) 01:33
skink m: sub Foo(int8 $x = 4) { say $x; }; Foo(); 01:34
camelia rakudo-moar 9c8989: OUTPUT«Bytecode validation error at offset 40, instruction 6:␤operand type 32 does not match register type 8␤ in block <unit> at /tmp/piYiIHbdC8 line 1␤␤»
skink Wow
m: sub Foo(UInt32 $x = 4) { say $x; }; Foo();
camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5=== Error while compiling /tmp/bOmnaE7f8b␤Invalid typename 'UInt32' in parameter declaration. Did you mean 'uint32', 'int32'?␤at /tmp/bOmnaE7f8b:1␤------> 3sub Foo(UInt327⏏5 $x = 4) { say $x; }; Foo();␤» 01:35
hotel m: sub Foo(int32 $x = 4) { say $x; }; Foo();
camelia rakudo-moar 9c8989: OUTPUT«Bytecode validation error at offset 40, instruction 6:␤operand type 32 does not match register type 24␤ in block <unit> at /tmp/3UE92nKKsp line 1␤␤»
hotel even when signed
fun
skink Right, UInt32 is in Subsets::Common 01:36
ZoffixWin m: loop(;;){last} 01:38
camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5=== Error while compiling /tmp/sI4M_XRt0W␤Undeclared routine:␤ loop used at line 1␤␤»
ZoffixWin LTA Error
hotel lawn tennis association? 01:39
AlexDaniel well, hm
m: loop(;;) {last}
camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5===␤Word 'loop' interpreted as 'loop()' function call; please use whitespace around the parens␤at /tmp/R5D0VS0mht:1␤------> 3loop7⏏5(;;) {last}␤Unexpected block in infix position (two terms in a row)␤at /tmp/R5D0VS0mht:1␤--…»
ZoffixWin hm 01:40
Screw it then.
hotel but really, lighter than air?
AlexDaniel so the error message is quite good, but it is not printed when you omit space *after* parens 01:41
ZoffixWin huggable, LTA 01:41
huggable ZoffixWin, Less Than Awesome
hotel oh
right
hotel knew that :\
ZoffixWin huggable, TTIAR
huggable ZoffixWin, nothing found
ZoffixWin huggable, TTIAR :is: Two Terms In A Row
hotel huggable, PEBCAK
huggable ZoffixWin, Added TTIAR as Two Terms In A Row
hotel, nothing found 01:42
AlexDaniel ZoffixWin: well, at least it is not this
m: sub Foo(uint32 $x = 4) { }; Foo
camelia rakudo-moar 9c8989: OUTPUT«Bytecode validation error at offset 40, instruction 6:␤operand type 160 does not match register type 152␤ in block <unit> at /tmp/uBp7pf9zfb line 1␤␤»
hotel lol
ZoffixWin :o
AlexDaniel skink: will you submit a bug report? 01:43
hotel there was already a ticket opened, wasn't there? 01:44
AlexDaniel ah, there's already one
ok, missed it
AlexDaniel m: my @x; say @x:delete 01:46
camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5=== Error while compiling /tmp/z6AA8VflVw␤Variable '@x:delete' is not declared␤at /tmp/z6AA8VflVw:1␤------> 3my @x; say 7⏏5@x:delete␤»
hotel huggable, PEBCAK :is: Problem Exists Between Chair And Keyboard
huggable hotel, Added PEBCAK as Problem Exists Between Chair And Keyboard
AlexDaniel how can I declare @x:delete? :) 01:47
oh
m: my @x:delete = 42; say @x:delete
camelia rakudo-moar 9c8989: OUTPUT«[42]␤»
AlexDaniel since when colons are allowed 01:48
hotel m: my $: = 'colon'; say $: 01:48
camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5=== Error while compiling /tmp/7AlCZQ90De␤Unsupported use of $: variable; in Perl 6 please use Form module␤at /tmp/7AlCZQ90De:1␤------> 3my $:7⏏5 = 'colon'; say $:␤»
AlexDaniel m: my $hello:world = 42; say $hello:world
camelia rakudo-moar 9c8989: OUTPUT«42␤»
hotel I guess it's like hyphens 01:49
ZoffixWin wtf 01:50
m: my $hello::world = 42; say $hello::world 01:51
camelia rakudo-moar 9c8989: OUTPUT«42␤»
hotel welp
ZoffixWin m: my $h::::e:l:l:o::wo:r:l:d = 42; say $h::::e:l:l:o::wo:r:l:d
camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5=== Error while compiling /tmp/H5Z3GXtqUl␤Name component may not be null␤at /tmp/H5Z3GXtqUl:1␤------> 3my $h::7⏏5::e:l:l:o::wo:r:l:d = 42; say $h::::e:l:␤»
ZoffixWin m: my $h::x::e:l:l:o::wo:r:l:d = 42; say $h::::e:l:l:o::wo:r:l:d
camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5=== Error while compiling /tmp/c9sN87qKIA␤Confused␤at /tmp/c9sN87qKIA:1␤------> 3my $h::x::e:l:l:o:7⏏5:wo:r:l:d = 42; say $h::::e:l:l:o::wo:r:␤ expecting any of:␤ colon pair␤»
ZoffixWin m: my $h::x::e:l:l:o::wo:r:l:d = 42; say $h::x::e:l:l:o::wo:r:l:d 01:52
camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5=== Error while compiling /tmp/X4M_SBZjGH␤Confused␤at /tmp/X4M_SBZjGH:1␤------> 3my $h::x::e:l:l:o:7⏏5:wo:r:l:d = 42; say $h::x::e:l:l:o::wo:r␤ expecting any of:␤ colon pair␤»
hotel m: my $kebab--case = 'help I\'m dying'; say $kebab--case
camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5=== Error while compiling /tmp/uSYPBbtXtE␤Two terms in a row␤at /tmp/uSYPBbtXtE:1␤------> 3my $kebab--7⏏5case = 'help I\'m dying'; say $kebab--ca␤ expecting any of:␤ infix␤ infix stopper␤ statement…»
AlexDaniel m: my $_-_'_:_ = 42; say $_-_'_:_
camelia rakudo-moar 9c8989: OUTPUT«42␤»
ZoffixWin Feels like a bug with the thing that decides namespaced vars
m: my \Δ_-_'_:_ = 42; say Δ_-_'_:_ 01:53
camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5=== Error while compiling /tmp/YthMv1GQ70␤Variable '&Δ_-_'_:_' is not declared␤at /tmp/YthMv1GQ70:1␤------> 3my \Δ_-_'_:_ = 42; say 7⏏5Δ_-_'_:_␤»
ZoffixWin m: my \Δ_-_'__ = 42; say Δ_-_'__
camelia rakudo-moar 9c8989: OUTPUT«42␤»
hotel m: my $x-::-y = 'but' say $x-::-y
camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5=== Error while compiling /tmp/Fpe8haOoHS␤Unsupported use of y///; in Perl 6 please use tr///␤at /tmp/Fpe8haOoHS:1␤------> 3my $x-::-y7⏏5 = 'but' say $x-::-y␤»
hotel wat
ZoffixWin m: my %Δ_-_'_:_ = 42; say %Δ_-_'_:_
camelia rakudo-moar 9c8989: OUTPUT«Odd number of elements found where hash initializer expected␤ in block <unit> at /tmp/i29BbOTCJw line 1␤␤»
ZoffixWin m: my %Δ_-_'_:_ = 42 => 'meow'; say %Δ_-_'_:_
camelia rakudo-moar 9c8989: OUTPUT«{42 => meow}␤»
hotel life is just crazy
AlexDaniel hah, look at this 01:54
m: my $_-_'_::_ = 42; say $_-_'_::_
camelia rakudo-moar 9c8989: OUTPUT«42␤»
AlexDaniel but
m: my $_-_'_:::_ = 42; say $_-_'_:::_
camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5=== Error while compiling /tmp/GEbksP4vIs␤Variable '$_-_'_:_' is not declared. Did you mean '$_-_'_:::_'?␤at /tmp/GEbksP4vIs:1␤------> 3my $_-_'_:::_ = 42; say 7⏏5$_-_'_:::_␤»
ZoffixWin Something is off :) 01:55
AlexDaniel : not declared, use :::… well, that's what I am doing!
hotel lmao
AlexDaniel by the way, related discussion here: github.com/perl6/specs/issues/106
ZoffixWin File that as LTA Error for the luls :P
AlexDaniel indeed 01:57
hotel class help { my $method = method (|args) { 42 }; $?CLASS.^addmethod(' ', $method); }; say help.new" "()
m: class help { my $method = method (|args) { 42 }; $?CLASS.^addmethod(' ', $method); }; say help.new" "()
camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5=== Error while compiling /tmp/SmkhdIMv8l␤Two terms in a row␤at /tmp/SmkhdIMv8l:1␤------> 3addmethod(' ', $method); }; say help.new7⏏5" "()␤ expecting any of:␤ infix␤ infix stopper␤ postfix␤ …»
skink You can just a space as a method name? O_O
just use*
hotel according to that discussion 01:58
*.*
geekosaur you can. but not like that 01:59
hotel thought he was copying the example given
geekosaur given where? 02:00
because `help.new" "()` looks rather wrong to me
hotel <AlexDaniel> by the way, related discussion here: github.com/perl6/specs/issues/106
geekosaur I recall stuff like that needing some kind of ::()
hotel oh I forgot the . 02:01
m: class help { my $method = method (|args) { 42 }; $?CLASS.^addmethod(' ', $method); }; say help.new." "()
camelia rakudo-moar 9c8989: OUTPUT«Method 'addmethod' not found for invocant of class 'Perl6::Metamodel::ClassHOW'␤ in block <unit> at /tmp/h3aF_YPBgj line 1␤␤»
geekosaur oh
right, that makes more sense
ZoffixWin m: my $foo = class {}.new; $foo.^add_method(' ', {say "Weee";}); $foo." "()
camelia rakudo-moar 9c8989: OUTPUT«Weee␤»
hotel m: class help { my $method = method (|args) { 42 }; $?CLASS.^add_method(' ', $method); }; say help.new." "()
camelia rakudo-moar 9c8989: OUTPUT«42␤»
hotel yeah also would help if I used the right method call
ZoffixWin m: class {$?CLASS.^add_method(' ', {say "Weee";})}." "() 02:03
camelia rakudo-moar 9c8989: OUTPUT«Weee␤»
ZoffixWin neat
m: class {$?CLASS.^add_method('', {say "Weee";})}.""()
camelia rakudo-moar 9c8989: OUTPUT«Weee␤»
hotel super anonymous many wow
ZoffixWin :o
Empty method name! That's perverse.
skink Alright, I added a subset of Int to get around the uint32 thing. Crypt::Random now works again, using the actual and proper Windows Crypt API
hotel good for golf I guess
AlexDaniel ZoffixWin: RT #128120 02:04
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=128120
ZoffixWin heh 02:05
AlexDaniel++
ZoffixWin my $foo:::_ = 42; say $foo:::_ 02:05
m: my $foo:::_ = 42; say $foo:::_
camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5=== Error while compiling /tmp/WVtvbaBWf0␤Variable '$foo:_' is not declared␤at /tmp/WVtvbaBWf0:1␤------> 3my $foo:::_ = 42; say 7⏏5$foo:::_␤»
ZoffixWin m: my $foo_:::_ = 42; say $foo_:::_ 02:06
camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5=== Error while compiling /tmp/uc8idlJOMT␤Variable '$foo_:_' is not declared. Did you mean '$foo_:::_'?␤at /tmp/uc8idlJOMT:1␤------> 3my $foo_:::_ = 42; say 7⏏5$foo_:::_␤»
hotel it's like escaping one of the colons
ZoffixWin AlexDaniel, the "code" in your RT is off :) Though, if corrected, the error is same
AlexDaniel ah fuck
hotel more like it's a different result? 02:07
kek
ZoffixWin I'll comment, 'cause I have something to add.
AlexDaniel m: my $foo_:::_ = 42; say $foo_:::_
camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5=== Error while compiling /tmp/xn360F0bKe␤Variable '$foo_:_' is not declared. Did you mean '$foo_:::_'?␤at /tmp/xn360F0bKe:1␤------> 3my $foo_:::_ = 42; say 7⏏5$foo_:::_␤»
AlexDaniel and there is no way to edit your bug report! 02:08
geekosaur wonders how that ::: is parsed
hotel maybe it thinks there's a namespace called :_ 02:09
hotel rather, a namespace called foo_ with a method called :_** 02:09
geekosaur single colon has to do with things like term:foo
AlexDaniel m: my $foo_:_ = 42; say $foo_:::_ 02:10
camelia rakudo-moar 9c8989: OUTPUT«42␤»
AlexDaniel that's how it is parsed. I HAVE NO IDEA
hotel lol wtf 02:10
geekosaur m: my $foo_:_ = 42; say $foo_:_
camelia rakudo-moar 9c8989: OUTPUT«42␤»
ZoffixWin AlexDaniel, yeah, that's why I hate RT. 02:11
geekosaur right, so : is doing whatever and then ::_ is being the same as _?
but I have not tried to figure out the grammar for that single colon
BenGoldberg m: my $foo:_ = 42; say $foo::_;
camelia rakudo-moar 9c8989: OUTPUT«(Any)␤»
AlexDaniel m: my $foo:_ = 42; say $foo::::::::_ 02:12
camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5=== Error while compiling /tmp/CoLHwp3udq␤Name component may not be null␤at /tmp/CoLHwp3udq:1␤------> 3my $foo:_ = 42; say $foo::7⏏5::::::_␤»
AlexDaniel ok, three is a magic number
geekosaur also, hm, LTM implies it should parse as :: : not : ::
(or does it?)
AlexDaniel ZoffixWin: it was a funny bug report. Until I noticed that there's a typo :((( 02:13
ZoffixWin AlexDaniel, I now wish I've read the WHOLE discussion you linked to. I missed the mention of ':', so now I feel like an idiot 02:14
ZoffixWin Still, variables aren't methods. And we still have discrepancy between \foo:bar and $foo:bar 02:14
hotel how the heck do I leave selfservice on the rt site? 02:16
BenGoldberg Close the window? 02:17
AlexDaniel hotel: I think that in order to leave selfservice you have to write an email to the admin
hotel oh
cool
AlexDaniel hotel: well, if nothing else works
hotel: have you ever had a functional rt? 02:18
hotel I emailed one in I think
BenGoldberg On an unrelated note, perl6's regexes, if i recall correctly, use longest-leftmost matching when there are multiple options.
So ::: should be parsed as :: :, not as : ::. I think.
ZoffixWin [22:12:47] <geekosaur> also, hm, LTM implies it should parse as :: : not : :: 02:20
:)
AlexDaniel m: my $w:t:f = 42; say $w:t:f 02:21
camelia rakudo-moar 9c8989: OUTPUT«42␤»
AlexDaniel m: my $w:t:f = 42; say $w:::t:f
camelia rakudo-moar 9c8989: OUTPUT«42␤»
AlexDaniel m: my $w:t:f = 42; say $w:t:::f
camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5=== Error while compiling /tmp/nWz20UXNgy␤Variable '$w:t' is not declared␤at /tmp/nWz20UXNgy:1␤------> 3my $w:t:f = 42; say 7⏏5$w:t:::f␤»
ZoffixWin m: say ':::' ~~ /':'|'::'/; say ':::' ~~ /':'||'::'/
camelia rakudo-moar 9c8989: OUTPUT«「::」␤「:」␤»
AlexDaniel so why ::: does not work after : ? 02:24
ZoffixWin m: say "loop(i++) in Perl 6 is {(7*60+8.954) /3.429} times slower than loop(register i++) in C" 02:29
camelia rakudo-moar 9c8989: OUTPUT«loop(i++) in Perl 6 is 125.095946 times slower than loop(register i++) in C␤»
ZoffixWin Not tooo bad
AlexDaniel m: my $x::::::::::::::::::::::::::::::::::::::::::x = 42; 02:32
camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5=== Error while compiling /tmp/LxhcyVoTBu␤Name component may not be null␤at /tmp/LxhcyVoTBu:1␤------> 3my $x::7⏏5::::::::::::::::::::::::::::::::::::::::␤»
AlexDaniel whoops! 02:33
geekosaur you have a C which still does register? (I thought gcc and clang both ignored it these days)
ZoffixWin Why would it ignore it? :/
geekosaur, based on my tests, yes: 0m7.880s without register and 0m3.431s with 02:34
geekosaur because it was interfering with their own optimizations (which include moving stuff to registers if it's appropriate)
ZoffixWin gcc version 4.8.4
AlexDaniel ZoffixWin: is it with -O3 ? 02:37
hotel is still looking for p6 project ideas 02:41
AlexDaniel hotel: what about this? github.com/perl6/perl6-most-wanted...modules.md 02:43
hotel interesting, thanks
hotel what about for more... self-serving purposes, like becoming fluent in perl 6 02:53
skink If it's just for learning, do you have older projects for translating? 02:55
hotel I have a couple half-finished things, nothing really relevant though
skink e.g. every time I explore a new language, I write a passphrase generator in it 02:56
MadcapJake hotel: www.reddit.com/r/learnprogramming/...cts_xpost/ 03:05
AlexDaniel m: say (^36¹⁵).pick.base(36)
camelia rakudo-moar 9c8989: OUTPUT«WW2890CV3FM1CUW␤»
hotel みんな、ありがとう
AlexDaniel m: say (^36¹⁵).pick.base(36)
camelia rakudo-moar 9c8989: OUTPUT«M7ODCTR7TSAN8N2␤»
MadcapJake どういたしまして 03:06
AlexDaniel m: say (^36¹⁵).pick.base(36).comb».&{(.tc, .lc).pick}.join 03:07
camelia rakudo-moar 9c8989: OUTPUT«V36s555BdTxpI3Z␤»
AlexDaniel m: say (^36¹⁵).pick.base(36).comb».&{(.tc, .lc).pick}.join
camelia rakudo-moar 9c8989: OUTPUT«hbu8BmlvsFze0Lu␤»
AlexDaniel m: my @chars = flat ‘a’..‘z’, ‘A’..‘Z’, 0..9; say [~] @chars.pick(15) 03:12
camelia rakudo-moar 9c8989: OUTPUT«e9aWbz63VmETyY1␤»
AlexDaniel m: my @chars = flat ‘a’..‘z’, ‘A’..‘Z’, 0..9; say [~] @chars.pick(15)
camelia rakudo-moar 9c8989: OUTPUT«mLEuhsZavMnqFWR␤»
grondilu m: say (^36).roll(15).base(36)
camelia rakudo-moar 9c8989: OUTPUT«Method 'base' not found for invocant of class 'Seq'␤ in block <unit> at /tmp/CeYWEMsxkL line 1␤␤»
grondilu m: say (^36).roll(15)[].base(36)
camelia rakudo-moar 9c8989: OUTPUT«Method 'base' not found for invocant of class 'Seq'␤ in block <unit> at /tmp/KwqkTXTXZt line 1␤␤»
hotel what it do
grondilu m: say (^36).roll(15).list.base(36)
camelia rakudo-moar 9c8989: OUTPUT«Method 'base' not found for invocant of class 'List'␤ in block <unit> at /tmp/5SmVObRPX7 line 1␤␤»
grondilu oh yeah
m: say (^36).roll(15)>>.base(36) 03:13
camelia rakudo-moar 9c8989: OUTPUT«(5 P H P Y 4 A K 0 2 W K 5 L Q)␤»
AlexDaniel 5 PHP 03:14
hotel it's a sign 03:15
grondilu was wondering if it was a RC task. There is a draft but it has annoying additional requirements. 03:17
hotel lol project 98 on this list is to make a basic lisp interpreter
TEttinger hotel: heh, other than forth it's hard to have an easier language to implement the base of 03:26
hotel what's forth's base? 03:27
TEttinger forth can be implemented in assembly and often is, but anything really
hotel ah 03:28
lisp is just lists right?
TEttinger jonesforth is a well-known assembly forth IIRC.
geekosaur yep. and forth is just stacks
TEttinger perl already basically has most of what lisp would need
TEttinger there's an existing perl 6 grammar for a lisp somewhere 03:28
in japanese IIRC
hotel あ、よかった 03:29
MadcapJake TEttinger, hotel: my Perl 6 forth github.com/MadcapJake/rabble
hotel wow 03:30
cool
MadcapJake hotel: what other PLs do you know? 03:35
hotel python and java mostly
and then some web-related stuff: semi-literate in php and javascript 03:36
MadcapJake one of my favorite ways to learn is find a cool, isolated (and small) project in another langauge (python/java) and re-implement in Perl 6. You really get a grasp of how Perl 6 differs from the ones you know. Try and find ways to improve design via Perl 6 unique features and then when implemented, try and adjust the interface to be more Perl 6 ish. This 03:37
is more a long-haul idea but it's really helped me learn and the legwork of designing is already done by the source project :)
skink MadcapJake: Well-deserving of 'Mad' 03:38
hotel lol, thanks
skink @ rabble
hotel what's the overhead like on rabble? 03:39
MadcapJake skink: oh! haha! I have some cool plans for Rabble, I really need to add more operations but I *really* want to try and rewrite it mostly in NQP :D
well so far I've only really done little one liners with it, but I'd say the only overhead is a little bit more startup time (seems negligible to me but will grow as I add more, surely) 03:40
My initial design was just to make the code slick, now I want to go back and make it ugly for performance-sake 03:41
MadcapJake But I'm also reading through some books/docs on Forth languages, I'm looking for some neat ideas that could make Rabble a really unique beast 03:42
hotel: remember that Perl 6 uses a grammar to parse Perl 6! So any language written in Perl 6 (via grammars) should have similar performance (of course how you design the rest is certainly going to have an impact) 03:44
hotel this is making me excited for next year (but I need to finish this year's homework first :0)
oh good point
skink hotel, If you want have some real fun, there is a Perl6 implementation of... Perl6! 03:45
github.com/masak/yapsi 03:46
want to* have, gah
hotel no way! *clicks*
on a side note, something is using 10GB of memory on my computer 03:48
MadcapJake `killall moar` :D
geekosaur on my machine thats usually chrome >.> 03:49
hotel it seems to be a mixture of chrome (no surprises there) and "service host: local system (18)"
geekosaur (initially I typoed that as "chrime" --- which sometimes seems apropos <.< )
hotel yeah you right
MadcapJake "service host" sounds like Windows, amirite? 03:50
hotel well... puu.sh/oNC26/8f6b487911.png puu.sh/oNC1M/9a99644cef.png
geekosaur yeh, that's svchost.exe 03:51
hotel for some reason opening taskmanager made my computer sound a lot less like a jet engine, anyway
MadcapJake check your services tab 03:52
geekosaur when I had that problem it turned out to be a lot of OEM crapware that I subsequently purged
hotel 17 services with pid 9916 03:53
MadcapJake also could be microsoft downloading updates :P
hotel yeah I've purged this machine a few times
geekosaur because it included things like a wifi widget that didn't even work as well as the one in winxp)
MadcapJake is so glad to be done with Windows
3 years clean now :P
hotel what did you switch to? 03:54
MadcapJake Xubuntu initially but I've since bastardized it into basically what Ubuntu Gnome is today :P
geekosaur anyway, windows services exist as DLLs, and svchost.exe exists to start a thread for activated services, load the service DLL in that thread, and jump to its entry point
hotel sounds efficient 03:55
geekosaur running as the local system account
(not even administrator has full access to the entire system. LSA does)
hotel apparently chrome was only using 4% of 66% of my memory 03:56
guess I'll restart 03:59
peace
ufobat good morning perl6 06:36
masak morning, ufobat; #perl6 06:50
moritz \o 07:07
nine Good morning! 07:11
DrForr Morning. 07:15
masak m: for my @greeting = 777982, 787378, 713333 -> $cchunk.comb(/../) -> $chunklet { print chr $chunklet }; print "-" } 07:19
camelia rakudo-moar 9c8989: OUTPUT«5===SORRY!5=== Error while compiling /tmp/9cOPrHblmk␤Malformed parameter␤at /tmp/9cOPrHblmk:1␤------> 3ting = 777982, 787378, 713333 -> $cchunk7⏏5.comb(/../) -> $chunklet { print chr $ch␤ expecting any of:␤ constraint␤»
masak m: for my @greeting = 777982, 787378, 713333 -> $chunk { for $chunk.comb(/../) -> $chunklet { print chr $chunklet }; print "-" } 07:20
camelia rakudo-moar 9c8989: OUTPUT«MOR-NIN-G!!-»
ufobat could anyone please explain why this error occurs? gist.github.com/ufobat/b32e8825640...6b51672a9f 07:23
masak ufobat: not sure. but the problem does go away if you make line 4 be `$!env = $env;` 07:27
(which I would tend to do anyway, all other things being equal) 07:28
I somehow feel that it should work the way it is too. it might be a bug that it doesn't.
ufobat jap, then it's gone
moritz I've added two lines of debugging to method rest 07:31
*reset
say $!env.VAR.^name;
say $!env.VAR.defined;
the first one always says Scalar, which is to be exected
moritz the second says False first, and then True 07:31
so, somehow a Scalar gets autovivified on assignment, but it's a RO scalar?
masak m: class Strange { has $.env is rw; method reset($env) { $.env = $env } }; my $s = Strange.new; my %env = (1 => 2, 3 => 4); $s.reset(%env); $s.reset(%env) 07:32
camelia rakudo-moar 9c8989: OUTPUT«Cannot assign to a readonly variable or a value␤ in method reset at /tmp/plljs3r5Zt line 1␤ in block <unit> at /tmp/plljs3r5Zt line 1␤␤»
masak golf'd
moritz how do I introspect a Scalar for whether it's RO? 07:33
are there things such as read-only scalars?
m: sub f($x) { say $x.VAR.^name }
camelia ( no output )
moritz m: sub f($x) { say $x.VAR.^name }; f 42
camelia rakudo-moar 9c8989: OUTPUT«Scalar␤»
moritz there seem to be, yes
masak m: class Strange { has $.env is rw; method reset($.env) {} }; my $s = Strange.new; my %env = (1 => 2, 3 => 4); $s.reset(%env); $s.reset(%env); say "strangely, this works" 07:35
camelia rakudo-moar 9c8989: OUTPUT«strangely, this works␤»
moritz well, this binds two times
ufobat soo, it's a bug? 07:38
masak pretty sure it is, yes
care to submit it? :)
ufobat of course :-) 07:40
thanks for your help
moritz ufobat++, masak++ # golfing 07:44
lizmat psch: re irclog.perlgeek.de/perl6/2016-05-09#i_12456079 , good point: will mention it next week 08:11
lizmat psch: otoh, make test / spectest are supposed to run *without* make install 08:14
RabidGravy boom 08:51
psch lizmat: right, which means instead of a && before "make test" we should have two scripts, one with --make-install and one with "; make test" 09:34
lizmat: not quite sure how that fits into the p6weekly though (which i assume you mean with "mention next week")
lizmat well, the fact that you fixed not spotting install errors by Travis, would be mentionable ?
psch oh. yeah, i suppose that makes sense 09:35
...well as soon as i actually fix it :)
psch hm, travis docs aren't quite clear on how to do that, to me at least 09:39
ZoffixWin .tell AlexDaniel you're right, with -O3 register doesn't matter and the whole thing goes down to 0m2.284s 10:12
yoleaux ZoffixWin: I'll pass your message to AlexDaniel.
ZoffixWin I wonder when computers will be able to take -O10 to figure out that for (x = 2; x < 2e9; x++); can be optimized into an assignment XD
timotimo it's already doing -O10, it's just the base isn't decimal
ZoffixWin but it doesn't change that loop into an assignment :)
timotimo yeah, because clearly you want to have a loop there 10:12
if you didn't actually want it to loop, you would have written the assignment :P 10:13
pmurias masak: It's interesting how a more complex QAST test ends up looking (for contvars), as opposed to the elegant sexprs tests 007 has: paste.debian.net/683340/ 10:45
masak pmurias: the comparison has occurred to me, yes. 11:02
pmurias masak: the test is broken btw ;)
masak pmurias: but -- it's not that QAST is bad; it's just that it targets a different demographic. compilers, rather than code authors. 11:03
pmurias The big things seems to be that .new constructors are a pretty bad notation for writing big chunks of QAST 11:09
jnthn To be fair, "easy to write big chunks of QAST" wasn't really a design goal :) 11:10
masak yes, that's much of my point 11:13
even in the 007 tests, we eschew the slightly more longhand 007 constructor notation with named parameters, in favor of Lisp-like positional syntax 11:14
pmurias jnthn: prior experience with pir suggests that an easy to write intermediate format is not a good design goal ;) 11:18
jnthn: contvar locals seem to be supported only on the moarvm, but not on the jvm. Should I implement them on the js? 11:20
jnthn Hm, are they really supported on MoarVM? 11:21
jnthn somehow thought not
lunch, bbiab
pmurias jnthn: the is an error message: Can only use 'contvar' decl with scope 'lexical 11:23
jnthn: but a check above attempts to implement them anyway ;)
jnthn: and they don't work 11:24
as in don't give an error message and don't do the cloning 11:25
masak I'm not sure PIR's failing was that it was an easy to write intermediate format. rather it, like Parrot, was designed before it was clear what the uses would be and how they would be distributed. 11:29
making it difficult to use effectively once those uses became clear. 11:30
pmurias it's big failing that is that it was used as an actual programming language 11:31
masak well, it was the only choice for some things people needed to do. 11:33
and I'm not all that sure about "easy to write" either. it ended up being used far beyond its designed purpose.
pmurias was there a real problem blocking the parrot people from having something like NQP rather then pir? 11:36
(for use by humans) 11:37
moritz well, one design problem with PIR was that it was meant to be used as an intermediate representation, but it wasn't designed to be fast to process
pmurias: the main problem seemed to be that people couldn't agree on one language
jast that doesn't sound like a useful combination :)
lizmat isn't the concept of NQP a lesson learned from Parrot ?
moritz pmurias: at some point, and older version of NQP served that niche partially, then winxed came along
arnsholt lizmat: NQP was initially built on top of Parrot 11:38
moritz pmurias: but there was never a (successful) push to write basically all human-level parrot code in either language
lizmat arnsholt: ah, ok
moritz iirc the progression was PGE, NQP, NQP-rx (which had its own regex engine, didn't use PGE anymore) and then the current NQP, which is 6model-based 11:39
masak there was also talk about putting Parrot on a better meta-object foundation. I think it was called m0, and it was supposed to borrow heavily from 6model.
moritz steps before PGE are before my involvement, and eluded me :-)
masak: right. But at that point, parrot had lost enough steam that it never happened
masak moritz: before PGE there was TGE, IIRC. but I wasn't around then either, or at least not paying attention enough.
moritz masak: sounds vaguely familiar 11:40
masak moritz: yes. there simply wasn't ever a champion for m0.
moritz "tree grammar engine"
masak yes. I think it was clunky to use.
arnsholt Speaking of PGE, there was GGE as well =) 11:41
Of course, that was in Perl 6
moritz still admires GGE from a distance 11:42
arnsholt Same, same
masak pity I couldn't take it further 11:43
masak for a brief while there, it could have been quite a game-changer for Perl 6 code 11:43
moritz now I have Bette Midler in my head ("from a distance")
arnsholt (For those who weren't around for that: GGE is the Glacial Grammar Engine, a masak++ project reimplementing PGE [IIRC] in Perl 6)
masak yeah, it was basically a straight port of PGE into Perl 6. 11:55
which means at some point I must have been able to read PIR pretty well. 11:56
masak I learned a lot about grammar engines, and Perl 6's in particular. 11:56
smls [Coke], others: Should we reject RT tickets like #127440 ? 12:33
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=127440
smls It reports a segfault when putting a third-party Perl 6 module under heavy load, and is in this form probably not useful to Rakudo implementors.
It should probably be submitted as an issue on the github page of the module in question, so that the module author can investigate it, and hopefully submit a more useful Rakudobug with a golfed testcase. 12:34
jnthn smls: I think the reporter *is* the developer of the module in question. 12:38
smls ah
smls jnthn: While you're here: A Perl 6 variable should never end up being a `VMNull`, right? 12:43
So #127254 and #126857 are still a bug even though they no longer crash?
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=127254
Link: rt.perl.org/rt3//Public/Bug/Displa...?id=126857
perlpilot smls: that sounds right to me. (What do those do on the jvm?) 12:46
smls no idea
jnthn smls: Yeah, VMNull leaking into Perl 6 space is a Bad Thing. 12:47
smls ok
jnthn smls: Better than SEGV, of course :) 12:47
pmurias I get a compile error with the JVM backend 12:48
paste.debian.net/683363
it's caused by 58d507380d068b8cba0ce92ba02c26047d0b4909 12:49
psch ...i promise i'll stop pushing things at 3 in the morning
pmurias: you built with --gen-nqp=master? 12:52
pmurias: cause afaics we didn't bump NQP to that commit yet
pmurias psch: I just built nqp-j 12:59
dalek osystem: 8e1adbb | titsuki++ | META.list:
Fix Term::Readsecret to Terminal::Readsecret
osystem: 4361ee7 | titsuki++ | META.list:
Merge pull request #205 from titsuki/change-module-name

Fix Term::Readsecret to Terminal::Readsecret
pmurias psch: not to get rakudo-js, just to add a print statement to see when a given hack is used 13:00
psch pmurias: ah. i've patched coerce_i2n and _n2i locally, fwiw. gonna push that in a bit 13:02
...and then look at the nqp make test failures i'm seeing right now, which seem to relate to the getattr hack for NC i recently implemented
tomboy64 psch: could i ask for your time one more time? 13:19
psch tomboy64: sure, what's up? 13:20
tomboy64 psch: i need to provide a custom path for -Djna.library.path in tools/build/create-jvm-runner.pl
what would be the proper way to implement that?
it's related to github.com/perl6/nqp/pull/281 - building rakudo fails when there's a custom jna.jar used for nqp 13:21
since rakudo's perl6-j needs to know about the native library via jna.library.path
psch tomboy64: can't you just initialize $sharedir from e.g. %ENV?
...or however Perl 5 does that. i think it's %ENV :S 13:22
tomboy64 yes, that's a good idea. thanks!
smls [Coke], others: Do we need a Roast test for "This is not allowed and its behavior is undefined, but at least it probably shouldn't segfault" cases like #127208 ? 13:37
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=127208
smls Or can the ticket be closed directly? 13:41
moritz a test would be appreciated, yes 13:42
teatime so, can you have something like: sub (MyType(Str) $foo) {…} without augmenting Str to have a .MyType() method? 13:53
tony-o MadcapJake: i fixed the updating mechanism on modules.zef.pm - it's being updated every 15 minutes now 13:58
MadcapJake nice! Looking good, though I miss the colored icons :) 14:00
MadcapJake is off to an interview
moritz MadcapJake: good luck 14:05
teatime hrmz... what do I want to work on today...
tony-o MadcapJake: good luck 14:06
teatime so, can you have something like: sub (MyType(Str) $foo) {…} without augmenting Str to have a .MyType() method? <-- this really seems like no, but perhaps I am just overlooking something? 14:09
tony-o do you consider inheritance to be augmenting? 14:11
teatime if you mean 'MyType is Str', then no. but that would let me use a MyType in a sub that takes a Str; how does it help me wanting to use a Str in a sub that takes a MyType? 14:14
teatime I think I am just missing something very obvious. 14:15
tony-o it doesn't, you also didn't say that was a constraint. what are you trying to do that you'd like to add a method call to Str without augmenting? 14:15
teatime I don't want to do that. 14:16
tony-o do what?
psch teatime: the only thing besides "augment" i can think of is only useful if you have control over where the Str come from
psch teatime: that'd be "but role { method MyType { ... } }" 14:16
teatime psch: ah well. I was hoping perhaps it would try auto-calling MyType.new(Str) with $foo 14:18
or something similar
psch teatime: irclog.perlgeek.de/perl6/2015-01-23#i_9992538 is where this was discussion previously 14:19
teatime thank you 14:20
oh ok, so there *is* a way
teatime reads.
tony-o m: class A { has $.x; }; sub r ($x where { A.new(:x{$_}) }) { $x.say; }; r("hello"); #teatime - is this what you're attempting to do? 14:21
camelia rakudo-moar dc7346: OUTPUT«hello␤»
tony-o or something similar 14:22
psch m: sub f (Str(Int) $x) { say $x.WHAT }; f(5)
camelia rakudo-moar dc7346: OUTPUT«(Str)␤»
psch tony-o: ^^^ that but with MyType as target, not Str (well, and Str as source, not Int) 14:23
tony-o glad you guys could interpret :-)
teatime tony-o: that's interesting 'cause I didn't know you could do that. 14:26
psch m: class A { has $.x; }; sub r ($x where { A.new(:x{$_}) }) { $x.WHAT.say; }; r("hello");
camelia rakudo-moar dc7346: OUTPUT«(Str)␤»
psch you can't really :) 14:27
teatime and forgive me, I didn't mean to be unclear. by 'sub (MyType(Str) $foo) {…}' I just meant, can I define my own implicit coercions from basic types w/o augmenting them.
the goal is to reduce boring boilerplateish code to enhance readability, though, so complex/tricky solutions are not too interesting. except when they're interesting, heh. 14:28
psch: mm, does that actually create a type, and if it were a multi, that r() would only be called where A.new($x) returns a true value? 14:29
psch m: class A { has $.x; method Bool { False } }; sub r ($x where { A.new(:x{$_}) }) { $x.WHAT.say; }; r("hello"); 14:30
camelia rakudo-moar dc7346: OUTPUT«Constraint type check failed for parameter '$x'␤ in sub r at /tmp/4GZsgSQgY2 line 1␤ in block <unit> at /tmp/4GZsgSQgY2 line 1␤␤»
psch teatime: it does create an object and checks if that object is truthy, yeah 14:31
teatime: the truthiness determins if dispatch works for that parameter or not
dalek c: 5a05c56 | (Wenzel P. P. Peppmeyer)++ | doc/Language/functions.pod:
add where clause to MAIN example
c: 8a9014a | (Wenzel P. P. Peppmeyer)++ | doc/Language/functions.pod:
add MAIN to index
c: e4ac430 | (Wenzel P. P. Peppmeyer)++ | doc/Language/functions.pod:
indent MAIN example a little better
teatime yup, ok. yay I understand something. 14:32
sortiz \o #perl6 14:35
tony-o you can, you just need a copy :-) 14:48
m: class A { has $.x; }; sub r ($x is copy where { $x = A.new(:$x) }) { $x.WHAT.say; }; r("hello");
camelia rakudo-moar dc7346: OUTPUT«(A)␤»
tony-o teatime: ^ 14:50
for readability, i'd just constrain Str:D $x in the params and create a new MyType in the block
teatime tony-o: yes, that's the alternative. or probably, have it be a multi where `sub foo(Str:D $x)` converts and calls `sub foo(MyType:D $x)`. 14:52
teatime it seems like what I wanted might actually be possible though 14:52
moritz shocking! 14:53
teatime btw, am I correct in thinking that --> used in signatures is definitely not an operator (that you could, e.g., overload) 14:54
I guess I should grep the code for it first
jnthn No, not an operator; special syntax in signature parsing 14:55
teatime k, assumed so.
MadcapJake tony-o, moritz: thanks for the well-wishes! Had two interviews already this morning and they both went well! 15:26
mspo let the bidding wars begin 15:27
MadcapJake I wish! These are just crappy customer service jobs :( 15:29
teatime psch: so I guess, S13 says it should already fallback to calling MyType.new(Str $x), and that's just NYI. 15:38
thx again for link to discuss, I suppose it told me everything I wanted to know. 15:39
ZoffixW Where does NativeCall look for libraries? I have libmahlib.so in ./ and I run perl6 -I. -MNativeCall -e 'sub mahfunc(Str) is native("mahlib") {}; mahfunc("fooo")', but I get an error Cannot locate native library 'libmahlib.so' 15:41
I guess a better question is: "How to tell NativeCall where to look for libraries?"
teatime LD_LIBRARY_PATH ? 15:42
pmurias MadcapJake: non-programming ones? 15:43
nine MadcapJake: why do you apply for crappy jobs?
ZoffixW teatime, hm, that does the trick if I set it on the command line, but not via %*ENV 15:44
MadcapJake I don't have a programming degree :(
ZoffixW looks at NativeCall sauce 15:44
MadcapJake, neither do I!
MadcapJake how do you get programming jobs then?! They all say "minimum bachelors/associates in computer field". 15:45
ZoffixW Neither do the XX% of self-taught programmers (/me doesn't recall exact StackOverflow survey figures, but they're double-digits)
MadcapJake, apply anyway :)
Say you have "equivalent"
teatime Yes, apply anyway. Never think of job ad requirements as actual requirements.
nine MadcapJake: github repos and contributions to free software are pretty much worth as much as a degree 15:46
geekosaur MadcapJake, it's worth remembering that the folks who write those requirements also toss in a "must have 5 years experience in <tech released last week>"
ZoffixW MadcapJake, a lot of jobs require you write a test program before they even look at you. If you can write stellar code there, they'll care less about papers
teatime Sometimes they're filler added by HR and aren't requirements at all. Other times, they may be waived for the right cantidate. They're rarely set in stone, so assume they never are.
tadzik I always smile when job offers list "BS in Computer Science" as a requirement 15:47
nine MadcapJake: I would actually like to have an applicant with a good online track record :) Is much easier to judge than papers
tadzik don't you people have enough BS in computer science to deal with already?
MadcapJake wow never realized that!
MadcapJake I also live in the midwest so I'm not sure tech employers here would be so flexible 15:49
sortiz ZoffixW, In linux NativeCall uses dlopen(3) so, without an explicit path, it uses the rules annotated.
nine MadcapJake: you'll never know unless you ask 15:50
ZoffixW sortiz, thanks
geekosaur HR *always* mangles those things beyond recognition
MadcapJake I'll give it a try! Thanks for the advice Sixians! You guys are the best! :) 15:51
nine MadcapJake: don't know about the US but in Europe people are desparate again to find developers. I'd probably hire you just on the base that you asked NativeCall questions ;)
teatime ZoffixW: also only vaguely related, but I found this enlightening a while back. tldp.org/HOWTO/Program-Library-HOWT...aries.html
geekosaur one of the things we had to do when I was at Carnegie Mellon was help figure out what job description to feed to HR that would be vaguely recognizeable when it came back out
ZoffixW teatime, thanks 15:52
teatime ZoffixW: interesting that that doesn't work from %*ENV. 15:53
ZoffixW teatime, it calls something from nqp, so maybe that's why
teatime, and well, as sortiz pointed out, dlopen(3)
MadcapJake nine: wow! I think some parts of US are hiring but the Midwest is a little behind-the-times :P
tony-o MadcapJake: probably more flexible there than out here 15:54
sortiz ZoffixW, so, to load that use 'is native("./libmahlib.so")'
tony-o MadcapJake: detroit is building up around tech, or trying at least
MadcapJake tony-o: huh, never thought of it that way, good point!
teatime MadcapJake: this is an instance of, it never hurts to ask / you miss 100% of the shots you don't take. 15:55
teatime The other big place where requirements are actually quite mutable but people frequently lose out by not realizing it, is uni degree requirements and especially course prerequisites. 15:56
EvilBOT just a test 15:57
nicq EvilBot: hello 15:57
nicq EvilBot: hello 15:58
Guest35459 hello
MadcapJake teatime: this is true, I gotta keep reminding myself of that. I also should write some more non-Perl 6 code for practice. I've been in a Perl 6 bubble as-of-late :) 16:00
ZoffixW sortiz, ah, cool!
sortiz++
dogbert17 o/ #perl6 16:03
ZoffixW \o 16:04
geekosaur would also note that the problem with tech employers isn't flexibility so much as availability (that is, they gotta actually be hiring) 16:05
in the midwest US
dogbert17 I would like to close github.com/perl6/doc/issues/494 and github.com/perl6/doc/issues/493 can I Do that or should I wait for titsuki to do it?
moritz dogbert17: you can 16:07
dalek Iish: aded2a4 | (Salvador Ortiz)++ | lib/NativeLibs.pm6:
Some subs missing the move outside its methods
Iish: 33fcb99 | (Salvador Ortiz)++ | / (5 files):
Pg: Add some DB introspection methods

Like perl5 DBI: $drv.data-sources and $dbh.table-info
  + $dbh.quote for generic quoting
dogbert17 moritz: thx, will fix
dalek c: 960e14c | (Wenzel P. P. Peppmeyer)++ | doc/Type/Int.pod:
add 0x and friends to class Int
16:09
dalek c: 9da6285 | (Jan-Olof Hendig)++ | doc/Language/5to6-perlvar.pod:
Fixed two typos
16:14
dalek Iish: 1bb0d44 | (Salvador Ortiz)++ | lib/DBDish/mysql (3 files):
mysql: Fix column NULL type
16:17
Iish: 82c072f | (Salvador Ortiz)++ | t/41-sqlite-exec-error.t:
SQLite: Fail earlier when no library available
nicqbot hi 16:18
nicq p6: sub desc($var) { say $var.WHAT; }; "hello".&desc; 16:21
camelia rakudo-moar dc7346: OUTPUT«(Str)␤»
tony-o hi 16:28
smls p6: sub desc($var is copy) { say $var.WHAT; }; "hello".&desc;
camelia rakudo-moar dc7346: OUTPUT«(Str)␤»
gregf_ m: sub desc($var) { say $var.WHAT; }; &desc.^name.say 16:29
camelia rakudo-moar dc7346: OUTPUT«Sub␤»
smls Am I the only one who sometimes misses a postfix/method form of `given`? 16:30
`for` --> `.map`, `given` --> ?? 16:31
dalek c: a90a5e5 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Order.pod:
doc enum Order
16:33
c: 9360de4 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Order.pod:
remove double wording twice
c: 1d02351 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Order.pod:
fix copypasta mistage
c: 7f19607 | (Wenzel P. P. Peppmeyer)++ | doc/Language/5to6-perlvar.pod:
Merge branch 'master' of github.com/perl6/doc
timotimo smls: that's literally invocation :) 16:34
smls hm? 16:35
timotimo m: { .say; $_ + 10 .say }(1234)
camelia rakudo-moar dc7346: OUTPUT«1234␤10␤»
timotimo well, the precedence isn't right there, but ...
m: { .say; $_ + 10 .say }.(1234)
camelia rakudo-moar dc7346: OUTPUT«1234␤10␤»
timotimo that's totally the postfix/method form of given
smls timotimo: Ah, I was thinking the other way around 16:36
I.e. instead of:
my $aspect = .[0] / .[1] given @dimensions;
We'd write something like:
my $aspect = @dimensions.do: { .[0] / .[1] };
timotimo oh!
smls basically like .map except without iterating
timotimo well, at least for a purely side-effect related thing, you can use a for over a single variable to get a given 16:37
but you'll probably want the return value to not be listified
smls right
Of course if the code to apply is in a named sub, we can use the .&foo form. 16:43
timotimo if you know the thing is defined-ish, you can use "with"
teatime hrm, I seem to remember someone rejiggering Test to allow description-first argument order... or something..
timotimo yeah, there's a pull-request, probably to rakudo. or just a branch perhaps 16:44
teatime k, thx
smls timotimo: Isn't `with` a block or statement suffix keyword like given?
timotimo i know i saw it on the mailing list
oh!
well, you can use "do" in front of any of these. including "given"
smls timotimo: I'm mostly concerned about flow of readin in method chains, where it would allow to write: 16:45
$source.step1.step2.do({STEP3}).step4
timotimo oh 16:46
hmm.
m: 1234.&[{ .say; $_ }].sin.say
camelia rakudo-moar dc7346: OUTPUT«5===SORRY!5=== Error while compiling /tmp/1D4nMcgDTd␤Missing infix inside []␤at /tmp/1D4nMcgDTd:1␤------> 031234.&[7⏏5{ .say; $_ }].sin.say␤ expecting any of:␤ dotty method or postfix␤ infix␤ infix noun␤ …»
timotimo not quite
teatime also, is there any reason I may not be thinking of, why you would not want to: make your t/*.t files chmod +x and add '#!/usr/bin/env perl6' 16:47
timotimo on clue
sortiz m: my @dims = 3,4; my $aspect = @dims.&{ .[0] / .[1] }; say $aspect; 16:48
camelia rakudo-moar dc7346: OUTPUT«0.75␤»
timotimo oooh 16:49
that's fine
smls neat!
sortiz :)
smls I guess there are always new things to learn in Perl 6... :P 16:51
perlpilot There will forever be new things to learn in Perl 6.
perlpilot (until it's a dead language) 16:52
dalek c: 03dd1b5 | (Jan-Olof Hendig)++ | doc/Language/functions.pod:
Fixed broken example code with suggested fixes from nd3i++
17:04
gregf_ m: say [ &{ .uc }.("foo"), "foo".&{ .uc }, "".can("uc")[0].("foo") ] 17:07
camelia rakudo-moar dc7346: OUTPUT«[FOO FOO FOO]␤»
gregf_ can these 3 be equivalent? i can see there can be a sub, a block, a method and heaven only knows what else :| 17:09
psch m: say [eqv] [ &{ .uc }.("foo"), "foo".&{ .uc }, "".can("uc")[0].("foo") ] 17:10
camelia rakudo-moar dc7346: OUTPUT«True␤»
psch gregf_: looks like they are eqv
well, their results in this case at least
gregf_ p6: class Foo { has Int $.bar is rw; method baz(Int $v where $v > 0){ $!bar * $v; } }; say Foo.new(bar => 100).&{ .baz(10) + 100 };
camelia rakudo-moar dc7346: OUTPUT«1100␤»
gregf_ psch: ok, thanks
sortiz m: 'foo'."{'u'~'c'}"().say; # One more :) 17:29
camelia rakudo-moar dc7346: OUTPUT«FOO␤»
psch m: say ::("&uc")("foo")
camelia rakudo-moar dc7346: OUTPUT«FOO␤»
grondilu Hi #perl6 17:31
sortiz \o grondilu 17:34
[Coke] smls: I agree with the folks who responded to you. thanks for doing ticket wrangling. 18:05
bartolin yeah, smls++ 18:17
ZoffixW How well must NativeCall sub signatures match C prototypes? Is there any good guidelines? I have a function with prototype driver_return_code_t cdio_eject_media_drive (const char *psz_drive), but it still works fine if I define it without any parameters or return types 18:20
MadcapJake how do you convert an Int to an int? 18:21
moritz MadcapJake: in user-space code, you assign to an int-typed variable
jdv79 aka unbox. assign to a var of that type? idk really:)
moritz in the setting, nqp::unbox_i()
MadcapJake m: Array[int].new(0 xx 10).say # I wish this worked 18:25
camelia rakudo-moar dc7346: OUTPUT«Type check failed in assignment to ; expected int but got Int (0)␤ in block <unit> at /tmp/BX7tw7lAJK line 1␤␤»
timotimo m: Array[int].new(|(0 xx 10)) 18:26
camelia rakudo-moar dc7346: OUTPUT«Type check failed in assignment to ; expected int but got Int (0)␤ in block <unit> at /tmp/M3IvCdkZu0 line 1␤␤»
timotimo mhm
m: Array[int].new(@(0 xx 10))
camelia rakudo-moar dc7346: OUTPUT«Type check failed in assignment to ; expected int but got Int (0)␤ in block <unit> at /tmp/EkOIjZ9X2q line 1␤␤»
timotimo m: Array[int].new((0 xx 10).list)
camelia rakudo-moar dc7346: OUTPUT«Type check failed in assignment to ; expected int but got Int (0)␤ in block <unit> at /tmp/NgLz5m5kkM line 1␤␤»
MadcapJake m: Array[Int].new(0 xx 10).say # timotimo, this works fine
camelia rakudo-moar dc7346: OUTPUT«[0 0 0 0 0 0 0 0 0 0]␤»
timotimo sucks :)
MadcapJake m: my int $zero = 0; Array[int].new($zero xx 10).say # why doesn't this work even? 18:27
camelia rakudo-moar dc7346: OUTPUT«Type check failed in assignment to ; expected int but got Int (0)␤ in block <unit> at /tmp/k_GOLXd04O line 1␤␤»
psch m: use nqp; my int $zero = 0; say nqp::istype(($zero xx 10)[0], int) 18:28
timotimo m: (Array[int].new() = 0 xx 10).perl.say
camelia rakudo-moar dc7346: OUTPUT«0␤»
rakudo-moar dc7346: OUTPUT«Type check failed in assignment to ; expected int but got Int (0)␤ in block <unit> at /tmp/cHIEqGvZSf line 1␤␤»
timotimo m: ((my @foo := Array[int].new()) = 0 xx 10).perl.say
camelia rakudo-moar dc7346: OUTPUT«Type check failed in assignment to ; expected int but got Int (0)␤ in block <unit> at /tmp/AfHXuwQbWu line 1␤␤»
timotimo how do ... 18:29
MadcapJake m: my int $zero := 0; Array[int].new($zero xx 10).say
camelia rakudo-moar dc7346: OUTPUT«5===SORRY!5=== Error while compiling /tmp/mNu_GYYir1␤Cannot bind to natively typed variable '$zero'; use assignment instead␤at /tmp/mNu_GYYir1:1␤------> 3my int $zero := 07⏏5; Array[int].new($zero xx 10).say␤»
timotimo m: my int @a = 0 xx 10
camelia ( no output )
timotimo why not use this way of spelling it, btw?
sortiz ZoffixW, that is a difficult question, there are lots of details involved. 18:30
ZoffixW Alright.
timotimo ZoffixW: it really depends mostly on the ABI in use on the platform you're on
MadcapJake timotimo: I wasn't assigned it I wanted to just use to to build a hash that has Array[int] values
s/assigned/assigning/ 18:31
timotimo for example, usually the first few parameters are passed via register. if you don't have anything in your signature, those registers will just keep whatever value they had "the last time"
psch m: my %h = a => my int @, b => my int @; say %h.perl
camelia rakudo-moar dc7346: OUTPUT«{:a(array[int].new()), :b(array[int].new())}␤»
psch MadcapJake: that still works spelled like that
ZoffixW timotimo, so it's a bad idea not to match the signature? I'm writing a short article. I don't wanna say "Hey, look! No signature and it still works" if it's wrong :) 18:32
timotimo it's highly non-portable is what it is :) 18:32
i.e. on a different architecture, your stuff might blow up. who knows?
i expect the signature you give the function on the perl6 side also tells moar how many things to push onto the stack before invoking the function, so if you have too few, maybe the function ends up reading past the beginning of its stack segment or something? 18:33
and there's extra differences based on floating point values, because those go in special registers
ZoffixW I see. Thanks. 18:34
sortiz There are some details on calling conventions in dyncall's documentation.
MadcapJake psch: sweet thanks! Didn't know `my` would work there 18:35
timotimo you can even give each function a different calling convention via a trait on the perl6 side, if i remember correctly
psch MadcapJake: it's still scoped in the same scope as %h i think, but as it's anon you don't have to care, i suppose... :) 18:36
MadcapJake I'm so close, but still getting a type check error on the key now: 18:37
m: my $nodes = 5; my Array[int] %hash{int} = (my int $i = ++$) xx $nodes Z=> (my int @a = 0 xx $nodes) xx $nodes;
camelia rakudo-moar dc7346: OUTPUT«Type check failed in binding key; expected int but got Int (1)␤ in block <unit> at /tmp/dFDA6wTnO7 line 1␤␤»
jnthn Native arrays are spelt `array`, not `Array`
timotimo oooooooooooh! 18:38
timotimo facepalms
that makes so much sense
jnthn Should probably have a better error to point that out though :)
mst perl6 should've been capitalisation insenstivie like nim
MadcapJake m: my $nodes = 5; my array[int] %hash{int} = (my int $i = ++$) xx $nodes Z=> (my int @a = 0 xx $nodes) xx $nodes;
camelia rakudo-moar dc7346: OUTPUT«Type check failed in binding key; expected int but got Int (1)␤ in block <unit> at /tmp/JldrU5JjsW line 1␤␤»
MadcapJake still same error
or you mean earlier when creating it? 18:39
ahh yeah that works but still, how can I get the key to work?
m: my $nodes = 5; my array[int] %hash{int} = (my int $i = ++$) xx $nodes Z=> array[int].new(0 xx $nodes) xx $nodes; 18:40
camelia rakudo-moar dc7346: OUTPUT«Type check failed in binding key; expected int but got Int (1)␤ in block <unit> at /tmp/mVlxLrsAZ1 line 1␤␤»
jnthn MadcapJake: We don't have natively typed hashes yet, sorry.
timotimo mst: you mean Nim, right?
mst timotimo: trout.me.uk/really.jpg
MadcapJake jnthn: oh alright, no prob, just like to try to go native whenever possible :)
jnthn They're a reasonable thing to want, and on the wish list... :) 18:41
timotimo trout.me.uk’s server DNS address could not be found.
:(
mst augh 18:42
yes, sorry, registration fsckup temporarily
must remember not to use the jpgs until that's fixed
timotimo understood 18:44
mst a button needs clicking once every five years or so, and mdk's third child arrived just in time to distract him from doing that yet 18:45
timotimo OK :) 18:46
sortiz runs to pay an about to expire domain. 18:49
ZoffixW temp.perl6.party/really.jpg 18:52
timotimo d'aaw 18:54
mst ZoffixW++ 18:57
MadcapJake My boston terrier does that head tilt thing all the time xD 19:01
timotimo mimi07.soup.io/post/683943882/Stiff...e-a-little 19:05
suppe.tobold.cc/post/683826030/Image - a very good cat gif 19:08
teatime suddenly yearns for a quote-words operator like <…> that interprets <foo> as ('foo') rather than 'foo' 19:10
TimToady you mean ('foo',) ?
ZoffixW m: dd [ 1, (<foo>,), 2 ] 19:11
camelia rakudo-moar dc7346: OUTPUT«[1, ("foo",), 2]␤»
timotimo m: say @(<foo>).perl
camelia rakudo-moar dc7346: OUTPUT«("foo",)␤»
ZoffixW Ohh
TimToady ('foo') is generally indistinguishable from 'foo', since by default parens are only for grouping 19:12
mst unlike in python where foreach will hate your face
teatime no, I was wanting a construct that would quote barewords like qw but that would make <a> and <a b> both return lists of strings.
oh.
then yes, I meant ('foo',)
TimToady in general, that's solved by treating single items as degenerate lists on the other end 19:13
lizmat m: say 1.elems 19:14
camelia rakudo-moar dc7346: OUTPUT«1␤»
lizmat m: say 42.elems
camelia rakudo-moar dc7346: OUTPUT«1␤»
teatime I'm being silly and contorting Perl in weird ways.
and probably doing *that* in the wrong way.
TimToady in general, Perl is biased toward a tagmemics view of language, where you can use an X in a Y slot and get away with it much of the time 19:15
so, for instance $foo() is saying the $foo noun is going to be treated as a verb instead by context 19:16
likewise &foo is a noun that can be called, whereas foo is a verb that assumes it's being called even in the absence of any parens 19:17
we can't be quite as flexible in that regard as English, of course, where verbing weirds language 19:18
but that's because computers are still pretty darn stupid 19:19
Perl 5 tried to be a little too cute about turning verbs into methods for the indirect object form, and that's why Perl 6 requires a colon after the invocant to disambiguoate that form 19:21
diakopter o/ Ambigoates 19:22
TimToady *guate even 19:22
mst TimToady: argh argh S_intuit_method argh *sob* argh argh *sob* *shiver* 19:24
mst takes his copy of indirect.pm as a security blanket and hides under the desk until he stops remembering how he made Devel::Declare work
mst (first meeting TimToady from him saying "well that's a new way to mess with the perl compiler" over my shoulder was ... yeah ...) 19:25
TimToady so there's no need for an intuit_method in Perl 6 :)
mst for which I am glad, but I'm still never getting those SAN points back 19:26
TimToady never had SAN points, so took the hits on his constitution
tony-o SAN ? 19:28
[Coke] totes my ambigoates.
SANITY
think rpg stats, but for call of c'thulhu
timotimo in allcaps
TimToady
.oO(describes US elections pretty well, low on sanity, about to take major hits on constitution...)
19:36
huf advanced forms of democracy might look surprisingly strange at first glance... :) 19:37
timotimo *groan*
mst applauds
ufobat i fixed my tests! wheee :D
moritz huf: advanced or degenerate, that's the question 19:38
huf well advanced on the road to the next form
"this isnt even my final form"... 19:39
ufobat so its the perfect moment to open the wine leftovers from the gpw2016
ShimmerFairy ohhhh man 19:46
yoleaux 1 Jan 2016 16:44Z <ZoffixWin> ShimmerFairy: I can certainly see the *reasons* for your frustration and the reasons for writing that blog post, but merely attacking the person responsible for your unpopular opinion does not make anything better. Your frustrated post could easily have been a post about a choice between poorly-tested code and a release without a key feature.
19 Jan 2016 19:21Z <[Coke]> ShimmerFairy: to see latest comment on RT #127108 that will give you a workaround so you can keep moving.
synopsebot6 Link: rt.perl.org/rt3//Public/Bug/Displa...?id=127108
ShimmerFairy I just thought I'd stop by to share this absolute gem of a bug I encountered last night: rt.perl.org/Ticket/Display.html?id=128128
Since apparently this is something I can expect to happen for as long as people don't install to the system. It's wonderful, I can't stop smiling over it :D 19:47
ZoffixW New blog post "Perl 6 NativeCall: Look, Ma! I'm a C Programmer!": blogs.perl.org/users/zoffix_znet/20...mer-1.html 19:48
lizmat ShimmerFairy o/
ShimmerFairy \o
And I'm not lying: for some reason I'm genuinely happy and smiling that this bug would happen _again_ :) 19:49
lizmat glad to see you smiling :-)
mst ShimmerFairy: oh, hey, you're back. excellent. 19:53
nine ShimmerFairy: welcome back!
moritz and I'm glad you think the fix is easy, because that means we can expect a patch from you, right?
mst wonders if that's a 'rejoin to well volunteered' record time 19:54
ShimmerFairy not really, since I took myself out of the rakudo organization a while back. And besides, "remember people install to the system" isn't my lesson to learn :P .
diakopter ShimmerFairy: ohhh I didn't know you are lue 19:55
ShimmerFairy yep, c'est moi 19:56
mst ShimmerFairy: yeah, you ragequit just as I was setting up a toolchain team to try and fix this stuff and then blinked and one of the people I wanted for a founder member of the problem solving team had quit because of the problem :P
teatime ShimmerFairy: is that one windows? I am curious why it would want to do mode 0777.
mst (note that's meant to read as a compliment as well as an 'augh' ;)
teatime *on
mst (you remember me, right? :)
ShimmerFairy teatime: it just says 777 because that's what Perl 6 wants; of course the usual umask would be applied to that, but the error doesn't do that 19:57
mst: of course I remember you :)
mst ShimmerFairy: good, that means you won't miss the compliment due to my sarcastic turn of phrase :D 19:58
masak ShimmerFairy: welcome back. I agree with lizmat -- nice to see you smiling over bug reports. :) 20:03
ShimmerFairy masak: though admittedly it's probably more of a smug-ish smile :P 20:04
masak .oO( I *knew* it! ) :P 20:05
masak anyway, as long as Schadenfreude gets cranked out into bug reports... :) 20:05
tony-o nice 20:06
dha join #perl 20:14
bah.
masak dha: I hear #perl over att irc.perl.org is better. 20:15
at*
dha It's... different. 20:16
ShimmerFairy masak: well, I figured I shouldn't let my Schadenfreude be unproductive, hence the bug report :)
dha For instance, on the freenode version, you can talk about Perl. :-)
I have to give a talk on Perl resources for beginners next month, so I'm looking at freenode #perl for a change. 20:17
masak dha: heh :)
masak .oO( don't let your Schadenfreude just sit around! put it to work! )
moritz SDD, Schadenfreude-Driven Development 20:18
dha So, silly question. Since Perl 6 uses a Perl 6 grammar to parse Perl 6, one could, in theory, change how the language works, right?
moritz dha: not just in theory 20:19
dha oh good. Where would one find information on how to actually do that, then?
moritz dha: you can define operators on the fly, which changes the language 20:20
dha: also, look on modules.perl6.org/ for "slang"
dha Right.
moritz and look at how those modules do that
dha I wish to do something stupid.
leedo_ anyone else seeing this when installing rakudo? gist.github.com/leedo/bb83ded06dbc...ccd6f7fb1f
nine ShimmerFairy: looks like I'm getting close to making packaging modules work which for me is a blocker for using system installed rakudo. So your use case may get a boost somewhat soon :) 20:22
ZoffixMobile leedo_, yeah, I was getting it a couple of days ago when running rakudobrew triple nom master master.... though, I've no idea what it means :/
dha Hm... looks like it may require at least mild understanding of nqp. and roles.
dha wonders how much effort he wants to put into doing something stupid. 20:23
ShimmerFairy nine: cool :) I just wish it were a more common thing in general, so anything to help with that would be good.
moritz dha: how invasive is your change going to be?
dha Well, I... want to change the statement terminator. 20:24
I wanted to port over my only CPAN module, actually.
nine ShimmerFairy: well my goal is to be able to deploy rpm packages on our servers.
moritz changing the statement terminator sounds like something that's very hairy in the grammar 20:25
ShimmerFairy nine: how about .ebuilds? :P
moritz but at least you don't need to change the actions 20:25
nine ShimmerFairy: they face the same issues, so it doesn't matter all that much
dha metacpan.org/pod/Semi::Semicolons 20:26
ShimmerFairy I can help with any gentoo-related stuff if it comes up, since I'm on a gentoo system and have poked at helping out with gentoo before.
timotimo ShimmerFairy: i'm glad you're stopping by :)
nine ShimmerFairy: actually I'm a bit puzzled by your bug report since with literally every change I make I have in mind that we won't be able to write to the site repository unless we're installing
timotimo ShimmerFairy: any chance you could make supernova available? :3 20:27
i was really bugged i didn't clone it before you took it down :|
so was hoelzro
nine ShimmerFairy: but I guess nothing beats trying it out in practice
ShimmerFairy timotimo: sure, I can put it back later :) 20:28
I was planning on only stopping by for a brief second, but your darn kind community ways have suckered me back in :3 20:29
timotimo yay
timotimo has dinner now
ShimmerFairy nine: yeah, I was surprised by that too.
timotimo bbiab
ShimmerFairy I have to go afk for a few hours now, but I'll be back :)
MadcapJake how can I .shift a seq? 20:33
moritz MadcapJake: no, a Seq is immutable
m: say gather { take 42 }.^name 20:34
camelia rakudo-moar a31ab3: OUTPUT«Seq␤»
MadcapJake let me rephrase, how can you lazily shift an Array?
moritz m: say gather { take 42; take 23}[1..*]
camelia rakudo-moar a31ab3: OUTPUT«(23)␤»
MadcapJake i.e., turn a gather block into a lazy array that you can shift 20:35
is that possible?
moritz m: @a = gather { take 42; take 23; say 'reified';}; 20:36
camelia rakudo-moar a31ab3: OUTPUT«5===SORRY!5=== Error while compiling /tmp/bwhXKmtNvm␤Variable '@a' is not declared␤at /tmp/bwhXKmtNvm:1␤------> 3<BOL>7⏏5@a = gather { take 42; take 23; say 'rei␤»
moritz m: my @a = gather { take 42; take 23; say 'reified';};
camelia rakudo-moar a31ab3: OUTPUT«reified␤»
moritz m: @a = lazy gather { take 42; take 23; say 'reified';};
camelia rakudo-moar a31ab3: OUTPUT«5===SORRY!5=== Error while compiling /tmp/nhB1AvGXCS␤Variable '@a' is not declared␤at /tmp/nhB1AvGXCS:1␤------> 3<BOL>7⏏5@a = lazy gather { take 42; take 23; say␤»
moritz m: my @a = lazy gather { take 42; take 23; say 'reified';};
camelia ( no output )
moritz MadcapJake: ^^ like this
m: my @a = lazy gather { take 42; take 23; say 'reified';}; @a.shift; say @a.perl
camelia rakudo-moar a31ab3: OUTPUT«Cannot .elems a lazy list␤ in block <unit> at /tmp/cZvEMwo85z line 1␤␤Actually thrown at:␤ in block <unit> at /tmp/cZvEMwo85z line 1␤␤»
moritz m: my @a = lazy gather { take 42; take 23; say 'reified';}; @a.shift; say @a
camelia rakudo-moar a31ab3: OUTPUT«[...]␤»
moritz m: my @a = lazy gather { take 42; take 23; say 'reified';}; @a.shift; say @a[0]; 20:37
camelia rakudo-moar a31ab3: OUTPUT«23␤»
teatime what does a union type look like in Perl6 20:38
psch m: my @a = lazy gather { take 42; take 23; say 'reified';}; say @a.shift while @a; 20:40
camelia rakudo-moar a31ab3: OUTPUT«42␤23␤reified␤»
psch m: my @a = lazy gather { take 42; take 23; say 'reified';}; say so @a.shift while @a; 20:41
camelia rakudo-moar a31ab3: OUTPUT«True␤True␤reified␤»
psch that's neat
m: my @a = lazy gather { take 1; take 2; say "you sure you need more elems?"; take 3; say "alright, that's definitely enough" }; say @a[0..1]; 20:42
camelia rakudo-moar a31ab3: OUTPUT«(1 2)␤»
psch m: my @a = lazy gather { take 1; take 2; say "you sure you need more elems?"; take 3; say "alright, that's definitely enough" }; say @a[0..*];
camelia rakudo-moar a31ab3: OUTPUT«you sure you need more elems?␤alright, that's definitely enough␤(1 2 3)␤»
psch well, the slice does it differently... :)
MadcapJake moritz: thanks! I'm curious though, I thought gather was already lazy? Does `lazy` make it explicit? 20:46
MadcapJake m: (lazy gather { take 1 }).WHAT.say; (gather { take 1 }).WHAT.say 20:49
camelia rakudo-moar a31ab3: OUTPUT«(Seq)␤(Seq)␤»
lizmat the assignment of the (lazy) list is by default eager 20:49
the "lazy" prefix makes it lazy
MadcapJake m: (lazy gather { take 1 }).is-lazy.say; (gather { take 1 }).is-lazy.say
camelia rakudo-moar a31ab3: OUTPUT«True␤False␤»
lizmat I recall that before the GLR you would have to bind to get the lazy behaviour 20:50
prefix lazy seems less as a WAT to me :-)
dogbert17 would be pleased if someone reviewed my attempt to document Pair.freeze. gist.github.com/dogbert17/81529690...6faf999b0c
MadcapJake m: (gather { loop { take ++$ } }).Array.[0] # is this equivalent to assignment? 20:51
camelia rakudo-moar a31ab3: OUTPUT«(timeout)»
sortiz lizmat, for the Array case, for the List case no. The difference is Array.pm/L53 20:52
psch m: &infix:<=>(my @a, gather { take 1; say "took first"; take 2 }); say @a[0];
camelia rakudo-moar a31ab3: OUTPUT«took first␤1␤»
psch m: &infix:<=>(my @a, lazy gather { take 1; say "took first"; take 2 }); say @a[0];
camelia rakudo-moar a31ab3: OUTPUT«1␤»
psch m: (gather { take 1; say "took first"; take 2 })[0].say 20:53
camelia rakudo-moar a31ab3: OUTPUT«1␤»
psch m: lazy &infix:<=>(my @a, gather { take 1; say "took first"; take 2 }); say @a[0]; 20:54
camelia rakudo-moar a31ab3: OUTPUT«took first␤1␤»
MadcapJake So let me see if I get this: a gather block is lazy in the sense that Seqs are lazily "collected". However upon placing in an Array it (I'm assuming) checks is-lazy and if False, it eagerly collects all the values. Is this accurate?
s/placing in/converting to/ 20:55
lizmat MadcapJake: I think so, yes 20:56
sortiz MadcapJake, yes, Array explicitly need the Seq lazy == True to avoid instant reifycation.
MadcapJake alrighty thanks! (this is for that generator blog post I'm working on) 20:57
sortiz a gather/loop block by default crates a Seq with lazy = false. 20:58
MadcapJake sortiz: ok gotcha, but that lazy attribute doesn't really come into effect until you leave the Seq world, right? Because Seqs are inherently lazy. 20:59
sortiz Yep, And you can use 'lazy' to create a new Seq wrapping the original one with a lazy = True.
MadcapJake got it! 21:03
lizmat dogbert17: looks fine, but you have no example of Pair.freeze actually returning the value as well 21:06
dogbert17: perhaps use "$p.freeze.say" as an example 21:07
dogbert17 lizmat++ will fix
perlpilot dogbert17: also a little jargony with "deconts". Maybe use more words there. Maybe. 21:08
dogbert17 gist updated
perlpilot: any suggestions, I also think decont is a bit on the vague side 21:09
sortiz "Remove the Scalar container" ?
jnthn "removes the value from its Scalar container, making it unassignable" or so perhaps 21:10
perlpilot dogbert17: what those guys said ;)
dogbert17 oh, lots of suggestions, many thanks
lizmat "Makes the value of the Pair read-only"
psch s/unassignable/semantically constant/ # maybe
lizmat the fact that it's deconting, is an implementation detail, I would think
dogbert17 what to choose, what to choose :)
jnthn Is .freeze in place?
perlpilot lizmat++ 21:11
lizmat yes, and there is a test for it
jnthn Hm, curious choice :) 21:11
perlpilot dogbert17: what lizmat said. That's the best answer IMHO
ZoffixWin With Inline::Perl5, there's no way to make the used code see command line args, is there?
ZoffixWin is experimenting with using Mojolicious via Inline::Perl5
dogbert17 Ok, I'll go for lizmat's variant
lizmat actually, jnthn has a point also
"Makes the value of the Pair read-only by removing the value from its Scalar container" 21:12
jnthn in his perl 6 introduction course, makes a point of explaining Scalar containers and making sure people get that
jnthn It's worth grasping early since it explains quite a lot of things :) 21:13
lizmat so reinforcing that in the pod, is a good goal, I would think
BTW, dogbert17++ :-) 21:14
dogbert17 will fix :)
hi hi 21:14
masak briefly considers trolling #perl6 by innocently going "what's a Scalar container?"
hi, hi
perlpilot lizmat: if I read that (and didn't know anything), I'd immediately ask "why?" 21:14
jnthn masak: It's kinda like a fish with an open mouth 21:15
sortiz Well, one problem is that, by default, a Pair don't use a Scalar container for its value.
masak jnthn: so, a monad? :P
Guest76776 p6: say 2
camelia rakudo-moar a31ab3: OUTPUT«2␤»
Guest76776 p6: say 2;
camelia rakudo-moar a31ab3: OUTPUT«2␤»
masak p6: say 2;;
camelia rakudo-moar a31ab3: OUTPUT«2␤»
jnthn masak: :D
masak p6: say 2;;; 21:15
camelia rakudo-moar a31ab3: OUTPUT«2␤»
masak no, wait. a monad is more like a fish with a closed mouth. never mind. 21:16
jnthn That or a fish taco
perlpilot
.oO( I've never heard of a monad fish )
jnthn Or was it a burrito...
lizmat goes to bed hungry 21:17
masak :D
psch sortiz: i don't think that's completely true. a Pair doesn't *add* a Scalar container for the value if there isn't one feels more right
masak .oO( it's called Scalar because a fish... has... scales *mind blown* ) 21:18
jnthn masak: It took you that long to spot the pun? :P
psch sortiz: which is the same behavior List has, which makes it feel right to me, fwiw
masak jnthn: I should have suspected something was fishy the moment you willingly mentioned fish. 21:19
jnthn: scale-aaah
timotimo i use fish as my shell 21:20
psch .oO( so Perl has Scalars 'cause someone got scared of python..? )
sortiz psch, i talk in the sense that the user needs to use a container in the first place.
psch is reaching
timotimo "scientists have described their fish-spider chimaera as 'the first web-scale animal'"
masak ba dum fish
psch maybe we need Pair.thaw vOv 21:21
perlpilot dogbert17: in any case, this discussion makes me think the docs for .freeze should have a pointer to other docs that talk about containers and values and such :)
psch sortiz: right, just like with List you don't get conts if you don't put conts. in contrast to e.g. Array, which voluntarily adds conts 21:22
dogbert17 perlpilot: will add a link to doc.perl6.org/language/containers#...containers
perlpilot dogbert17++ 21:23
sortiz Yep, in Array and Hash you need yo opt-out, in the other cases you need yo opt-in. :-)
s/yo/to/
Hotkeys m: Blob.new(pick 1000, 0..255).elems.say 21:26
camelia rakudo-moar a31ab3: OUTPUT«256␤»
Hotkeys why is there a cap here
m: ("farts" x 100).encode("Latin-1").elems.say
camelia rakudo-moar a31ab3: OUTPUT«500␤»
Hotkeys but not in this instance 21:27
psch m: Blob.new(roll 1000, 0..255).elems.say 21:28
camelia rakudo-moar a31ab3: OUTPUT«1000␤»
psch Hotkeys: pick is "select without putting back"
Hotkeys ah
do I want roll
psch Hotkeys: i don't know :)
Hotkeys m: Blob.new(roll 1000, 0..255).elems.say 21:29
camelia rakudo-moar a31ab3: OUTPUT«1000␤»
Hotkeys cool
thanks psch
dalek c: ee43bb8 | (Jan-Olof Hendig)++ | doc/Type/Pair.pod:
Added some documentation for the 'freeze' method. #perl6++
perlpilot Hotkeys: the number of elements conveniently being the same size as the range should have given you a clue that something wasn't quite right in your understanding ;) 21:30
m: Blob.new(pick 1000, 15..45).elems.say; # I suppose this would have been more obvious
camelia rakudo-moar a31ab3: OUTPUT«31␤»
Hotkeys the number of elements being 2^8 made me think it was some kind of limit
i didn't really relate it to me also using 2^8 in my pick :p 21:31
dha Hm... DBIish still hates me. 21:33
perlpilot If .freeze decontainerizes, then presumably someone (other than psch) will want .thaw to containerize ... What will the P6 version of Storable use? 21:34
AlexDaniel dogbert17++ # for doc improvements 21:34
yoleaux 10:10Z <ZoffixWin> AlexDaniel: you're right, with -O3 register doesn't matter and the whole thing goes down to 0m2.284s
AlexDaniel ZoffixWin: great :) 21:35
ZoffixWin :)
dha Dammit, I hate this senility. How do I get around Task::Star bailing out on DBIish?
masak 'night, #perl6
dha knows he's done this before...
ZoffixWin dha, don't install it? :) Fix DBIish? :)
dha night masak
ZoffixWin masak, night
perlpilot renaming .freeze to .decont will also allow for .cont and not conflict with other commonish usages of .freeze/.thaw
g'night masak
ZoffixWin dha, --force ?
dha ZoffixWin - I'm happy not to install it. I think Task::Star does not agree with that plan. 21:36
ZoffixWin dha, what's the error message(s)? It should be installing fine
tony-o perlpilot: if perl6 is supposed to be englishy then it makes sense to words for all kinds of things they were never meant for
to use words*
ZoffixWin dha, I think --force will work fine. panda --force install Task::Star; zef --force install Task::Star 21:37
dha There's a LOT of errors.
ZoffixWin pastebin them
dha yep. 21:38
dha pastebin.com/fVCG3ATW 21:40
ZoffixWin 0.o 21:40
dha Yes. 21:41
ZoffixWin does rerunning install DBIish show the same errors?
I vaguely remember Basic failing for me, but succeeding on a re-try
dha I won't swear it's *exactly* the same errors, but it sure *looks* the same. 21:43
ZoffixWin *shrug* Probably worth reporting on the DBIish repo. I saw a few commits go in recently. Maybe they broke something.
dha ok.
AlexDaniel ZoffixWin: “I wonder when computers will be able to take -O10 to figure out that for (x = 2; x < 2e9; x++); can be optimized into an assignment XD” – don't they do it already? 21:44
ZoffixWin: maybe not by default, and not with huge numbers like this, but
ZoffixWin Not when I tried it at least :)
AlexDaniel ZoffixWin: try -funroll-loops 21:45
ZoffixWin: or even -funroll-all-loops
once unrolled, I think that it should be able to figure it out
ZoffixWin AlexDaniel, takes same amount of time ~2seconds
timotimo that'll unroll to quite a big piece of code
AlexDaniel ZoffixWin: try smaller number 21:46
ZoffixWin AlexDaniel, smaller number where?
AlexDaniel ZoffixWin: < 2e9 is a bit too much :)
ZoffixWin Well, without it, the code executes too fast anyway 21:47
So you can't even tell if -funroll-loops does anything.
AlexDaniel run it 2e9 times instead
ZoffixWin can't be bothered
AlexDaniel timotimo: “if you didn't actually want it to loop, you would have written the assignment” – the question was when compilers will get smarter than stupid human beings, so your remark does not apply here :) 21:51
timotimo :D
ZoffixWin Well, and I didn't mention it at the time, but there are cases where I--a human--would want to write a loop, which a compiler should optimize. Like raising into power. 21:52
Hexchat-- # breaks support for windows alt+num pad sequences 21:53
timotimo gtk, eh? :( 21:53
maybe you just have to right-click into the input field and change the input method
AlexDaniel timotimo: eh?
ZoffixWin Well, it's at System(Simple)... I've no idea what else would give me alt sequences if not system :) 21:54
AlexDaniel just as a side note: none of the Qt apps work properly with custom xkb keyboard layouts, but gtk apps are fine and dandy 21:55
timotimo neo2 on windows is a nightmare with java programs (especially intellij) and qt programs (in particular qtcreator) 21:56
none of them seem to understand the extra arrow keys
AlexDaniel yea, that kind of thing
though my arrows work fine everywhere, it is combinations like ctrl+backspace that are not working 21:57
AlexDaniel (not the regular ctrl+backspace, but altgr-ed custom thingy) 21:59
dha Huh. Now panda is telling me that p6doc is a "Possibly ambiguous module name" 22:14
dha The problem with an software tool called "panda" is that, if you say "I want to beat panda to death with a baseball bat", people think you're talking about doing that to an actual panda. Which I think would upset people. 22:16
ZoffixWin Try zef 22:17
ZoffixWin modules.perl6.org/repo/zef 22:17
sortiz dha, Seems that DBIish's SQLite driver detection is failing on OS X
dha sortiz - ah. I guess that would be a problem. 22:17
irony: using panda to install zef.
ZoffixWin dha, you don't have to :) You can download zip 22:18
dha yeah, but I already did it. I enjoy the irony.
zef seems slower than panda. For whatever that's worth (probably not much). 22:19
dogbert17 hmm, the documentation changes have not shown up, how can I see if something has gone wrong with the build? 22:20
ZoffixWin dha, yeah, it's a lot slower.
dha And... zef failed to install p6doc.
ZoffixWin :(
tadzik try redpanda now :P 22:21
App::redpanda
timotimo i still have no clue what the difference between panda and redpanda is supposed to be
sortiz The color? ;-) 22:22
tadzik redpanda is cpanm of panda
it's not trying to do all the things
it just installs stuff
tadzik also, I had no tuits to actually modernize panda itseluf 22:22
ZoffixWin neat
tadzik to the point of actually maintaining the features 22:23
dha Hm. redpanda says it successfully installed p6doc, but my system disbelieves it. 22:26
tony-o what's the reason for failing with zef, dha ?
dha good question let me look for that... 22:26
oh damn. I managed to install p6doc by downloading it and installing from the local directory. So I probably can't tell you why zef failed. :-/ 22:29
timotimo ZoffixWin: you could have made the parameters optional for the cdio functions and invoking would have been simpler :)
dha sorry. :-(
tony-o interesting
running the install twice made it work on osx 22:30
dha oh? I didn't try it twice. :-)
ZoffixWin timotimo, that occurred to me when I was re-reading an already-posted post, but I was too lazy to change it
timotimo, maybe I should
timotimo :)
tony-o i also can't 'use JSON::Fast' on OSX, even though it's definitely installed
dha And now I have to go. Bah. 22:30
Later all, thanks for the suggestions. 22:31
ZoffixWin Hm, I get 'Cannot unbox a type object' if I specify Str = Str in the signature 22:34
timotimo no need to Str = Str 22:35
just Str $foo?
the default value is the type object already
ZoffixWin Same error
timotimo huh
that's weird. where does the error occur? (--ll-exception)
when you define it, or when you call it? 22:36
ZoffixWin Thought it actually happens on the call to close tray, that has sig close-tray(Str $x?, int32 = 0)
open-tray works fine it seems
Oh
Nope... I thought naming, like, int32 $y = 0 would help, but same error 22:37
--ll-exception: gist.github.com/zoffixznet/3c85f6c...6bcb1c727c 22:38
sortiz ZoffixWin, Are you talking of the signature of a native sub, right?
ZoffixWin Yeah
(code is in the gist above)
tony-o ZoffixWin: how does perl know which version of those to call? 22:39
ZoffixWin tony-o, "those"? They're different named subs. The signature isn't the only difference.
tony-o oh oops
ZoffixWin :)
tony-o guess it's time to go home 22:40
sortiz I see, in native subs an "optional" argument isn't permitted.
ZoffixWin hehe
tony-o or back to the hotel at least
ZoffixWin Good. Then I don't have to change my article \o/
psch m: sub f($x?, Str = "") { say $x }; f() 22:48
camelia rakudo-moar bffc3a: OUTPUT«(Any)␤»
psch that feels *really* confusing to me
i mean, it does make sense thinking about it for a second 22:49
but still, on first glance i was stumped :P
but yeah, i suppose it comes down to what sortiz++ says. don't do "$x?" but do "$x = Str" instead 22:50
sortiz In fact in native signatures the only important (and valid) thing are the types and arity. For example, you don't need to declare variables.
ZoffixWin psch, but $x = Str doesn't work either (same error). 22:53
Which seems more like an NIY than a technical limitation.
psch ZoffixWin: oh. yeah, that's my bad. i mean, the error says it can't unbox a type object, so defaulting to a type object is obviously nonsense... :) 22:54
ZoffixWin: does "$x = ''" work?
ZoffixWin psch, but it works if I declare it as foo(Str) and then call it as foo Str;
psch, same error. 22:55
psch huh
ZoffixWin psch, and open-tray(Str?) works fine it seems. I think the issue is with int32 $x = 0; actually
psch ZoffixWin: but 0 is not a type object..?
ZoffixWin ¯\_(ツ)_/¯ 22:56
psch ZoffixWin: in any case, this seems way to far into NC territory for my knowledge to be meaningful... :)
ZoffixWin wtf 22:57
gist.github.com/zoffixznet/a03a6ef...8ba12cd3e9
If I remove = 0 from signature of close-tray, it "works". But with it, I get "never work with this signature" :S 22:58
(I saw "works", because on this box my tray isn't opening even with original code that was working on the box I wrote that code on first, but at least I get no errors)
s/saw/say/;
timotimo doesn't have optical drives nearby to test 23:02
sortiz ZoffixWin, for close-try the valid signature is (Str, int32), forget about defaults and optionals, if you need that, wrote a normal perl6 wrapper sub.
The signature at the C level is static, so dyncall constructs an immutable callsite for it, and use that. 23:04
ZoffixWin Alright 23:07
Thanks.
ShimmerFairy hey timotimo, wanted this? :) github.com/ShimmerFairy/SUPERNOVA 23:13
timotimo ninja-forks 23:15
timotimo much appreciated :) 23:17
ShimmerFairy :) 23:19
gfldex m: my @perm = <a b c>.combinations(2)».permutations; dd [ @perm.map(*.Slip) ] 23:39
camelia rakudo-moar bffc3a: OUTPUT«[("a", "b"), ("b", "a"), ("a", "c"), ("c", "a"), ("b", "c"), ("c", "b")]␤»
psch m: my @perm = map <a b c>.combinations(2): *.permutations.Slip; dd @perm 23:50
camelia rakudo-moar bffc3a: OUTPUT«Array @perm = [("a", "b"), ("b", "a"), ("a", "c"), ("c", "a"), ("b", "c"), ("c", "b")]␤»
psch ...not quite sure that's neater vOv
why does the type show up there anyway..? 23:51
timotimo i need help with something 23:55
gist.github.com/timo/7babb36055768fe04eeb - when i put "say energies(@bodies) into the loop, i get about the same value over and over again, but when it's only after the loop, it gets a completely different value
what the f is up with that?