Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-07-16

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:02 BrassLantern joined #perl6
00:18 Zoffix It's so quiet.... You could download the sound of a pin dropping...
00:23 TEttinger sprint!
00:34 dj_goku ........|
01:10 BenGoldberg_ joined #perl6
01:13 labster joined #perl6
01:14 Zoffix If you are "neuron", "ianmcb", and "LLFourn" wish to use their full names instead of nicknames in this month's Rakudo's contributors list, let me know.
01:14 Zoffix llfourn, ping ^
01:31 huggable joined #perl6
01:37 silug joined #perl6
01:47 ilbot3 joined #perl6
01:47 Topic for #perl6 is now »ö« Welcome to Perl 6! | https://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  or /msg camelia p6: ... | irclog: http://irc.perl6.org or http://colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend!
01:51 TEttinger Zoffix, that's their real name, it's welsh
01:52 TEttinger it's pronounced by wrapping your tongue around your left eye and sneezing
01:54 kalkin-_ joined #perl6
01:54 jdv79 could you demonstrate?
01:56 TEttinger I haven't made my sacrifice to Wlldrkrrl today
01:58 MasterDuke joined #perl6
02:06 Zoffix Ah :) OK then :)
02:14 itaipu joined #perl6
02:19 dalek bisectbot: 6f9e9a6 | (Daniel Green)++ | benchable.pl:
02:19 dalek bisectbot: Discard STDOUT and round timing results
02:19 dalek bisectbot: review: https://github.com/perl6/bisectbot/commit/6f9e9a6430
02:28 Khisanth joined #perl6
02:35 dalek bisectbot: b56e519 | (Daniel Green)++ | benchable.pl:
02:35 dalek bisectbot: Add missing initial '|' from error output
02:35 dalek bisectbot: review: https://github.com/perl6/bisectbot/commit/b56e519a66
02:43 Madcap^Jake^ joined #perl6
02:44 noganex_ joined #perl6
02:49 dalek bisectbot: f579c64 | (Daniel Green)++ | benchable.pl:
02:49 dalek bisectbot: Better associate errors with the commit they came from
02:49 dalek bisectbot: review: https://github.com/perl6/bisectbot/commit/f579c641bf
02:57 Tonik joined #perl6
03:00 Tonik I write
03:00 Tonik my $a = 42;
03:00 Tonik my $b := $a;
03:00 Tonik ... and I do some awesome stuff ...
03:00 Tonik but then I want $b to become a happy free variable again, not bound to $a.  How do I do that without touching $a?
03:02 AlexDaniel great question
03:02 Zoffix Bind it to something else?
03:02 * geekosaur just tried Scalar.new but it doesn't like that
03:02 Zoffix m: my $a = 42; my $b := $a; $b = 72; say $a; my $z = 42; $b := $z; $b = 'meow'; say $a
03:02 camelia rakudo-moar e2ec35: OUTPUT«72␤72␤»
03:02 AlexDaniel Zoffix: what if you want $b = 42 without binding?
03:03 Zoffix TBH, there's likely a much better solution to Tonik's problem.
03:03 Tonik Zoffix, $b wants to be on its own, not bound to anyone :(
03:03 Zoffix Tonik, why?
03:04 Tonik because if it can't, it will feel something is wrong with Perl 6
03:04 Zoffix :/
03:04 Zoffix Very well then.
03:04 konobi yeah, you'd just use a different variable in real life, no?
03:05 konobi but it's probably doable
03:06 geekosaur hack alert
03:07 geekosaur m: my $a = 4; my $b := $a; $b = 6; say $a; $b := $; $b = 2; say $a; say $b;
03:07 camelia rakudo-moar e2ec35: OUTPUT«6␤6␤2␤»
03:07 Tonik I've been trying to wrap my mind around the idea of binding in Perl 6, and I almost convinced myself it makes sense, until I found out you can rebind what's already been bound, and it all fell apart for me.  Seems that every variable is in fact a pointer, but you don't get to enjoy the full power of pointers as in other languages, and these pointers are shoved down your throat whether you want it or not
03:07 konobi well, everything's a reference
03:08 Tonik except "my $a := 42" which is not, right?
03:08 AlexDaniel wait, um… if you don't want to rebind then just don't? Doctor, it hurts when I do this…
03:10 konobi Tonik: https://github.com/rakudo/rakudo/blob/nom/src/core/Variable.pm
03:11 konobi so gotta be able to do it somehow =0)
03:11 * geekosaur points up at hack
03:11 geekosaur an alternative would be for Scalar.new to not produce Nil...
03:13 geekosaur well, actually, the hack will lose if it's used in a scope that gets re-entered at some point, since $ will use the same Scalar each time whereas $a will be a new one each time, so not 100% the same behavior
03:15 Tonik geekosaur, uh, what is $ ?
03:15 geekosaur anonymous state variable
03:15 geekosaur (like a C `static`)
03:16 konobi geekosaur: seems to me like a lot of that sort of state management would be a pretty interesting pattern for IOC
03:16 Tonik I see
03:17 geekosaur but since it's anonymous, every use of `$` is distinct; so if you did `$b := $; $c := $;` then each one gets its own `state` variable which will be reused every time the scope is re-entered
03:19 geekosaur would have to figure out how to bind it to a new Scalar to avoid this (which currently throws)
03:19 geekosaur m: my $a = 4; my $b := $a; $b = 6; say $a; $b := Scalar.new; $b = 2; say $a; say $b;
03:19 camelia rakudo-moar e2ec35: OUTPUT«6␤Cannot call method 'BUILDALL' on a null object␤  in block <unit> at <tmp> line 1␤␤»
03:20 geekosaur (I suspect it can be made to work but Scalar.new needs more information, which if I had to guess is an initial content --- but it also does not take positionals. so I'd have to dig into implementation of Scalar to see what to feed it)
03:21 konobi could you apply a role to the instance of the Scalar and override the scope?
03:23 konobi *blink* could do some crazy stuff
03:23 adu joined #perl6
03:24 kid51 joined #perl6
03:25 * geekosaur looks at Scalar impl and gets a headache --- need to create a Perl6::Metamodel::ContainerDescriptor, then the Scalar with named parameters descriptor and value
03:25 gfldex konobi: could can't get hold of an instance of scalar. There is no way to tell the compiler you are talking to the container. There is Proxy tho.
03:25 adu TimToady!
03:28 Zoffix Would be neat if bisectable could bisect hangs.
03:28 Zoffix Can it take a gist?
03:29 AlexDaniel sure
03:29 Tonik if some of you guys have a sensible visual representation of what a scalar is and how binding works, please share it with me
03:30 Tonik or draw it on a piece of paper and show it to me
03:30 Zoffix ," https://gist.githubusercontent.com/zoffixznet/1b371fb8c4624aa662d622e685d6e950/raw/d42b6046679b369cbb0faa4dcefde97b5f66d0f5/gistfile1.txt
03:30 Zoffix bisect: https://gist.githubusercontent.com/zoffixznet/1b371fb8c4624aa662d622e685d6e950/raw/d42b6046679b369cbb0faa4dcefde97b5f66d0f5/gistfile1.txt
03:31 bisectable Zoffix: Successfully fetched the code from the provided URL.
03:31 bisectable Zoffix: Exit code is 1 on both starting points, bisecting by using the output
03:31 bisectable Zoffix: bisect log: https://gist.github.com/1314ad2dec81edc86f9ddaa94eb64bc8
03:31 bisectable Zoffix: (2015-12-25) https://github.com/rakudo/rakudo/commit/07fecb5
03:31 Zoffix Tonik, there's Containers page on docs. It may be useful: https://docs.perl6.org/language/containers
03:31 Tonik nono, I want to know how *you*  *visualize* it
03:31 adu Tonik: "scalar"?
03:31 Zoffix I don't use binding.
03:32 * Tonik sighs
03:32 adu Tonik: my personal definition of scalar is "not deep"
03:32 gfldex Zoffix: you do use binding by calling subs and methods
03:33 gfldex my personal definiton of scalar is "double indirection". Also somebody else wrote that scalars are object the forward pretty much all their methods to another object.
03:34 Tonik gfldex, double indirection sounds about right :(
03:34 geekosaur the "natural" state of a name is to bind to something. if you bind it to a value, the name is readonly. if you bind it to a container, the name is read-write and you can store values in the container and replace them with new values. `=` stores a new value in a container (and throws if it's not bound to a container). `:=` binds to something else, which may be a container from some other place.
03:35 gfldex don't look so much at := and ::= to understand binding. Look at signatures and calls.
03:35 gfldex also, default values.
03:35 Tonik hm.  what is ::= ?
03:36 gfldex compile time binding
03:36 Tonik oh
03:36 geekosaur it makes a reasonable amount of sense to me, but then I program in Haskell so I have a clear distinction between the concepts to start with :)
03:36 gfldex m: my Int $i = Failure.new('Dude, I'm empty!'); say $i;
03:36 camelia rakudo-moar e2ec35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' ␤at <tmp>:1␤------> 3my Int $i = Failure.new('Dude, I'7⏏5m empty!'); say $i;␤    expecting any of:␤        infix␤        i…»
03:37 gfldex m: my Int $i is default Failure.new('Dude, I'm empty!'); say $i;
03:37 camelia rakudo-moar e2ec35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3my Int $i is default7⏏5 Failure.new('Dude, I'm empty!'); say $i␤    expecting any of:␤        constraint␤        infix␤        infix stopper␤       …»
03:37 gfldex m: my Int $i = 1is default Failure.new('Dude, I'm empty!'); say $i;
03:37 camelia rakudo-moar e2ec35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 3my Int $i = 17⏏5is default Failure.new('Dude, I'm empty!␤»
03:37 gfldex m: my Int $i = 1 is default Failure.new('Dude, I'm empty!'); say $i;
03:37 camelia rakudo-moar e2ec35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3my Int $i = 17⏏5 is default Failure.new('Dude, I'm empty␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement…»
03:37 Tonik "::=" not yet implemented. Sorry.
03:37 * Tonik sighs
03:37 gfldex m: my Int $i is default Failure.new('Dude, I'm empty!') = 1; say $i;
03:37 camelia rakudo-moar e2ec35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3my Int $i is default7⏏5 Failure.new('Dude, I'm empty!') = 1; sa␤    expecting any of:␤        constraint␤        infix␤        infix stopper␤       …»
03:37 geekosaur doesn't is default require some kind of parens/braces? (i.e. it is syntactically an adverb)
03:39 Zoffix It's a trait
03:39 Zoffix m: my Int $i is default(Failure.new: 'Dude, Im empty!') = 1;
03:39 camelia rakudo-moar e2ec35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Default value '(HANDLED) Dude, Im empty!␤  in any  at src/Perl6/World.nqp line 2199␤  in any trait_mod:sym<is> at gen/moar/m-Perl6-Actions.nqp line 5056␤  in any trait_mod:sym<is> at src/Perl6/Grammar.…»
03:40 gfldex m: my Int $i is default(42); $i = 10; $i = Nil; say $i;
03:40 camelia rakudo-moar e2ec35: OUTPUT«42␤»
03:41 gfldex m: my $i is default(Failure.new("Dude, I'm empty!")) = 1; say $i;
03:41 camelia rakudo-moar e2ec35: OUTPUT«1␤»
03:41 gfldex m: my $i is default(Failure.new("Dude, I'm empty!")); say $i;
03:41 camelia rakudo-moar e2ec35: OUTPUT«===SORRY!===␤Dude, I'm empty!␤»
03:42 gfldex the type constraint seams to peek into the container and triggers the Failure
03:43 gfldex m: my Int $i is default(Nil);
03:43 camelia rakudo-moar e2ec35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Default value 'Nil' will never bind to a parameter of type Int␤at <tmp>:1␤------> 3my Int $i is default(Nil)7⏏5;␤    expecting any of:␤        constraint␤»
03:44 gfldex m: my $i is default(Nil);
03:44 camelia rakudo-moar e2ec35: ( no output )
03:44 gfldex m: my $i is default(Nil); dd $i;
03:44 camelia rakudo-moar e2ec35: OUTPUT«Nil $i = Nil␤»
03:44 Zoffix left #perl6
03:44 gfldex ha! I finally found a way to hold onto Nil. :)
03:44 gfldex that leaves the question if that is sensible to allow
03:45 rgrinberg joined #perl6
04:00 dalek bisectbot: a8df0e3 | (Aleks-Daniel Jakimenko-Aleksejev)++ | benchable.pl:
04:00 dalek bisectbot: Oops, restore server
04:00 dalek bisectbot: review: https://github.com/perl6/bisectbot/commit/a8df0e374d
04:02 benchable joined #perl6
04:02 jsimonet joined #perl6
04:13 BrassLantern joined #perl6
04:17 MasterDuke benchable: HEAD~50..HEAD my $a = "a" x 2**16;my $b = $a.chop($_) for ^1000
04:18 cpage__ joined #perl6
04:19 benchable MasterDuke: https://gist.github.com/0d621f847cc2b80db181cee77d20c71b
04:20 AlexDaniel benchable: 2015.10,2016.02,2016.04,HEAD my $a = "a" x 2**16;my $b = $a.chop($_) for ^5000
04:20 benchable AlexDaniel: |«2015.10»:1.1509␤|«2016.02»:1.0659␤|«2016.04»:1.0590␤|«HEAD»:1.1272
04:24 djbkd joined #perl6
04:26 dalek bisectbot: f763de7 | (Aleks-Daniel Jakimenko-Aleksejev)++ | / (2 files):
04:26 dalek bisectbot: Fix encoding issue
04:26 dalek bisectbot:
04:26 dalek bisectbot: get_output should probably decode automatically, but for now this is enough.
04:26 dalek bisectbot: review: https://github.com/perl6/bisectbot/commit/f763de76a5
04:28 dalek bisectbot: 57bd995 | (Aleks-Daniel Jakimenko-Aleksejev)++ | committable.pl:
04:28 dalek bisectbot: Oops, missed “use”
04:28 dalek bisectbot: review: https://github.com/perl6/bisectbot/commit/57bd9954f8
04:29 bisectable joined #perl6
04:29 committable joined #perl6
04:40 Cabanossi joined #perl6
04:58 holyghost joined #perl6
05:12 samb1 joined #perl6
05:29 CIAvash joined #perl6
05:31 huggable joined #perl6
05:40 cpage_ joined #perl6
05:42 wamba joined #perl6
06:05 furelypunctional joined #perl6
06:06 canopus joined #perl6
06:30 domidumont joined #perl6
06:35 domidumont joined #perl6
06:40 masak in a moment of weakness, I expected .prompt to be a method on $*IN, not just a global sub
06:41 masak now that I think about it, I'm not sure that was reasonable -- prompt() does involve both output and input
06:41 masak but I will not that I did expect it :)
06:41 masak note*
06:44 masak no big deal either way -- I'll solve what I wanted to do in a different way ;)
06:49 maddingue joined #perl6
06:58 darutoko joined #perl6
07:01 firstdayonthejob joined #perl6
07:03 donaldh joined #perl6
07:05 moritz could $*OUT.prompt($message, :readfrom($*IN))
07:05 moritz or $*IN.prompt($message, :out($*OUT))
07:09 canopus joined #perl6
07:18 Ulti lizmat++ another tenth of a second saving on my tests
07:21 domidumont joined #perl6
07:40 RabidGravy joined #perl6
08:07 Xliff_ Will .defined return true if scalar is set to a type object?
08:07 Xliff_ Always thought it returned false.
08:08 Xliff_ m: my $a = Str; say $a.defined;
08:08 camelia rakudo-moar e2ec35: OUTPUT«False␤»
08:08 Xliff_ And so it doesn't. Hmmm...
08:09 Xliff_ m: use NativeCall; class A does Str { }; my $a = nativecast(A, Str); say $a.defined;
08:09 camelia rakudo-moar e2ec35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Str is not composable, so A cannot compose it␤at <tmp>:1␤»
08:09 Xliff_ m: use NativeCall; class A does Int { }; my $a = nativecast(A, Int); say $a.defined;
08:09 camelia rakudo-moar e2ec35: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Int is not composable, so A cannot compose it␤at <tmp>:1␤»
08:09 Xliff_ Hrm.
08:19 FROGGS joined #perl6
08:21 FROGGS o/
08:35 rindolf joined #perl6
08:39 girafe joined #perl6
08:53 holyghost »ö«
09:01 Ven joined #perl6
09:10 wamba joined #perl6
09:21 masak »ö«
09:24 setty1 joined #perl6
09:31 huggable joined #perl6
09:36 Senji joined #perl6
09:39 TreyHarr1 joined #perl6
09:55 donaldh joined #perl6
09:55 espadrine joined #perl6
10:06 rindolf joined #perl6
10:53 Xliff_ FROGGS: \o
10:55 Xliff_ m: use NativeCast; class A is repr('CStruct') { }; class B does A { }; my $a = A; my $b = nativecast(B, $a); say $b.defined;
10:55 camelia rakudo-moar cd19db: OUTPUT«===SORRY!===␤Could not find NativeCast at line 1 in:␤    /home/camelia/.perl6␤    /home/camelia/rakudo-m-inst-1/share/perl6/site␤    /home/camelia/rakudo-m-inst-1/share/perl6/vendor␤    /home/camelia/rakudo-m-inst-1/share/perl6␤    CompUnit::Re…»
10:55 Xliff_ m: use NativeCall; class A is repr('CStruct') { }; class B does A { }; my $a = A; my $b = nativecast(B, $a); say $b.defined;
10:55 camelia rakudo-moar cd19db: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤A is not composable, so B cannot compose it␤at <tmp>:1␤»
10:55 Xliff_ m: use NativeCall; class A is repr('CStruct') { has int32 $.a }; class B does A { }; my $a = A; my $b = nativecast(B, $a); say $b.defined;
10:55 camelia rakudo-moar cd19db: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤A is not composable, so B cannot compose it␤at <tmp>:1␤»
10:56 Xliff_ m: use NativeCall; class A is repr('CStruct') { has int32 $.a }; class B is A { }; my $a = A; my $b = nativecast(B, $a); say $b.defined;
10:56 camelia rakudo-moar cd19db: OUTPUT«Internal error: unhandled target type␤  in sub nativecast at /home/camelia/rakudo-m-inst-1/share/perl6/sources/24DD121B5B4774C04A7084827BFAD92199756E03 (NativeCall) line 406␤  in block <unit> at <tmp> line 1␤␤»
10:57 jnthn Xliff_: At a guess, you'd need to mark B as "is repr('CStruct')" too for that to work
10:57 Xliff_ m: use NativeCall; class A is repr('CStruct') { has int32 $.a }; class B is A is repr('CStruct') { }; my $a = A; my $b = nativecast(B, $a); say $b.defined;
10:57 camelia rakudo-moar cd19db: OUTPUT«False␤»
10:57 Xliff_ jnthn: Yep. Thanks.
10:57 jnthn Also, you can factor things out in to roles and compose those into classes marked "is repr('CStruct')" if you like
10:58 jnthn Since composition is flattening, that should Just Work.
10:58 Xliff_ jnthn: Thanks! That's good to know.
10:58 Xliff_ Right now I'm trying to figure out why certain routines seem to be returning type objects even though they've gone through a .defined check.
10:59 Xliff_ So far every use case I've tried through camelia seems to work fine, but in my code it doesn't. Must be missing something.
11:04 jnthn Odd... Guess it's a case of trying to boil it down to the smallest possible test case...
11:19 kid51 joined #perl6
11:21 girafe joined #perl6
11:23 timotimo also, just to make sure it's not something wonky in spesh or something, try MVM_SPESH_DISABLE=yesplease
11:40 pmurias joined #perl6
11:42 pmurias .tell konobi using v8-profiler and loading the profiles in chrome turned out the thing I needed for profiling
11:42 yoleaux pmurias: I'll pass your message to konobi.
11:42 pmurias do we have an API for profiling things?
11:43 pmurias that is for turning profiling on from Perl6/NQP code?
11:43 cpage_ joined #perl6
11:46 timotimo we do for moarvm
11:46 timotimo but it's just two ops
11:48 girafe2 joined #perl6
11:48 TreyHarr1 joined #perl6
11:55 masak moritz: I'd argue that .prompt is "more" a method on $*IN than on $*OUT, since $message is optional but the .get is not ;)
12:09 pmurias timotimo: how are they used?
12:10 jnthn pmurias: I think the most natural way would be to nqp::getcomp('perl6').eval('some code', :profile(1)) or some such
12:11 jnthn pmurias: (Which already should work, or something close to it)
12:11 jnthn See run_profiled in the MoarVM Backend.nqp in the NQP repo for how it's done
12:11 jnthn In fact, you can probably use nqp::getcomp('perl6').backend.run_profiled($code_object)
12:12 jnthn (Note, method names from memory, may not 100% match reality ;))
12:27 amoe_ joined #perl6
12:37 pmqs_ joined #perl6
12:56 BenGoldberg_ joined #perl6
13:00 avenj joined #perl6
13:00 avenj joined #perl6
13:01 dogbert17 it's very quiet around here, is everyone out tapping their beer supplies
13:02 dogbert17 m: say 'a b' ~~ /a b/
13:02 camelia rakudo-moar 88c35e: OUTPUT«Potential difficulties:␤    Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)␤    at <tmp>:1␤    ------> 3say 'a b' ~~ /a7⏏5 b/␤Nil␤»
13:03 dogbert17 do we really need to list this as a trap when we get this warning? https://docs.perl6.org/language/traps#Regexes
13:10 MasterDuke IMHO, yes. Perl 5 regexes are almost muscle memory now, but i have to stop and think about Perl 6 syntax. anything to warn people ahead of time is good
13:12 psch the warning somewhat goes against /x as default
13:12 dogbert17 MasterDuke: perl6 does warn you, but the text implies that is does not, perhaps it needs to be rephrased a bit
13:13 psch and perl5 doesn't warn on 'say "foo" =~ / f o o /x'
13:13 psch (yes, i had to check :P )
13:15 psch which is to say i'd rather like the warning to go and only keep it around in language/traps
13:16 psch m: $ = quietly / a b / # especially as it's not quietly-able
13:16 camelia rakudo-moar 88c35e: OUTPUT«Potential difficulties:␤    Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)␤    at <tmp>:1␤    ------> 3$ = quietly / a7⏏5 b / # especial…»
13:16 dogbert17 that's one way I guess. to me it seems that the warning was added after the text was written
13:16 sammers joined #perl6
13:18 pmurias joined #perl6
13:20 pmurias are the situations where you want use /a b/ instead of /ab/ common?
13:21 psch matching any continuous over an (arbitrary) length of 40 chars in a regex is where it applies
13:21 psch i don't know how common that is, but i also don't think that "how common" matters for my argument
13:22 holyghost joined #perl6
13:22 psch but i also don't really feel strongly about it
13:22 psch it just seems weird to me that we "force" /x on people and complain when they use it to its full extend
13:22 jnthn m: no worries; / a b /
13:22 camelia rakudo-moar 88c35e: OUTPUT«Potential difficulties:␤    Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)␤    at <tmp>:1␤    ------> 3no worries; / a7⏏5 b /␤»
13:22 jnthn Hm, I'd have expected that to suppress it
13:28 kurahaupo joined #perl6
13:30 holyghost joined #perl6
13:31 huggable joined #perl6
13:35 pmurias psch: "how common" matters a lot for warnings, what the warning is IMHO intented to catch is people assuming :sigspace is in effect when it's not
13:43 psch pmurias: as i said, i don't think that matters for my argument
13:43 skids joined #perl6
13:43 psch pmurias: i mean, the intend behind making all regexen assume /x semantic is to allow arbitrary whitespace
13:43 psch pmurias: and then we complain about arbitrary whitespace, which just seems weird
13:44 psch but, as also said, i don't feel strongly about it
13:48 cpage joined #perl6
13:49 cpage__ joined #perl6
13:49 pmurias psch: warnings are for things that are allowed but confusing/seem to be a mistake, for things that are not allowed we have errors
13:51 psch m: /a b+/ # i want to seperate, purposefully, for clarity
13:51 camelia rakudo-moar 88c35e: OUTPUT«Potential difficulties:␤    Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing)␤    at <tmp>:1␤    ------> 3/a7⏏5 b+/ # i want to seperate, p…»
13:51 psch because ab+ is easily misunderstood as "ab"+
13:51 psch having to silence the warning by rewriting that just makes it worse
13:52 psch granted, if we could silence it that particular case stops being valid
13:52 psch but we can't
13:52 psch m: say "foo" or "bar" # why aren't we warning here?
13:52 camelia rakudo-moar 88c35e: OUTPUT«foo␤»
13:52 * psch stops now
13:52 psch i'm getting way to invested :)
13:56 masak because for all the compiler knows, `say` might return something falsy, which makes the rhs of the `or` run
14:05 TreyHarr1 joined #perl6
14:05 kaare_ joined #perl6
14:12 dogbert17 m: sub postfix:<!>(Int $x where { $x >= 0 }) { [*] 1..$x }; say 5! # oddball question, but why does this take almost one sec to parse
14:12 camelia rakudo-moar cd4265: OUTPUT«120␤»
14:13 rgrinberg joined #perl6
14:15 moritz dogbert17: adding new operators is fairly expensive, because rakudo has to re-calculate the finite statement machines for the regex engine
14:15 moritz dogbert17: but it surprises me that it takes almost a second
14:15 Xliff_ timotimo, what is spesh?
14:16 moritz Xliff: just-in-time specialization of code
14:17 moritz things like eliminating unecessary type checks, containers etc.
14:17 timotimo yup
14:17 Xliff kk
14:17 dogbert17 moritz: on my machine, (old i5) it takes ~0.9 sec
14:18 moritz 0.5s here
14:18 dogbert17 moritz: do you have an i7?
14:18 moritz dogbert17: I think so
14:19 canopus joined #perl6
14:19 dogbert17 moritz: compare with this, takes 0.13 sec for me: ulti minfix:<+>(Int $x, "same") { 2 * $x };
14:19 moritz if I change it to a regular sub, it takes 0.17s instead
14:19 dogbert17 aha, interesting
14:20 moritz infix:<+> already exists, so no parser changes required there
14:20 dogbert17 ah, didn't think of that
14:26 Xliff If I have a base class that has attributes, and a descendent class that wants to set them, how would I do that?
14:27 Xliff Example: class A { has $.a }; class B is A { setA { # Want to set class A's $!a here } }
14:27 Xliff I think I've asked this before but...
14:27 Xliff Right now both are repr('CStruct') so I can use nativecast() to access the super, but I don't think that's a wise long-term solution.
14:28 timotimo did someone recommend mixing in a role yet? :)
14:29 gfldex m: class B {...}; class A { has $!foo = 42; trusts B; method say { put $!foo } }; class B is A { method m(){ $A::foo = "answer"; } }; B.new.m.say
14:29 camelia rakudo-moar cd4265: OUTPUT«answer␤»
14:30 gfldex Xliff: ^^^ (there may be dragons)
14:31 Xliff gfldex: Thanks. Will try. Would prefer to see an example without "has $!att"
14:31 Xliff And that doesn't need trust.
14:31 Xliff But then again, beggars can't be choosers.
14:31 gfldex m: class A { has $.foo = 42; method say { put $!foo } }; class B is A { method m(){ $A::foo = "answer"; } }; B.new.m.say
14:31 camelia rakudo-moar cd4265: OUTPUT«answer␤»
14:31 gfldex there you go
14:31 Xliff LOL
14:31 timotimo does the attribute really have to be private?
14:32 Xliff My attributes are not private.
14:32 gfldex :->
14:32 timotimo in that case, why don't you just $.foo = 10?
14:32 Xliff Rakudo doesn't let me.
14:32 Xliff Says attribute is not found.
14:32 timotimo please share the code where that errors?
14:33 khw joined #perl6
14:33 Xliff Let me see if I can create a use case, timotimo
14:34 timotimo thanks
14:34 timotimo because what you're describing sounds a bit like a bug
14:36 ggoebel joined #perl6
14:38 Xliff Attribute $!intSubset not declared in class XML::LibXML::Document
14:39 Xliff But $!intSubset is declared in xmlDoc, and class XML::LibXML::Document is xmldoc.
14:39 Xliff Er...
14:39 Xliff class XML::LibXML::Document is xmlDoc.
14:40 Xliff https://github.com/Xliff/p6-XML-LibXML/blob/07dtd/lib/XML/LibXML/CStructs.pm#L95 <- xmlDoc def
14:41 Xliff https://github.com/Xliff/p6-XML-LibXML/blob/07dtd/lib/XML/LibXML/Document.pm#L18 <- XML::LibXML::Document def
14:43 Xliff https://github.com/Xliff/p6-XML-LibXML/blob/07dtd/lib/XML/LibXML/Document.pm#L527 <- Line causing error.
14:43 Xliff timotimo, sorry to be throwing the kitchen sink at you, but every time I've tried to pair this down to something small, it doesn't reproduce.
14:43 kid51 joined #perl6
14:43 Xliff One moar time...
14:43 kid51 joined #perl6
14:43 timotimo oh
14:43 timotimo it's a regular class and the derived class is a cstruct?
14:44 Xliff Both classes are CStructs
14:44 timotimo i don't see the CStruct for xmlDoc
14:44 Xliff One is barebones for some nativecall routines other is full object rep.
14:45 timotimo when you have the superclass p6opaque and the subclass cstruct, i don't know how that behaves
14:45 Xliff timotimo: that is part of the predef... https://github.com/Xliff/p6-XML-LibXML/blob/07dtd/lib/XML/LibXML/CStructs.pm#L24
14:46 timotimo oh, ok
14:46 timotimo i haven't used derived classes with cstruct yet, but i thought it'd Just Work™
14:47 Xliff m class A { has $.a }; class B is A { setA($a) { $!a = $a } }; my $b = B.new; $b.setA(42); say $b.a;
14:47 Xliff m: class A { has $.a }; class B is A { setA($a) { $!a = $a } }; my $b = B.new; $b.setA(42); say $b.a;
14:47 camelia rakudo-moar cd4265: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$a' is not declared␤at <tmp>:1␤------> 3lass A { has $.a }; class B is A { setA(7⏏5$a) { $!a = $a } }; my $b = B.new; $b.se␤»
14:47 Xliff m: class A { has $.a }; class B is A { method setA($a) { $!a = $a } }; my $b = B.new; $b.setA(42); say $b.a;
14:47 camelia rakudo-moar cd4265: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Attribute $!a not declared in class B␤at <tmp>:1␤------> 3 B is A { method setA($a) { $!a = $a } }7⏏5; my $b = B.new; $b.setA(42); say $b.a;␤    expecting any of:␤        horizontal whitespace…»
14:47 Xliff ^^^
14:48 Xliff m: class A { has $.a }; class B is A { method setA($a) { $A::a = $a } }; my $b = B.new; $b.setA(42); say $b.a;
14:48 camelia rakudo-moar cd4265: OUTPUT«(Any)␤»
14:48 Xliff O_o
14:48 Xliff What did I miss?
14:48 ggoebel_ joined #perl6
14:49 mtj_ joined #perl6
14:49 Xliff m: class A { has $.a }; class B is A { method setA($a) { $A!a = $a } }; my $b = B.new; $b.setA(42); say $b.a;
14:49 camelia rakudo-moar cd4265: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '$A' is not declared. Did you mean '$a'?␤at <tmp>:1␤------> 3$.a }; class B is A { method setA($a) { 7⏏5$A!a = $a } }; my $b = B.new; $b.setA(42␤»
14:50 Xliff m: class A { has $.a }; class B is A { method setA($a) { $A::a = $a; say $a; } }; my $b = B.new; $b.setA(42); say $b.a;
14:50 camelia rakudo-moar cd4265: OUTPUT«42␤(Any)␤»
14:50 Xliff m: class A { has $.a }; class B is A { method setA($a) { $A::a = $a; say $a; say $.a; } }; my $b = B.new; $b.setA(42); say $b.a;
14:50 camelia rakudo-moar cd4265: OUTPUT«42␤(Any)␤(Any)␤»
14:51 Xliff m: class A { has $.foo = 42; method say { put $!foo } }; class B is A { method m(){ $A::foo = "answer"; } }; my $b = B.new; $b.m; say $b.foo
14:51 camelia rakudo-moar cd4265: OUTPUT«42␤»
14:51 Xliff Ah. And thus the dragon breathes fire.
14:52 Xliff The assignment to $A::foo is not setting the $.foo attribute.
14:55 Ven joined #perl6
14:56 gfldex m: class A { has $.a }; class B is A { method setA($a) { $A::a := $a; say $a; say $.a; } }; my $b = B.new; $b.setA(42); say $b.a;
14:56 camelia rakudo-moar cd4265: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Cannot use bind operator with this left-hand side␤at <tmp>:1␤------> 3s B is A { method setA($a) { $A::a := $a7⏏5; say $a; say $.a; } }; my $b = B.new; $␤»
14:57 gfldex $A::a is the accessor method, not the container
14:58 timotimo sorry, i'm quite distracted
14:59 timotimo why would you have to $A::a? the method is already public, so it's derived and can be called on self
15:00 gfldex m: class A is rw { has $.a = 42 }; class B is A { method setA($a) { $.a = $a; } }; my $b = B.new; $b.setA(42); say $b.a;
15:00 camelia rakudo-moar cd4265: OUTPUT«42␤»
15:00 gfldex Xliff: also ^^^
15:00 ggoebel joined #perl6
15:00 gfldex m: class A { has $.a = is raw 42 }; class B is A { method setA($a) { $.a = $a; } }; my $b = B.new; $b.setA(42); say $b.a;
15:00 camelia rakudo-moar cd4265: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routines:␤    is used at line 1␤    raw used at line 1␤␤»
15:00 gfldex m: class A { has $.a = is rw 42 }; class B is A { method setA($a) { $.a = $a; } }; my $b = B.new; $b.setA(42); say $b.a;
15:00 camelia rakudo-moar cd4265: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routines:␤    is used at line 1␤    rw used at line 1␤␤»
15:01 gfldex m: class A { has $.a = is rw; }; class B is A { method setA($a) { $.a = $a; } }; my $b = B.new; $b.setA(42); say $b.a;
15:01 camelia rakudo-moar cd4265: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared routines:␤    is used at line 1␤    rw used at line 1␤␤»
15:01 gfldex m: class A { has $.a is rw; }; class B is A { method setA($a) { $.a = $a; } }; my $b = B.new; $b.setA(42); say $b.a;
15:01 camelia rakudo-moar cd4265: OUTPUT«42␤»
15:01 gfldex ENEEDMORETEA
15:02 Xliff gfldex: Thanks! One of those might work.
15:02 Xliff timotimo: I was trying to set the attribute. Not access a method.
15:04 adu joined #perl6
15:04 gfldex Xliff: you may be aiming at your feed. Esp. if you intend to use threads to make your life harder.
15:05 gfldex threads are clearly the work of the devil
15:07 pmurias jnthn: re run_profiled it fits almost perfectly for the kind of profiling support I want to expose on the js backend
15:08 timotimo but why don't you set the attribute via the method?
15:09 Xliff timotimo: ???
15:09 Xliff timotimo: Via what method?
15:09 timotimo well, make the attribute rw and set the value via the accessor?
15:09 timotimo the method that has the same name as the attribute
15:10 Xliff Oh. Could do that, but sometimes we get "Cannot set an immutable object" so I'm forced to drop back to nqp and bindattr.
15:10 Xliff And in those situations I have to nativecast back to the superclass.
15:11 Xliff And I'm worried that in some situations, when doing that I am confusing something in the model because test that should pass... aren't.
15:12 timotimo just "is rw" :)
15:12 Xliff Even with "is rw" I get that "Cannot set an immutable object" error.
15:12 Xliff Especially when dealing with structs that originate in libxml2.
15:12 dogbert17 m: https://gist.github.com/dogbert17/dcf078ff80c7b868dfdce95632b4ad63
15:12 kid51 joined #perl6
15:12 camelia joined #perl6
15:12 Xliff ok 9 - DTD's system ID matches $htmlSystem
15:12 Xliff Cannot modify an immutable xmlDtdPtr
15:12 timotimo wtf?
15:12 Ven joined #perl6
15:12 Xliff ^^ There's one.
15:13 dogbert17 m: https://gist.github.com/dogbert17/dcf078ff80c7b868dfdce95632b4ad63
15:13 timotimo is that attribute rw?
15:13 timotimo it doesn't seem like you're getting a container there
15:13 Xliff I changed xmlDoc to "is rw"
15:13 dogbert17 hmm, shouldn't that work, evaluating a gist that is
15:13 camelia rakudo-moar cd4265: OUTPUT«Attempt to return outside of any Routine␤  in block <unit> at <tmp> line 8␤␤»
15:14 Xliff I can try changing that attribute to "is rw" as well.
15:14 dogbert17 why does the example fail with: Attempt to return outside of any Routine␤  in block <unit> at <tmp> line 8
15:14 timotimo is rw on the class should do that for you, but i'm not sure how stubbed classes and traits like that interact, really
15:15 Xliff Well I have done "is rw" on the class and the trait.
15:16 timotimo OK
15:16 Xliff FROGGS initially wrote most of this and was using nqp::bindattr to get around it.
15:16 donaldh joined #perl6
15:16 dvinciguerra_ joined #perl6
15:16 gfldex dogbert17: a pointy block is a Block, what is lower in the chain then A Routine.
15:16 Xliff timotimo: Still getting same error.
15:17 gfldex dogbert17: IIRC nexsame and/or callwith fire control exceptions
15:17 dogbert17 gfldex: dunno what it should look like but note that I took this from https://docs.perl6.org/language/functions
15:17 gfldex dogbert17: `return` basicylly _is_ a control exception, that's where the LTA error message comes from
15:18 timotimo are you sure nextsame and callwith work via control exceptoins?
15:18 timotimo ... toins?
15:18 dogbert17 gfldex; so does that mean that the example is incorrect?
15:18 Xliff timotimo: https://github.com/Xliff/p6-XML-LibXML.git. Checkout 07dtd branch. Then run "perl6 -Ilib t/07dtd" to see what I am talking about.
15:18 Xliff Gotta split for a bit.
15:19 gfldex dogbert17: since we don't got automatic testing on our examples and some of them are quite old, there will be broken examples
15:19 gfldex i know because I fixed a few already
15:19 timotimo i'm not sure i actually can figure that out now
15:20 dogbert17 gfldex: I've fixed a few too but in this case I don't know how it should look ;(
15:20 dogbert17 in order to do what the author intended
15:22 gfldex m: https://gist.github.com/gfldex/ecde10b59aab332941a245dc4e74ddf0
15:22 camelia rakudo-moar cd4265: OUTPUT«2␤0+2i␤»
15:22 gfldex dogbert17: ^^^
15:23 dogbert17 gfldex++, do you want to fix the doc or should I?
15:23 gfldex m: https://gist.github.com/gfldex/ecde10b59aab332941a245dc4e74ddf0
15:23 camelia rakudo-moar cd4265: OUTPUT«2␤NaN␤»
15:23 gfldex dogbert17: yes please, and this example doesn't need use soft;
15:23 gfldex actually it does
15:24 dogbert17 gfldex: will fix, thx for helping
15:26 Ven joined #perl6
15:27 CIAvash joined #perl6
15:28 AlexDaniel joined #perl6
15:29 dalek doc: fff09c0 | (Jan-Olof Hendig)++ | doc/Language/functions.pod6:
15:29 dalek doc: Fixed broken code example. gfldex++ for providing working code.
15:29 dalek doc: review: https://github.com/perl6/doc/commit/fff09c0c92
15:30 kid51 joined #perl6
15:34 AlexDaniel committable: HEAD https://gist.githubusercontent.com/gfldex/ecde10b59aab332941a245dc4e74ddf0/raw/a026c559e2f7fee22a929c1d78843cb6a93f9391/gistfile1.txt
15:34 committable AlexDaniel: Successfully fetched the code from the provided URL.
15:34 committable AlexDaniel: |«HEAD»: Attempt to return outside of any Routine␤  in block <unit> at /tmp/C9ZdVrwfds line 8␤ exit code = 1
15:34 AlexDaniel committable: 2015.12 https://gist.githubusercontent.com/gfldex/ecde10b59aab332941a245dc4e74ddf0/raw/a026c559e2f7fee22a929c1d78843cb6a93f9391/gistfile1.txt
15:34 committable AlexDaniel: Successfully fetched the code from the provided URL.
15:34 committable AlexDaniel: |«2015.12»: Attempt to return outside of any Routine␤  in block <unit> at /tmp/uNm2Cgpdkx line 8␤ exit code = 1
15:34 AlexDaniel alright
15:37 travis-ci joined #perl6
15:37 travis-ci Doc build failed. Jan-Olof Hendig 'Fixed broken code example. gfldex++ for providing working code.'
15:37 travis-ci https://travis-ci.org/perl6/doc/builds/145226944 https://github.com/perl6/doc/compare/75a689d39eb1...fff09c0c9272
15:37 travis-ci left #perl6
15:38 firstdayonthejob joined #perl6
15:38 AlexDaniel “Cannot invoke this object (REPR: Null; VMNull)” – yay…
15:39 gfldex is `sub trait_mod:<is>(Mu:U $type, :$rw!)` the trait in `class is rw Foo {}`
15:39 gfldex ?
15:52 dogbert17 must be a very recent commit which breaks htmlify.p6
15:53 gfldex it seams to fail while processing glossary.pod6
15:57 dalek doc: c35be33 | (Wenzel P. P. Peppmeyer)++ | doc/Language/typesystem.pod6:
15:57 dalek doc: doc `is rw` on class
15:57 dalek doc: review: https://github.com/perl6/doc/commit/c35be332c0
16:05 gfldex the docs build fine locally
16:05 travis-ci joined #perl6
16:05 travis-ci Doc build failed. Wenzel P. P. Peppmeyer 'doc `is rw` on class'
16:05 travis-ci https://travis-ci.org/perl6/doc/builds/145230176 https://github.com/perl6/doc/compare/fff09c0c9272...c35be332c02a
16:05 travis-ci left #perl6
16:07 dogbert17 gfldex: are you running todays release?
16:08 gfldex no
16:09 dogbert17 htmlify.p6 fails for me with: This is Rakudo version 2016.06-283-g76ce6d4 built on MoarVM version 2016.07
16:12 gfldex dogbert17: I may have a old module installed.
16:15 dogbert17 gfldex: i suspect something has changed during the last 24 hours, it should narrow things slightly at least
16:15 gfldex i will build rakudo next
16:16 dogbert17 perhaps Zoffix should wait with the release ?
16:16 gfldex however, given what htmlify.p6 does, it should not trip over a null pointer
16:18 dogbert17 I ran htmlify earlier today, before upgrading, and then it went well. When going through glossary.pod6 htmlify logged 'does not have an =SUBTITLE' three times and then continued
16:20 gfldex the =SUBTITLE thing is ok
16:27 gfldex dogbert17: i can reproduce. The regression happened in the last 2 days. We may be able to narrow it with travis logs on the docs.
16:27 dogbert17 gfldex: good idea
16:29 dogbert17 last working build is 19 hours old: Deletion of Hash definition, which is alraedy greatly described in Class sect
16:29 gfldex dogbert17: i reported in #perl6-dev
16:29 * gfldex runs to the shop
16:31 TreyHarr1 joined #perl6
16:55 susmus joined #perl6
16:57 jack_rabbit joined #perl6
17:00 dalek doc: e93bd2a | (Zoffix Znet)++ | template/examples.html:
17:00 dalek doc: Remove unused template/examples.html
17:00 dalek doc:
17:00 dalek doc: The redirect has been implemented via .htaccess in a3c7c99
17:00 dalek doc: review: https://github.com/perl6/doc/commit/e93bd2a66f
17:04 Xliff FROGGS, you around?
17:08 travis-ci joined #perl6
17:08 travis-ci Doc build failed. Zoffix Znet 'Remove unused template/examples.html
17:08 travis-ci https://travis-ci.org/perl6/doc/builds/145237269 https://github.com/perl6/doc/compare/c35be332c02a...e93bd2a66fab
17:08 travis-ci left #perl6
17:10 darutoko joined #perl6
17:12 marcel_ joined #perl6
17:14 timotimo the df chart of hack.p6c.org is worrying me
17:14 timotimo i was hoping it'd throw out the huge log files that happened when i was using the fuzzer and it spammed all the segfaults into the syslog
17:14 timotimo hm, though that's not yet a full month old
17:18 dalek doc: 91a6581 | (Zoffix Znet)++ | htmlify.p6:
17:18 dalek doc: Remove attempt to copy templates/examples.html
17:18 dalek doc:
17:18 dalek doc: It was removed in e93bd2a
17:18 dalek doc: review: https://github.com/perl6/doc/commit/91a658105a
17:25 cyphase joined #perl6
17:26 travis-ci joined #perl6
17:26 travis-ci Doc build failed. Zoffix Znet 'Remove attempt to copy templates/examples.html
17:26 travis-ci https://travis-ci.org/perl6/doc/builds/145240077 https://github.com/perl6/doc/compare/e93bd2a66fab...91a658105abd
17:26 travis-ci left #perl6
17:28 adu joined #perl6
17:31 huggable joined #perl6
17:35 TreyHarr1 joined #perl6
18:13 dalek doc: 6ebab29 | (Wenzel P. P. Peppmeyer)++ | lib/Pod/Htmlify.pm6:
18:13 dalek doc: remove is cached, it was too experimental
18:13 dalek doc: review: https://github.com/perl6/doc/commit/6ebab29430
18:13 gfldex dogbert17: it's all good now
18:14 djbkd joined #perl6
18:14 zacts joined #perl6
18:15 dogbert17 gfldex++
18:21 TreyHarr1 joined #perl6
18:30 travis-ci joined #perl6
18:30 travis-ci Doc build passed. Wenzel P. P. Peppmeyer 'remove is cached, it was too experimental'
18:30 travis-ci https://travis-ci.org/perl6/doc/builds/145247588 https://github.com/perl6/doc/compare/91a658105abd...6ebab29430c2
18:30 travis-ci left #perl6
18:58 dalek doc: 42d01d0 | (Wenzel P. P. Peppmeyer)++ | lib/Pod/Htmlify.pm6:
18:58 dalek doc: implement cache on url-rewriter because more speed is more better
18:58 dalek doc: review: https://github.com/perl6/doc/commit/42d01d0f1a
18:59 zacts joined #perl6
19:06 labster joined #perl6
19:06 Madcap^Jake^ joined #perl6
19:09 rgrinberg joined #perl6
19:09 Sigyn joined #perl6
19:12 tomaw joined #perl6
19:15 cdg joined #perl6
19:34 TreyHarr1 joined #perl6
19:36 gfldex m: class A { has $.a }; &trait_mod:<is>(A, :rw);
19:36 camelia rakudo-moar bc722a: ( no output )
19:36 gfldex m: class A { has $.a }; &trait_mod:<is>(A, :rw); dd A.new.a = 1;
19:36 camelia rakudo-moar bc722a: OUTPUT«Cannot modify an immutable Any␤  in block <unit> at <tmp> line 1␤␤»
19:37 gfldex m: class A { has $.a }; trait_mod:<is>(A, :rw); dd A.new.a = 1;
19:37 camelia rakudo-moar bc722a: OUTPUT«Cannot modify an immutable Any␤  in block <unit> at <tmp> line 1␤␤»
19:45 djbkd joined #perl6
19:56 dwarring joined #perl6
20:20 espadrine joined #perl6
20:30 yqt joined #perl6
20:35 dalek infrastructure-doc: cecd958 | (Zoffix Znet)++ | hosts/hack.p6c.org.pod:
20:35 dalek infrastructure-doc: List Zoffix as possessing sudo
20:35 dalek infrastructure-doc: review: https://github.com/perl6/infrastructure-doc/commit/cecd958fb2
20:38 TreyHarr1 joined #perl6
20:49 TEttinger joined #perl6
20:55 zacts joined #perl6
21:01 sjn_ joined #perl6
21:15 timotimo gfldex: yeah, that has to be set before composition happens
21:16 djbkd joined #perl6
21:17 dalek doc: 2ef1eba | (Wenzel P. P. Peppmeyer)++ | doc/Language/typesystem.pod6:
21:17 dalek doc: better index entry on is rw for class
21:17 dalek doc: review: https://github.com/perl6/doc/commit/2ef1ebae95
21:17 gfldex m: my &ieq = &lc o &infix:<eq>; say so 'abc' [&ieq] 'abd';
21:17 camelia rakudo-moar bc722a: OUTPUT«True␤»
21:18 gfldex m: my &ieq = &infix:<eq> o &lc; say so 'abc' [&ieq] 'abd';
21:18 camelia rakudo-moar bc722a: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤  in block <unit> at <tmp> line 1␤␤»
21:18 gfldex that can't work I think
21:19 gfldex do we have a way chain a postfix (method call i case of .lc) and a infix?
21:21 timotimo hm, can you write *.lc there? otherwise it'd have to be { .lc } instead
21:21 gfldex the anon sub returned by infix:<o> got 1 positional
21:22 timotimo oh
21:22 timotimo right, it should derive that from the right-hand argument
21:22 gfldex and $a [&foo] $b if just $a.&foo($b)
21:23 timotimo well, it's &foo($a, $b)
21:23 gfldex m: my &ieq = &infix:<eq> o:2 &lc; say so 'abc' [&ieq] 'abd';
21:23 camelia rakudo-moar bc722a: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed radix number␤at <tmp>:1␤------> 3my &ieq = &infix:<eq> o:27⏏5 &lc; say so 'abc' [&ieq] 'abd';␤    expecting any of:␤        number in radix notation␤»
21:23 timotimo which is the same thing i suppose, unless you have an invocant argument in there, or if it's a method object
21:24 gfldex it is the same thing
21:25 gfldex m: my method oi(Int:D: Mu:U){ say 'oi!' }; 42.&oi(Any);
21:25 camelia rakudo-moar bc722a: OUTPUT«oi!␤»
21:25 rindolf What happened to TimToady ?
21:26 gfldex as any prophet he has to meditate every now and then
21:26 gfldex .seen TimToad
21:26 yoleaux I haven't seen TimToad around.
21:26 gfldex .seen TimToady
21:26 yoleaux I saw TimToady 13 Jul 2016 16:48Z in #perl6: <TimToady> usually the browser does better than the terminal, but in this case it's worse
21:27 zacts joined #perl6
21:31 huggable joined #perl6
21:44 gfldex multi sub infix:<∘> (&f, &g --> Block) { (&f).count > 1 ?? -> |args { f |g |args } !! -> |args { f g |args } }
21:44 gfldex timotimo: ^^^ it only looks at the left function
21:44 timotimo oh, huh
21:50 Roamer` hmm, the sequence operator seems to be - only in some cases - a bit smarter than its documentation suggests... but not in other cases
21:50 Roamer` "If the endpoint is not *, it is smart-matched against each generated element, and the sequence is terminated when the smart-match succeeded."
21:50 Roamer` m: say 1,2,4...64
21:50 camelia rakudo-moar bc722a: OUTPUT«(1 2 4 8 16 32 64)␤»
21:50 Roamer` so far so good
21:50 Roamer` m: say 1,2,4...100
21:50 camelia rakudo-moar bc722a: OUTPUT«(1 2 4 8 16 32 64)␤»
21:51 Roamer` this one seems to be a bit smarter than the docs would suggest
21:51 Roamer` m: say 1,1,-> $a, $b { $a + $b }...10
21:51 camelia rakudo-moar bc722a: OUTPUT«(1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 2178309 3524578 5702887 9227465 14930352 24157817 39088169 63245986 102334155 165580141 267914296 433494437 7014087…»
21:51 Roamer` but this one... isn't.
21:51 Roamer` (it's exactly as smart as the docs suggest)
21:51 timotimo m: say 1, 9, 11 ... * > 100
21:51 camelia rakudo-moar bc722a: OUTPUT«Unable to deduce arithmetic or geometric sequence from 1,9,11 (or did you really mean '..'?)␤  in block <unit> at <tmp> line 1␤␤»
21:52 nine Roamer`: for arithmetic or geometric squences it can indeed detect when it should end
21:52 timotimo m: say 1, 9, 10 ... * > 100
21:52 camelia rakudo-moar bc722a: OUTPUT«Unable to deduce arithmetic or geometric sequence from 1,9,10 (or did you really mean '..'?)␤  in block <unit> at <tmp> line 1␤␤»
21:52 timotimo hm
21:52 timotimo m: say 1, 9, 11, 19 ... * > 100
21:52 camelia rakudo-moar bc722a: OUTPUT«===SORRY!===␤Unable to deduce arithmetic or geometric sequence from 9,11,19 (or did you really mean '..'?)␤»
21:52 timotimo why are those errors different :D
21:52 Roamer` nine, yep, exactly... so I assumed it would also work for others, and I went ahead and tried to demonstrate this to somebody with the Fibonacci sequence... and the assumption turned out to be wrong :)
21:52 Roamer` I'm not complaining, mind
21:53 BenGoldberg joined #perl6
21:53 timotimo yeah, only arithmetic and geometric sequences will be auto-deduced
21:53 nine Roamer`: it knows what arithmetic or geometric sequences are. With the Fibonacci sequence you essentially give it code which generates the next value. The sequence operator cannot understand this code, it just executes it. So it cannot say whether the sequence will return to the given end value or not
21:54 timotimo oh!
21:54 timotimo i didn't even see what they meant
21:54 nine m: say 1, { $_ > 10 ?? $_ - 1 !! $_ + 2} ... 10
21:54 camelia rakudo-moar bc722a: OUTPUT«(1 3 5 7 9 11 10)␤»
21:54 nine Roamer`: like in this case ^^^
21:56 MasterDuke why did one of the errors have '===SORRY!===␤' and the others didn't?
21:57 timotimo yes, why?
21:57 Roamer` different phases of compilation? (wild guess)
21:57 MasterDuke ahh, that one had one more value before the ... than the others
21:58 timotimo yup
21:58 timotimo but that's no good reason to blow up differently :D
21:59 AlexDaniel m: say 2,4,8 ... 100
21:59 camelia rakudo-moar bc722a: OUTPUT«(2 4 8 16 32 64)␤»
21:59 AlexDaniel m: say 2,4,8 ... * > 100
21:59 camelia rakudo-moar bc722a: OUTPUT«(2 4 8 16 32 64 128)␤»
21:59 Roamer` timotimo, I'd assume (although we've seen how far assumptions got me just now) that it has something to do with the fact that three values are enough to determine whether it's a geometric sequence
22:00 Roamer` so when you give it three values, it finds out that it's neither an arithmetic nor a geometric one and blows up "normally"
22:00 gfldex MasterDuke: it's a compile time error, there are also compile time errors that (for now) suck
22:00 Roamer` and then you give it *four* values, which is more than enough
22:00 Roamer` (no idea why that would matter, just another wild guess)
22:01 MasterDuke the error is from X::Sequence::Deduction
22:01 MasterDuke which is only thrown in one place
22:02 timotimo the ... operator might be compile-time-evaluated by the static optimizer, though
22:03 MasterDuke ahh, seems plausible
22:04 gfldex m: https://gist.github.com/gfldex/54d376465854b2d0dab0d7baf536d86e
22:04 camelia rakudo-moar bc722a: OUTPUT«[True True False]␤»
22:04 gfldex timotimo: ^^^ does what I want from infix:<o>
22:05 RabidGravy joined #perl6
22:12 gfldex m: https://gist.github.com/gfldex/54d376465854b2d0dab0d7baf536d86e
22:12 camelia rakudo-moar bc722a: OUTPUT«[True True False]␤»
22:12 gfldex updated with more readability
22:13 mr-foobar joined #perl6
22:15 timotimo sorry, very distracted again
22:16 gfldex m: say [eq] <Abc abc>>>.lc
22:16 camelia rakudo-moar bc722a: OUTPUT«True␤»
22:20 _28_ria joined #perl6
22:20 BenGoldberg joined #perl6
22:21 wamba joined #perl6
22:22 Zoffix joined #perl6
22:31 gfldex m: sub f($) {}; sub g($,$) {}; my &infix:<fg> = &f o &g; say 1 fg 2;
22:31 camelia rakudo-moar fd1be3: OUTPUT«Nil␤»
22:31 gfldex :o
22:32 gfldex did we doc `my &infix:<> = sub {};` ?
22:34 gfldex m: my &infix:<ieq> =  -> |l { [eq] l>>.lc }; say so "abc" ieq "Abc";
22:34 camelia rakudo-moar fd1be3: OUTPUT«True␤»
22:35 Zoffix left #perl6
22:35 gfldex i better stop before the mind boggle overwhelms me
22:37 gfldex i wonder if the code golfers would accept a task that starts with: "Define a infix operator that ..."
22:47 zacts joined #perl6
22:55 dalek doc: 187e0c0 | (Wenzel P. P. Peppmeyer)++ | doc/Type/Callable.pod6:
22:55 dalek doc: remove extra space resulting in bad index entry/link
22:55 dalek doc: review: https://github.com/perl6/doc/commit/187e0c0024
22:58 BenGoldberg m: my &infix<ieq> = -> \list { [eq] list>>.fc }; say "abc" ieq "ABC" ieq "aBc";
22:58 camelia rakudo-moar fcfe3c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Shaped variable declarations not yet implemented. Sorry. ␤at <tmp>:1␤------> 3my &infix<ieq>7⏏5 = -> \list { [eq] list>>.fc }; say "abc␤»
22:58 BenGoldberg m: my &infix<ieq> = -> |list { [eq] list>>.fc }; say "abc" ieq "ABC" ieq "aBc";
22:58 camelia rakudo-moar fcfe3c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Shaped variable declarations not yet implemented. Sorry. ␤at <tmp>:1␤------> 3my &infix<ieq>7⏏5 = -> |list { [eq] list>>.fc }; say "abc␤»
22:59 BenGoldberg . o O (What am I doing wrong?)
23:00 timotimo you're forgetting the : after the "infix"
23:00 BenGoldberg m: my &infix:<ieq> = -> |list { [eq] list>>.fc }; say "abc" ieq "ABC" ieq "aBc";
23:00 camelia rakudo-moar fcfe3c: OUTPUT«False␤»
23:00 BenGoldberg m: my &infix:<ieq> = -> |list { [eq] list>>.fc }; say "abc" ieq "ABC";
23:00 camelia rakudo-moar fcfe3c: OUTPUT«True␤»
23:00 BenGoldberg m: say 1 == 2 == 4;
23:00 camelia rakudo-moar fcfe3c: OUTPUT«False␤»
23:00 BenGoldberg m: say 4 == 4 == 4;
23:01 camelia rakudo-moar fcfe3c: OUTPUT«True␤»
23:08 djbkd joined #perl6
23:09 wamba m: my &f= *+1; my &g= *+*; sub postfix:<₂> (&f) {-> $a, $b {&f($a),&f($b)}};  say (&g o &f₂)(1,2)
23:09 camelia rakudo-moar fcfe3c: OUTPUT«5␤»
23:15 dalek doc: 12d28f5 | (Zoffix Znet)++ | doc/Type/Int.pod6:
23:15 dalek doc: Clarify .polymod behaviour when divisors are given as a lazy list
23:15 dalek doc: review: https://github.com/perl6/doc/commit/12d28f53d0
23:18 gfldex lölibloggedalittle https://gfldex.wordpress.com/2016/07/17/i-dont-need-conditionals-either/
23:31 Frameless FWIW, .fc, not .lc, should be used for case-insensitve comparison
23:32 gfldex Frameless: ENOSUCHDOC
23:32 Frameless m: my &infix:<ieq> = { [eq] @_».lc }; say "SS" ieq "ß"
23:32 camelia rakudo-moar 980f49: OUTPUT«False␤»
23:32 Frameless m: my &infix:<ieq> = { [eq] @_».fc }; say "SS" ieq "ß"
23:32 camelia rakudo-moar 980f49: OUTPUT«True␤»
23:33 Frameless gfldex: seems to be here: https://docs.perl6.org/routine/fc
23:33 gfldex i take that back
23:33 gfldex fat finger syndrom
23:33 Frameless :)
23:33 gfldex i better update the blogpost before anyone reads it (changes are good)
23:34 Frameless gfldex: oh, then there's also a typo "arguments of it’s first operand" should be "its"
23:39 Frameless m: say "SS" ~~ m:i/"ß"/
23:39 camelia rakudo-moar 980f49: OUTPUT«False␤»
23:39 Frameless I kinda expected that to be True
23:40 wamba m: sub postfix:<₂> (&f) {-> $a, $b {&f($a),&f($b)}}; my &infix:<ieq> =&infix:<eq> o &fc₂; say "abc" ieq "Abc";
23:40 camelia rakudo-moar 980f49: OUTPUT«True␤»
23:42 gfldex m: multi sub fc(*@a){ @a>>.lc }; my &infix:<ieq> =&infix:<eq> o &fc; say "abc" ieq "Abc";
23:42 camelia rakudo-moar 980f49: OUTPUT«True␤»
23:42 gfldex what leaves the question if the buildin sub fc should have (+@a) as a signature
23:44 gfldex it's defined as `sub fc(Cool $s) { $s.fc }`
23:45 gfldex m: <abß deö>.fc.say
23:45 camelia rakudo-moar 980f49: OUTPUT«abss deö␤»
23:46 edehont joined #perl6
23:51 b2gills joined #perl6

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

Perl 6 | Reference Documentation | Rakudo