Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-08-19

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:05 kurahaupo joined #perl6
00:07 pierre_ joined #perl6
00:11 mcmillhj joined #perl6
00:15 kurahaupo joined #perl6
00:28 MilkmanDan joined #perl6
00:29 cdg joined #perl6
00:50 cibs joined #perl6
00:57 mcmillhj joined #perl6
00:58 tailgate timotimo: I appreciate the effort. Hell of a language, too
01:05 BenGoldberg joined #perl6
01:06 grondilu joined #perl6
01:17 tailgate m: https://gist.github.com/ahalbert/​1b495ad9facc504db0f7aa9fedc3ebe0
01:17 camelia rakudo-moar 1b898c: OUTPUT«([a a])␤([a b] [a b])␤([a c] [a c] [a c])␤»
01:18 tailgate this is more interesting. Maybe because @state is passed around, and needs to be made a new copy...
01:22 kalkin-_ joined #perl6
01:23 SmokeMachine____ Hi! is there any way to create a trait on a parameter on a sub/method? some thing like: sub bla($par is my-custom-trait){...}
01:27 SmokeMachine____ m: multi trait_mod:<is> ($a, :$my-custom-trait!) {say $a.^name}; sub bla($par is my-custom-trait){...}
01:27 camelia rakudo-moar 1b898c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Can't use unknown trait 'is my-custom-trait' in a parameter declaration.␤at <tmp>:1␤    expecting any of:␤        rw␤        readonly␤        copy␤        required␤        raw␤        leading…»
01:30 Calibellus joined #perl6
01:35 SmokeMachine____ I got it! thanks!
01:35 dataangel In python 3 PathLib gives you path objects similar to IO::Path but they include an extra method called with_suffix that lets you conveniently change the extension. Is there something like that for IO::Path, and if not what is the most Perlish way to add it?
01:35 SmokeMachine____ m: multi trait_mod:<is> (Parameter $a, :$blablabla!) {say $a.^name}; sub bla($a is blablabla) {}
01:35 camelia rakudo-moar 1b898c: OUTPUT«Parameter␤»
01:47 pierre_ joined #perl6
01:47 pierre_ joined #perl6
01:47 dataangel Found the documentation for augment, but not sure if that's the way that I should do things
01:48 ilbot3 joined #perl6
01:48 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:50 bjz joined #perl6
01:51 Actualeyes joined #perl6
01:51 grondilu augment is not something you should do on regular use indeed
01:52 dataangel I can just define a free function... But that doesn't seem Perlish either
01:54 grondilu just try inheritance?
01:56 grondilu like class MyPath is IO::Path { method with_suffix {...} } or something.
01:56 dataangel I assume Perl 6 doesn't have any form of uniform function call syntax? Like that would let you define free functions taking a type but then call them with the method calling syntax on the object?
01:57 grondilu like the .&function syntax?
01:57 grondilu m: sub foo { say "Foo!!" }; say pi.&foo
01:57 camelia rakudo-moar 1b898c: OUTPUT«Too many positionals passed; expected 0 arguments but got 1␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
01:57 dataangel Maybe that's what I want
01:57 grondilu m: sub foo($_) { say "Foo!!" }; say pi.&foo
01:57 camelia rakudo-moar 1b898c: OUTPUT«Foo!!␤True␤»
01:57 grondilu you will have to explicitely put the ampersand though
01:58 grondilu I suspect it's better to use inheritance.
01:58 grondilu or roles
01:59 grondilu m: role Suffixable { method with-suffix {...} }
01:59 camelia rakudo-moar 1b898c: ( no output )
02:00 grondilu roles are very useful in Perl 6.  I use them more than classes :)
02:00 dataangel Inside the S/// operator how do I refer to a variable?
02:01 grondilu I'm not sure but {} always work
02:01 dataangel grondilu: but then how do I attach that role to IO::Path?
02:01 grondilu not to the class itself, but to instances.
02:01 grondilu m: say "/tmp".IO.WHAT
02:01 camelia rakudo-moar 1b898c: OUTPUT«(Path)␤»
02:02 grondilu m: say my $path = "/tmp".IO but role { method talk { say "hi" } }; $path.talk
02:02 camelia rakudo-moar 1b898c: OUTPUT«"/tmp".IO␤hi␤»
02:03 bjz joined #perl6
02:08 dataangel Haven't seen but before @_@
02:09 canopus joined #perl6
02:13 noganex joined #perl6
02:15 dataangel 'but' is interesting but in order to use it you have to remember to do it on every single called to every single function that might produce a new IO::Path, so I suspect .& is still preferable
02:18 dataangel m: sub with-suffix (IO::Path:D $p, Str:D $ext --> IO::Path:D) { (S/(\.<-[.]>)?$/{$ext}/ given $p).IO; } say "hello.c".IO.&with-suffix(".o");
02:18 dataangel
02:18 camelia rakudo-moar 1b898c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Strange text after block (missing semicolon or comma?)␤at <tmp>:1␤------> 3 (S/(\.<-[.]>)?$/{$ext}/ given $p).IO; }7⏏5 say "hello.c".IO.&with-suffix(".o");␤    expecting any of:␤        infix…»
02:18 dataangel m: sub with-suffix (IO::Path:D $p, Str:D $ext --> IO::Path:D) { (S/(\.<-[.]>)?$/{$ext}/ given $p).IO; }; say "hello.c".IO.&with-suffix(".o");
02:18 camelia rakudo-moar 1b898c: OUTPUT«Type check failed in binding to $p; expected IO::Path but got "hello.c".IO(:SPEC(IO...␤  in sub with-suffix at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
02:19 dataangel Weird... Works for me locally
02:20 benchable joined #perl6
02:20 dataangel May be bot is on a different version?
02:20 bisectable joined #perl6
02:22 Actualeyes joined #perl6
02:22 grondilu maybe you want a parametric role?
02:23 grondilu or a trait.
02:23 grondilu wait
02:23 grondilu just a role with one attribute
02:24 grondilu m: role Suffixed { has Str $.suffix; }; my $path = "hello.c".IO but Suffixed(".o");
02:24 camelia rakudo-moar 1b898c: ( no output )
02:24 grondilu m: role Suffixed { has Str $.suffix; }; my $path = "hello.c".IO but Suffixed(".o"); say $path.suffix
02:24 camelia rakudo-moar 1b898c: OUTPUT«.o␤»
02:25 grondilu nah I got your semantics wrong I guess
02:25 grondilu sorry
02:26 dataangel p6: sub with-suffix (IO::Path:D $p, Str:D $ext --> IO::Path:D) { (S/(\.<-[.]>)?$/{$ext}/ given $p).IO; }; say "hello.c".IO.&with-suffix(".o");
02:26 camelia rakudo-moar 1b898c: OUTPUT«Type check failed in binding to $p; expected IO::Path but got "hello.c".IO(:SPEC(IO...␤  in sub with-suffix at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
02:26 dataangel Thought I might get a different bot :p
02:26 pierre_ joined #perl6
02:26 dataangel Still confused by that
02:27 grondilu I'm not sure you can use the .& notation like that.  Let me check.
02:27 dataangel Like I said works on my computer
02:27 grondilu m: sub f($a, $b) { "$a $b" }; say pi.&f(2);
02:27 camelia rakudo-moar 1b898c: OUTPUT«3.14159265358979 2␤»
02:28 grondilu oh you can
02:28 dataangel camelia for some reason doesn't like it
02:28 grondilu what this uppercase S///?
02:28 dataangel Returns a copy instead of editing in place
02:28 grondilu consider using .subst
02:29 grondilu m: sub with-suffix($p, $D) { $r.subst(/foo/, "bar").IO }; say "foo.c".IO.&with-suffix(*)
02:29 camelia rakudo-moar 1b898c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$r' is not declared␤at <tmp>:1␤------> 3sub with-suffix($p, $D) { 7⏏5$r.subst(/foo/, "bar").IO }; say "foo.c"␤»
02:30 grondilu m: sub with-suffix($p, $D) { $p.subst(/foo/, "bar").IO }; say "foo.c".IO.&with-suffix(*)
02:30 camelia rakudo-moar 1b898c: OUTPUT«"bar.c".IO␤»
02:30 grondilu m: sub with-suffix($p, $suffix) { $p.subst(/\.\w$$/, $suffix).IO }; say "hello.c".IO.&with-suffix(*)
02:30 camelia rakudo-moar 1b898c: OUTPUT«"hello*".IO␤»
02:31 grondilu m: sub with-suffix($p, $suffix) { $p.subst(/\.\w$$/, $suffix).IO }; say "hello.c".IO.&with-suffix(".o")
02:31 camelia rakudo-moar 1b898c: OUTPUT«"hello.o".IO␤»
02:31 dataangel with-suffix changes the extension (or adds one if there isn't one) not the part before
02:31 grondilu yeah I was just simplifying to test the subst
02:32 grondilu you ought to name your sub "change-suffix" instead of "with-suffix" though.
02:33 grondilu or not.  Not obvious.
02:34 wamba joined #perl6
02:44 ShimmerFairy grondilu: it works if you read is as "I want a file with this name, but with suffix .o". But I agree it's a touch ambiguous, since you could also say "I want this filename with suffix .o added"
02:48 parabolize joined #perl6
02:55 finanalyst joined #perl6
02:56 SmokeMachine____ m: role param_injected[Str $name?] { has $.injected = True; has $.default = {"injected $name"}; }; multi trait_mod:<is> (Parameter $a, :$injected!) { $a does param_injected; }; sub bla(Str $a is injected) { say $a; }; bla();
02:56 camelia rakudo-moar 1b898c: OUTPUT«Unhandled exception: Cannot unbox a type object␤   at <unknown>:1  (/home/camelia/rakudo-m-inst-2/share/perl6/r​untime/CORE.setting.moarvm:print_exception)␤ from gen/moar/m-CORE.setting:24486  (/home/camelia/rakudo-m-inst-2/​share/perl6/runtime/CORE.sett…»
03:22 cpage_ joined #perl6
03:29 committable6 joined #perl6
03:32 pierre_ joined #perl6
03:42 pierre_ joined #perl6
03:52 SmokeMachine____ if I have a variable with a Signature, how can I define a sub with that signature?
03:55 dj_goku SmokeMachine____: huh?
03:56 SmokeMachine____ m: \cap = :(Int $a); sub bla(|cap) {say "worked?"}; bla(42); bla()
03:56 camelia rakudo-moar 1b898c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Preceding context expects a term, but found infix = instead␤at <tmp>:1␤------> 3\cap =7⏏5 :(Int $a); sub bla(|cap) {say "worked?"␤»
03:56 geekosaur I think they want a meta method
03:56 geekosaur or, no. it's a sub. so, hm, I think that "can be done" but only in NQP-land
03:57 SmokeMachine____ geekosaur: what I really want is wrap a method taking off some parameters...
03:57 geekosaur oh. you want .assuming
03:58 geekosaur (maybe)
03:58 SmokeMachine____ oh! method/sub
03:59 geekosaur m: my sub foo($a, $b) { $a + $b }; my sub bar(&f) { f(15) }; say bar(&foo.assuming(3))
03:59 camelia rakudo-moar 1b898c: OUTPUT«18␤»
04:01 SmokeMachine____ What I want to do is something like: sub my-func($par1, $par2 is injected) is injected {} # and it should wrap the my-func with a fund only wit the signature ($par1)
04:02 leego joined #perl6
04:02 SmokeMachine____ m: my sub foo($a, $b) { $a + $b }; my sub bar(&f) { f(15) }; say bar(&foo.assuming(nil, 3))
04:02 camelia rakudo-moar 1b898c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    nil used at line 1␤␤»
04:03 dj_goku SmokeMachine____: Not that i'll be able to answer your question. But why are you wanting/needing this?
04:04 SmokeMachine____ I am writing a dependency injector...
04:04 dj_goku oh. sounds complicated. :D
04:04 dj_goku what does a dependency injector do?
04:05 geekosaur there;s already a wrap thing
04:06 BenGoldberg m: my $diff = * - *; say $diff.assuming(3).(1);
04:06 camelia rakudo-moar 1b898c: OUTPUT«Method 'assuming' not found for invocant of class 'WhateverCode'␤  in block <unit> at <tmp> line 1␤␤»
04:06 SmokeMachine____ this is my old code (that Im rewriting) https://github.com/FCO/Injector
04:06 BenGoldberg m: my $diff = &[-]; say $diff.assuming(3).(1);
04:06 camelia rakudo-moar 1b898c: OUTPUT«2␤»
04:06 BenGoldberg m: my $diff = &[-]; say $diff.assuming(*, 3).(1);
04:06 camelia rakudo-moar 1b898c: OUTPUT«-2␤»
04:07 BenGoldberg m: my sub foo($a, $b) { $a + $b }; my sub bar(&f) { f(15) }; say bar(&foo.assuming(*, 3))
04:07 camelia rakudo-moar 1b898c: OUTPUT«18␤»
04:07 SmokeMachine____ hum!!! the whatever star!
04:07 geekosaur https://docs.perl6.org/routine/wrap but I don't think you can do much with the parameters
04:07 geekosaur there's nextwith...
04:07 dj_goku s: &infix:<eqv>
04:07 SourceBaby dj_goku, Sauce is at https://github.com/rakudo/rakudo/​blob/1b898c8/src/core/Mu.pm#L828
04:08 BenGoldberg You might need to EVAL some text to create a sub with different parameters.
04:10 dj_goku with sourcery are you able to find out what code is executed for an expression?
04:10 dj_goku s: Any.WHAT
04:10 SourceBaby dj_goku, Something's wrong: ␤ERR: Cannot resolve caller sourcery(Any); none of these signatures match:␤    ($thing, Str:D $method, Capture $c)␤    ($thing, Str:D $method)␤    (&code)␤    (&code, Capture $c)␤  in block <unit> at -e line 6␤␤
04:10 labster joined #perl6
04:11 dj_goku s: Any, 'WHAT'
04:11 SourceBaby dj_goku, Something's wrong: ␤ERR: Type check failed in binding to &code; expected Callable but got Nil (Nil)␤  in sub do-sourcery at /home/zoffix/services/lib/CoreHackers-​Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 42␤  in sub sourcery at /home/zoffix/services/lib/CoreHackers-​Sourcery/lib/CoreHackers/Sourcery.pm6 (CoreHackers::Sourcery) line 33␤  in block <unit> at -e line 6␤␤
04:13 BenGoldberg WHAT is a metamethod.  It looks like a method, but is actually a macro.
04:14 dj_goku ahh ok
04:15 canopus joined #perl6
04:17 geekosaur m: sub foo($a, +@b) { $a <<+<< @b }; sub bar(|x) { nextwith(1, |x) }; &foo.wrap(&bar); say foo(4,5,6)
04:17 camelia rakudo-moar 1b898c: OUTPUT«[5 6 7]␤»
04:17 BenGoldberg It's documented here <https://docs.perl6.org/language/mop> and here <https://design.perl6.org/S12.html>
04:18 rkazak joined #perl6
04:19 * geekosaur 's first attempt at that used a pointy block instead of a separate sub; nextsame didn't like that
04:20 Cabanossi joined #perl6
04:41 MilkmanDan joined #perl6
04:59 rkazak joined #perl6
05:30 brrt joined #perl6
05:38 MilkmanDan joined #perl6
05:39 shantanu how would I use a object from a classname that is stored in a variable
05:40 shantanu m: my $a = "Example"; class Example {}; my $b = $a.new; $b.^name;
05:40 camelia rakudo-moar 1b898c: ( no output )
05:40 shantanu m: my $a = "Example"; class Example {}; my $b = $a.new; say $b.^name;
05:40 camelia rakudo-moar 1b898c: OUTPUT«Str␤»
05:41 shantanu m: my $a = "Example"; class Example {}; my $b = $a.new; say $b.^methods;
05:41 camelia rakudo-moar 1b898c: OUTPUT«(BUILD Int Num chomp pred succ simplematch match ords samecase samemark samespace word-by-word trim-leading trim-trailing trim encode NFC NFD NFKC NFKD wordcase trans indent codes chars uc lc tc fc tclc flip ord WHY WHICH Bool Str Stringy DUMP ACCEPTS chop…»
05:44 brrt shantanu: perl6 type objects are prototypes
05:44 brrt m: 3.new.WHAT.say;
05:44 camelia rakudo-moar 1b898c: OUTPUT«(Int)␤»
05:44 brrt m: 3.new.defined.say;
05:44 camelia rakudo-moar 1b898c: OUTPUT«True␤»
05:44 brrt m: 42.new.say;
05:44 camelia rakudo-moar 1b898c: OUTPUT«0␤»
05:44 brrt so that doesn't do what you want
05:45 brrt my guess is you have to lookup the type object explicitly, and i know that is possible but i've forgotten how
05:45 shantanu ohh so is there any way to get initialize a object of a class whose name you have in a variable?
05:45 brrt yeah
05:45 shantanu I am trying to implement a pluggable role.
05:45 brrt you have to get the type object from the namespace
05:45 brrt but as i said, i'm not100% sure how :-)
05:46 brrt m: my $a = 3; say $::<$a>;
05:46 camelia rakudo-moar 1b898c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$' is not declared␤at <tmp>:1␤------> 3my $a = 3; say 7⏏5$::<$a>;␤»
05:46 shantanu ohh
05:46 brrt m: my $a = 3; say ::<$sa>;
05:46 camelia rakudo-moar 1b898c: OUTPUT«Nil␤»
05:46 brrt not yet
05:46 shantanu my $a = ; my $b = 'a'; say ::<$b>;
05:46 shantanu m: my $a = ; my $b = 'a'; say ::<$b>;
05:46 camelia rakudo-moar 1b898c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed initializer␤at <tmp>:1␤------> 3my $a =7⏏5 ; my $b = 'a'; say ::<$b>;␤    expecting any of:␤        prefix␤        term␤»
05:48 brrt hmmm
05:50 brrt m: my $a = 10; say $::<$a>;
05:50 camelia rakudo-moar 1b898c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$' is not declared␤at <tmp>:1␤------> 3my $a = 10; say 7⏏5$::<$a>;␤»
05:50 brrt m: my $a = 10; say ::<$a>;
05:50 camelia rakudo-moar 1b898c: OUTPUT«10␤»
05:51 brrt m: my $a = 10; my $b = '$a'; say ::{$b};
05:51 camelia rakudo-moar 1b898c: OUTPUT«10␤»
05:51 brrt shantanu: https://docs.perl6.org/lang​uage/packages#Direct_lookup is what you want
05:51 brrt i think
05:54 brrt m: sub foo { $_*2; };  say foo 3
05:54 camelia rakudo-moar 1b898c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Calling foo(Int) will never work with declared signature ()␤at <tmp>:1␤------> 3sub foo { $_*2; };  say 7⏏5foo 3␤»
05:54 brrt m: sub foo(|) { $_ * 2; }; say foo 3;
05:54 camelia rakudo-moar 1b898c: OUTPUT«Use of uninitialized value of type Any in numeric context  in sub foo at <tmp> line 1␤0␤»
05:55 brrt m: sub foo { $^a * 3; }; say foo 3;
05:55 camelia rakudo-moar 1b898c: OUTPUT«9␤»
05:55 brrt hmm, that's actually quite cool
05:55 brrt m: sub foo { $^a * 3; }; say &foo.^signature;
05:55 camelia rakudo-moar 1b898c: OUTPUT«Method 'signature' not found for invocant of class 'Perl6::Metamodel::ClassHOW'␤  in block <unit> at <tmp> line 1␤␤»
06:01 brrt m: sub foo { $^a * 3]; say &foo.signature;
06:01 camelia rakudo-moar 1b898c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3sub foo { $^a * 37⏏5]; say &foo.signature;␤    expecting any of:␤        statement end␤        statement modifier␤        statement modifier loop␤»
06:01 brrt m: sub foo { $^a * 3; }; say &foo.signature;
06:01 camelia rakudo-moar 1b898c: OUTPUT«($a)␤»
06:02 brrt m: sub foo ($a, $b where $b > 2*$a) { $a * $b * $b }; foo(1,2); foo(2,1);
06:02 camelia rakudo-moar 1b898c: OUTPUT«Constraint type check failed for parameter '$b'␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
06:04 grondilu joined #perl6
06:05 grondilu joined #perl6
06:07 Xliff joined #perl6
06:07 Xliff \o
06:08 brrt hi Xliff
06:10 brrt isn't there a bot here that can help me with the link to  RT #127425
06:10 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=127425
06:11 brrt good synopsebot6 :-)
06:11 brrt .hug synopsebot6
06:11 brrt .botsnack
06:11 synopsebot6 om nom nom
06:11 yoleaux :D
06:16 pmurias joined #perl6
06:25 Xliff brrt: Isn't it nice when you can get answers out of the blue like that?
06:25 Xliff No effort solutions!
06:25 Xliff Is there a way to get the SQL of an executed statement from DBIish?
06:27 brrt joined #perl6
06:28 firstdayonthejob joined #perl6
06:29 shantanu m: my $a = 10; my $b = '$a'; say ::{$b};
06:29 camelia rakudo-moar 1b898c: OUTPUT«10␤»
06:29 shantanu brrt: Thanks!
06:30 shantanu m: my $a = "Example"; class Example {}; my $b = ::{$a}.new; say $b.^methods;
06:30 camelia rakudo-moar 1b898c: OUTPUT«()␤»
06:30 shantanu m: my $a = "Example"; class Example {}; my $b = ::{$a}.new; say $b.^name;
06:30 camelia rakudo-moar 1b898c: OUTPUT«Example␤»
06:35 shantanu m: my $a = "Example"; class Example {}; my $b = ::{"Example"}.new; say $b.^name;
06:35 camelia rakudo-moar a2b4a2: OUTPUT«Example␤»
06:38 TheLemonMan joined #perl6
06:42 trnh joined #perl6
06:53 RabidGravy joined #perl6
07:03 TheLemonMan 'morning #perl6
07:04 lizmat TheLemonMan o/
07:07 nine My brain really sucks at generating dreams that try to deal with the abstract challenges encountered during a heavy coding day...
07:07 zengargoyle joined #perl6
07:08 ufobat what happens during the night, nine?
07:09 ufobat sometimes i am dreaming of a solution for my coding problem, but usually it makes no sense in the morning :(
07:10 nine I...can't really say. It's so confusing. I just remember being half awake sometimes and just wishing it to stop.
07:10 rkazak joined #perl6
07:13 lizmat joined #perl6
07:13 ufobat that doesn't sound good.
07:13 darutoko joined #perl6
07:15 TheLemonMan nine, are you sure you weren't just dreaming in APL ?
07:16 pmurias TheLemonMan: in the pull request maybe it would make sense to have a 'if $valreg_kind {$valreg := $*REGALLOC.fresh_register($valreg_kind)}' to avoid repetition
07:19 TheLemonMan pmurias, absolutely, but the condition should be $valreg_kind ne $param_kind
07:20 pmurias yes
07:20 nine TheLemonMan: well I don't know APL, so yes, I'm sure :)
07:24 pmurias or even better the whole ugly if chain could be replaced with an array lookups in @trunc_op[$param_kind] and @trunc_kind[$param_kind] arrays
07:27 ufobat .oO( how many ppl just googled APL now? )
07:31 pmurias turning into array lookup might be overkill, anyway just nitpicking ;)
07:41 TheLemonMan pmurias, done!
07:41 arnsholt People who have VPSes for things: What providers are good these days?
07:44 pmurias TheLemonMan: test file for your changes: https://gist.github.com/pmurias/​4594138e3e482eb9e1e8d417fda164d2
07:45 pmurias TheLemonMan: did you push?
07:45 * pmurias has to get afk&
07:46 TheLemonMan pmurias, force-pushed
07:46 pierre_ joined #perl6
07:55 dakkar joined #perl6
08:04 zakharyas joined #perl6
08:07 espadrine joined #perl6
08:09 Wiertek joined #perl6
08:11 g4 joined #perl6
08:20 sno joined #perl6
08:33 bjz joined #perl6
08:45 labster joined #perl6
08:57 TheLemonMan interesting, NativeCall subs don't support default arguments, but RT#125523 shows it should
08:57 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=125523
08:58 TheLemonMan CALL-ME simply throws if the arguments don't match the arity
09:05 bjz joined #perl6
09:08 webstrand joined #perl6
09:15 AlexDaniel joined #perl6
09:17 rindolf joined #perl6
09:30 mvorg joined #perl6
09:44 Xliff (scrollbacked) - I used to know APL, but I think my brain's self-defense mechanisms have deleted those memories.
09:46 DrForr I know enough APL to be dangerous, but that particular project is far down the queue of stuff...
09:47 TheLemonMan m: say class :: {has uint16 $.x;}.new(x=>0xffff).x;
09:47 camelia rakudo-moar 5f2818: OUTPUT«-1␤»
09:47 TheLemonMan ENOTCOOL
09:48 Xliff "class ::" o_O
09:50 trnh joined #perl6
09:50 trnh joined #perl6
10:00 AlexDaniel bye bye bisectable
10:04 committable6 joined #perl6
10:04 bisectable6 joined #perl6
10:06 finanalyst joined #perl6
10:09 AlexDaniel hello bisectable6 :)
10:21 mcmillhj joined #perl6
10:28 Zoffix joined #perl6
10:31 Zoffix If nsvedberg 0racle Xliff dmaestro are here please add self to https://github.com/rakudo/rakudo/blob/nom/CREDITS if you want to be credited under a different name. Here's the full current list if you wanted to check yourself: https://gist.github.com/zoffixznet​/c439bedb4d69c7aff8a108251fc4ba10
10:32 Zoffix (yeah, there are a couple of duplicated names ATM, which I'm working on)
10:36 Zoffix .tell sena_kun please add yourself to https://github.com/rakudo/rakudo/blob/nom/CREDITS if you don't want to show up as `Altai-man` in credits.
10:36 yoleaux Zoffix: I'll pass your message to sena_kun.
10:37 Xliff Zoffix: Done. \o/
10:37 Zoffix Merged. Thanks.
10:38 * Xliff is now playing: Eschaton - Euphonic (Original Mix)
10:38 * Xliff groves.
10:40 zacts joined #perl6
10:40 DrForr "Uh, that's 'groove', sir, you're in the groove now."
10:40 tadzik joined #perl6
10:45 pmurias joined #perl6
10:52 Xliff DrForr: Not amongst the trees? Got it wrong again...
10:53 Xliff ♪┏(°.°)┛┗(°.°)┓┗(°.°)┛┏(°.°)┓ ♪
10:54 DrForr Sorry, 'twas a rather obscure ref to "Rappin' Ronnie" :)
11:04 heatsink joined #perl6
11:10 M-Illandan joined #perl6
11:10 Matthew[m] joined #perl6
11:19 masak p'haps of interest: zero-cost futures (promises) in Rust: http://aturon.github.io/blog/2016/08/11/futures/
11:19 masak (hi, #perl6)
11:29 pmurias hi masak
11:30 masak pmurias: going to start writing the 007/JS backend now.
11:41 pierre_ joined #perl6
11:49 bjz_ joined #perl6
12:00 n1lp7r joined #perl6
12:27 camelia joined #perl6
12:29 finanalyst joined #perl6
12:34 zakharyas1 joined #perl6
12:39 mcmillhj joined #perl6
12:46 pmurias joined #perl6
12:48 wamba joined #perl6
12:50 unmatched} .tell El_Che would you add yourself to https://github.com/rakudo/rakudo/blob/nom/CREDITS so the entiry shows up as you like in release announcement, please?
12:50 yoleaux unmatched}: I'll pass your message to El_Che.
12:50 unmatched} .tell titsuki would you add yourself to https://github.com/rakudo/rakudo/blob/nom/CREDITS so the entiry shows up as you like in release announcement, please?
12:50 yoleaux unmatched}: I'll pass your message to titsuki.
12:52 ItayAlmog joined #perl6
12:57 masak pmurias: locally:
12:57 masak $ bin/007 --backend=javascript -e='say("OH HAI, JavaScript backend")' | nodejs
12:57 masak OH HAI, JavaScript backend
12:57 masak :)
12:58 unmatched} \o/
12:58 masak (but hold your horses. it really only does `say` yet)
12:58 masak and it passes four tests
13:01 ItayAlmog I redid all of my code so it will work with my parser, So now you can declare variables (which is uses a hacky way for now because in perl 6 every thing is a class but i don't have classes yet...)
13:01 dalek doc: 8ad489c | (Zoffix Znet)++ | CONTRIBUTING.md:
13:01 dalek doc: Add note about CREDITS file
13:01 dalek doc:
13:01 dalek doc: Asking users to add selves, if they wish to use a name other than what the commit log gives.
13:01 dalek doc: review: https://github.com/perl6/doc/commit/8ad489cbac
13:01 ItayAlmog and you can also assign variables, now I am working on subroutines
13:02 El_Che off to a lego-like exposition (clics) with the kids
13:02 yoleaux 12:50Z <unmatched}> El_Che: would you add yourself to https://github.com/rakudo/rakudo/blob/nom/CREDITS so the entiry shows up as you like in release announcement, please?
13:02 El_Che laters
13:02 masak ItayAlmog: what parser are we talking about?
13:03 ItayAlmog about my parser for compiling Perl 6 to assembly
13:03 masak sounds... challenging :)
13:04 ItayAlmog This is the point :D
13:07 cdg joined #perl6
13:07 bjz joined #perl6
13:08 andreoss joined #perl6
13:09 andreoss is there a way to define a class where all attributes is r/o? without specifing `is ro` for each attribute
13:10 bjz joined #perl6
13:10 unmatched} andreoss: that's the default behaviour. You don't need is ro
13:10 finanalyst left #perl6
13:10 andreoss left #perl6
13:11 andreoss joined #perl6
13:11 unmatched} :/
13:11 andreoss left #perl6
13:11 andreoss joined #perl6
13:11 unmatched} heh
13:11 andreoss it's not
13:11 andreoss m: class Foo { has $.x } ; my Foo $x .= new; $x.x = 1 ; $x.x = 2; say $x.x
13:11 camelia rakudo-moar f5ed6b: OUTPUT«Cannot modify an immutable Any␤  in block <unit> at <tmp> line 1␤␤»
13:11 unmatched} m: my $x = class { has $.foo }.new: :42foo; say $x.foo; $x.foo = 42; say $x
13:11 camelia rakudo-moar f5ed6b: OUTPUT«42␤Cannot modify an immutable Int␤  in block <unit> at <tmp> line 1␤␤»
13:13 andreoss m: class Foo { my $.x } ; my Foo $x .= new; $x.x = 1 ; $x.x = 2; say $x.x
13:13 camelia rakudo-moar f5ed6b: OUTPUT«2␤»
13:13 andreoss i see
13:13 bjz joined #perl6
13:13 unmatched} Ah, right, class attributes are rw
13:14 unmatched} Then no, I'm unaware of a way to set class attributes to ro without is ro on each
13:18 perlpilot pretty sure it's  class Foo is ro { ... }  # or, it's intended to be.  dunno if it's actually implemented
13:19 unmatched} m: class Foo is ro { my $.x } ; my Foo $x .= new; $x.x = 1 ; $x.x = 2; say $x.x
13:19 camelia rakudo-moar f5ed6b: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤'Foo' cannot inherit from 'ro' because it is unknown.␤at <tmp>:1␤»
13:19 perlpilot now I'm pretty sure I've conflated a couple of memories  ;)
13:20 unmatched} Why can't Perl 6 be parsed without executing some code?
13:21 unmatched} Like, if I define sub infix:<+> { ... } does that get "run" or is it still ummm.. parsing time or whatever.
13:21 * unmatched} is trying to answer "Why is that functionality acceptable (or perhaps desirable) to you? From where I am sitting, a language that cannot be parsed without evaluating it would be a deal breaker."
13:23 [Coke] unmatched}: if you define that sub, it impacts the compilation of the unit it's in.
13:24 unmatched} Right, but does anything get "evaluated"?
13:25 perlpilot unmatched}: It's acceptable to me because that's one of the ways we warp the language to closer match the problem domain
13:25 unmatched} perlpilot: so warping the language requires evaluation of some code, right?
13:25 kjs_ joined #perl6
13:25 perlpilot most times.
13:27 skids joined #perl6
13:27 perlpilot unmatched}: What are you feelings about macros?
13:28 unmatched} "I've no idea what they are"
13:29 perlpilot http://strangelyconsistent.org/b​log/macros-what-the-faq-are-they
13:29 perlpilot masak++
13:30 zacts joined #perl6
13:30 perlpilot although, I thought he also had some pointers to earlier non-perl6 stuff, but I don't see it in my quick search
13:31 perlpilot anyway, reading all the stuff masak has written about P6 macros may prove instructive  :)
13:31 perlpilot Just search http://strangelyconsistent.org/blog/list-of-posts for all the posts with "macro" in the title
13:31 jnthn Just declaring a new operator isn't really something that causes code evaluation. Much better examples (that are already implemented) are EXPORT subs and doing various bits of meta-programming.
13:33 jnthn For example, a MOP module that hooks add_method to wrap a method up would need to run as methods are added, and methods are added at compile time because otherwise we can't do stuff like compile time role composition.
13:33 moritz .botsnack
13:33 synopsebot6 om nom nom
13:33 yoleaux :D
13:34 unmatched} jnthn++ thanks. That sounds very smarty-smart :D
13:35 mcmillhj joined #perl6
13:37 * unmatched} just copy-pastes jnthn's answer to https://www.reddit.com/r/programming/comments​/4xuo1r/the_awesome_errors_of_perl_6/d6nkc54
13:38 jnthn Reddit'll find a way to make it a negative anyway :P
13:39 unmatched} :D
13:39 kjs_ joined #perl6
13:41 telex joined #perl6
13:43 AlexDaniel joined #perl6
13:43 mst unmatched}: please check that my comment makes sense?
13:44 unmatched} Seems to yeah
13:44 unmatched} mst++
13:45 mst it's easy for people to confuse themselves because it's the same language performing both roles, because the compiler's self hosting
13:46 mst fortunately I've spent enough time in stuff like lisp that instead of going "wtf" it makes me "omg squeeee", but it's totally understandable
13:46 ItayAlmog joined #perl6
13:50 zakharyas joined #perl6
13:56 ItayAlmog joined #perl6
13:56 MilkmanDan joined #perl6
13:57 TheLemonMan are nativecalls subs supposed to accept default arguments like regular subs ?
14:02 kyclark_ joined #perl6
14:02 ItayAlmog joined #perl6
14:11 kyclark_ joined #perl6
14:18 sufrostico joined #perl6
14:31 acrussell joined #perl6
14:37 smls joined #perl6
14:38 skids TheLemonMan: I don't know.  That might just not be implemented yet, along with putting wrapper code around the {*} like in a proto.
14:38 skids m: proto sub foo ($s) { "OHAI".say; {*} }; multi foo ($s) { $s.say }; foo("THERE")
14:38 camelia rakudo-moar 1a16f6: OUTPUT«OHAI␤THERE␤»
14:39 unmatched} skids: did you want to appear as just "skids" in the credits? I forget if I asked you in past releases.
14:39 unmatched} If not, please add self to https://github.com/rakudo/rakudo/blob/nom/CREDITS
14:41 darutoko joined #perl6
14:45 MilkmanDan joined #perl6
14:48 cibs joined #perl6
14:48 skids unmatched}: do you want to do the whole PR dance or just add me?
14:49 unmatched} skids: I can add you, just let me know what to add
14:53 mcmillhj joined #perl6
14:54 * skids wonders how long the nick list is for unmatched} :-)
14:54 unmatched} :}
14:57 smls Hn, why does `zef install Inline::Python` say "Aborting due to build failure"
14:57 smls without giving more info
14:57 unmatched} Try with zef --debug
14:57 rba_ joined #perl6
14:58 unmatched} "VERBOSITY LEVEL (from least to most verbose) -error, --warn, --info (default), --verbose, --debug"
14:58 smls ah, thanks
15:00 smls it was the 'ol python2 vs 3 issue again
15:00 smls needed to `sudo ln -sf python2 /usr/bin/python`
15:00 nine Have they still not given up on Python 3?
15:01 smls ;)
15:05 tailgate^2 joined #perl6
15:09 mcmillhj joined #perl6
15:11 jack_rabbit joined #perl6
15:14 zacts joined #perl6
15:16 nowan_ joined #perl6
15:17 harmil_wk m: my \ℕ = ^Inf; say ℕ[^3]; for zip(ℕ, ^3) -> ($i, $n) { $i.say }; for ℕ -> $i { .say; last if (state $n = 0)++ >= 2 }
15:17 camelia rakudo-moar dd5c28: OUTPUT«(0 1 2)␤0␤1␤2␤(Any)␤(Any)␤(Any)␤»
15:17 harmil_wk Those first two behave as I would expect. Why do I get Any from the last one?
15:18 canopus joined #perl6
15:18 unmatched} harmil_wk: looks like you put the data in $i, yet are doing .say (which is on $_)
15:18 harmil_wk Doh!
15:18 harmil_wk Thanks
15:20 El_Che smls: are you sure you used spaced and no tabs in the command "zef install Inline::Python"
15:20 smls ?
15:21 El_Che bad joke :)
15:21 mcmillhj joined #perl6
15:21 smls ah, I get it now :)
15:22 El_Che :)
15:23 dj_goku El_Che: haha zef install    Inline::Python
15:23 El_Che :)
15:24 tadzik hahah
15:25 El_Che I have 2 computer jokes. The other one is 'have you tried to turn it on and off again', but it was less applicable :)
15:26 skids "You're not turning it off and on again fast enough, keep doing it faster till you see the sparks"
15:26 El_Che hehe
15:26 lucs And when quantum computers are a thing: "Have you tried turning it off and on at the same time?"
15:28 skids Why not we already have quantum USB ports -- you can't tell which way on the plug is up until you actually observe it to collapse the state.
15:29 mcmillhj joined #perl6
15:32 itaipu joined #perl6
15:36 pierre_ joined #perl6
15:37 khw joined #perl6
15:38 El_Che haha
15:42 crucialrhyme does perl 6 support unicode identifiers? i'm very concerned with i18n and so would like to exclusively use emoji for variable names, to make sure code is understandable to non english speakers
15:42 nine crucialrhyme: it does. Though it does restrict identifiers to what Unicode thinks are characters that should be used for identifiers.
15:43 unmatched} m: sub term:<😹> { 42 };  say 😹
15:43 camelia rakudo-moar dd5c28: OUTPUT«42␤»
15:44 nine /msg cameli: my $😹 = 1 ; say $😹;
15:44 nine Woah
15:44 danaj joined #perl6
15:44 unmatched} m: sub term:<😹> is rw {$}; 😹 = 42; say 😹²
15:44 camelia rakudo-moar dd5c28: OUTPUT«1764␤»
15:44 nine my irssi's input is considerably screwed by using emoji
15:44 vcv mine too.  same with vim
15:45 crucialrhyme this is legit though. tooling aside it's definitely only the cool languages that can do this
15:45 nine Or rather my terminal
15:46 TheLemonMan nine, definitely your terminal
15:47 unmatched} TheLemonMan: you're a core irssi dev?
15:48 TheLemonMan unmatched}, dev and evangelist heh
15:48 unmatched} :)
15:48 * unmatched} hides his copy of weechat
15:48 El_Che Long live irssi!
15:53 timotimo weechat <3
15:53 timotimo haven't looked back :P
15:53 timotimo but irssi is still good
15:53 * TheLemonMan wonders if the nameless blocks are a feature (or just a bug ? :)
15:55 vcv ffff~.~~~
15:55 timotimo the nameless blocks of what?
15:55 vcv sorry, terminal was frozen for a minute
15:56 timotimo know that feel ;(
15:56 timotimo maybe you forgot to hit return before your .~?
15:56 TheLemonMan timotimo, 'sub x () { my $x = 1; given $x { when Int { die 3; } } }; x()' the ones shown in the backtrace
15:57 timotimo maybe we want to skip blocks that can't be called from anywhere else but the very place they're written down at?
15:57 kyclark joined #perl6
15:57 TheLemonMan wrong example, meh, it's what #125477
15:57 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=125477
15:57 El_Che is weechat a fork or irssi? It look similar
15:57 kyclark How do I indicate that an sub should return an Array of Str?
15:57 timotimo no, it's a different codebase
15:57 TheLemonMan *what RT says
15:57 telex joined #perl6
15:58 timotimo oh
15:58 timotimo that's fine, i think
16:00 telex joined #perl6
16:00 rkazak joined #perl6
16:05 bpmedley joined #perl6
16:05 unmatched} m: react { whenever IO::Socket::Async.connect('irc.freenode.net', 6667) -> $c { $c.print: "NICK NotZoffix\nUSER Z Z Z Z\nJOIN #perl6\nPRIVMSG #perl6 :Zoffix, stop messing around!!"; } }
16:05 camelia rakudo-moar dd5c28: ( no output )
16:06 kyclark https://gist.github.com/kyclark/​767cb163720345cba30fabb20c813502
16:06 unmatched} m: react { whenever IO::Socket::Async.connect('irc.freenode.net', 6667) -> $c { $c.print: "NICK NotZoffix\nUSER Z Z Z Z\nJOIN #perl6\nPRIVMSG #perl6 :Zoffix, stop messing around!!"; whenever $c.Supply -> $buf {say $buf }; }
16:06 camelia rakudo-moar dd5c28: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3henever $c.Supply -> $buf {say $buf }; }7⏏5<EOL>␤»
16:06 unmatched} bah
16:07 timotimo i didn't realize the irc server would let you send your stuff before you've received the appropriate amount of other stuff
16:08 smls http://rosettacode.org/mw/index.php?tit​le=Special:RecentChanges&amp;limit=250 -- o.O does the author of the Sidef programming language ever rest?
16:08 unmatched} timotimo: some servers don't would ignore join until they send you 001, but freenode's not one of them
16:08 unmatched} kyclark: ? The error message is correct
16:09 smls Interestingly, it seems Sidef has become more Perl 6-ish with this update, bowwowing the gather/take construct, @( ) contextualizer, etc.
16:09 smls *rr
16:09 timotimo kyclark: you can only pass that type check if you define an Array of Str and return that
16:09 timotimo kyclark: we won't go through an array and check if all its elements match Str
16:10 shlomif joined #perl6
16:10 unmatched} m: react { whenever IO::Socket::Async.connect('irc.freenode.net', 6667) -> $c { $c.print: "NICK NotZoffix\nUSER Z Z Z Z\nJOIN #perl6\nPRIVMSG #perl6 :Zoffix, stop messing around!!"; whenever $c.Supply { .say } } }
16:10 NotZoffix joined #perl6
16:10 unmatched} ah, damn, forgot the newline :)
16:10 camelia rakudo-moar dd5c28: OUTPUT«(timeout):barjavel.freenode.net NOTICE * :*** Looking up your hostname...
16:11 unmatched} m: react { whenever IO::Socket::Async.connect('irc.freenode.net', 6667) -> $c { $c.print: "NICK NotZoffix\nUSER Z Z Z Z\nJOIN #perl6\nPRIVMSG #perl6 :Zoffix, stop messing around!!\n"; whenever $c.Supply { .say } } }
16:11 NotZoffix joined #perl6
16:11 NotZoffix Zoffix, stop messing around!!
16:11 unmatched} :D
16:11 lizmat joined #perl6
16:11 camelia rakudo-moar dd5c28: OUTPUT«(timeout):barjavel.freenode.net NOTICE * :*** Looking up your hostname...
16:11 * unmatched} is writing an article... on the topic
16:12 timotimo i find it amusing to see the output from the IRC server appear on camelia's output
16:12 timotimo kyclark: does my explanation help?
16:12 Actualeyes joined #perl6
16:13 smls unmatched}: If you know about this stuff, could you also review my rosettacode entry here? http://rosettacode.org/wiki/Chat_server#Perl_6
16:13 smls I'm still slightly unsure if it's all thread-safe and correct.
16:13 kyclark Yes.  If I lose the return type, I'm not getting the output I expect. https://gist.github.com/kyclark/​767cb163720345cba30fabb20c813502
16:14 kyclark I would expect each kmer (string) to be on a separate line
16:15 timotimo you're joining the kmers with \t instead of \n
16:15 kyclark D'oh!
16:15 timotimo :)
16:15 unmatched} smls: no, hash assignment like that is not thread safe
16:16 smls even in react/whenever?
16:16 timotimo correct, because the hash can grow when you assign
16:16 kyclark This is ugly and I wouldn't do it for reals but I was curious if this would work (it doesn't)
16:16 kyclark put map { $seq.seq.substr($_, $k) }, 0..^{ $seq.seq.chars - $k + 1};
16:16 kurahaupo joined #perl6
16:16 unmatched} smls: right. It doesn't automatically lock it for you.
16:16 timotimo kyclark: maybe you want to use a rotor over the .comb of your input sequence
16:17 kyclark Hmm, I'll have to read some docs
16:17 unmatched} kyclark: this may be of help: http://perl6.party/post/Perl6-Comb-It   http://perl6.party/post/Perl-6-.ro​tor-The-King-of-List-Manipulation
16:17 smls unmatched}: Doesn't the react make sure to only run one instance of the whenever at a time?
16:17 timotimo smls: one thought that comes to mind: use supply instead of react, "emit" every pair you want to assign to the hash, then .tap the resulting supply and mutate the hash from there
16:17 smls or something
16:18 timotimo smls: i've had this explained to me on multiple occasions, but i still always forget ...
16:18 iH2O joined #perl6
16:18 unmatched} smls: would that make it not concurrent?
16:18 unmatched} s/would/wouldn't/;
16:19 * lizmat waves from Prague
16:19 unmatched} \o
16:19 timotimo hey lizmat!
16:19 smls unmatched}: I think it would make it like Supply.act instead of Supply.tap
16:19 timotimo that must have been a long bike ride! :)
16:19 AlexDaniel m: mkdir ‘test’
16:19 camelia rakudo-moar dd5c28: OUTPUT«mkdir is disallowed in restricted setting␤  in sub restricted at src/RESTRICTED.setting line 1␤  in sub mkdir at src/RESTRICTED.setting line 8␤  in block <unit> at <tmp> line 1␤␤»
16:19 lizmat timotimo: yup, and sideways at that, at max 180km/hour  :-)
16:20 AlexDaniel what should I do to make mkdir throw an excetion?
16:20 timotimo holy hell
16:21 smls AlexDaniel: use the .IO.mkdir form
16:21 iH2O left #perl6
16:21 AlexDaniel smls: right
16:21 unmatched} smls: then react { whenever { ... } } would be no different than loop { for { ... } }
16:22 smls hm...
16:22 unmatched} smls: I'm gonna test it out and see
16:22 lizmat afk until later&
16:24 AlexDaniel alright, whatever… Do we have any module for file locks?
16:28 kyclark Now with rotor.  Comments?
16:28 kyclark https://gist.github.com/kyclark/​767cb163720345cba30fabb20c813502
16:28 unmatched} m: my $c = Channel.new; my %h; react { whenever Supply.interval(.001) { %h{$_} = $_; $c.send: $_; done if 20 < (now - INIT now) } };  $c.close; dd [ +(keys %h), +($c.list) ]
16:29 camelia rakudo-moar dd5c28: OUTPUT«Unhandled exception in code scheduled on thread 4␤Access denied to keep/break this Promise; already vowed␤  in any  at /home/camelia/rakudo-m-inst-2/share​/perl6/runtime/CORE.setting.moarvm line 1␤  in block  at <tmp> line 1␤  in block  at /home/cam…»
16:29 unmatched} What are those exceptions/access denied are about?
16:30 nine AlexDaniel: IO::Handle has lock and unlock
16:31 lostinfog joined #perl6
16:32 unmatched} m: Channel.new.list;
16:32 camelia rakudo-moar dd5c28: ( no output )
16:34 AlexDaniel nine: how does it work?
16:37 AlexDaniel uhhhhhhhh https://github.com/MoarVM/MoarVM/blob/99bf383cb1​01058ece7840d26e3b1e020a733762/src/io/io.c#L352
16:40 timotimo that's not what file locks mean :)
16:40 timotimo i don't think?
16:40 timotimo depends on what the repr behind the IO::Handle things locking means
16:42 geekosaur how can you tell what it's doing? impl is the same as e.g. flush, all the real logic is in libuv
16:42 * timotimo fails at searchign for it
16:42 El_Che joined #perl6
16:44 mcmillhj joined #perl6
16:47 kjs_ joined #perl6
17:02 mcmillhj joined #perl6
17:13 hankache joined #perl6
17:18 El_Che joined #perl6
17:20 El_Che joined #perl6
17:21 mcmillhj joined #perl6
17:22 xiaomiao joined #perl6
17:23 sufrostico joined #perl6
17:23 kjs_ joined #perl6
17:24 sena_kun joined #perl6
17:26 firstdayonthejob joined #perl6
17:26 El_Che joined #perl6
17:27 kyclark joined #perl6
17:28 trnh joined #perl6
17:28 trnh joined #perl6
17:30 dalek rt-six-help: 7ec6c7f | coke++ | summary.p6:
17:30 dalek rt-six-help: track [MATH]
17:30 dalek rt-six-help: review: https://github.com/coke/rt-​six-help/commit/7ec6c7f9a2
17:31 El_Che joined #perl6
17:31 mcmillhj joined #perl6
17:34 heatsink joined #perl6
17:35 pierre_ joined #perl6
17:39 dalek doc: c082929 | titsuki++ | doc/Type/Signature.pod6:
17:39 dalek doc: Add an index for ;;
17:39 dalek doc: review: https://github.com/perl6/doc/commit/c082929735
17:39 dalek doc: 1966354 | titsuki++ | doc/Type/Signature.pod6:
17:39 dalek doc: Merge pull request #842 from titsuki/fix-double-semicolon
17:39 dalek doc:
17:39 dalek doc: Add an index for ;;
17:39 dalek doc: review: https://github.com/perl6/doc/commit/196635476f
17:39 mcmillhj joined #perl6
17:39 El_Che joined #perl6
17:41 unmatched} smls: no idea. I can't think of a test that has a good chance to get a race condition whithout hitting a bug I've just discovered. Maybe someone smarter can tell whether react { whenever Supply } is like an .act or like a .tap ¯\_(ツ)_/¯
17:41 unmatched} (the docs do say "tap the supply", so if it's an .act, they should be amended)
17:42 sena_kun
17:42 yoleaux 10:36Z <Zoffix> sena_kun: please add yourself to https://github.com/rakudo/rakudo/blob/nom/CREDITS if you don't want to show up as `Altai-man` in credits.
17:44 sena_kun Zoffix, I do want, so don't bother. (:
17:46 unmatched} noted
17:47 dalek rt-six-help: 1019430 | coke++ | summary.p6:
17:47 dalek rt-six-help: track [REGEX]
17:47 dalek rt-six-help: review: https://github.com/coke/rt-​six-help/commit/10194304ad
17:50 buggable joined #perl6
17:50 unmatched} buggable: rt
17:50 buggable unmatched}, TOTAL: 1381, UNTAGGED: 471, BUG: 449, LTA: 108, JVM: 64, NYI: 42, CONC: 40, RFC: 36, SEGV: 34, UNI: 29, PERF: 25, REGEX: 21, @LARRY: 17, POD: 14, NATIVECALL: 14, PRECOMP: 12, TODO: 10, BUILD: 8, STAR: 5, GLR: 4, WEIRD: 3, BOOTSTRAP: 3, MOARVM: 2, MATH: 2, OSX: 2, WEB: 1, IO: 1, REGX: 1, LHF: 1, SPESH: 1, DOCS: 1, REPL: 1   Details: http://bug.perl6.party/1471629057.html
17:52 dalek doc/revert-842-fix-double-semicolon: c882ef6 | titsuki++ | doc/Type/Signature.pod6:
17:52 dalek doc/revert-842-fix-double-semicolon: Revert "Add an index for ;;"
17:52 dalek doc/revert-842-fix-double-semicolon: review: https://github.com/perl6/doc/commit/c882ef6e11
17:53 mcmillhj joined #perl6
17:57 dalek doc: c882ef6 | titsuki++ | doc/Type/Signature.pod6:
17:57 dalek doc: Revert "Add an index for ;;"
17:57 dalek doc: review: https://github.com/perl6/doc/commit/c882ef6e11
17:57 dalek doc: 93cdcb6 | titsuki++ | doc/Type/Signature.pod6:
17:57 dalek doc: Merge pull request #843 from perl6/revert-842-fix-double-semicolon
17:57 dalek doc:
17:57 dalek doc: Revert "Add an index for ;;"
17:57 dalek doc: review: https://github.com/perl6/doc/commit/93cdcb6cbe
17:57 setty1 joined #perl6
18:02 sno joined #perl6
18:02 itaipu_ joined #perl6
18:03 sufrostico joined #perl6
18:04 labster joined #perl6
18:06 * unmatched} modifies https://perl6advent.wordpress.com/ to close https://rt.perl.org/Ticket/Display.html?id=127127
18:07 dalek doc: 94b889e | titsuki++ | doc/Type/Signature.pod6:
18:07 dalek doc: Fix a ;; index again (use C<<;;>>)
18:07 dalek doc: review: https://github.com/perl6/doc/commit/94b889e5d7
18:07 dalek doc: 6d26699 | titsuki++ | doc/Type/Signature.pod6:
18:07 dalek doc: Merge pull request #844 from titsuki/fix-double-semicolon-again
18:07 dalek doc:
18:07 dalek doc: Fix a ;; index again (use C<<;;>>)
18:07 dalek doc: review: https://github.com/perl6/doc/commit/6d26699684
18:08 mcmillhj joined #perl6
18:18 nine AlexDaniel: it's really just flock(2)
18:18 AlexDaniel nine: ah, so .lock on IO::Handle is flock, did I get that right?
18:18 setty1 joined #perl6
18:19 AlexDaniel committable6: releases my @a[;];
18:19 AlexDaniel whoah
18:19 AlexDaniel bisectable6: good=2016.07 my @a[;];
18:20 AlexDaniel well
18:20 bisectable6 joined #perl6
18:20 AlexDaniel bisectable6: good=2016.07 my @a[;];
18:21 AlexDaniel “Heap corruption detected: pointer 0x7f6130b132f0 to past fromspace”
18:21 unmatched} past fromspace! :D
18:21 unmatched} future tospace!
18:22 AlexDaniel well, it does not look like my fault, right?
18:22 committable6 joined #perl6
18:22 AlexDaniel committable6: 2016.07 my @a[;];
18:22 committable6 joined #perl6
18:22 AlexDaniel committable6: 2016.07 say ‘hello’
18:22 committable6 AlexDaniel, ¦«2016.07»: hello
18:23 unmatched} That doesn't error out on bleed
18:23 unmatched} m: my @a[;];
18:23 camelia rakudo-moar 079da9: ( no output )
18:24 unmatched} Nothing sinister in REPL either, so seems like that ticket can be closed with tests
18:24 AlexDaniel committable6: 2016.07 ;
18:24 committable6 AlexDaniel, ¦«2016.07»:
18:25 [Coke] didn't I just comment on that ticket?
18:25 [Coke] what's the ticket #, ad?
18:25 AlexDaniel #126979
18:25 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=126979
18:25 [Coke] it was still broken in 2016.07.01
18:25 [Coke] checking.
18:25 AlexDaniel still, it makes bisectable and committable die… why? Whyyy?
18:26 AlexDaniel committable6: HEAD my @a[;];
18:26 committable6 AlexDaniel, ¦«HEAD»:
18:26 unmatched} Probably fixed by this one: https://github.com/rakudo/rakudo/commit/​59b7e51b34057ae1cae87950b5d0a009aee6dbbf
18:26 AlexDaniel committable6: HEAD~50 my @a[;];
18:26 committable6 AlexDaniel, ¦«HEAD~50»:
18:26 [Coke] yup, was fixed since 2016.07.1
18:26 AlexDaniel committable6: HEAD~100 my @a[;];
18:26 committable6 AlexDaniel, ¦«HEAD~10»:
18:26 [Coke] 'will update comment.
18:26 AlexDaniel committable6: HEAD~300 my @a[;];
18:26 unmatched} 'cause IIRC that fixed the barf with @[;] or whatever that short code was
18:26 mcmillhj joined #perl6
18:26 AlexDaniel unmatched}: yeah, I thought about it too
18:27 [Coke] Done.
18:27 AlexDaniel unmatched}: have a commit hash that fixed it?
18:27 * unmatched} points up :)
18:27 AlexDaniel omg, I'm blind
18:27 dalek doc/revert-844-fix-double-semicolon-again: ec8929a | titsuki++ | doc/Type/Signature.pod6:
18:27 dalek doc/revert-844-fix-double-semicolon-again: Revert "Fix a ;; index again (use C<<;;>>)"
18:27 dalek doc/revert-844-fix-double-semicolon-again: review: https://github.com/perl6/doc/commit/ec8929a0c8
18:27 committable6 joined #perl6
18:27 AlexDaniel committable6: 59b7e51b34 my @a[;];
18:27 committable6 AlexDaniel, ¦«59b7e51»:
18:27 AlexDaniel committable6: 59b7e51b34~1 my @a[;];
18:27 committable6 AlexDaniel, ¦«59b7e51»: ===SORRY!===␤Unknown QAST node type BOOTInt «exit code = 1»
18:28 AlexDaniel committable6: 59b7e51b34~2 my @a[;];
18:28 dalek doc: 000a24d | smls++ | doc/Language/operators.pod6:
18:28 dalek doc: Improve explanation of reduction operators
18:28 dalek doc:
18:28 dalek doc: * Fixed some incorrect/outdated info.
18:28 dalek doc: * Made some sentences less confusing.
18:28 dalek doc: * Linked to </routine/reduce>, made sure not to duplicate its info
18:28 dalek doc:   on reduction semantics, and instead focus on the syntactical
18:28 jeek joined #perl6
18:28 dalek doc:   details of the operator form.
18:28 dalek doc: review: https://github.com/perl6/doc/commit/000a24d66c
18:28 dalek doc: 234e846 | smls++ | doc/Language/operators.pod6:
18:28 dalek doc: Remove the "user defined" example in the Reduction Operators section
18:28 AlexDaniel so there you have it ;)
18:28 dalek doc:
18:28 dalek doc: As far as I can see, this example does not belong here.
18:28 dalek doc: Contrary to what it claims, it doesn't define a reduce operator - it
18:28 dalek doc: merely defines a completely custom operator that happens to use
18:28 dalek doc: square brackets in its symbol.
18:28 dalek doc: Nor is is the functionality it implements related to reduce -
18:28 dalek doc: rather, it seems to re-implement (part of) the functionality of the
18:28 dalek doc: built-in `map` routine.
18:28 dalek doc: review: https://github.com/perl6/doc/commit/234e846b59
18:28 unmatched} \o/
18:28 El_Che joined #perl6
18:29 El_Che joined #perl6
18:30 Xliff Have a weird SEGV in rakudo
18:30 Xliff Not golfed. I don't know how I would start to golf this.
18:30 dalek doc: ec8929a | titsuki++ | doc/Type/Signature.pod6:
18:30 dalek doc: Revert "Fix a ;; index again (use C<<;;>>)"
18:30 dalek doc: review: https://github.com/perl6/doc/commit/ec8929a0c8
18:30 dalek doc: 871ab84 | titsuki++ | doc/Type/Signature.pod6:
18:30 dalek doc: Merge pull request #845 from perl6/revert-844-fix-double-semicolon-again
18:30 dalek doc:
18:30 dalek doc: Revert "Fix a ;; index again (use C<<;;>>)"
18:30 dalek doc: review: https://github.com/perl6/doc/commit/871ab84ea1
18:30 Xliff I'll start writing up a gist.
18:30 unmatched} Xliff: on HEAD? and does it involve Proc::Async ?
18:30 AlexDaniel “Internal error: zeroed target thread ID in work pass”…
18:30 MilkmanDan joined #perl6
18:31 bisectable joined #perl6
18:31 AlexDaniel bisectable: my @a[;];
18:32 AlexDaniel right, it will time out
18:32 AlexDaniel at least it does not crash /o\
18:33 AlexDaniel ok stop
18:33 bisectable6 joined #perl6
18:33 committable6 joined #perl6
18:35 El_Che joined #perl6
18:37 Xliff unmatched}, not sure. Looks like it involves Inline::Perl5
18:41 travis-ci joined #perl6
18:41 travis-ci Doc build failed. Itsuki Toyota 'Merge pull request #845 from perl6/revert-844-fix-double-semicolon-again
18:41 travis-ci https://travis-ci.org/perl6/doc/builds/153639375 https://github.com/perl6/doc/com​pare/234e846b59e3...871ab84ea124
18:41 travis-ci left #perl6
18:44 Xliff https://gist.github.com/Xliff/a​835c15ae283e33c484cf5d7b2b4ebc2
18:48 Xliff ^^ describes SEGV
18:49 wamba joined #perl6
18:54 [Coke] your backtrace starts in a perl 5 function, so yes, Inline::Perl5
18:55 [Coke] what version of I::p5 are you using?
18:56 unmatched} And Rakudo. Recently my SEGV with Perl 5's Mojolicious went away...
18:56 unmatched} So ensure you're using latest and greatest of everything
18:57 mcmillhj joined #perl6
18:58 [Coke] unmatched}: This is Rakudo version 2016.07.1-225-g5f2818b built on MoarVM version 2016.07-17-g40948f6
18:58 [Coke] implementing Perl 6.c.
18:59 unmatched} m:
18:59 unmatched} m: ''
18:59 camelia rakudo-moar 079da9: OUTPUT«WARNINGS for <tmp>:␤Useless use of constant string "" in sink context (line 1)␤»
18:59 [Coke] also, maybe, what version of perl 5?
19:03 TakinOver joined #perl6
19:08 AndyBotwin joined #perl6
19:08 Wiertek joined #perl6
19:09 harmil_wk Seeing Perl_yyparse in a backtrace... ah memories... and PTSD
19:10 AlexDaniel “fatal: write failure on 'stdout': Connection reset by peer”
19:10 AlexDaniel /o\
19:11 [Coke] m: enum Suit <♠ ♥ ♣ ♦> is export;
19:11 camelia rakudo-moar 079da9: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3enum Suit <♠ ♥ ♣ ♦>7⏏5 is export;␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤        …»
19:11 [Coke] that's a change.
19:11 harmil_wk AlexDaniel: y u reset? :)
19:11 AlexDaniel committable6: releases enum Suit <♠ ♥ ♣ ♦> is export;
19:11 committable6 AlexDaniel, https://gist.github.com/7992​880d5516a894a54a146b08008284
19:13 Xliff OK. Updating Inline::Perl5
19:13 harmil_wk Is &?ROUTINE read-only?
19:13 smls m: enum Suit is export <♠ ♥ ♣ ♦>;  # [Coke]
19:13 camelia rakudo-moar 079da9: ( no output )
19:14 AlexDaniel arguably it is LTA because it could've suggested that
19:15 [Coke] smls: huh. wonder when that changed. (digging up an old p6 project)
19:15 [Coke] thanks
19:15 masak harmil_wk: I should hope so! :P
19:15 masak harmil_wk: what are you trying to achieve, exactly?
19:15 [Coke] oh, and I also had this:
19:15 [Coke] m: enum Suit <a b c>; class Suit is { ... };
19:15 camelia rakudo-moar 079da9: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Invalid name␤at <tmp>:1␤------> 3enum Suit <a b c>; class Suit is7⏏5 { ... };␤»
19:16 [Coke] m: enum Suit <a b c>; class Suit { ... };
19:16 camelia rakudo-moar 079da9: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Redeclaration of symbol Suit␤at <tmp>:1␤------> 3enum Suit <a b c>; class Suit7⏏5 { ... };␤    expecting any of:␤        generic role␤»
19:16 masak [Coke]: those look right to me.
19:16 harmil_wk masak: Was trying to figure out if you could attach docs to a routine that way. If you were auto-translating Python, for example, the first sink-context string before code is the doc.
19:17 harmil_wk Nominally, such a string shouldn't do any work, but it can in Python... kind of sketchy that way.
19:17 rindolf joined #perl6
19:18 masak oh yes, those """ strings
19:18 masak well, "do any work" might be a bit of a stretch. it does have an effect, but it's definitely on the declarative side
19:18 harmil_wk Oh, I'm wrong. If you do any work, python will ignore it
19:19 masak harmil_wk: I guess you're already aware that one can attach Pod documentation to things?
19:19 [Coke] masak: yes, I'm saying that I had working code before with both kinds of Suits.
19:19 grondilu I wonder why they used a string and not just comments.
19:19 * [Coke] now has to decide what he meant.
19:19 masak [Coke]: oh! you expected it to work having an `enum` and a `class` with the same name like that?
19:19 harmil_wk masak: yeah, I was just trying to figure out what the minimal change would be. I think that's the right thing to do... it's a project for the back-back-burner, though.
19:20 unmatched} m: #`(some docs)␤sub foo {}␤say foo.WHY
19:20 camelia rakudo-moar 079da9: OUTPUT«(Any)␤»
19:20 unmatched} harmil_wk: FWIW, I forget the exact syntax, but Perl 6 does have a way of attaching docs to a sub. They'd be accessible via .WHY
19:20 grondilu you need #|
19:20 [Coke] masak: ... it USED TO WORK
19:20 Xliff Wow! SEGV has been banished!
19:20 unmatched} m: #|some docs␤sub foo {}␤say foo.WHY
19:20 camelia rakudo-moar 079da9: OUTPUT«(Any)␤»
19:21 masak [Coke]: yes, I hear you.
19:21 unmatched} m: #|(some docs)␤sub foo {}␤say foo.WHY
19:21 camelia rakudo-moar 079da9: OUTPUT«(Any)␤»
19:21 grondilu hum
19:21 Xliff Updating gist.
19:21 masak [Coke]: but I was still surprised at your expectation. I know Rakudo has bugs :)
19:21 grondilu m: #=(some docs)␤sub foo {}␤say foo.WHY
19:21 camelia rakudo-moar 079da9: OUTPUT«(Any)␤»
19:21 * [Coke] ponders just nuking this project from orbit and starting over.
19:21 harmil_wk Next question, more relevant to active work: I recall someone saying that some work was done at some point on importing the OEIS sequences, but that that was dropped.
19:22 [Coke] I only expected it to work in Dec 2014, apparently.
19:22 harmil_wk Is there anything left of that, since I now have a module half-written, I don't want to step on anything that's already there.
19:22 [Coke] harmil_wk: yah, we're not doing that.
19:22 moritz harmil_wk: I don't think it was ever seriously planned for core
19:22 moritz harmil_wk: but for a module, that's a good idea
19:22 unmatched} m: https://gist.github.com/zoffixznet​/1f0b59adf15b7bad5a3d31158cfc8035
19:22 camelia rakudo-moar 079da9: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Invalid typename 'Spell' in parameter declaration.␤at <tmp>:1␤------> 3sub cast(Spell7⏏5 $s)␤»
19:23 unmatched} m: #= some docs␤sub foo {}␤say foo.WHY
19:23 camelia rakudo-moar 079da9: OUTPUT«(Any)␤»
19:23 unmatched} Oh, damn
19:23 unmatched} m: #= some docs␤sub foo {}␤say &foo.WHY
19:23 camelia rakudo-moar 079da9: OUTPUT«Nil␤»
19:23 unmatched} ~_~
19:23 harmil_wk moritz: thanks. Yeah, I started with just wanting to have a more functional ℤ, ℕ and ℝ and then it got... out of hand :-)
19:24 moritz harmil_wk: the usual terminology is "that escalated quickly" :-)
19:24 harmil_wk yes, exactly. only when dealing with OEIS "quickly" has lots of definitions :-)
19:25 unmatched} m: sub foo␤ #= some docs␤ {}␤say &foo.WHY
19:25 camelia rakudo-moar 079da9: OUTPUT«some docs␤»
19:25 unmatched} There we go :) lol took awhile
19:25 masak harmil_wk: pretty sure there must've been a toggled "kidding" bit on that conversation
19:25 harmil_wk :)
19:26 TEttinger joined #perl6
19:27 grondilu so the #= must be just before the opening curly??  I had no idea.
19:28 grondilu makes sense, though.
19:32 mcmillhj joined #perl6
19:33 grondilu hang on
19:33 * unmatched} hangs off
19:34 grondilu #| { test } sub {}.WHY.say
19:34 grondilu m: #| { test } sub {}.WHY.say
19:34 camelia rakudo-moar 3c2e29: ( no output )
19:34 unmatched} m: #| { test } ␤sub {}.WHY.say
19:34 camelia rakudo-moar 3c2e29: OUTPUT«{ test }␤»
19:35 grondilu not sure why the newline is required
19:35 grondilu m: (#| { test } sub {}).WHY.say
19:35 camelia rakudo-moar 3c2e29: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in parenthesized expression; couldn't find final ')' ␤at <tmp>:1␤------> 3(#| { test } sub {}).WHY.say7⏏5<EOL>␤»
19:35 grondilu m: #| { test } sub foo {}; say foo.WHY
19:35 camelia rakudo-moar 3c2e29: ( no output )
19:35 unmatched} It just treats it as a comment, I presume
19:36 unmatched} m: #| { test } ␤sub foo {}; say &foo.WHY
19:36 camelia rakudo-moar 3c2e29: OUTPUT«{ test }␤»
19:36 unmatched} m: #| meow ␤sub foo {}; say &foo.WHY
19:36 camelia rakudo-moar 3c2e29: OUTPUT«meow␤»
19:36 unmatched} The reason it wasn't working for me above is 'cause I forgot the & on the sub
19:36 grondilu m: #= { test } sub {}.WHY.say
19:36 camelia rakudo-moar 3c2e29: ( no output )
19:37 unmatched} m: #=(test) sub {}.WHY.say
19:37 camelia rakudo-moar 3c2e29: OUTPUT«Nil␤»
19:37 grondilu ^I suspect this not working is a bug
19:37 grondilu unmatched}: if you don't end by newline you must use curlies
19:38 unmatched} m: #={ test } sub {}.WHY.say
19:38 camelia rakudo-moar 3c2e29: OUTPUT«Nil␤»
19:38 grondilu m: #= { test } sub {}.WHY.say # <- this not working is suspicious
19:38 camelia rakudo-moar 3c2e29: ( no output )
19:38 grondilu m: #= { test } sub {}.WHY.say; say "alive!"
19:38 camelia rakudo-moar 3c2e29: ( no output )
19:38 grondilu oh
19:39 grondilu m: #={ test } sub {}.WHY.say; say "alive!"
19:39 camelia rakudo-moar 3c2e29: OUTPUT«Nil␤alive!␤»
19:39 grondilu Ic
19:39 unmatched} Well, I don't see a problem with that. It just it assumes it's a regular comment when there's space after |= or whatever
19:39 grondilu yeah I forgot that the space makes it ignore the opening curly
19:40 grondilu I'm not familiar with those things
19:42 domidumont joined #perl6
19:43 Xliff m: @a = <<a b c>>; say @a
19:43 camelia rakudo-moar 3c2e29: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '@a' is not declared␤at <tmp>:1␤------> 3<BOL>7⏏5@a = <<a b c>>; say @a␤»
19:44 Xliff m: my @a = <<a b c>>; say @a
19:44 camelia rakudo-moar 3c2e29: OUTPUT«[a b c]␤»
19:44 Xliff m: my @a = <<a b c>>; dd @a
19:44 camelia rakudo-moar 3c2e29: OUTPUT«Array @a = ["a", "b", "c"]␤»
19:46 zengargoyle joined #perl6
19:48 domidumont joined #perl6
19:48 mcmillhj joined #perl6
19:50 MasterDuke joined #perl6
19:57 itaipu joined #perl6
20:02 mcmillhj joined #perl6
20:02 labster joined #perl6
20:08 harmil_wk Mathematical / philosophical / perhaps religious question... Should ℕ.elems give Inf or fail? I'm leaning toward Inf...
20:08 harmil_wk It's technically imprecise as I think it's something like 2^aleph0 but for all Perl really cares, I think Inf is fine.
20:10 cdg joined #perl6
20:11 Piotr joined #perl6
20:19 mcmillhj joined #perl6
20:19 grondilu m: constant  ℕ = ^Inf; say  ℕ[^10]
20:19 camelia rakudo-moar 920295: OUTPUT«(0 1 2 3 4 5 6 7 8 9)␤»
20:20 grondilu that'd be a fun constant to define
20:20 moritz harmil_wk: we  don't do different infiniteies :-)
20:24 tailgate^2 m: ℕ.elems
20:24 camelia rakudo-moar 920295: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routine:␤    ℕ used at line 1␤␤»
20:24 setty1 joined #perl6
20:24 tailgate^2 m: constant  ℕ = ^Inf; say  ℕ.elems
20:24 camelia rakudo-moar 920295: OUTPUT«Inf␤»
20:27 setty1 joined #perl6
20:34 mcmillhj joined #perl6
20:36 harmil_wk tailgate: Yeah, the default would definitely be Inf. I'm inclined to go that way
20:36 harmil_wk moritz: Not... yet ;-)
20:38 harmil_wk grondilu: It's in the module I'm writing along with ℤ, ℝ and lots of OEIS sequences.
20:40 skrilax joined #perl6
20:41 pyrimidine joined #perl6
20:43 cyphase joined #perl6
20:44 grondilu ℝ can not be a sequence though, can it?
20:45 sena_kun grondilu, it cannot.
20:46 harmil_wk grondilu: it can. There are only limited things you can reason about it. It's essentially "-Inf, {fail "Not countable"} ... Inf" Same problem, to a lesser extent with the Integers
20:47 harmil_wk But it's useful in a few contexts as a sentinel value, for assertions and a few other things.
20:48 Wiertek joined #perl6
20:49 mcmillhj joined #perl6
20:53 harmil_wk One good example is you should be able to ask "is pi in ℝ" and get True, but "is 1i in ℝ" should give False.
20:54 Xliff Is there an easy way to currency print in P6 so that 1000 becomes "$1,000"?
20:55 grondilu pi is defined as a Rat though, so it's not in R
20:55 grondilu Xliff: not builtin.  But a module would be welcome
20:56 grondilu there may be a printf code for thousand separator though
20:56 grondilu m: printf "%'d", 1e6
20:56 camelia rakudo-moar 920295: OUTPUT«Directive 'd is not valid in sprintf format sequence %'d␤  in any  at /home/camelia/rakudo-m-inst-2/share​/perl6/runtime/CORE.setting.moarvm line 1␤  in any panic at /home/camelia/rakudo-m-inst-2​/share/nqp/lib/NQPHLL.moarvm line 1␤  in any statement a…»
20:57 Xliff m: my $a = "100000"; say $a.comb(3)
20:57 camelia rakudo-moar 920295: OUTPUT«(100 000)␤»
20:57 Xliff m: my $a = "100000"; say $a.comb(3).join(',')
20:57 camelia rakudo-moar 920295: OUTPUT«100,000␤»
20:57 Xliff m: my $a = "1000000"; say $a.comb(3).join(',')
20:57 camelia rakudo-moar 920295: OUTPUT«100,000,0␤»
20:57 Xliff D'oh
20:57 grondilu bash supports %'
20:57 Xliff m: my $a = "1000000"; say $a.reverse.comb(3).reverse.join(',')
20:57 camelia rakudo-moar 920295: OUTPUT«Cannot resolve caller comb(List: Int); none of these signatures match:␤    (Cool $: *%_)␤    (Cool $: Regex $matcher, $limit = Inf, *%_)␤    (Cool $: Str $matcher, $limit = Inf, *%_)␤  in block <unit> at <tmp> line 1␤␤»
20:58 Xliff m: my $a = "1000000"; say $a.reverse.comb(3)
20:58 camelia rakudo-moar 920295: OUTPUT«Cannot resolve caller comb(List: Int); none of these signatures match:␤    (Cool $: *%_)␤    (Cool $: Regex $matcher, $limit = Inf, *%_)␤    (Cool $: Str $matcher, $limit = Inf, *%_)␤  in block <unit> at <tmp> line 1␤␤»
20:58 Xliff m: my $a = "1000000"; say $a.reverse
20:58 camelia rakudo-moar 920295: OUTPUT«(1000000)␤»
20:58 Xliff Humm...
20:58 harmil_wk grondilu: all rationals are real. You're talking types, I'm talking ranges.
20:59 harmil_wk ℝ is not a type (even though the category theorists will try to assert that there's little difference)
21:00 cyphase joined #perl6
21:00 mvorg joined #perl6
21:00 grondilu well we do have Real, don't we?  Or maybe I'm not sure what your point is.
21:00 grondilu m: say pi ~~ Real; say 1i ~~ Real
21:00 camelia rakudo-moar 920295: OUTPUT«True␤False␤»
21:01 harmil_wk You're still talking about type comparisons. As you pointed out a Rat is not a Real, but the value you put in a Rat is a "real number".
21:01 grondilu oh yeah.
21:01 grondilu of course what I wrote above was inaccurate indeed
21:02 harmil_wk I find it interesting that pi is Real... I assumed it was a Rat too
21:02 grondilu well Real is a Role implemented by Rats
21:02 grondilu (IIRC)
21:03 harmil_wk I thought that was Rational and Rat was a class... maybe I have it backwards.
21:03 grondilu Perl6's Real is the closest you can get from math's concept of Real numbers.
21:04 MasterDuke m: my $a = "1000000"; say $a.flip.comb(3).reverse.join(',')
21:04 camelia rakudo-moar 920295: OUTPUT«1,000,000␤»
21:04 harmil_wk Yeah, it's definitely better than a machine float
21:04 MasterDuke Xliff: is that ^^^ what you were looking for?
21:04 grondilu it's a bit unfortunate that "Complex" is not the equivalent for complex numbers, if you ask me.
21:04 geekosaur Rat is class, Rational is role, Real is role (done by Rational)
21:04 grondilu m: say 1 ~~ Complex # arguably that should be true
21:04 camelia rakudo-moar 920295: OUTPUT«False␤»
21:04 harmil_wk $a.flip.comb ... I find myself thinking it should say, "aaaayyyyy" after that.
21:06 kyclark Is there a way to trigger the default USAGE from within a script?
21:06 skids joined #perl6
21:06 kyclark Also, could I add a statement to it?  E.g., “k must be positive”?
21:06 mcmillhj joined #perl6
21:06 timotimo m: say USAGE
21:06 camelia rakudo-moar 920295: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared name:␤    USAGE used at line 1␤␤»
21:07 timotimo m: say &*USAGE
21:07 camelia rakudo-moar 920295: OUTPUT«Dynamic variable &*USAGE not found␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
21:07 timotimo m: say $*USAGE
21:07 camelia rakudo-moar 920295: OUTPUT«Dynamic variable $*USAGE not found␤  in block <unit> at <tmp> line 1␤␤Actually thrown at:␤  in block <unit> at <tmp> line 1␤␤»
21:07 timotimo m: say $USAGE
21:07 camelia rakudo-moar 920295: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$USAGE' is not declared␤at <tmp>:1␤------> 3say 7⏏5$USAGE␤»
21:07 timotimo i don't even know
21:07 grondilu $?USAGE exists in the source
21:07 timotimo ah, that one
21:07 grondilu m: say $?USAGE
21:07 camelia rakudo-moar 920295: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$?USAGE' is not declared␤at <tmp>:1␤------> 3say 7⏏5$?USAGE␤»
21:07 grondilu lol
21:07 kyclark So I’ve declared a “subset PosInt of Int where * > 0;” and then I have “PosInt $k”
21:08 kyclark MAIN prints USAGE if I pass -k=-3, but it doesn’t say why
21:08 Wiertek joined #perl6
21:08 Xliff MasterDuke, LOL! That's actually pretty close to what I came up with.
21:08 grondilu kyclark: UInt exists in the core
21:08 Xliff m: "10000000".flip.comb(3).join(',').flip.say
21:08 camelia rakudo-moar 920295: OUTPUT«10,000,000␤»
21:08 grondilu m: say sub (UInt $) {}
21:08 camelia rakudo-moar 920295: OUTPUT«sub (Int $ where { ... }) { #`(Sub|69905928) ... }␤»
21:09 Xliff MasterDuke, I think I like yours better.
21:09 Xliff Thanks!
21:10 MasterDuke welcome
21:10 kyclark Hmm, UInt is good, thanks!
21:10 Xliff Ack!
21:10 Xliff MasterDuke...
21:10 Xliff m: my $a = "10000000"; say $a.flip.comb(3).reverse.join(',')
21:10 camelia rakudo-moar 920295: OUTPUT«01,000,000␤»
21:10 Xliff Mine gets that right.
21:11 Xliff *sob* -- the syntax of .flip.comb(3).reverse.join(',') sounds like it DWIM though!
21:11 Xliff m: "10000000".flip.comb(3).join(',').flip.say
21:11 camelia rakudo-moar 920295: OUTPUT«10,000,000␤»
21:11 Xliff m: "10000000".flip.comb(3).join(',')
21:11 camelia rakudo-moar 920295: ( no output )
21:11 Xliff m: "10000000".flip.comb(3).join(',').say
21:11 camelia rakudo-moar 920295: OUTPUT«000,000,01␤»
21:11 Xliff LOL
21:14 kyclark Can I “die” without the trace info?
21:14 masak kyclark: you can "note" and then "exit"
21:15 kyclark OK
21:15 masak probably exit(1) or some other nice non-zero exit code
21:16 mcmillhj joined #perl6
21:17 Xliff m: "3859486323".flip.comb(3).join(',').say
21:17 camelia rakudo-moar 920295: OUTPUT«323,684,958,3␤»
21:17 Xliff m: "3859486323".flip.comb(3).join(',').flip.say
21:17 camelia rakudo-moar 920295: OUTPUT«3,859,486,323␤»
21:19 Xliff ARGH! This gets complex with floating point.
21:19 Xliff m: "3859486323.81".flip.comb(3).join(',').flip.say
21:19 camelia rakudo-moar 920295: OUTPUT«3,859,486,323,.81␤»
21:20 Xliff m: "3859486323.81667".flip.comb(3).join(',').flip.say
21:20 camelia rakudo-moar 920295: OUTPUT«3,859,486,323,.81,667␤»
21:20 perlpilot why the spurious quotes?  :)
21:21 MasterDuke m: "3859486323.81667".flip.comb(3).join(,).flip.say
21:21 camelia rakudo-moar 920295: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Preceding context expects a term, but found infix , instead␤at <tmp>:1␤------> 3"3859486323.81667".flip.co​mb(3).join(,7⏏5).flip.say␤»
21:22 MasterDuke don't think any of the quotes are spurious?
21:22 geekosaur quotes around the number are superfluous (Cool)
21:22 grondilu m: say 1i.im
21:22 camelia rakudo-moar 920295: OUTPUT«1␤»
21:22 MasterDuke m: 3859486323.81667 .flip.comb(3).join(',').flip.say
21:22 camelia rakudo-moar 920295: OUTPUT«3,859,486,323,.81,667␤»
21:23 MasterDuke m: 3859486323.81667.flip.comb(3).join(',').flip.say
21:23 camelia rakudo-moar 920295: OUTPUT«3,859,486,323,.81,667␤»
21:23 grondilu since we were talking about it, couldn't we define Complex as a role and have Real implement it?   Something like role Real does Complex { method im { 0 } }
21:24 MasterDuke only since the flip comes first, couldn't comb() directly after
21:24 MasterDuke m: 3859486323.81667.comb(3).join(',').flip.say
21:24 camelia rakudo-moar 920295: OUTPUT«Cannot resolve caller comb(Rat: Int); none of these signatures match:␤    (Cool $: *%_)␤    (Cool $: Regex $matcher, $limit = Inf, *%_)␤    (Cool $: Str $matcher, $limit = Inf, *%_)␤  in block <unit> at <tmp> line 1␤␤»
21:24 MasterDuke m: 3859486323.81667 .comb(3).join(',').flip.say
21:24 camelia rakudo-moar 920295: OUTPUT«Cannot resolve caller comb(Rat: Int); none of these signatures match:␤    (Cool $: *%_)␤    (Cool $: Regex $matcher, $limit = Inf, *%_)␤    (Cool $: Str $matcher, $limit = Inf, *%_)␤  in block <unit> at <tmp> line 1␤␤»
21:25 sno joined #perl6
21:26 mcmillhj joined #perl6
21:26 MilkmanDan joined #perl6
21:29 trnh joined #perl6
21:29 trnh joined #perl6
21:36 AlexDaniel joined #perl6
21:37 perlpilot btw, does RosettaCode have a commify routine?  It probably should
21:37 perlpilot (hint, hint :)
21:37 pierre_ joined #perl6
21:37 grondilu what's "commify"?
21:38 perlpilot http://docstore.mik.ua/orell​y/perl/cookbook/ch02_18.htm
21:39 perlpilot It was actually an example in Programming Perl IIRC
21:39 grondilu all languages will probably use this very regex, though.
21:39 grondilu so it's of relatively little interest for RosettaCode
21:40 grondilu IMHO
21:40 perlpilot perhaps
21:41 grondilu feel free to make a draft task though.  It's quite easy to do.
21:55 grondilu m: role C {...}; role R does C { method b returns C { C } }; role C { method a returns R {...}; method b returns R {...} }; # testing if circularity
21:55 camelia rakudo-moar 920295: ( no output )
21:55 grondilu .=trans(C => "Complex", R => "Real")
21:57 grondilu I mean I remember being annoyed when I had to explicity convert an Int to Complex when feeding a function that accepted Complex arguments.  That should not be so.
21:57 cyphase joined #perl6
21:57 grondilu m: sub (Complex $z) { say "$z" }(1)
21:57 camelia rakudo-moar 920295: OUTPUT«Type check failed in binding to $z; expected Complex but got Int (1)␤  in sub  at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
21:57 grondilu ^that's LTA if you ask me
21:58 grondilu "expected Complex but got Int"   <-- that's just embarassing, really.
21:58 geekosaur I think you just proved your point about having a Complex role
22:00 masak numeric types not matching type-wise the way they naturally embed math-wise continues to be a surprise to people at all levels of Perl 6... :)
22:01 geekosaur it does seem not-Perl-ish
22:01 geekosaur in Haskell it makes perfect sense
22:01 grondilu masak: yes TimToady once told me the same thing.  I'm just not still convinced.
22:01 masak not trying to convince anyone of anything right now
22:02 masak just stating a fact about surprise
22:02 grondilu rather he told me that was a conscious decision not to nest numeric types as in maths or something.
22:03 masak well, I do think it's a very Liskov notion to say that an Int isn't a type of Rat
22:03 masak nor is a Rat a type of Num
22:04 masak you might argue that Perl 6 comes at it from how the types are represented (efficiently), not how they nest mathematically
22:05 El_Che still about the errors: does rakudo only output utf8 errors? I am thinking of ⏏ (I tried using LANG C and stuff and it looks like utf8 only)
22:06 grondilu one day, if I ever find time and courage, I'll rewrite the whole thing with roles and stuff, and see if that runs the spectests and if we lose any performance.
22:06 geekosaur performance is likely to suffer, yes
22:08 masak grondilu: also consider things like `if $n ~~ Rat`, but then it's actually an Int, but under your regime suddenly it matches True
22:09 MilkmanDan joined #perl6
22:11 grondilu not that I doubt there is any, but I'm struggling to see an example of use case where you really want to check that a variable is really a Rat and not an Int.
22:12 Wiertek joined #perl6
22:14 mcmillhj joined #perl6
22:15 masak grondilu: I'm just pointing out that there's the risk of people writing `if $n ~~ Rat` while not considering that Int would be included in that check.
22:15 grondilu also in any case you could write if $n.denominator !== 1
22:15 masak yes, but you'd *have to*, that's my point
22:15 grondilu true
22:15 masak for all its faults, with the current factoring, you don't have to do anything like that
22:16 masak you also don't have to live in a world where an Int has a .denominator :)
22:16 grondilu but they do :/
22:17 masak I'm almost ready to classify that response as some kind of Stockholm syndrome
22:17 masak but let's call it a simple disagreement for now ;)
22:18 grondilu I do see how that's can be confusing though.  To be frank none of the points of view entirely satisfy me.
22:22 masak fair enough
22:28 mcmillhj joined #perl6
22:29 [Coke] (numeric types not the same hier as maths) could be done in a Math:: module.
22:33 kyclark I just wrote up a section on types.  I’d appreciate any input.  https://kyclark.gitbooks.io/me​tagenomics/content/types.html
22:34 grondilu [Coke]: in order to be useful such a module would have to override literals.  That can be tough to write.
22:35 Zoffix left #perl6
22:39 masak you could override literals in a slang
22:40 Piotr joined #perl6
22:41 skids joined #perl6
22:43 grondilu yes.  I'll try that one of these days.
22:45 mcmillhj joined #perl6
22:56 lizmat joined #perl6
23:05 harmil_wk m: class Foo is Range { multi method new(:$min=0, :$max=10, :$excludes-min = True, :$excludes-max = False) { nextwith :$min, :$max, :$excludes-min, :$excludes-max } }; say Foo.new.excludes-min
23:05 camelia rakudo-moar 920295: OUTPUT«False␤»
23:05 harmil_wk How can that be false? I'm setting it to True...
23:11 geekosaur m: my $s = Range.new(:min(0), :max(10), :excludes-min, :!excludes-max); say so $s.excludes-min
23:11 camelia rakudo-moar 920295: OUTPUT«False␤»
23:11 jack_rabbit joined #perl6
23:11 masak m: say Range.new(:excludes-min(True)).excludes-min
23:11 camelia rakudo-moar 920295: OUTPUT«False␤»
23:11 geekosaur I suspect excludes-min is not a keyword parameter to the Range constructor, so does nothing when nextsame-d
23:11 geekosaur and theres no sane way to report "no constructor along the build plan used this keyword"
23:12 geekosaur (sadly)
23:12 geekosaur er nextwith-d
23:12 kurahaupo joined #perl6
23:16 DrParis joined #perl6
23:16 masak 'night, #perl6
23:17 japhb Good night, masak!
23:17 japhb Sleep well ...
23:33 mcmillhj joined #perl6
23:34 Wiertek joined #perl6
23:38 timotimo we alaread have a slang that lets you override literals

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

Perl 6 | Reference Documentation | Rakudo