Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-08-17

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:07 leego joined #perl6
00:08 MasterDuke timotimo: i don't know how to read the actual output, but the output of perl6 --target=ast -e 'my $a = "A"; say "y" if $a eq "a" | "A";' is exactly the same as the output of perl6 --target=ast --optimize=0 -e 'my $a = "A"; say "y" if $a eq "a" | "A";'
00:08 unmatched} I'd write it as $letter.lc eq 'a'
00:09 unmatched} (or ensure $letter has .lc from the get go)
00:10 MasterDuke for that example sure, but if you wanted different actual letters, e.g., "a" | "A" | "b" | "B"
00:10 MasterDuke which could then be $letter.lc eq 'a' | 'b', but you still neither either the junction or the or
00:11 MasterDuke *need either
00:11 adhoc_ joined #perl6
00:12 rkazak joined #perl6
00:12 unmatched} For DNA bases, it'd be ATCG
00:12 adhoc_ left #perl6
00:13 unmatched} As for the optimizer, even though it outputs stuff the same for the Junction, a more efficient way would be an eq whatever or eq whatever, but the optimizer doesn't do that ATM, which is what I believe timotimo was talking about
00:13 unmatched} Not sure how that's to go about when Junctions will autothread ¯\_(ツ)_/¯
00:16 timotimo we are *not* going to spawn out threads for comparing a string against two different things
00:16 timotimo that's just pure overhead
00:17 unmatched} Yeah, I'd hope so
00:20 El_Che 7
00:21 itaipu joined #perl6
00:23 stux|RC-only joined #perl6
00:23 awwaiid joined #perl6
00:24 BenGoldberg joined #perl6
00:26 cyphase joined #perl6
00:31 pierre_ joined #perl6
00:33 skids well, unless they are all huge strings in which the first 1MB or so are the same :-)
00:34 timotimo OK, except in that case
00:34 timotimo but if they have ever been used in a hash, we do have the hash code ...
00:34 timotimo probably won't have it
00:37 skids If we had an opportunistic hashing thing going on in the background we might.  Also if you are going to strcmp anyway it doesn't cost that much more to throw some instructions in to partially hash while pulling in cache lines.  But that's all fantasy for now.
00:39 prammer joined #perl6
00:39 skids but then we get into dos-resistant versus rolling hashes and when to use which.
00:40 Ben_Goldberg joined #perl6
00:42 timotimo oh, i had meant to inspect the hash function we use for collisions in strings that are ascii representations of decimal numbers
00:46 prammer joined #perl6
00:48 MasterDuke would anybody mind if i add my (hopefully not too controversial two cents) to the Perl 6 errors are awesome or not discussion? or is that topic touchy?
00:48 skids You know actually "if you have N-strings for N>some_value and you compare them often, put them in a hash key" as a user-visible way of tweaking that behavior isn't so completely horrible.
00:51 timotimo MasterDuke: we're not going to tell you to do or not do :)
00:52 timotimo forgiveness is better than permission, after all
00:52 timotimo i don't think i have to tell you to be calm and respectful and all that ;)
00:53 timotimo i'm so annoyed i can't get "show comments newer than the last time you looked" outside of /r/perl6
00:53 MasterDuke that's pretty much what i figured, but if there is a lot of history i wasn't aware of i don't want to stir the pot unnecessarily
00:54 timotimo *shrug*, i don't think there really is
00:54 timotimo one person was presenting rakudo's error messages as a good example for the whole industry, commenters were like "no, those errors are shit"
00:54 timotimo that's all there is to it, if i'm not mistaken
00:55 sammers hi perl6
00:55 timotimo hey sammers
00:55 sammers hi timotimo
00:55 timotimo i wonder if people ever tell you to "go and make me a sammich, sammers" :o)
00:55 MasterDuke my feeling has always been that Perl 6's errors are good, but i'm sympathetic to whoever it was that complained that the list of "expecting any of" things wasn't all that helpful in the general case
00:55 sammers my wife
00:55 timotimo that's fair :D
00:55 sammers :)
00:56 timotimo MasterDuke: yeah, that's a very valid thing to say, and to add to the discussion
00:56 MasterDuke personally, i have never once gotten any useful information out of them
00:56 timotimo others have already weighed in with "we should perhaps filter the list to only have things the user would understand easily"
00:56 MasterDuke the messages that precede them are very helpful
00:56 sammers are there any examples of using an endless loop to emit to a Supply, without blocking?
00:56 timotimo yes, they can be uninformative at times
00:56 MasterDuke e.g.
00:57 MasterDuke m: .say if /asdf \s+ \/
00:57 camelia rakudo-moar b00d92: OUTPUT«5===SORRY!5===␤Regex not terminated.␤at <tmp>:1␤------> 3.say if /asdf \s+ \/7⏏5<EOL>␤Unable to parse regex; couldn't find final '/'␤at <tmp>:1␤------> 3.say if /asdf \s+ \/7⏏5<EOL>␤    expecting any of:␤        infix stoppe…»
00:57 timotimo sammers: since supplies are push-based, you can't emit in an endless loop without blocking a thread, unless you use something like an interval
00:57 sammers what about using Thread?
00:57 timotimo sure, that works
00:58 timotimo don't forget that things tapped to the supply will run on the same thread that does the emit
00:58 MasterDuke the first part, really helpful. the expecting any of i ignore
00:58 timotimo m: my $supply = start { supply { .emit for 1..* } }; $supply.tap({ .say; last if ++$ > 10 })
00:58 camelia rakudo-moar b00d92: OUTPUT«Method 'tap' not found for invocant of class 'Promise'␤  in block <unit> at <tmp> line 1␤␤»
00:58 sammers ah, so is there anyway to have a new Thread emit to a Supply on a different thread?
00:59 MasterDuke i understand that people doing fancy grammar related things probably do find them very useful
00:59 timotimo m: my $supply = await start { supply { .emit for 1..* } }; $supply.tap({ .say; last if ++$ > 10 })
00:59 camelia rakudo-moar b00d92: OUTPUT«No such method 'emit' for invocant of type 'Int'␤  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 <unit> at <tmp> line 1␤␤»
00:59 timotimo oh
00:59 timotimo m: my $supply = await start { supply { .&emit for 1..* } }; $supply.tap({ .say; last if ++$ > 10 })
00:59 camelia rakudo-moar b00d92: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤11␤»
00:59 timotimo sammers: how does that look?
00:59 sammers ok, I will play with it... thanks
00:59 timotimo actually, i don't think i even need the start there?
00:59 timotimo m: my $supply = supply { .&emit for 1..* }; $supply.tap({ .say; last if ++$ > 10 })
00:59 camelia rakudo-moar b00d92: OUTPUT«1␤2␤3␤4␤5␤6␤7␤8␤9␤10␤11␤»
00:59 timotimo yeah, neat.
01:00 unmatched} m: my $supply = supply { .emit for 1..* }; $supply.tap({ .say; last if ++$ > 10 })
01:00 camelia rakudo-moar b00d92: OUTPUT«No such method 'emit' for invocant of type 'Int'␤  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 <unit> at <tmp> line 1␤␤»
01:00 timotimo ah, of course!
01:00 unmatched} :(
01:00 timotimo the supply block gets run whet you tap the thing
01:00 MasterDuke but my impression is that most people "in the wild" writing Perl (5 or 6), are frequently doing command line text manipulation and things like that
01:00 timotimo unmatched}: you did see .&emit?
01:00 timotimo it's strange to have .take but not .emit
01:01 timotimo i do!
01:01 unmatched} timotimo: yeah, I kinda figured .emit would work :()
01:01 timotimo could be a rakudobug
01:01 MasterDuke and for them, the first part of the error message is extremely useful and the second part isn't
01:01 timotimo i.o.w.: please submit if you have time :)
01:01 * unmatched} is too drunk to submit anything
01:01 timotimo fair enough! i'll do it, then
01:02 timotimo already submitted
01:02 unmatched} And my apartment smells like burt popcorn, because I'm not steeped enough in North American culture to know to take off the cardboard bit of the pan-like popcorn thingies :/
01:02 MasterDuke so i would be in favour of turning the second part (i.e, "expecting any of" and things like that) off in the general case and adding a flag to turn it on, like we already have --ll-exceptions
01:04 MasterDuke but if i were to add that as an RFC rakudobug, would i get summarily smacked down?
01:05 timotimo i don't think it'd be smacked down just like that
01:05 timotimo oh, yikes
01:05 timotimo REPL seems to be kind of b0rked at the moment
01:05 timotimo when you "my $a = 0" and then "say $a", you get "variable $a not declared"
01:05 timotimo we don't have a test that ensures such basic things in the repl?
01:05 unmatched} MasterDuke: as I whined about earlier today, I feel the entire branch of "LTA errors" of tickets is missing its mark. We need to have a solid plan of what the errors are meant to look like and possibly expose the interface for emitting them to module-space. ATM, we're just like dung-beetles, changing the text of errors any time someone complains, without any plan whatsoever
01:06 timotimo unmatched}: huh? but all those errors are already structured exception objects that give you pretty much all you need to work with them?
01:06 timotimo and LTA error tickets aren't only about wording, but also about what class to emit and what properties those should have
01:08 unmatched} timotimo: oh damn. Maybe that's why RT#127933 git fixed :/ REPL no longer remembers previous lines
01:08 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=127933
01:08 MasterDuke unmatched}: i don't really have a problem with the existing tickets, but that's because as you say we don't have a concrete plan for errors overall
01:09 timotimo unmatched}: seems at least partially unrelated, because even with an int8 or similar you'll get "not declared"
01:09 timotimo i'm heading to bed now
01:09 unmatched} timotimo: they do, which is why module-space error writers would make a lot of sense. But tickets *are* a lot about wording. Last week I fixed the ticket for say Any ~ "x", which was actually in addition to previous LTA error message fixing it
01:10 unmatched} buggable: rt
01:10 unmatched} buggable: rt LTA
01:10 buggable unmatched}, TOTAL: 1361, UNTAGGED: 556, BUG: 421, LTA: 107, JVM: 62, NYI: 35, RFC: 31, SEGV: 31, UNI: 27, CONC: 25, PERF: 22, POD: 14, @LARRY: 14, PRECOMP: 10, TODO: 10, BUILD: 7, GLR: 6, STAR: 5, NATIVECALL: 4, WEIRD: 3, BOOTSTRAP: 3, MOARVM: 2, OSX: 2, WEB: 1, SPESH: 1, DOCS: 1, MATH: 1   Details: http://bug.perl6.party/1471396225.html
01:10 buggable unmatched}, Found 98 tickets tagged with LTA. Details: http://bug.perl6.party/1471396228.html
01:10 timotimo they're not *all* about wording
01:11 BenGoldberg Why did buggable first say LTA: 107, then only 98?
01:11 unmatched} No, they aren't. But I somewhat feel the actual wording should be a very small part of the equation
01:11 unmatched} BenGoldberg: she's buggy as hell
01:11 BenGoldberg Here I was hoping we'd somehow fixed 9 bugs in 3 seconds ;)
01:11 unmatched} :)
01:12 timotimo they are a big part of the equation, because the wording helps us figure out what kind of info is needed and what exception type is the right one
01:13 timotimo and until we have module-space error printers, it's all users have
01:14 unmatched} And that's exactly my point. Until we have module-space errors, any Joe Whatever is free to complain a particular error isn't good enough and we'll likely amend it... because we don't have any plan for errors
01:14 unmatched} m: say Any ~ "x"
01:15 camelia rakudo-moar b00d92: OUTPUT«Use of uninitialized value of type Any in string context.␤Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.  in block <unit> at <tmp> line 1␤x␤»
01:15 unmatched} I didn't have any issues with the previous warning for the above, but X amount of human hours were spent on submitting the ticket, reading the ticket, fixing the ticket, spectesting the ticket, and commiting and closing the ticket.
01:15 unmatched} And it's just a cycle
01:16 unmatched} Anyway. I have have one too many beers to think about this clearly :)
01:16 * unmatched} leaves to fly to undiscovered planets in No Man's Sky
01:18 BenGoldberg You might be on the wrong side of Ballmer's Peak ;)
01:19 Actualeyes joined #perl6
01:23 kurahaupo_ joined #perl6
01:27 MasterDuke hoping to not be too controversial, but RT #128969 is a paraphrasing of my previous comments and suggestion about error messages
01:27 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=128969
01:29 kalkin- joined #perl6
01:30 timotimo you seem to assume human hours not spent fixing a trivial bug could have fixed a difficult bug instead
01:33 unmatched} timotimo: that's part of the assumtion yes, but the bigger issue is consistency. You could open a thousand tickets each complaining about LTAness of some particular error and they would all be valid tickets, *because there's no plan for errors*
01:34 timotimo yeah, the metric for what error is good or not is subjective
01:34 timotimo but that doesn't mean we'll eternally flip-flop between different possibilities
01:40 unmatched} No, not eternally. Eventually we'd hit equllibrium :) For example why does block gobbling error put filename in which the error occurs last, yet levenshtein errors put the filename first? Which choice do you pick to be the "right" one? The errors I report for the same inconsistency will depend on that choice, because there's no master plan :D
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:49 dataangel Does perl 6 have anything like the override keyword from c++11? (Lets you mark a function in a subclass to explicitly indicate that it should be overwriting a function in the base class, benefits not you get a compile time error, so you catch things like when someone renames the function in the base class but forgets to in the derived class)
01:49 dataangel * benefit is that you get
01:50 timotimo we don't have that, but it ought to be pretty easy for a module
01:51 dataangel But there seems to be a keyword for everything else why not one more? ;)
01:51 timotimo because they're not keywords :)
01:51 timotimo and they don't have to be added in core for things to work right
01:52 Calibellus joined #perl6
01:53 timotimo https://github.com/jonathanstowe/Attribute-Lazy/blob/master/lib/Attribute/Lazy.pm  -  check this for an example
01:54 awwaiid joined #perl6
01:56 dataangel Very cool... not far along enough yet to understand the implementation yet but I'm looking forward to the meta-programming stuff
01:58 BenGoldberg dataangel, You could create a Role with a stub method, and give your base class a submethod BUILD which dies unless the current object being instantiated does that Role.
01:58 gfldex m: role R { method m {...} }; class C does R {};
01:58 camelia rakudo-moar b00d92: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Method 'm' must be implemented by C because it is required by a role␤at <tmp>:1␤»
01:58 gfldex dataangel: ^^^
01:58 timotimo i'd assume you'd have something like a compose method that would mix into the method object to be called when the class gets composed and then you'd inspect the superclasses (or the given class) for "does it have the specified method" and "do i actually override this properly? i.e. not just mix into a multi method?"
01:59 gfldex dataangel: you may want to unlearn the c++ concept of "baseclass"
01:59 dataangel gfldex: that's like having a pure virtual function C++ but it's not quite the same thing
02:02 BenGoldberg m: role R { submethod BUILD { say '\o/' } }; class C does R {}; C.new;
02:02 camelia rakudo-moar b00d92: OUTPUT«\o/␤»
02:02 gfldex any method call in Perl 6 uses late binding. If a method is implemented or not is a runtime question.
02:03 dataangel gfldex: seems like if roles can detect method collisions at compile time it should at least be possible for them
02:03 gfldex m: role R { method m {...} }; class C {}; my $c = C.new but R;
02:03 camelia rakudo-moar b00d92: OUTPUT«Method 'm' must be implemented by C+{R} because it is required by a role␤  in any compose_method_table at gen/moar/m-Metamodel.nqp line 2850␤  in any apply at gen/moar/m-Metamodel.nqp line 2860␤  in any compose at gen/moar/m-Metamodel.nqp line 3033…»
02:04 cyphase joined #perl6
02:04 BenGoldberg Now that I'm thinking about it, the c++ 'override' keyword is used within a subclass, in order to indicate, "I'm not defining a method here just for my own darn use, I'm defining this method here in order for it to replace a matching method in my superclass"
02:04 gfldex the border between runtime and compile time is fuzzy in Perl 6
02:04 dataangel BenGoldberg: yes
02:04 BenGoldberg It's to prevent typos, more or less.
02:05 dataangel Will also do not let classes get out of sync
02:06 BenGoldberg Yea, I can see that... if someone changes the source of a superclass, say "corrects" the spelling of a method, and any subclasses which *don't* have 'overrides' might compile but not work right.
02:06 awwaiid joined #perl6
02:07 dataangel yup
02:07 * dataangel bbl
02:07 timotimo oh, the important thing about "is override" is that you have to complain about every class that doesn't use it ...
02:09 gfldex what is sensible in a static language
02:09 timotimo well, when you use the module it could have an "as late as possible" phaser that goes through the whole module it was used "in"
02:10 gfldex m: role R1 { method m {...} }; role R2 { method m {'oi'} }; class C does R1 {}; my $c = C.new but R2;
02:10 camelia rakudo-moar b00d92: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Method 'm' must be implemented by C because it is required by a role␤at <tmp>:1␤»
02:10 BenGoldberg Surely could be checked at compose time?
02:10 gfldex here the concept breaks
02:11 gfldex $c would have m, but the compiler assumes static behaviour - in a dynamic language
02:13 timotimo i don't think that's what
02:13 timotimo m: class foo { method m { ... }; method m { 'oi' } };
02:13 camelia rakudo-moar b00d92: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Package 'foo' already has a method 'm' (did you mean to declare a multi-method?)␤at <tmp>:1␤»
02:13 timotimo hm
02:13 timotimo well, putting roles into a class is like copy-pasting the role body into that class
02:14 BenGoldberg m: role R1 { method m { ... } }; role R2 { method m { 42 } }; my $c = (R1&R2).new;
02:14 camelia rakudo-moar b00d92: ( no output )
02:14 BenGoldberg m: role R1 { method m { ... } }; role R2 { method m { 42 } }; my $c = (R1&R2).new; dd $c;
02:14 camelia rakudo-moar b00d92: OUTPUT«P6opaque: no such attribute '$!reified' in type List when trying to check if it's initialized␤  in block <unit> at <tmp> line 1␤␤»
02:15 BenGoldberg wtf?
02:15 noganex joined #perl6
02:15 timotimo m: Junction.new
02:15 camelia rakudo-moar b00d92: OUTPUT«P6opaque: no such attribute '$!reified' in type List when trying to check if it's initialized␤  in block <unit> at <tmp> line 1␤␤»
02:15 gfldex m: role R1 { method m { ... } }; role R2 { method m { 42 } }; my $c = (R2&R1).new; dd $c;
02:15 camelia rakudo-moar b00d92: OUTPUT«P6opaque: no such attribute '$!reified' in type List when trying to check if it's initialized␤  in block <unit> at <tmp> line 1␤␤»
02:15 leego joined #perl6
02:15 timotimo i golfed it much shorter already
02:16 BenGoldberg Why didn't it error when I didn't try to print $c?
02:16 BenGoldberg m: Str.new;
02:16 camelia rakudo-moar b00d92: ( no output )
02:16 BenGoldberg m: my $c = Junction.new;
02:16 camelia rakudo-moar b00d92: ( no output )
02:16 BenGoldberg m: Junction.new;
02:16 camelia rakudo-moar b00d92: OUTPUT«P6opaque: no such attribute '$!reified' in type List when trying to check if it's initialized␤  in block <unit> at <tmp> line 1␤␤»
02:16 gfldex Junctions are introspection-blackholes
02:16 timotimo it wasn't trying to autothread the junction when you didn't print or sink it
02:17 timotimo m: Junction.new; say "test"
02:17 camelia rakudo-moar b00d92: OUTPUT«P6opaque: no such attribute '$!reified' in type List when trying to check if it's initialized␤  in block <unit> at <tmp> line 1␤␤»
02:17 BenGoldberg m: Junction.new.sink;
02:17 camelia rakudo-moar b00d92: OUTPUT«P6opaque: no such attribute '$!reified' in type List when trying to check if it's initialized␤  in block <unit> at <tmp> line 1␤␤»
02:17 BenGoldberg m: my $c = (Int&Str).new;
02:17 camelia rakudo-moar b00d92: ( no output )
02:17 BenGoldberg m: my $c = (Int&Str).new; dd $c;
02:17 camelia rakudo-moar b00d92: OUTPUT«P6opaque: no such attribute '$!reified' in type List when trying to check if it's initialized␤  in block <unit> at <tmp> line 1␤␤»
02:19 BenGoldberg It's a little strange that I could .new on a junction type.
02:19 BenGoldberg And very strange what happens when trying to dd it.
02:20 BenGoldberg m: my $c = ("ook" ^ 42).new;
02:20 camelia rakudo-moar b00d92: ( no output )
02:20 BenGoldberg m: dd 42.new;
02:20 camelia rakudo-moar b00d92: OUTPUT«0␤»
02:20 BenGoldberg m: dd "ook".new;
02:20 camelia rakudo-moar b00d92: OUTPUT«""␤»
02:20 BenGoldberg m: dd 42.new(27);
02:20 camelia rakudo-moar b00d92: OUTPUT«27␤»
02:23 jack_rabbit joined #perl6
02:27 SmokeMachine____ m: my Int %a = a => 1, b => Int; %a .= pairs.grep(-> (:key($), :value($val)) {$val ~~ Any:D}); dd %a
02:27 camelia rakudo-moar b00d92: OUTPUT«Hash[Int] %a = (my Int % = :a(1), :b(Int))␤»
02:28 labster joined #perl6
02:30 SmokeMachine____ I can't get it...
02:31 BenGoldberg m: my Int %a = a => 1, b => Int; %a = Hash[Int].new(pairs.grep(-> (:key($), :value($val)) {$val ~~ Any:D})); dd %a
02:31 camelia rakudo-moar b00d92: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Calling pairs() will never work with any of these multi signatures:␤    ($x)␤at <tmp>:1␤------> 3 = a => 1, b => Int; %a = Hash[Int].new(7⏏5pairs.grep(-> (:key($), :value($val)) {$␤»
02:31 SmokeMachine____ m: my Int %a = a => 1, b => Int; my Int %b = %a.pairs.grep(-> (:key($), :value($val)) {$val ~~ Any:D}); dd %b
02:31 camelia rakudo-moar b00d92: OUTPUT«Hash[Int] %b = (my Int % = :a(1))␤»
02:31 BenGoldberg m: my Int %a = a => 1, b => Int; %a = Hash[Int].new(%a.pairs.grep(-> (:key($), :value($val)) {$val ~~ Any:D})); dd %a
02:31 camelia rakudo-moar b00d92: OUTPUT«Hash[Int] %a = (my Int % = :a(1))␤»
02:31 kyclark joined #perl6
02:31 BenGoldberg m: my Int %a = a => 1, b => Int; %a := Hash[Int].new(%a.pairs.grep(-> (:key($), :value($val)) {$val ~~ Any:D})); dd %a
02:31 camelia rakudo-moar b00d92: OUTPUT«(my Int % = :a(1))␤»
02:32 SmokeMachine____ but why the .= doesn't work?
02:32 BenGoldberg m: my Int %a = a => 1, b => Int; %a{not defined *.value}:delete; dd %a
02:32 camelia rakudo-moar b00d92: OUTPUT«Hash[Int] %a = (my Int % = :a(1), :b(Int))␤»
02:33 BenGoldberg m: dd (not defined *.value)
02:33 camelia rakudo-moar b00d92: OUTPUT«Bool::False␤»
02:33 BenGoldberg m: False.not.say;
02:33 camelia rakudo-moar b00d92: OUTPUT«True␤»
02:33 BenGoldberg m: my Int %a = a => 1, b => Int; %a{*.value.defined.not}:delete; dd %a
02:33 camelia rakudo-moar b00d92: OUTPUT«WhateverCode object coerced to string (please use .gist or .perl to do that)  in block <unit> at <tmp> line 1␤Hash[Int] %a = (my Int % = :a(1), :b(Int))␤»
02:34 BenGoldberg m: my Int %a = a => 1, b => Int; %a{%a.grep(*.value.defined.not).map: *.key}:delete; dd %a
02:34 camelia rakudo-moar b00d92: OUTPUT«Hash[Int] %a = (my Int % = :a(1))␤»
02:35 SmokeMachine____ but shouldn't the .= op work?
02:38 BenGoldberg Maybe?
02:38 * BenGoldberg shrugs
02:40 wamba joined #perl6
02:41 SmokeMachine____ m: my Int %a = a => 1, b => Int; dd %a{* ~~ Any:D}
02:41 camelia rakudo-moar b00d92: OUTPUT«WhateverCode object coerced to string (please use .gist or .perl to do that)  in block <unit> at <tmp> line 1␤Int %a = Int␤»
02:41 SmokeMachine____ this internally loops through all keys?
02:43 Calibellus joined #perl6
02:43 gfldex m: my Int %a = a => 1, b => Int; dd %a.pairs.grep(-> (:key($), :value($val)) {$val ~~ Any:D});
02:43 camelia rakudo-moar b00d92: OUTPUT«(:a(1),).Seq␤»
02:43 gfldex .= should have worked
02:44 gfldex my Int $i = 42; $i.=new; dd $i;
02:44 gfldex m: my Int $i = 42; $i.=new; dd $i;
02:44 camelia rakudo-moar b00d92: OUTPUT«Int $i = 0␤»
02:45 gfldex Hash slices don't take a matcher, they want a list of keys
02:57 prammer joined #perl6
03:08 prammer joined #perl6
03:08 awwaiid joined #perl6
03:09 dalek doc: 2ebe550 | gfldex++ | doc/Type/Proxy.pod6:
03:09 dalek doc: warn about breaking inmutability with Proxy
03:09 dalek doc: review: https://github.com/perl6/doc/commit/2ebe550701
03:11 gfldex m: my class C is Proxy {};
03:11 camelia rakudo-moar b00d92: ( no output )
03:11 gfldex m: my class C is Proxy {}; dd C.new;
03:11 camelia rakudo-moar b00d92: OUTPUT«Required named parameter 'FETCH' not passed␤  in block <unit> at <tmp> line 1␤␤»
03:12 cyphase joined #perl6
03:12 jack_rabbit joined #perl6
03:18 prammer joined #perl6
03:19 skids m: my class C is Proxy {}; dd C.new(FETCH -> $ { 42 }
03:19 camelia rakudo-moar b00d92: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' ␤at <tmp>:1␤------> 3 is Proxy {}; dd C.new(FETCH -> $ { 42 }7⏏5<EOL>␤    expecting any of:␤        postfix␤»
03:20 skids m: my class C is Proxy {}; dd C.new(FETCH -> $ { 42 })
03:20 camelia rakudo-moar b00d92: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Undeclared name:␤    FETCH used at line 1␤␤»
03:20 skids m: my class C is Proxy {}; dd C.new(FETCH => $ { 42 })
03:20 camelia rakudo-moar b00d92: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' ␤at <tmp>:1␤------> 3class C is Proxy {}; dd C.new(FETCH => $7⏏5 { 42 })␤    expecting any of:␤        infix stopper␤     …»
03:20 gfldex m: my class C is Proxy {}; dd C.new(FETCH => -> $ { 42 })
03:20 camelia rakudo-moar b00d92: OUTPUT«Required named parameter 'STORE' not passed␤  in block <unit> at <tmp> line 1␤␤»
03:20 skids m: my class C is Proxy {}; dd C.new(FETCH => -> $ { 42 }, STORE => -> $,$ { "OHAI".say; 42 })
03:20 camelia rakudo-moar b00d92: OUTPUT«42␤»
03:21 skids Hrm you cannot make a RO proxy?
03:21 gfldex you can
03:21 skids but you still need a STORE?
03:22 gfldex m: my class C is Proxy {}; my $container = C.new(FETCH => -> $ { 42 }, STORE => -> $,$ { "OHAI".say; 42 }); say $container; $container = 1; say $container
03:22 camelia rakudo-moar b00d92: OUTPUT«42␤1␤»
03:22 skids m: my class C is Proxy {}; my $container := C.new(FETCH => -> $ { 42 }, STORE => -> $,$ { "OHAI".say; 42 }); say $container; $container = 1; say $container
03:22 camelia rakudo-moar b00d92: OUTPUT«42␤OHAI␤42␤»
03:22 gfldex the constructor on Proxy demands :$STORE
03:24 skids That would seem to be, but why?
03:25 gfldex design decision
03:26 gfldex give what massive foodgun proxy is I'm not sad about it
03:28 prammer joined #perl6
03:30 lichtkind_ joined #perl6
03:34 TEttinger mmm foodgun
03:35 awwaiid joined #perl6
03:36 cpage_ joined #perl6
03:37 skids Did anyone ever figure out what :api<> is supposed to do for compunits?
03:50 awwaiid joined #perl6
03:53 gzix joined #perl6
04:04 kyclark joined #perl6
04:07 awwaiid joined #perl6
04:09 gzix Hi.. I'm waiting for perl 6 a way long. When its going to possibly released
04:09 araujo joined #perl6
04:10 timotimo http://perl6.org/downloads/ - have fun
04:13 rkazak joined #perl6
04:21 cibs joined #perl6
04:22 timotimo gzix: does that help?
04:22 Cabanossi joined #perl6
04:31 gzix Can i use it for production
04:31 gzix ?
04:32 gzix Anyway, thanks timotimo..
04:32 gfldex you will encounter bugs
04:32 gfldex if that matters for what you do, we can not know
04:39 awwaiid joined #perl6
05:29 prammer joined #perl6
05:30 awwaiid joined #perl6
05:34 Khisanth joined #perl6
05:39 pierre_ joined #perl6
05:49 brrt joined #perl6
05:58 BenGoldberg m: role { method m { ... } } but role { method m { 42 } }.new;
05:58 camelia rakudo-moar b00d92: OUTPUT«Method 'm' must be implemented by <anon|57472960> because it is required by a role␤  in any compose_method_table at gen/moar/m-Metamodel.nqp line 2850␤  in any apply at gen/moar/m-Metamodel.nqp line 2860␤  in any compose at gen/moar/m-Metamodel.nqp l…»
05:58 BenGoldberg m: (role { method m { ... } } but role { method m { 42 } }).new;
05:58 camelia rakudo-moar b00d92: OUTPUT«Method 'mixin' not found for invocant of class 'Perl6::Metamodel::ParametricRoleHOW'␤  in block <unit> at <tmp> line 1␤␤»
05:59 BenGoldberg Strange error.
06:10 CIAvash joined #perl6
06:16 andrzejku joined #perl6
06:22 firstdayonthejob joined #perl6
06:25 brrt joined #perl6
06:31 domidumont joined #perl6
06:35 awwaiid joined #perl6
06:36 domidumont joined #perl6
06:44 MilkmanDan joined #perl6
06:47 Actualeyes joined #perl6
06:52 movl joined #perl6
06:52 CIAvash joined #perl6
06:57 awwaiid joined #perl6
06:58 shantanu joined #perl6
06:58 avalenn joined #perl6
06:59 rkazak joined #perl6
07:09 RabidGravy joined #perl6
07:12 darutoko joined #perl6
07:14 movl joined #perl6
07:14 TheLemonMan joined #perl6
07:19 awwaiid joined #perl6
07:25 labster joined #perl6
07:32 awwaiid joined #perl6
07:34 shantanu nine: Hi
07:36 nine m: say $*REPO.next-repo.installed
07:36 camelia rakudo-moar b00d92: OUTPUT«()␤»
07:36 nine m: say $*REPO.next-repo.next-repo.installed
07:36 camelia rakudo-moar b00d92: OUTPUT«()␤»
07:36 nine m: say $*REPO.next-repo.next-repo.next-repo.installed
07:36 camelia rakudo-moar b00d92: OUTPUT«(CompUnit::Repository::Installation::InstalledDistribution.new(prefix => "/home/camelia/rakudo-m-inst-2/share/perl6".IO(:SPEC(IO::Spec::Unix),:CWD("/home/camelia"))))␤»
07:36 nine Ah, there we go :)
07:36 nine m: say $*REPO.next-repo.next-repo.next-repo.name
07:36 camelia rakudo-moar b00d92: OUTPUT«perl␤»
07:38 bjz joined #perl6
07:38 nine m: say $*REPO.next-repo.next-repo.next-repo.installed[0].meta<provides>.keys
07:38 camelia rakudo-moar b00d92: OUTPUT«(Pod::To::Text NativeCall::Compiler::MSVC CompUnit::Repository::Staging experimental newline NativeCall::Compiler::GNU NativeCall NativeCall::Types Test TAP)␤»
07:38 nine shantanu: does this make sense?
07:39 nine m: say $*REPO.repo-chain.grep(CompUnit::Repository::Installable)
07:39 camelia rakudo-moar b00d92: OUTPUT«(inst#/home/camelia/.perl6 inst#/home/camelia/rakudo-m-inst-2/share/perl6/site inst#/home/camelia/rakudo-m-inst-2/share/perl6/vendor inst#/home/camelia/rakudo-m-inst-2/share/perl6)␤»
07:39 nine All Installable repos have the .installed method
07:42 shantanu ahh this is new for me. Whats $*REPO?
07:43 shantanu when I do a use lib 'lib
07:43 gfldex a way to solve the problems that arise when one tries to rely on filenames when it comes to modules
07:43 shantanu nine: when I do a use lib 'lib'; it seems to change the output of $*REPO
07:44 sno joined #perl6
07:45 shantanu nine: isn't use lib 'lib'; supposed to append to the @INC list?
07:48 shantanu nine: Ahh I just realized, thats a handle! so you call next-repo on it to cycle through your repos. :)
07:49 shantanu m: say $*REPO.next-repo.next-repo.next-repo.installed[0]
07:49 camelia rakudo-moar b00d92: OUTPUT«CompUnit::Repository::Installation::InstalledDistribution.new(prefix => "/home/camelia/rakudo-m-inst-2/share/perl6".IO(:SPEC(IO::Spec::Unix),:CWD("/home/camelia")))␤»
07:50 shantanu nine: got it! Thanks for your help!
07:53 zakharyas joined #perl6
07:53 dakkar joined #perl6
07:59 nine shantanu: $*REPO replaced @INC. Giving those repositories a say in where to look next for a module has some nice advantages.
08:01 AlexDaniel joined #perl6
08:01 shantanu nine: I can figured. I do see a lot more support for generator like code in p6 with lazy arrays and such. I am quiet happy to see that. :)
08:06 canopus joined #perl6
08:12 dalek ecosystem: dedc552 | (Shantanu Bhadoria)++ | META.list:
08:12 dalek ecosystem: Add Printer::ESCPOS to ecosystem
08:12 dalek ecosystem:
08:12 dalek ecosystem: See https://github.com/shantanubhadoria/p6-Printer-ESCPOS
08:12 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/dedc5527d9
08:12 dalek ecosystem: 59a9227 | RabidGravy++ | META.list:
08:12 dalek ecosystem: Merge pull request #235 from shantanubhadoria/master
08:12 dalek ecosystem:
08:12 dalek ecosystem: Add Printer::ESCPOS to ecosystem
08:12 dalek ecosystem: review: https://github.com/perl6/ecosystem/commit/59a9227ca3
08:15 awwaiid joined #perl6
08:16 shantanu Thanks RabidGravy! This is my first port of one of my p5 modules to p6. Please review and send me your bricks, bats or flowers!
08:17 araujo_ joined #perl6
08:17 RabidGravy to be honest I haven't the faintest what it even does, but hey! :)
08:18 gfldex shantanu: please consider adding travis support
08:18 DrForr shantanu: Hi! (from FB - Jeff G.) Glad to see that bit of perl6 didn't put you out :)
08:18 RabidGravy though if it's for a "printer" the usefulness of travis testing is somewhat limited :)
08:19 shantanu Its for Receipt printers that you see at those retail outlets and such.
08:20 RabidGravy excellent stuff, does it actually get used in the wild?
08:20 shantanu The ones that print out most of your bills at restaurants.
08:21 shantanu Yeah I have got a few support requests for users around the world for my p5 module. Assuming there are 10-20 users for each one I have been contacted by I guess around 200-400 users.
08:21 RabidGravy (The last time I wrote any software to interact with an EPOS system was like twenty years ago ... in qbasic )
08:21 shantanu I use it at my job for my company's POS system as well.
08:22 gfldex shantanu: if you indent =begin code blocks, you will get an extra level of indentation in pod6
08:23 labster joined #perl6
08:23 shantanu btw in case you are interested my p5 version of module has 650 lines of code, the p6 version around 200. All due to easier typechecking support :)
08:24 gfldex m: enum FOO(ESC => "\x1b"); dd FOO.enums;
08:24 camelia rakudo-moar b00d92: OUTPUT«Map.new((:ESC("\x[1b]")))␤»
08:25 shantanu gfldex: Thanks, so no need to indent stuff inside =begin code blocks? Sorry I have been using POD:Weaver exclusively for p5. I hope that comes to p6 soon.
08:26 gfldex we don't got any external pod parsers yet, it's all done by The Perl 6 Grammar
08:28 gfldex and the action class in question will not remove the indentation. The renderers we have right now do add indentation. So there will be to much of the good stuff in the end,
08:28 gfldex m: enum FOO(ESC => "\x1b"); dd FOO.enums; say "ESC" ∈ FOO;
08:28 camelia rakudo-moar b00d92: OUTPUT«Map.new((:ESC("\x[1b]")))␤False␤»
08:29 gfldex m: enum FOO(ESC => "\x1b"); dd FOO.enums; say ESC ∈ FOO;
08:29 camelia rakudo-moar b00d92: OUTPUT«Map.new((:ESC("\x[1b]")))␤False␤»
08:29 gfldex m: enum FOO(ESC => "\x1b"); dd FOO.enums; say ESC ~~ FOO;
08:29 camelia rakudo-moar b00d92: OUTPUT«Map.new((:ESC("\x[1b]")))␤True␤»
08:29 gfldex ∈ would make sense for enums
08:31 gfldex shantanu: you could implement stuff like <UPC-A UPC-E JAN13 JAN8 CODE39 ITF CODABAR CODE93 CODE128>, match with ~~ and generate parts of the error messages automatically
08:31 gfldex s//Enum/
08:31 shantanu without using a subtype?
08:33 shantanu gfldex: can you give me a example of the code?
08:33 gfldex m: enum BarcodeSystem(<UPC-A UPC-E JAN13 JAN8 CODE39 ITF CODABAR CODE93 CODE128>); say BarcodeSystem.enums.keys.map({'"'~$_~'"'}).join(', ');
08:33 camelia rakudo-moar b00d92: OUTPUT«"CODE128", "UPC-E", "JAN8", "CODE39", "UPC-A", "CODABAR", "JAN13", "ITF", "CODE93"␤»
08:34 shantanu gfldex: How would I call a enum declared in a class from its object? I had some trouble exporting the enum type from my package
08:35 AlexDaniel /o\ ({'"'~$_~'"'})
08:35 AlexDaniel m: enum BarcodeSystem(<UPC-A UPC-E JAN13 JAN8 CODE39 ITF CODABAR CODE93 CODE128>); say BarcodeSystem.enums.keys.map({““$_””}).join(', ');
08:35 camelia rakudo-moar b00d92: OUTPUT«“CODE128”, “UPC-E”, “JAN8”, “CODE39”, “UPC-A”, “CODABAR”, “JAN13”, “ITF”, “CODE93”␤»
08:35 AlexDaniel m: enum BarcodeSystem(<UPC-A UPC-E JAN13 JAN8 CODE39 ITF CODABAR CODE93 CODE128>); say BarcodeSystem.enums.keys.map({“"$_"”}).join(', '); # or this, if you insist
08:35 camelia rakudo-moar b00d92: OUTPUT«"CODE128", "UPC-E", "JAN8", "CODE39", "UPC-A", "CODABAR", "JAN13", "ITF", "CODE93"␤»
08:36 g4 joined #perl6
08:36 g4 joined #perl6
08:36 gfldex shantanu: didn't try that yet, may contain bugs
08:37 gfldex shantanu: later you do my `%barcodeSystemMap = UPC-A => 0,` what you would get for free with enums
08:37 AlexDaniel m: enum BarcodeSystem(<UPC-A UPC-E JAN13 JAN8 CODE39 ITF CODABAR CODE93 CODE128>); say ““{BarcodeSystem.enums.keys.join('”, “')}””;
08:37 camelia rakudo-moar b00d92: OUTPUT«“CODE128”, “UPC-E”, “JAN8”, “CODE39”, “UPC-A”, “CODABAR”, “JAN13”, “ITF”, “CODE93”␤»
08:38 shantanu I had a enum for barcodeSystem first declared within the class. But I got a bareword error when I tried to use the enum name like CODABAR in the object.
08:39 gfldex shantanu: enums are not used that often, so there may acutally be a few bugs left
08:40 shantanu gdflex: Thanks, I kinda see what you mean. it could shave off a few more lines if I declare a enum and then use it for validation and mapping as well. Would be cool if I could export the barewords from enum keys though.
08:40 gfldex shantanu: some golfing would be very welcome
08:41 gfldex does camelia understand multi-file gists?
08:43 awwaiid joined #perl6
08:48 AlexDaniel no
08:48 AlexDaniel gfldex: how would it know which file to execute? :)
08:49 AlexDaniel that's a good question actually, something I can add to committable
08:50 RabidGravy gfldex, au contraire - I use enumerations a lot
08:50 gfldex AlexDaniel: find the one with a sub MAIN
08:50 AlexDaniel gfldex: okay, that would work. But what about gists without MAIN?
08:51 gfldex complain for multi gists without a MAIN
08:53 gfldex shantanu: you may want to define your own exception types by subclassing from Exception. Not sure if that makes sense for Printer::ESCPOS tho.
08:54 gfldex m: sub f(*@a where {$_.any ~~ Int}){say @a}; f(42); f(<a>);
08:54 camelia rakudo-moar b00d92: OUTPUT«[42]␤Constraint type check failed for parameter '@a'␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
08:55 gfldex shantanu: ^^^ you can have the type constraint for slurpy arrays in the signature if you like
08:55 gfldex m: sub f(*@a where {$_.all ~~ Int}){say @a}; f(42); f(<a>);
08:55 camelia rakudo-moar b00d92: OUTPUT«[42]␤Constraint type check failed for parameter '@a'␤  in sub f at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
08:55 gfldex it's .all ofc
08:57 awwaiid joined #perl6
08:57 gfldex m: Bool $a; say $a.Int;
08:57 camelia rakudo-moar b00d92: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3Bool7⏏5 $a; say $a.Int;␤    expecting any of:␤        infix␤        infix stopper␤        statement end␤        statement modifier␤        stateme…»
08:57 gfldex m: my Bool $a; say $a.Int;
08:57 camelia rakudo-moar b00d92: OUTPUT«(Bool)␤»
08:57 gfldex m: my Bool $a = True; say $a.Int;
08:57 camelia rakudo-moar b00d92: OUTPUT«True␤»
08:58 gfldex m: my Bool $a = True; print $a.Int;
08:58 camelia rakudo-moar b00d92: OUTPUT«True»
08:59 gfldex m: my Bool $a = True; dd $a.Int;
08:59 camelia rakudo-moar b00d92: OUTPUT«Bool::True␤»
09:00 gfldex m: my Bool $a = True; dd $a.Numeric;
09:00 camelia rakudo-moar b00d92: OUTPUT«1␤»
09:00 shantanu gfldex: Thanks! I was looking for constraint on slurpys. I think some of the documentation suggests it can't be done
09:00 gfldex doing it the easy way is NYI
09:10 shantanu gfldex: Yeah I thought $a.Int would work but there is a bug there. I am using $a.value, whats the difference between .value and .Numeric ?
09:10 gfldex Bool is an enum and the default type of enum values happens to be Int. You went lucky. :)
09:11 El_Che morning
09:13 shantanu gfldex: So that could change in future? Would I be better of with .Numeric?
09:14 RabidGravy If you know it is an Int then it's fine
09:14 RabidGravy but don't rely on other people's enumerations being Ints
09:16 gfldex shantanu: for bool .Numeric will work (I checked the source). A fix for that bug is easy.
09:17 dalek doc: 4abb361 | gfldex++ | doc/Type/Signature.pod6:
09:17 dalek doc: show how to constraint slurpy arguments
09:17 dalek doc: review: https://github.com/perl6/doc/commit/4abb3619b0
09:19 shantanu I see that th documentation for Bool mentions numeric explicitly, I will switch to that. Thanks a lot for your suggestion.
09:20 gfldex yw
09:24 g4 joined #perl6
09:24 g4 joined #perl6
09:25 shantanu gfldex Is there a standard inbuilt exception name to throw if when method params provided are invalid?
09:25 nine shantanu: sounds like you want to beef up your method's signature?
09:27 shantanu nine: Hey, I am not sure what that means actually.
09:28 shantanu nine: I just wanted to throw the standard exception in case of invalid params if there is such a exception class. I have params whose validity is dependent on value of other params.
09:28 nine shantanu: you really want to put all parameter checking into your method's signature.
09:28 nine m: sub foo($a, $b where $b ne $a) { }; foo("a", "b"); foo("a", "a");
09:28 camelia rakudo-moar b00d92: OUTPUT«Constraint type check failed for parameter '$b'␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
09:28 nine shantanu: ^^^
09:29 RabidGravy ooh Fedora has just given me rakudo 2016-07
09:29 nine RabidGravy: you could have had that with openSUSE several weeks ago ;)
09:29 shantanu nine: ohh yes, it thats the idea, if my method code can only include the tasks it needs to do and I delegate all the constraint checking to type definitions, it should lead to easier understanding of my code.
09:30 RabidGravy all good stuff
09:34 mvorg joined #perl6
09:37 shantanu m: sub foo($a, $b where $b ne $a) { }; foo("a", "a");
09:37 camelia rakudo-moar b00d92: OUTPUT«Constraint type check failed for parameter '$b'␤  in sub foo at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
09:37 shantanu m: sub foo($a, $b where $b ne $a) { }; foo("a", "b");
09:37 camelia rakudo-moar b00d92: ( no output )
09:38 araujo joined #perl6
09:38 araujo joined #perl6
09:39 prammer joined #perl6
09:40 su joined #perl6
09:46 shantanu m: '3' ∈ <3 a b>
09:46 camelia rakudo-moar b00d92: OUTPUT«WARNINGS for <tmp>:␤Useless use of "∈" in expression "'3' ∈ <3 a b>" in sink context (line 1)␤»
09:47 shantanu m: say '3' ∈ <3 a b>
09:47 camelia rakudo-moar b00d92: OUTPUT«False␤»
09:47 shantanu m: say 'a' ∈ <3 a b>
09:47 camelia rakudo-moar b00d92: OUTPUT«True␤»
09:47 shantanu Is that a bug?
09:47 shantanu m: say 'a' ∈ ('3', 'a', 'b')
09:47 camelia rakudo-moar b00d92: OUTPUT«True␤»
09:48 jnthn No
09:48 jnthn m: say ('3', 'a', 'b')
09:48 camelia rakudo-moar b00d92: OUTPUT«(3 a b)␤»
09:48 jnthn m: say ('3', 'a', 'b').perl
09:48 camelia rakudo-moar b00d92: OUTPUT«("3", "a", "b")␤»
09:48 jnthn m: say <3 a b>.perl
09:48 camelia rakudo-moar b00d92: OUTPUT«(IntStr.new(3, "3"), "a", "b")␤»
09:48 gfldex m: sub foo($a, $b where $b ne $a) { }; foo("a", "a"); CATCH { default { say .^name } };
09:48 camelia rakudo-moar b00d92: OUTPUT«X::AdHoc␤»
09:49 awwaiid joined #perl6
09:49 gfldex LTA exception name :)
09:50 gfldex shantanu: complete list: https://docs.perl6.org/type-exceptions.html
09:50 shantanu gfldex: Thanks :)
09:51 lizmat m: die; CATCH { dd $_ }   # it's the default from "die"
09:51 camelia rakudo-moar b00d92: OUTPUT«X::AdHoc.new(payload => "Died")␤Died␤  in block <unit> at <tmp> line 1␤␤»
09:51 zakharyas joined #perl6
09:52 shantanu jnthn: Thanks, I learnt about IntStr! :)
09:56 AlexDaniel m: say ~IntStr.new(42, ‘sixty-nine’)
09:56 camelia rakudo-moar b00d92: OUTPUT«sixty-nine␤»
09:56 AlexDaniel m: say +IntStr.new(42, ‘sixty-nine’)
09:56 camelia rakudo-moar b00d92: OUTPUT«42␤»
10:00 TheLemonMan hmm, #127012 should be referenced in #128803 as it has the same root cause
10:00 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=127012
10:00 synopsebot6 Link:  https://rt.perl.org/rt3//Public/Bug/Display.html?id=128803
10:00 pdcawley joined #perl6
10:01 vcv joined #perl6
10:03 AlexDaniel TheLemonMan: and this root cause is?
10:04 TheLemonMan AlexDaniel, http://irclog.perlgeek.de/perl6/2016-08-16#i_13034286
10:09 shantanu DrForr: Hi Jeff! Yeah I am enjoying it so far. :)
10:10 AlexDaniel TheLemonMan: I've added a reference
10:11 DrForr Just glad to see that you weren't dissuaded. To those ont eh inside that's just a harmless bit of golfing, but if you don't understand the language I'm sure it can seem to be a WAT.
10:12 DrForr *on the
10:23 pierre_ joined #perl6
10:26 moritz .botsnack
10:26 synopsebot6 om nom nom
10:26 yoleaux :D
10:26 * moritz goes back to roaming-imposed awayness
10:36 grondilu joined #perl6
10:44 movl joined #perl6
10:50 awwaiid joined #perl6
10:52 gfldex shantanu: FYI https://github.com/rakudo/rakudo/commit/a4140a3ec6
10:56 prammer joined #perl6
10:56 masak m: sub infix:«->»(\lhs, \rhs) { "blah" }; say 1 -> 2; say 3
10:56 camelia rakudo-moar b00d92: OUTPUT«1␤3␤»
10:57 pmurias joined #perl6
10:57 masak TimToady: is the above what you'd expect?
10:58 lizmat m: sub infix:«-->»(\lhs, \rhs) { "blah" }; say 1 --> 2; say 3
10:58 camelia rakudo-moar b00d92: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Confused␤at <tmp>:1␤------> 3nfix:«-->»(\lhs, \rhs) { "blah" }; say 17⏏5 --> 2; say 3␤    expecting any of:␤        postfix␤        statement end␤        statement modifier␤        stat…»
10:58 masak (I know why it happens, with <infixstopper> and stuff. just wondering if the behavior is sane enough)
10:58 masak lizmat: the `>>>` parses as `>>` and then spurious `>`
10:59 masak oh, I'm wrong
10:59 masak sorry, misconfigured terminal
10:59 lizmat ok  :-)
10:59 masak all my »s expand into >>s :/
10:59 masak haven't figgered out why yet
10:59 lizmat I just added two hyphens in two places taking your example
11:00 masak aye
11:00 lizmat I mean, it would be nice if this would work:
11:01 lizmat m: my @a = ^10; for @a --> Str { .Str }
11:01 camelia rakudo-moar b00d92: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Missing block␤at <tmp>:1␤------> 3my @a = ^10; for @a7⏏5 --> Str { .Str }␤    expecting any of:␤        block or pointy block␤»
11:01 lizmat m: my @a = ^10; for @a -> \x --> Str { x.Str }
11:01 camelia rakudo-moar b00d92: ( no output )
11:02 lizmat I mean, in a sub signature you can also just specify the return sig
11:03 lizmat specifying a non-Slip return sig, can make the loop go faster
11:05 lizmat m: my @a = ^1000; for ^1000 { @a.map( ->\x --> Str { x.Str } }; say now - INIT now
11:05 camelia rakudo-moar b00d92: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' ␤at <tmp>:1␤------> 3 ^1000 { @a.map( ->\x --> Str { x.Str } 7⏏5}; say now - INIT now␤»
11:05 lizmat m: my @a = ^1000; for ^1000 { @a.map: ->\x --> Str { x.Str } }; say now - INIT now
11:05 camelia rakudo-moar b00d92: OUTPUT«0.8080561␤»
11:05 lizmat m: my @a = ^1000; for ^1000 { @a.map: ->\x --> Str { x.Str } }; say now - INIT now
11:05 camelia rakudo-moar b00d92: OUTPUT«0.8038859␤»
11:06 lizmat oops, pasto
11:06 lizmat m: my @a = ^1000; for ^1000 { @a.map: *.Str }; say now - INIT now
11:06 camelia rakudo-moar b00d92: OUTPUT«0.994976␤»
11:06 lizmat m: say 0.8080561 / 0.994976
11:06 camelia rakudo-moar b00d92: OUTPUT«0.81213627␤»
11:08 araujo joined #perl6
11:25 pierre_ joined #perl6
11:32 awwaiid joined #perl6
11:45 awwaiid joined #perl6
11:55 n1lp7r joined #perl6
11:57 prammer joined #perl6
12:03 pierre_ joined #perl6
12:04 smls joined #perl6
12:07 prammer joined #perl6
12:10 masak I don't know how big the audience is for this, but here's the current Q type hierarchy for 007: https://gist.github.com/masak/ab28db9201e8d45c21ee60ea9ae7ad51
12:11 masak (I just compiled it in tree form because I'm toying with new text for the 007 web page)
12:12 nilptr joined #perl6
12:13 DrForr masak: Useful for me, thanks.
12:13 masak cool.
12:14 masak keep in mind that 007 is both inspired by and distinct from Perl 6.
12:14 masak we try to steer close to Perl 6 syntax and semantics, but we also try to be aggressively lazy when it serves us :)
12:15 DrForr Yeah, there are some obvious differences, and I'm taking a slighty different tack; mostly pragmatic.
12:16 masak remind me -- you're taking a different tack, with... what? :)
12:17 DrForr One moment.
12:17 DrForr https://github.com/drforr/perl6-Perl6-Tidy
12:18 masak nice
12:19 masak looks like we have enough philosophical overlap that it would be interesting to have a chat at some point
12:19 DrForr I'm just a *bit* busy at YAPC but *please* grab me.
12:24 awwaiid joined #perl6
12:24 masak :)
12:26 prammer joined #perl6
12:28 pierre_ joined #perl6
12:33 El_Che if someone with knowledge of the wealth of error could have a look at https://github.com/nxadm/syntastic/blob/master/README-perl6.md. I think I catch and hightlight most perl6 -c errors I have found, but I want to be as complete as possible before pushing perl 6 support upstream (syntastic, a vim linter)
12:36 El_Che screenshot: https://github.com/nxadm/syntastic/blob/master/screenshot-perl6.png
12:37 lizmat wow
12:37 awwaiid joined #perl6
12:40 El_Che lizmat: once perl6 -c can spit out json errors there are more possibilities for multi line errors (so far undeclared routine/name is the only ones I have found)
12:43 El_Che lizmat: I am working on an vim-perl6 howto that include all the plugins needed for perl6 support, but I was waiting untill this was pushed upstream to publish it
12:44 kjs_ joined #perl6
12:45 El_Che so far I have sane vimrc defaults as a starting point, vim-perl (syntax highlighted), vim-airline (status bar), tabular (align text), vim-figitive (git support),vim-markdown (for the readmes), the syntastic fork (for now) with perl6 support, and youcompleteme with fuzzy autocomplete taht works great
12:46 El_Che in the future, maybe the autocomplete could be less fuzzy and more perl6 specific, but so far it has been good
12:46 lizmat El_Che++
12:48 El_Che I could publish it now and point people to the fork, but I think it's better to wait, no?
12:48 lizmat release early release often!  :-)
12:49 [Coke] gfldex: telling people "they will encounter bugs" when they ask "is it ready for production" is unhelpfully true.
12:49 [Coke] (all software has bugs)
12:49 kjs_ joined #perl6
12:51 El_Che I think that DrForr Perl6::Tidy would make a great base for a plugin for vim or atom
12:51 gfldex [Coke]: do you think it would be better to see folk walk away and never return because we promised what we can't hold?
12:51 El_Che (in the case of atom, it's just a config pointing to the rightexecutable)
12:52 DrForr I'm getting close to being able to roundtrip; the problem mainly is that the official grammar doesn't put a lot of the barewords into terms where they can be used, although I understand why.
12:52 mcmillhj joined #perl6
12:52 [Coke] gfldex: I'm not saying "don't say we have bugs", but that marketing matters, even at this level.
12:53 rkazak joined #perl6
12:53 kjs_ joined #perl6
12:54 gfldex [Coke]: if being good at marketing requires me to give visitors advice that may cause them harm, then I will have to refuse to be good at marketing.
12:54 cat298 joined #perl6
12:55 cat298 hey I am trying to work on two libraries at the same time, but "perl6 -Ilib" only seems to be loading 1, the other is the version panda installed
12:55 kjs_ joined #perl6
12:56 unmatched} cat298: -Ilib just adds ./lib to the search paths for libraries
12:57 unmatched} cat298: are both of them in ./lib?
12:57 cat298 unmatched: I know, but the path is supposed have precedence when added via -Ilib, correct?
12:57 cat298 unmatched: yes, both are in ./lib
12:57 El_Che DrForr: a good autoformatter (besides tabular that works nicely on part of the file) is the only thing missing from my list
12:59 TheLemonMan hmm, is there any documentation about MoarVM call frames ?
13:00 nine cat298: precedence over what?
13:00 unmatched} cat298: yeah, and it works for me. What is your perl6 -v ? https://gist.github.com/zoffixznet/281a4534659d2032938375e78241c03f
13:00 unmatched} nine: over installed modules
13:00 nine unmatched}: yes, it does
13:02 unmatched} TheLemonMan: maybe there's something in here? https://github.com/MoarVM/MoarVM/tree/master/docs
13:02 cat298 unmatched: well I am using Ilib successfully to modify one library I am developing
13:03 cat298 unmatched: but basically I am trying to add SSL/TLS support to http::client, and that means screwing around with the OpenSSL module, and the OpenSSL module seems to be loaded from Panda and not the lib directory
13:04 TheLemonMan unmatched}, doesn't seem so, but I found an useful post on 6guts
13:04 unmatched} cat298: works fine with two modules too. Not sure what to suggest to you. Maybe check you got the paths right. https://gist.github.com/zoffixznet/98c1e0f3313b7e237c3ed1f81a40cd06
13:04 jnthn TheLemonMan: The data structures in the MoarVM header files are commented with what stuff is. frame.h is the important one in this case.
13:05 nine cat298: run as RAKUDO_MODULE_DEBUG=1 perl6
13:05 cat298 unmatched}: yeah but the issue is that the other module is 2 levels down in dependencies... so IO::Net::Socket is loaded from Panda, but I want to load OpenSSL from my local version
13:05 nine cat298: that will give you loads of debug output
13:06 nine cat298: if you gist the debug output, I may have a look at it
13:09 dalek rt-six-help: 89e02b5 | coke++ | summary.p6:
13:09 dalek rt-six-help: care about a few more tags
13:09 dalek rt-six-help: review: https://github.com/coke/rt-six-help/commit/89e02b5908
13:09 cdg joined #perl6
13:10 cdg joined #perl6
13:10 cat298 nine: this is what I have: https://gist.github.com/clearairturbulence/5ba56a5d6e20c2a7063ce9a3180835f6
13:13 cat298 I know that it's not loading the other libraries because I commented out a ';' and I am not getting a syntax error
13:13 cat298 I am not loading the OpenSSl one that is
13:14 cat298 I just moved IO::Socket::SSL source into my lib to see if that would work to no avail
13:14 nine Hm....I don't see any IO::Net::Socket at all in this output
13:16 cat298 nine: sorry, I moved it after that gist, I'll create a new one
13:17 cat298 nine: https://gist.github.com/clearairturbulence/fdd4b759119aa613078cf5cb5352be54
13:19 nine Still no IO::Net::Socket?
13:20 unmatched} Isn't it IO::Socket::SSL ?
13:20 unmatched} oH
13:20 cat298 yeah it's IO::Socket::SSL
13:21 stux|RC joined #perl6
13:21 TheLemonMan jnthn, thanks, I still haven't managed to find out why sometimes the call-chain breaks up and doesn't go all the way down to <eval>
13:21 TheLemonMan needs moar printfs!
13:23 nine Oh. I think we do not detect that the repository chain changed since we compiled that dependency as we never look at the Repository::FileSystem's content.
13:24 jnthn TheLemonMan: It may be a failure to keep ->caller in place in some situation
13:25 bjz joined #perl6
13:29 DrForr El_Che: Formatting is the goal behind Perl6::Tidy, yes. Most of the stumbling blocks now are caused (as I think I alluded to) the fact that the AST is a bit random about what matches and doesn't match whitespace, and keywords aren't always present in the final AST (though arguably they shouldn't be, as the name of the rule/token tells you wnat should be there - it's redundant)
13:30 Sgeo_ joined #perl6
13:30 cat298 so is there a way to prevent a panda library from loading? I asked on stackoverflow about uninstalling/removing and haven't gotten a response yet
13:31 tadzik panda library?
13:32 cat298 tadzik: sorry I mean a library installed via panda
13:32 kyclark joined #perl6
13:33 tadzik well, libraries don't just load themselves, if you don't want it to load, don't load it :)
13:34 El_Che DrForr: I hope you get it working. For bigger project it could be something like gofmt
13:34 nine cat298: https://gist.github.com/niner/b39258032f70c083e57b
13:36 danaj joined #perl6
13:38 skids joined #perl6
13:41 cat298 nine: thank you! that's incredibly useful
13:43 DrForr Oh, I will, it's just slogging.
13:45 cat298 okay, that works, now it's loading the local libraries first
13:45 wamba joined #perl6
13:48 ugexe cat298: sometimes you have to delete the .precomp/ directory for your changes to take affect
13:48 ugexe at least when you do things like dynamically load another module
13:48 sena_kun joined #perl6
13:52 mcmillhj joined #perl6
13:53 ugexe maybe there should be a flag for perl6 that says "precompile or re-precompile everything"
13:54 cat298 ugexe: what's the difference syntax-wise between dynamically and statically loading a library?
13:55 TheLemonMan jnthn, yeah, some crude debugging doesn't show any place where ->caller is nulled though
13:55 ugexe cat298: I havent looked at your code, but for HTTP::UserAgent, Net::HTTP, and LWP::Simple you dynamically load IO::Socket::SSL ala `if (try require ::("IO::Socket::SSL")) !~~ Failure { <setup ssl> }`
13:57 nine ugexe: sounds like you want no precompilation; in the module that dynamically loads libraries?
13:57 nine cat298: dynamically means at runtime
13:58 rindolf joined #perl6
13:58 ugexe nine: no, more so I don't have to delete .precomp manually (not that i've had to lately). so I can always test/benchmark the full lifecycle of a run
14:00 ugexe but also if this type of issue comes up again its easier to say "try it with --refresh-precomp" or whatever
14:01 TheLemonMan nah, screw that, I found where it goes legs up, now it's time to understand /why/
14:03 cat298 yeah I just got a segfault trying to run it, next time I ran the command it worked fine
14:07 zakharyas joined #perl6
14:09 ugexe cat298: if you delete $PROJECT_DIR/lib/.precomp and $HOME/.perl6 and *then* run it, does it segfault once and then run fine after?
14:12 cat298 ugexe: not sure, I haven't been able to recreate it. It happened before I messed with uninstalling a panda library and removing .precomp directories
14:13 bob777 joined #perl6
14:13 ugexe I ask because last month I had a situation where tests would fail *only* during the first run, but all subsequent runs would pass. If I deleted the .precomp directories the cycle would be restarted
14:14 prammer joined #perl6
14:17 lichtkind_ joined #perl6
14:19 mcmillhj joined #perl6
14:25 bob777 joined #perl6
14:44 awwaiid joined #perl6
14:46 dj_goku joined #perl6
14:48 TheLemonMan hmm, committable doesn't work when queried, does it ?
14:54 AlexDaniel TheLemonMan: it doesn't, but camelia does. If you want to do a lot of committable queries then feel free to join #whateverable
14:54 kyclark joined #perl6
14:56 El_Che greetings from the beach
14:56 [Coke] hio
14:57 El_Che we live in the future
14:57 El_Che a device to connect to 40y old technology ;)
14:59 edehont joined #perl6
15:15 zakharyas joined #perl6
15:16 awwaiid joined #perl6
15:22 pmurias joined #perl6
15:23 awwaiid joined #perl6
15:30 hankache joined #perl6
15:41 djbkd joined #perl6
15:41 rindolf joined #perl6
15:42 domidumont joined #perl6
15:46 dalek doc: d1abcae | (Zoffix Znet)++ | xt/trailing (2 files):
15:46 dalek doc: Use consistent file naming scheme
15:46 dalek doc: review: https://github.com/perl6/doc/commit/d1abcae470
15:46 dalek doc: dc25e76 | (Zoffix Znet)++ | Makefile:
15:46 dalek doc: Update makefile to reflect tests moved from t/ to xt/
15:46 dalek doc: review: https://github.com/perl6/doc/commit/dc25e761d2
15:47 awwaiid joined #perl6
15:58 dalek doc: 1154b64 | (Zoffix Znet)++ | doc/Programs/00-running.pod6:
15:58 dalek doc: Document PERL6_TEST_TIMES env var
15:58 dalek doc:
15:58 dalek doc: Fixes #738
15:58 dalek doc: review: https://github.com/perl6/doc/commit/1154b64683
15:59 awwaiid joined #perl6
16:07 TEttinger joined #perl6
16:11 dj_goku El_Che: well the internet is older than that too. don't forget that. :D
16:17 MilkmanDan joined #perl6
16:20 mcmillhj joined #perl6
16:25 El_Che joined #perl6
16:26 unmatched} It's pretty annoying that Pod::To::BigPage still has that MAST::Frame issue. Doesn't seem to even install with --force anymore :/
16:28 unmatched} Oh it did install, but you get Mast::Frame error when pod2onepage runs
16:29 mcmillhj joined #perl6
16:29 unmatched} Seems `make html-nohighlight` avoids the issue
16:31 awwaiid joined #perl6
16:36 kyclark Is there an easy way to see where a module is installed, e.g., the “CSV::Parser” I just used “panda” to install?
16:37 timotimo you can make it cause an exception in the code
16:37 timotimo like, give it bogus parameters or something
16:38 timotimo other than that, grab yourself a sub or method object from the module and grab its file
16:38 timotimo m: say &say.filename
16:38 camelia rakudo-moar b08527: OUTPUT«Method 'filename' not found for invocant of class 'Sub'␤  in block <unit> at <tmp> line 1␤␤»
16:38 timotimo m: say &say.^methods
16:38 camelia rakudo-moar b08527: OUTPUT«(<anon> <anon> <anon> soft <anon> <anon> yada perl <anon> onlystar candidates unwrap wrap <anon> <anon> package leave <anon> <anon> cando <anon> <anon> <anon> <anon> multi <anon> <anon> add_phaser has-phaser phasers assuming WHY set_why perl of <anon> retu…»
16:38 timotimo m: say &say.^methods.grep(*.name ne '<anon>')
16:38 camelia rakudo-moar b08527: OUTPUT«(soft yada perl onlystar candidates unwrap wrap package leave cando multi add_phaser has-phaser phasers assuming WHY set_why perl of returns fire_phasers has-phasers count line perl file of ACCEPTS signature Str arity returns new outer static_id)␤»
16:38 timotimo m: say &say.file
16:38 camelia rakudo-moar b08527: OUTPUT«gen/moar/m-CORE.setting␤»
16:38 timotimo hm. i wonder if that gives the right file name for installed stuff
16:38 harovali joined #perl6
16:38 timotimo star-m: use JSON::Tiny; say &to-json.file
16:38 camelia star-m 2016.04: OUTPUT«sources/9B467EEF9267A777BB53BAA2F19BE2C9D756BEED (JSON::Tiny)␤»
16:39 timotimo ah, yeah
16:40 unmatched} m: $*REPO.^methods.say
16:40 camelia rakudo-moar b08527: OUTPUT«(BUILD writeable-path can-install name upgrade-repository install uninstall files resolve need resource id short-id loaded installed precomp-store precomp-repository path-spec prefix load source-file repo-chain new perl gist Str WHICH next-repo)␤»
16:40 timotimo wellll, i don't know anything about $*REPO. which is dumb, because it's pretty awesome and nine has been doing some impressive work
16:40 timotimo but i was the one who wrote the code to make .file and .line work on subs and such, so ... :P
16:41 nine https://gist.github.com/niner/06792102587a79940294
16:42 unmatched} Is there some proper way to link to references in our docs? The L«C<todo>|/language/testing#index-entry-todo-todo($reason,_$count_=_1)» looks awfully fragile
16:42 unmatched} huggable: module source :is: This script shows module source: https://gist.github.com/niner/06792102587a79940294
16:42 huggable unmatched}, Added module source as This script shows module source: https://gist.github.com/niner/06792102587a79940294
16:42 nine m: say $*REPO.need(CompUnit::DependencySpecification.new(:short-name('Test'))).prefix;
16:42 camelia rakudo-moar b08527: OUTPUT«Method 'prefix' not found for invocant of class 'CompUnit'␤  in block <unit> at <tmp> line 1␤␤»
16:42 nine m: say $*REPO.need(CompUnit::DependencySpecification.new(:short-name('Test'))).repo.prefix;
16:42 camelia rakudo-moar b08527: OUTPUT«"/home/camelia/rakudo-m-inst-2/share/perl6".IO␤»
16:54 TEttinger joined #perl6
16:56 acrussell joined #perl6
16:58 gfldex unmatched}: you have to provide an empty X<|symbolic-name> with a symbolic name for the target
17:00 brrt joined #perl6
17:01 unmatched} gfldex: like L«C<todo>|X<|todo>» ?
17:01 * unmatched} tries
17:01 MilkmanDan joined #perl6
17:02 gfldex i would pull the X<> out and put it in from of the paragraph
17:02 gfldex that way you avoid having a sentence cut in halve and force the reader to scroll
17:02 gfldex depends on context ofc
17:03 unmatched} That just makes it /type/X$LESS-THAN_SIGN$VERTICAL_LINEtodo$GREATER-THAN_SIGN
17:07 gfldex what are you trying to link to?
17:07 unmatched} I want to link from elsehwere to here: https://docs.perl6.org/language/testing#index-entry-todo-todo%28%24reason%2C_%24count_%3D_1%29
17:07 unmatched} (it's a "Reference" link)
17:08 prammer joined #perl6
17:09 firstdayonthejob joined #perl6
17:10 gfldex then you put X<|todo (testing)> in from of the paragraph. That creates a link called /language/testing#test_(testing).
17:11 gfldex err /language/testing#todo_(testing)
17:13 brrt joined #perl6
17:13 unmatched} Doesn't that create the anchor point so I could make a link elsewhere to link to this point, where X|todo (testing)> is defined? I don't want to create an anchor, I want to create an <a href="...."> except without writing stuff like L«C<throws-like>|/language/testing#index-entry-throws-like-throws-like(%24code%2C_%24expected-exception%2C_%24description%3F%2C_*%2525matcher)»
17:15 gfldex if you don't like the lenthy anchor your will have to create a short one
17:22 cyphase joined #perl6
17:25 dalek doc: 4706f6e | (Zoffix Znet)++ | / (2 files):
17:25 dalek doc: Colourise a > code as a link
17:25 dalek doc:
17:25 dalek doc: Otherwise you can't tell that it's a link at all, as it's
17:25 dalek doc: coloured same as plain <code>
17:25 dalek doc: review: https://github.com/perl6/doc/commit/4706f6e093
17:29 dalek doc: b6cb311 | (Zoffix Znet)++ | doc/Language/testing.pod6:
17:29 dalek doc: Add Test.pm6 routine reference for easier navigation
17:29 dalek doc:
17:29 dalek doc: Fixes #737
17:29 dalek doc: review: https://github.com/perl6/doc/commit/b6cb311c1e
17:37 dalek doc: 3ae95b0 | (Trey Harris)++ | doc/Language/functions.pod6:
17:37 dalek doc: Fix typo in functions.pod6
17:37 dalek doc:
17:37 dalek doc: The typo causes the example code block to not be formatted.
17:37 dalek doc: review: https://github.com/perl6/doc/commit/3ae95b0e42
17:37 dalek doc: 02447b3 | Altai-man++ | doc/Language/functions.pod6:
17:37 dalek doc: Merge pull request #840 from treyharris/typo-fix
17:37 dalek doc:
17:37 dalek doc: Fix a typo in functions.pod6
17:37 dalek doc: review: https://github.com/perl6/doc/commit/02447b3b9d
17:38 [Coke] Could we theoretically construct a list of core devs? Is it just "people who have committed to rakudo/nqp/moarvm" in the past <timeperiod> ?
17:38 zakharyas joined #perl6
17:39 [Coke] asking for tail end of https://github.com/perl6/doc/issues/835
17:40 harovali1 joined #perl6
17:41 canopus joined #perl6
17:43 unmatched} You mean programmatically? You can probably just steal code from https://github.com/rakudo/rakudo/blob/nom/tools/contributors.pl6
17:43 unmatched} If you make it ignore commits that were merged in, you'll get just the people with the commit bit (I believe)
17:45 [Coke] I'm asking if that's the right list to answer the question on the ticket.
17:50 brrt joined #perl6
17:51 unmatched} No idea. If the context of making spec decisions, I wouldn't want to be on the list: (a) I don't know anything, (b) I don't want people randomly come up to me and ask questions, just 'cause they see me awake
17:51 unmatched} s/If/In/;
17:52 unmatched} So maybe the target should be #perl6-dev or RT *shrug*
17:54 jdv79 how can anyone see you awake?
17:54 cpage_ joined #perl6
17:55 unmatched} jdv79: because I'd be talking
18:01 bpmedley joined #perl6
18:03 nine Does anyone know a dist with a somewhat largish lib/ directory? I.e. many modules?
18:05 awwaiid joined #perl6
18:05 unmatched} If you clone https://github.com/moritz/perl6-all-modules there's probably some clever grep | sort combination that'll let you find one
18:06 jnthn nine: https://github.com/perl6/gtk-simple/tree/master/lib/GTK/Simple may be big enough?
18:07 unmatched} supernovus/perl6-timezone seems to standout
18:07 nine jnthn: yep, GTK::Simple looks like a good benchmark :)
18:08 unmatched} There's a gazillion of modules: https://github.com/supernovus/perl6-timezone/tree/master/lib/DateTime/TimeZone/Zone
18:09 prammer joined #perl6
18:09 rindolf joined #perl6
18:11 awwaiid joined #perl6
18:12 nine A quarter of a second to hash all of GTK::Simple's lib. That's better than I expected. I wonder if it's good enough.
18:14 dalek doc: 4cc1280 | (Zoffix Znet)++ | doc/Language/testing.pod6:
18:14 dalek doc: Simplify index entry for throws-like
18:14 dalek doc:
18:14 dalek doc: The anchor URL for the complex version does not work in Firefox.
18:14 dalek doc:
18:14 dalek doc: Fixes #736
18:14 dalek doc: review: https://github.com/perl6/doc/commit/4cc1280659
18:17 prammer joined #perl6
18:20 jnthn nine: When do we need to do it?
18:23 jnthn (or "would we need to do it", given you're pondering something... :))
18:24 nine jnthn: once for every FileSystem repository as soon as the first module is loaded. I need to know whether I have to re-check dependencies since the last time we did. Installation repos get their identity from the installed dist for that purpose.
18:24 nine Oh it's actually only 0.085 seconds when measured with now - INIT now instead of time perl6
18:25 sno joined #perl6
18:25 jnthn nine: Only affects -Ilib?
18:25 nine yes
18:26 nine So usually you'll only pay for the dist you're developing
18:27 jnthn *nod*
18:28 nine One of these days I should really start *using* Perl 6 on a larger scale. Some real world testcases would make things much simpler at times :)
18:29 kjs_ joined #perl6
18:34 * jnthn has spent his day mostly fixing things from a larger scale test case :)
18:37 dalek doc: d81e5a7 | (Zoffix Znet)++ | doc/Language/testing.pod6:
18:37 dalek doc: Minor grammar corrections
18:37 dalek doc: review: https://github.com/perl6/doc/commit/d81e5a7476
18:37 mcmillhj_ joined #perl6
18:41 kyclark Reading https://perl6advent.wordpress.com/2014/12/15/day-15-bioinformatics-and-the-joy-of-perl6/, he talks about accidentally find a StrDistance object.  Can I create one (intentionally) — how?
18:42 timotimo m: say StrDistance
18:42 camelia rakudo-moar b08527: OUTPUT«(StrDistance)␤»
18:42 timotimo s: StrDistance new
18:42 SourceBaby timotimo, Something's wrong: â�¤ERR: [31m===[0mSORRY![31m===[0m Error while compiling -eâ�¤Unable to parse expression in argument list; couldn't find final ')' â�¤at -e:6â�¤------> [32m    put sourcery( StrDistance[33mâ��[31m new )[1];[0mâ�¤    expecting any of:â�¤        infixâ�¤        infix stopperâ�¤
18:42 timotimo how do i use this again ...
18:42 timotimo s: StrDistance, new
18:42 SourceBaby timotimo, Something's wrong: â�¤ERR: [31m===[0mSORRY![31m===[0m Error while compiling -eâ�¤Undeclared routine:â�¤    new used at line 6 (in Perl 6 please use method call syntax instead)â�¤â�¤
18:42 timotimo s: StrDistance, "new"
18:42 SourceBaby timotimo, Sauce is at https://github.com/rakudo/rakudo/blob/b08527f/src/core/Mu.pm#L80
18:43 timotimo well, not quite :)
18:43 timotimo s: StrDistance
18:43 SourceBaby timotimo, Something's wrong: ␤ERR: Cannot resolve caller sourcery(StrDistance); 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␤␤
18:43 timotimo ...
18:43 timotimo https://github.com/rakudo/rakudo/blob/nom/src/core/StrDistance.pm - there we go
18:43 timotimo all you have to do is give it a :before and an :after
18:43 timotimo m: my $d = StrDistance("hello", "world"); say $d; say +$d;
18:43 camelia rakudo-moar b08527: OUTPUT«Cannot find method 'StrDistance' on object of type List␤  in block <unit> at <tmp> line 1␤␤»
18:44 timotimo m: my $d = StrDistance.new("hello", "world"); say $d; say +$d;
18:44 camelia rakudo-moar b08527: OUTPUT«Default constructor for 'StrDistance' only takes named arguments␤  in block <unit> at <tmp> line 1␤␤»
18:44 timotimo m: my $d = StrDistance.new(:before<hello>, :after<world>); say $d; say +$d;
18:44 camelia rakudo-moar b08527: OUTPUT«StrDistance.new(before => "hello", after => "world")␤4␤»
18:44 unmatched} s: StrDistance, "new"
18:44 SourceBaby unmatched}, Sauce is at https://github.com/rakudo/rakudo/blob/b08527f/src/core/Mu.pm#L80
18:44 timotimo what's wrong with my brain now ...
18:44 unmatched} s: StrDistance, "new", \()
18:44 SourceBaby unmatched}, Sauce is at https://github.com/rakudo/rakudo/blob/b08527f/src/core/Mu.pm#L81
18:44 timotimo unmatched}: it doesn't declare its own constructor
18:45 unmatched} timotimo: what did you want to see the source of?
18:45 timotimo i wanted to get the source for the class itself
18:45 unmatched} Ah, it don't do that
18:45 kyclark Very cool!  Thanks.
18:47 unmatched} s: StrDistance, "BUILD"
18:47 SourceBaby unmatched}, Sauce is at https://github.com/rakudo/rakudo/blob/b08527f/src/core/StrDistance.pm#L6
18:47 unmatched} tehe... hax :)
18:49 TheLemonMan joined #perl6
18:56 zacts joined #perl6
19:01 khw joined #perl6
19:10 jdoege joined #perl6
19:19 harovali1 left #perl6
19:22 ItayAlmog joined #perl6
19:24 jdoege given: my @keys = < 'a' 'b' 'c' >; my @values = < 1, 2, 3 >; then my %hash{@keys} = @values; throws an error: Invalid hash shape; type expected, while my %hash; %hash{@keys} = @values; works as expected. Reason?
19:25 unmatched} jdoege: the < ... > operator splits on whitespace, that's probably not what you meant
19:25 unmatched} m: my @keys = < 'a' 'b' 'c' >; dd @keys
19:25 camelia rakudo-moar 739d1a: OUTPUT«Array @keys = ["'a'", "'b'", "'c'"]␤»
19:25 unmatched} m: my @values = < 1, 2, 3 >; dd @values
19:25 camelia rakudo-moar 739d1a: OUTPUT«Array @values = ["1,", "2,", IntStr.new(3, "3")]␤»
19:26 harmil_wk My eyes want to read ["'a'", "'b'", "'c'"] as a list of three single-letter strings, so badly!
19:26 jdoege sorry, I mistakenly typed commas in my values list. Issue remains.
19:27 unmatched} jdoege: and my %hash{...} sets the type of keys. And you're trying to pass it a list
19:27 jdoege restated: given: my @keys = < 'a' 'b' 'c' >; my @values = < 1 2 3 >; then my %hash{@keys} = @values; throws an error: Invalid hash shape; type expected, while my %hash; %hash{@keys} = @values; works as expected. Reason?
19:27 [Coke] you can't do "my %hash{%keys}"
19:27 [Coke] you want my %hash; %hash{@keys} =
19:27 [Coke] you're my'ing the container there.
19:28 jdoege I didn't I did %hash{@keys} which in perl 5 was called a hash slice.
19:28 unmatched} m: my @keys = < 'a' 'b' 'c' >; my @values = < 1 2 3 >; my %hash = @keys Z=> @values
19:28 camelia rakudo-moar 739d1a: ( no output )
19:28 unmatched} m: my @keys = < 'a' 'b' 'c' >; my @values = < 1 2 3 >; my %hash = @keys Z=> @values; dd %hash
19:28 camelia rakudo-moar 739d1a: OUTPUT«Hash %hash = {"'a'" => IntStr.new(1, "1"), "'b'" => IntStr.new(2, "2"), "'c'" => IntStr.new(3, "3")}␤»
19:28 [Coke] jdoege: "this ain't perl 5"
19:28 [Coke] but I can see where you'd expect that to keep working; pretty sure it does not. you can still do the slice, you just can't my it.
19:29 [Coke] m: my @keys = < 'a' 'b' 'c' >; my @values = < 1 2 3 >; my %hash; %hash{@keys} = @values;
19:29 camelia rakudo-moar 739d1a: ( no output )
19:29 unmatched} jdoege: you can still do the slice, but just as in Perl 5 you have to declare the hash first, so you do in Perl 6. The only difference in Perl 6 you can have keys to be other than strings, so the my %hash{something} syntax is the way to set that
19:29 [Coke] m: my @keys = < 'a' 'b' 'c' >; my @values = < 1 2 3 >; my %hash; %hash{@keys} = @values; dd %hash
19:29 camelia rakudo-moar 739d1a: OUTPUT«Hash %hash = {"'a'" => IntStr.new(1, "1"), "'b'" => IntStr.new(2, "2"), "'c'" => IntStr.new(3, "3")}␤»
19:29 jdoege I think my point may be missed. %hash{@keys} = @values; works just fine, but not as an initializer.
19:29 unmatched} jdoege: and you're attempting to set it not to a type, but to something nonsensical
19:29 harmil_wk Still re-quoting those letters
19:29 harmil_wk m: my %hash; %hash{<a b c>} = <1 2 3>; say %hash.perl
19:29 camelia rakudo-moar 739d1a: OUTPUT«{:a(IntStr.new(1, "1")), :b(IntStr.new(2, "2")), :c(IntStr.new(3, "3"))}␤»
19:29 MilkmanDan joined #perl6
19:29 [Coke] jdoege: you can't my that expression. right.
19:29 jdoege I see.
19:30 jdoege Is there a language reason for that? It seems like a nice way to initialize a hash.
19:31 unmatched} jdoege: yes, there is. I've just explained it
19:31 jdoege I'll try to understand what you wrote.
19:31 pduh joined #perl6
19:32 nine ugexe: the -Ilib issue cat298 reported should be fixed now
19:32 harmil_wk jdoege: I think the key problem is that you're thinking of "my %hash{@slice}" as meaning a slice operation. Perl 6 is trying to understand what kind of data type you're defining.
19:32 ugexe m: my @a = <a b c d>; my @b = (1,2,3,4); my %c andthen {.{@a} = @b}; say %c.perl
19:32 camelia rakudo-moar 848add: OUTPUT«{:a(1), :b(2), :c(3), :d(4)}␤»
19:32 unmatched} m: my %hash-typed{Int} = 42 => 43; %hash-typed.keys[0].WHAT.say
19:32 camelia rakudo-moar 848add: OUTPUT«(Int)␤»
19:33 harmil_wk ugexe: I've seen andthen a dozen times and never understood what the heck it was supposed to be for. Thank you!
19:33 unmatched} jdoege: ^ by default hashes stringify their keys, but above, I told it to use Int type instead
19:33 [Coke] that syntax means something else in six; so even if we wanted to use it to allow init by slice, we can't.
19:35 unmatched} m: class Foo { method Str {'meow'} }; my %h; my $obj1 = Foo.new; my $obj2 = Foo.new; %h{$obj1, $obj2} = 42, 72;  say %h{$obj1}
19:35 camelia rakudo-moar 848add: OUTPUT«72␤»
19:35 mniip joined #perl6
19:35 unmatched} m: class Foo { method Str {'meow'} }; my %h{Foo}; my $obj1 = Foo.new; my $obj2 = Foo.new; %h{$obj1, $obj2} = 42, 72;  say %h{$obj1}
19:35 camelia rakudo-moar 848add: OUTPUT«42␤»
19:36 jdoege unmatched: thanks. I'm beginning to understand.
19:36 unmatched} jdoege: ^ and here I'm using a custom object that always stringifies to the same value. So I got two of such objects and if I can use a typed hash to use those objects as keys
19:36 unmatched} s/if I can/I can/;
19:36 telex joined #perl6
19:38 AlexDaniel m: say @::""
19:38 camelia rakudo-moar 848add: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '@' is not declared␤at <tmp>:1␤------> 3say 7⏏5@::""␤»
19:39 Wiertek joined #perl6
19:39 AlexDaniel m: my @ = 42; say @
19:39 camelia rakudo-moar 848add: OUTPUT«[]␤»
19:40 AlexDaniel m: my @; say @::""
19:40 camelia rakudo-moar 848add: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '@' is not declared␤at <tmp>:1␤------> 3my @; say 7⏏5@::""␤»
19:40 AlexDaniel how can I declare it? :D
19:44 Wiertek my @:: ; say @::
19:44 Wiertek m: my @:: ; say @::
19:44 camelia rakudo-moar 848add: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '@' is not declared␤at <tmp>:1␤------> 3my @:: ; say 7⏏5@::␤»
19:48 kjs_ joined #perl6
19:51 ItayAlmog Hey! So after writing some native compilers I decided to be naive and attempt to write a native compiler for Perl 6, But I have problem finding a reference to the lexical structure of the language :\ Does anyone know where I can find it?
19:52 unmatched} ItayAlmog: we have an Internals Course: http://edumentab.github.io/rakudo-and-nqp-internals-course/
19:52 unmatched} That's the only reference I know
19:53 ItayAlmog Thanks! I will take a look at it :)
19:53 wamba joined #perl6
19:53 Wiertek maybe You will find useful Desing Synopsis: http://design.perl6.org/
19:53 [Coke] that's not a reference for the Perl 6 language. If you want to know the syntax of the language, your best bet is https://github.com/rakudo/rakudo/blob/nom/src/Perl6/Grammar.nqp
19:53 [Coke] (that's not) (either the design OR the internals course)
19:54 [Coke] https://github.com/rakudo/rakudo/blob/nom/src/Perl6/Grammar.nqp#L416 is probably a slightly better URL
19:55 [Coke] Are you trying to make a perl 6 compiler that compiles down to machine code? That will be very challenging.
19:55 ItayAlmog Yes I am :) I know that, This is why I am trying to do it
19:55 harmil_wk [Coke]: Your definition of "very challenging" is either very dry humor or absurd understatement. :)
19:56 [Coke] harmil_wk: ¿porque no los dos?
19:56 [Coke] best of luck.
19:57 ItayAlmog Thanks. I will update here once I will have something which works :D
19:58 harmil_wk [Coke]: Both is an acceptable answer
19:58 perlpilot ItayAlmog: you might want to update us on your progress before that ;)
19:58 [Coke] Do you have a goal here other than academic curiosity?
19:58 ItayAlmog yeah probably xD
19:59 [Coke] (we might have other suggestions on stuff to hack on if you're looking for just "faster" or "native executables")
19:59 Wiertek_ joined #perl6
19:59 ItayAlmog Not really, I just need something to do on my free time (I am still in high school so I have alot of free time :D)
20:01 perlpilot ItayAlmog: you know ... we have an implementation called niecza that could use some love.  Maybe you could work on that instead?
20:02 cdg joined #perl6
20:02 ItayAlmog I think I will start with making the compiler and see how it goes, If I will see it turns to be too complicated for me to handle I might Go ahead and work on that instead :)
20:03 perlpilot ItayAlmog: what technology will you use for your compiler?
20:03 perlpilot (programming language, tools, whatever)
20:04 ItayAlmog For right now I will probably use Java to generate an assembly file and will compile it to an executable using NASM and GCC on Ubuntu computer
20:04 ItayAlmog This is how I wrote the other smaller compilers I made
20:05 ItayAlmog But if I will ever get it working I will probably rewrite it in perl 6 and use it to compile the Perl 6 version :D
20:06 harmil_wk ItayAlmog: If you want to understand why people are hedging so much, look into https://docs.perl6.org/language/functions#Defining_Operators for just a taste of the dynamic lexical analysis needed for Perl 6
20:06 perlpilot ItayAlmog: Well, good luck and most importantly, have fun!  :)
20:06 harmil_wk Also what perlpilot said
20:07 harmil_wk So, along the lines of overly ambitious, I was looking at macros... So, I'm trying to dig around in the guts of a parameter I got in a macro...
20:08 harmil_wk It's an AST, so great, I augmented AST to show me its innards, but I don't even know how to start unpeeling what's in a past because it's not actually Perl that I can introspect.
20:08 ItayAlmog Thanks! Yeah, I think I will start from the basics, Maybe I will get to the point of implementing the Object Oriented part
20:09 harmil_wk Is there a way to introspect a past from Perl, or do I have to use NQP primitives for that?
20:10 nine harmil_wk: you actually should be able to use at least some of Perl 6's introspection on it
20:10 harmil_wk For example:
20:10 nine harmil_wk: though I usually find it quicker to just read the class files in NQP's source code
20:10 harmil_wk m: use experimental :macros; use MONKEY-TYPING; augment class AST { method past { $!past } }; macro foo($a, $b) { dd $a.past; quasi { {{{$a}}} + {{{$b}}} } }; say foo(1,2)
20:10 camelia rakudo-moar 848add: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Method 'dispatch:<.?>' not found for invocant of class 'QAST::Op'␤at <tmp>:1␤»
20:13 grondilu joined #perl6
20:15 harmil_wk I guess the meta-question I'm asking is, "can a macro that does anything non-trivial be backend-agnostic right now?"
20:18 nine I think so
20:21 Sgeo joined #perl6
20:32 masak did someone say macros? :)
20:32 TEttinger joined #perl6
20:32 masak they've bit-rotted a wee bit in Rakudo, I know
20:32 masak but yes, they could do a few things that were not entirely useless
20:34 masak I think http://strangelyconsistent.org/blog/macros-progress-report-d2-merged remains the most accurate compilation on what works and what doesn't
20:39 harmil_wk masak: In Lisp, for example, one very common desire is to introspect the parameters to a macro, see if any of them are simple constants that can be factored out and produce the resulting simpler expression.
20:40 harmil_wk Is there a way to ask, "is this parameter a simple constant" without getting backend-specific?
20:42 perlpilot harmil_wk++  (so ... you're going to help masak with macros from now on, right?  ;-)
20:42 masak harmil_wk: I'm glad you ask
20:42 edehont joined #perl6
20:42 masak harmil_wk: could we get specific here? is -42 a simple constant?
20:43 masak (let's assume it's the original, un-overridden infix:<->)
20:43 harmil_wk Yes, I would think so. I'm thinking of something like "macro foo($a, $b) { quasi { {{{$a}}} + {{{$b}}} } }; foo(1,0);" where that zero could be dropped entirely if we could tell it's there.
20:43 masak er, prefix:<->
20:44 masak harmil_wk: maybe it'd be feasible to has an API surface to compile-time constant folding
20:44 masak have*
20:46 harmil_wk Okay, cool. I was just making sure I wasn
20:47 harmil_wk wasn't missing something that was obvious.
20:47 masak no, it's a good point
20:48 masak the reason I bring up -42 is that it's already been messing with some of My least Surprise in Perl 6 now and then
20:48 masak m: multi foo(0) { say "zero" }; multi foo(-1) { say "minus one" }; foo 0; foo -1
20:48 camelia rakudo-moar 848add: OUTPUT«zero␤minus one␤»
20:49 masak ...that used to not work, because `-1` was not considered a numeric constant
20:49 masak I'm glad it works now
20:49 masak jnthn++, probably :)
20:59 mvorg joined #perl6
21:03 masak harmil_wk: another possible answer is that, in the end, it might not matter, because JIT might detect that 0 and discard it.
21:03 masak harmil_wk: since JIT is completely downstream of code gen, which is downstream of macros
21:14 harmil_wk masak: That's absolutely true, and the example was poor in that respect, but a good example would be more difficult to IRCify. Imagine that "+" was replaced with an arbitrary function for which the interesting constant was, say 10, not 0.
21:14 harmil_wk or "apple"
21:16 harmil_wk A good example of this is where you define a tree with number of children as a parameter. you probably want to special-case 2 as a parameter because you can take advantage of some algorithmic shortcuts in that case.
21:16 harmil_wk Lisp does this ALL OVER the place, or at least that's as I recall. My last CL exposure was about 10 years ago.
21:20 jnthn masak: Wouldn't you just be able to look at the QTree of the parameter to the macro and see it's a literal, in the stuff you're planning?
21:20 dha joined #perl6
21:20 jnthn You can't really constant fold at that time though
21:21 masak jnthn: that's why I brought up -42, because "look to see if literal" isn't really enough in that case
21:21 labster joined #perl6
21:22 jnthn Yeah. Thanks to post-declaration of subs, you can't in general constant fold until after the whole compilation unit has been seen.
21:22 masak good point
21:23 masak heh, this thing *in Perl 6* surprised me while I was developing 007:
21:23 masak m: say 4 + 5; sub infix:<+>($, $) { "OH NOES" }
21:23 camelia rakudo-moar 7d8046: OUTPUT«OH NOES␤»
21:23 masak :)
21:23 masak (you can post-declare already-declared operators, and they will be called)
21:24 jnthn yup
21:24 jnthn You can get yourself into some bizzare situations if you post-modify precedence though :P
21:25 masak wiat, what? that's insane :)
21:25 masak wait*
21:25 jnthn No doubt!
21:25 niceperl joined #perl6
21:25 masak hm, yes, you *can* do that...
21:25 jnthn You "can", but the parser doesn't time travel. :)
21:25 dha Is that a bug or a feature?
21:26 * [Coke] decommutes
21:26 jnthn That the parser doesn't time travel? I think you'll have to check in with physics on that :)
21:26 masak I'm not sure it falls on the bug/feature axis at all :P
21:26 masak dha: oh, my eval above? it's correct
21:26 dha No, the fact that the parser doesn't time travel. :-)
21:27 masak feature, I'd say
21:27 masak it'd violate one-pass parsing, which we take rather seriously
21:27 jnthn Perl 6 is rather strongly into one-pass parsing, so it's nothing but consistent :)
21:27 mohae_ joined #perl6
21:27 jnthn heh, masak beat me to it ;)
21:28 masak didn't even need to time travel to do it :P
21:31 masak 'night, #perl6
21:31 jnthn 'night, masak
21:31 harmil_wk Night masak
21:32 TEttinger joined #perl6
21:34 mcmillhj joined #perl6
21:34 iH2O joined #perl6
21:35 jverce joined #perl6
21:37 harmil_wk I think this is a macro bug or I'm not understanding AST.Str:
21:37 harmil_wk m: use experimental :macros; macro foo($a, $b) { say ~$a; quasi { {{{$a}}} + {{{$b}}} } }; say foo(1, 2)
21:37 camelia rakudo-moar 7d8046: OUTPUT«(1, 2)␤3␤»
21:38 iH2O left #perl6
21:38 harmil_wk "(1,2)" is not the first parameter to my function...
21:39 harmil_wk *s/function/macro/
21:39 harmil_wk m: use experimental :macros; macro foo($a, $b) { say $a.WHAT; quasi { {{{$a}}} + {{{$b}}} } }; say foo(1, 2)
21:39 camelia rakudo-moar 7d8046: OUTPUT«(AST)␤3␤»
21:40 mcmillhj joined #perl6
21:44 cyphase joined #perl6
21:52 kjs_ joined #perl6
21:52 nilptr joined #perl6
21:54 geekosaur harmil_wk, I think it's going wrong in ~. both $a and $b appear to stringify as that
21:54 harmil_wk I feel I'm doing something wrong as soon as my code starts with "use nqp; use experimental :macros; use MONKEY-TYPING;"
21:54 geekosaur so likely something wrong with AST.Str
21:55 harmil_wk geekosaur: yeah
21:55 harmil_wk I'm now digging in the NQP to try to figure out what
21:55 geekosaur and, well, you're supposed to feel like something is wrong when you do that :)
21:56 harmil_wk geekosaur: probably fair given that my very next operation is "augment class AST {...}" ;-)
21:56 * geekosaur backs away slowly...
21:56 harmil_wk It's okay, as we discussed earlier, there's no time-travel...
22:02 adu joined #perl6
22:05 El_Che Hi, I migrated my vim-syntastic fork with perl6 support to a plugin so it can be used with the regular syntastic install in the meanwhile (send a PR): https://github.com/nxadm/syntastic-perl6
22:07 adu joined #perl6
22:11 El_Che It will easier to test/use it for people that already use vim-syntastic for other languages (like perl 5)
22:12 jnthn El_Che: Nice. :) Been getting myself into Vim recently, may give that a go. :)
22:13 dha El_Che - If I'm using Pathogen, can I just clone that into my bundle directory or do I have to shove it somewhere under syntastic itself?
22:14 dha (I note that the install instructions in that repository says to clone https://github.com/scrooloose/syntastic-perl6, which doesn't actually exist.)
22:18 ItayAlmog why does Perl6 has both int and Int?
22:18 ItayAlmog (one with uppercase I and one with lowercase I)
22:18 jnthn int is machine native integer, Int is an object and infinite precision
22:19 jnthn m: say 2 ** 1000
22:19 camelia rakudo-moar 7d8046: OUTPUT«1071508607186267320948425049060001810561404811705533607443750388370351051124936122493198378815695858127594672917553146825187145285692314043598457757469857480393456777482423098542107460506237114187795418215304647498358194126739876755916554394607706291457119…»
22:19 ItayAlmog ok, thanks!
22:20 jnthn Generally, all types with a lowercase name are "native" in some sense
22:20 stmuk_ joined #perl6
22:22 El_Che dha: just clone it in bundle. I use pathogen myself
22:22 dha *nod*
22:23 perlpilot joined #perl6
22:23 El_Che jnthn: I have spent time using intellij for go and perl. But I wanted to find a good perl6 env, and the best I found was atom and it was very lacking. Hence the usual suspect vim again :)
22:23 cdg_ joined #perl6
22:24 El_Che I plan to post a small howto of other useful plugins for a good perl 6 env setup (autocomplete, statusbar, align text, etc)
22:24 El_Che made note during my setup :)
22:30 El_Che (this wifi connection is crapy)
22:31 El_Che jnthn: what are you using nowadays?
22:32 harmil_wk m: use nqp; use experimental :macros; use MONKEY-TYPING; augment class AST { method past { $!past } }; macro foo($a, $b) { my @onto; $b.past.dump_children(0,@onto); dd @onto; Nil; } }; say foo(1, 2)
22:32 camelia rakudo-moar a23c39: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unexpected closing bracket␤at <tmp>:1␤------> 3ump_children(0,@onto); dd @onto; Nil; } 7⏏5}; say foo(1, 2)␤»
22:32 harmil_wk m: use nqp; use experimental :macros; use MONKEY-TYPING; augment class AST { method past { $!past } }; macro foo($a, $b) { my @onto; $b.past.dump_children(0,@onto); dd @onto; Nil; }; say foo(1, 2)
22:32 camelia rakudo-moar a23c39: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤This type (Array) does not support positional operations␤at <tmp>:1␤»
22:32 Zoffix joined #perl6
22:33 Zoffix If I have a file with `unit module Foo; sub bar {}` is there any way to use it from outside that file?
22:33 harmil_wk That seems to blow up in dump_children. What do I need to do to get a result from that?
22:38 jnthn El_Che: Been giving Atom a go. It's likeable in various ways, but its handling of big files is...well, it doesn't. After a couple of decades with Windows as my primary environment, I'm gradually transitioning away...so working out what I'd like my dev environment to look like. :)
22:40 adu_ joined #perl6
22:40 El_Che jnthn: I hear you. It would be nice to have an Intellij plugin though. I also tried Komodo Edit (also for perl 5) and it didn't suit me
22:40 prammer joined #perl6
22:41 TEttinger joined #perl6
22:41 jnthn El_Che: Yeah. :) I've done IntelliJ plugins in the past, though not for Perl 6...darn HUGE Java API they got going there.
22:42 jnthn Complete with all the obligatory factories. :P
22:43 El_Che hehe
22:43 El_Che I have tried the perl5 plugin and it turned out to be grat
22:43 El_Che great
22:43 tailgate m: my @i=((0,1)); my $repeat=3 say @i[0] xx $repeat; say  (@i ==> map {@_ xx $repeat});
22:43 camelia rakudo-moar a23c39: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3my @i=((0,1)); my $repeat=37⏏5 say @i[0] xx $repeat; say  (@i ==> map ␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤   …»
22:43 jnthn Yeah, IntelliJ is a well designed platform and you can build good stuff on it.
22:44 El_Che the author wanted to do a perl6 one as well, but sticks now with perl 5 becasue of the work of 1 plugin was pretty high
22:44 El_Che jnthn: yes and no
22:44 tailgate m: my @i=((0,1),); my $repeat=3; say @i[0] xx $repeat; say  (@i ==> map {@_ xx $repeat});
22:44 camelia rakudo-moar a23c39: OUTPUT«((0 1) (0 1) (0 1))␤(([(0 1)] [(0 1)] [(0 1)]))␤»
22:44 jnthn I can fully understand that. While it's decent it's...time consuming.
22:44 El_Che jnthn: the go and perl5 plugins I used (I hardly open a java view) are fine. Although very alien, with in most menus references to java stuff
22:44 tailgate I don't understand what's diffrent about the two statements - what's going on?
22:47 tailgate why is one of the nested lists [] rather than ()
22:48 jnthn tailgate: Probably because using @_ in a block is a bit like having written it more like `-> *@_ { @_ xx repeat }` or so
22:49 prammer joined #perl6
22:49 jnthn sleep time; 'night, #perl6
22:51 Zoffix night
22:51 Zoffix left #perl6
22:55 rkazak joined #perl6
22:59 ItayAlmog Rakudo uses NQP for compiling Perl6 to JVM / MoarVM right?
23:04 skids joined #perl6
23:11 unmatched} ItayAlmog: right
23:12 unmatched} (FWIW, we also have #perl6-dev channel)
23:12 ItayAlmog Oh ok, thanks :)
23:15 bjz joined #perl6
23:16 prammer joined #perl6
23:25 MilkmanDan joined #perl6
23:26 dj_goku s: Int, 'abs'
23:26 SourceBaby dj_goku, Sauce is at https://github.com/rakudo/rakudo/blob/1c7ca5e/src/core/Int.pm#L48
23:27 dj_goku s: [[]], 'eqv', [[]]
23:27 SourceBaby dj_goku, Something's wrong: ␤ERR: Cannot resolve caller sourcery(Array, Str, Array); 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␤␤
23:27 dj_goku s: [[]], 'eqv'
23:27 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␤␤
23:28 bjz joined #perl6
23:28 dalek doc: 367202a | (Zoffix Znet)++ | doc/ (2 files):
23:28 dalek doc: Document PERL6_TEST_DIE_ON_FAIL
23:28 dalek doc:
23:28 dalek doc: Added today in https://github.com/rakudo/rakudo/commit/1c7ca5e13b
23:28 dalek doc: review: https://github.com/perl6/doc/commit/367202a994
23:29 unmatched} s: &infix:[eqv]
23:29 SourceBaby unmatched}, Something's wrong: ␤ERR: ===SORRY!===␤Cannot invoke this object (REPR: Null; VMNull)␤
23:29 unmatched} :o
23:29 unmatched} s: &infix:<eqv>
23:29 SourceBaby unmatched}, Sauce is at https://github.com/rakudo/rakudo/blob/1c7ca5e/src/core/Mu.pm#L819
23:29 unmatched} dj_goku: ^
23:29 unmatched} SourceBaby: help
23:29 SourceBaby unmatched}, Use s: trigger with args to give to sourcery sub. e.g. s: Int, 'base'. See http://modules.perl6.org/dist/CoreHackers::Sourcery
23:33 dj_goku unmatched}: thanks!
23:33 ItayAlmog In perl 6 every method inside a class is Global (Can be accessed without having an instance of the class)?
23:34 unmatched} ItayAlmog: you can call methods on the call without instantiating it, but no, methods live inside classes
23:35 unmatched} ItayAlmog: we do have functions same-named as some class methods, for people who want to use functional programming rather than OO
23:35 unmatched} m: say sort <a b c>
23:35 camelia rakudo-moar e97fb7: OUTPUT«(a b c)␤»
23:35 unmatched} m: <a b c>.sort.say
23:35 camelia rakudo-moar e97fb7: OUTPUT«(a b c)␤»
23:36 ItayAlmog ok, thanks!
23:36 unmatched} s: &sort, \(<abc>)
23:36 SourceBaby unmatched}, Sauce is at https://github.com/rakudo/rakudo/blob/1c7ca5e/src/core/Any-iterable-methods.pm#L2100
23:36 unmatched} s: &say, \(<abc>)
23:36 SourceBaby unmatched}, Sauce is at https://github.com/rakudo/rakudo/blob/1c7ca5e/src/core/io_operators.pm#L22
23:36 unmatched} s: <abc>, "sort", \()
23:36 SourceBaby unmatched}, Something's wrong: ␤ERR: Type check failed in binding to &code; expected Callable but got Method+{<anon|42627280>} (Method+{<anon|4262728...)␤  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 29␤  in block <unit> at -e l
23:36 unmatched} bah
23:37 unmatched} s: <abc>, "say", \()
23:37 SourceBaby unmatched}, Sauce is at https://github.com/rakudo/rakudo/blob/1c7ca5e/src/core/Mu.pm#L451
23:39 unmatched} *call methods on a the class... I meant
23:40 ItayAlmog Yeah, I understood it :) I am right now thinking how The classes definitions are going to get represented in memory, I think I have an idea but i dunno, Also I have to think about this defined method....
23:41 unmatched} m: my $awesome-int = 42 but role { method is-even { self %% 2 } }; 42.is-even.say;
23:41 camelia rakudo-moar e97fb7: OUTPUT«Method 'is-even' not found for invocant of class 'Int'␤  in block <unit> at <tmp> line 1␤␤»
23:42 unmatched} orly
23:42 unmatched} bisect: m: my $awesome-int = 42 but role { method is-even { self %% 2 } }; 42.is-even.say;
23:42 bisectable unmatched}: On both starting points (good=2015.12 bad=7d80466) the exit code is 1 and the output is identical as well
23:42 bisectable unmatched}: Output on both points: Method 'is-even' not found for invocant of class 'Int'␤  in block <unit> at /tmp/JRXI1zgB9o line 1␤
23:42 unmatched} weird. I could've swore that worked before.
23:43 unmatched} bisect: class WorkingInt is Int {}; my $awesome-int = WorkingInt.new(42) but role { method is-even { self %% 2 } }; 42.is-even.say;
23:43 bisectable unmatched}: On both starting points (good=2015.12 bad=7d80466) the exit code is 1 and the output is identical as well
23:43 bisectable unmatched}: Output on both points: Method 'is-even' not found for invocant of class 'Int'␤  in block <unit> at /tmp/jgyWGl7RDk line 1␤
23:43 unmatched} oops
23:43 unmatched} Ohh... good god. I need some sleep
23:44 unmatched} m: my $awesome-int = 42 but role { method is-even { self %% 2 } }; $awesome-int.is-even.say;
23:44 camelia rakudo-moar e97fb7: OUTPUT«True␤»
23:44 dj_goku m: my @b[2;2] = ([1, 2], [3,4]); say @b;
23:44 camelia rakudo-moar e97fb7: OUTPUT«[[1 2] [3 4]]␤»
23:44 dj_goku m: my @b[2;2] = ([1, 2], [3,4]); dd @b;
23:44 camelia rakudo-moar e97fb7: OUTPUT«Array.new(:shape(2, 2), [1, 2], [3, 4])␤»
23:44 unmatched} :) Anyway, the point I was trying to make is objects/classes can be altered at runtime
23:44 AndyBotwin joined #perl6
23:44 unmatched} m: use MONKEY-TYPING; augment class Int { method is-even { self %% 2 } }; 42.is-even.say;
23:44 camelia rakudo-moar e97fb7: OUTPUT«True␤»
23:45 unmatched} m: use MONKEY-TYPING; say 42.^can('is-even'); EVAL 'augment class Int { method is-even { self %% 2 } }'; 42.is-even.say;
23:45 camelia rakudo-moar e97fb7: OUTPUT«()␤5===SORRY!5=== Error while compiling /home/camelia/EVAL_0␤augment not allowed without 'use MONKEY-TYPING'␤at /home/camelia/EVAL_0:1␤------> 3augment class Int7⏏5 { method is-even { self %% 2 } }␤    expecting any of:␤        generi…»
23:45 unmatched} m: say 42.^can('is-even'); EVAL 'use MONKEY-TYPING; augment class Int { method is-even { self %% 2 } }'; 42.is-even.say;
23:45 camelia rakudo-moar e97fb7: OUTPUT«()␤True␤»
23:45 unmatched} there we go
23:45 * unmatched} &
23:46 dj_goku so on my local machine the REPL is messed up some how. I create a new array like above but when I try to print it I get: Variable '@b' is not declared ------> say ⏏@b
23:47 cdg joined #perl6
23:47 LegalResale joined #perl6
23:47 unmatched} oh damn. yeah, it's borked
23:48 unmatched} This is a release blocker too IMO.
23:48 unmatched} dj_goku++
23:49 unmatched} Seems to have been opened 10 hours ago: https://rt.perl.org/Ticket/Display.html?id=128973
23:53 phifisher joined #perl6
23:54 adu joined #perl6
23:55 phifisher left #perl6
23:55 dj_goku unmatched}: :(
23:55 phifisher joined #perl6
23:55 dj_goku I rebuilt thinking it would fix it.
23:56 phifisher I want learn perl 6, where I searched a videos about? youtube?
23:56 phifisher Good night.
23:57 dj_goku unmatched}: that is what i get for bleeding edge
23:57 unmatched} huggable: beginners
23:57 huggable unmatched}, nothing found
23:57 unmatched} huggable: beginner
23:57 huggable unmatched}, nothing found
23:58 dj_goku newbs
23:58 unmatched} huggable: newcomers
23:58 huggable unmatched}, nothing found
23:58 unmatched} huggable: newcomer
23:58 huggable unmatched}, nothing found
23:58 unmatched} stupid robot
23:58 phifisher yes, I am new
23:58 phifisher hehe
23:58 unmatched} phifisher: check the 'New Comers' section on http://perl6.org/documentation/ http://perl6intro.com/ and there's also http://perl6.party/
23:58 unmatched} No idea about videos.
23:59 phifisher unmatched}, thx man
23:59 phifisher =)

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

Perl 6 | Reference Documentation | Rakudo