Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2016-11-09

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:11 kyclark_ joined #perl6
00:32 ggoebel joined #perl6
00:34 tony-o valgrindr
00:34 tony-o where vals find one another
00:42 pierre_ joined #perl6
00:44 Rawriful joined #perl6
00:46 japhb .oO( Come and play in our new thread pool! )
01:04 seatek joined #perl6
01:04 aborazmeh joined #perl6
01:04 aborazmeh joined #perl6
01:13 andlrc joined #perl6
01:16 andlrc left #perl6
01:21 jameslenz joined #perl6
01:23 Xliff Hmmm....
01:24 cog_ joined #perl6
01:24 Xliff Say I have a grammar where a token is called more than once. How can I get the data from that token to create an array that can be accessed from method TOP of the action class?
01:28 seatek guess, but i think you should be able to create a normal attribute in your action class that is an array, and just push onto it
01:30 Xliff :-O
01:30 Xliff D'oh!
01:30 Xliff \/o
01:30 Xliff Er.
01:30 Xliff /o\
01:30 Xliff OK. It's election night and it's obvious I am too drunk to code but not drunk enough to watch the Election Map.
01:30 Xliff Time to choose.
01:31 Xliff seatek++ for the obvious solution.
01:31 seatek hey i excel at the obvious :)
01:31 Xliff :D
01:32 gfldex m: grammar G { token TOP { <a>+ }; token a { 'a' } }; dd G.parse("aaa")<a>.keys;
01:32 camelia rakudo-moar fb5676: OUTPUT«(0, 1, 2).Seq␤»
01:32 Xliff I should.
02:01 pierre_ joined #perl6
02:14 samcv jnthn, let me know if you make progress on that. i'm mostly looking at performance in the main thread to be honest, so even just that would be great
02:15 canopus joined #perl6
02:15 pierre_ joined #perl6
02:16 BenGoldberg joined #perl6
02:36 aindilis joined #perl6
02:46 hyer joined #perl6
02:47 ilbot3 joined #perl6
02: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!
02:48 Rawriful joined #perl6
02:56 Rawriful joined #perl6
03:11 mildbill_ joined #perl6
03:12 mildbill_ left #perl6
03:14 Rawriful joined #perl6
03:19 ggoebel joined #perl6
03:24 cyphase joined #perl6
03:33 pierre_ joined #perl6
03:35 ugexe .tell dha can you tell me what OS you are on and send me the output of `ZEF_PLUGIN_DEBUG=1 zef --debug install $problem-module-name`? That should be enough for me to solve your 'no fetching backend available' issue
03:35 yoleaux ugexe: I'll pass your message to dha.
03:49 noganex joined #perl6
04:00 Rawriful joined #perl6
04:12 Rawriful joined #perl6
04:31 pierre_ joined #perl6
04:38 llll joined #perl6
04:40 Bork joined #perl6
04:47 pierre_ joined #perl6
05:30 Cabanossi joined #perl6
05:33 dataf3l joined #perl6
05:33 dataf3l left #perl6
05:33 dataf3l joined #perl6
05:33 dataf3l hi guys
05:33 dataf3l I reported bug #129909 indicating the need for compilation to jvm jar files
05:33 synopsebot6 Link:  https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=129909
05:34 AlexDaniel 🙋
05:34 dataf3l i kinda wanted to do something like this
05:34 dataf3l > perl6 --target=jvm --output=guess.jar guess.p6
05:34 dataf3l the perl6 team indicated they didn’t have it in immediate plans, which sucks for me I guess
05:34 ugexe --target=jar
05:34 dataf3l the team’s response was:
05:34 dataf3l “There are plans to make that a possibility eventually, but as far as I know that's not a priority of what the developers are focusing on at the moment."
05:35 dataf3l I’m now looking for an alternative, using moarvm t
05:35 dataf3l to generate moar files, which can then be fed into the vm, but I have zero clue as to how to do that
05:35 ugexe --target=moar?
05:35 dataf3l I assuming it must be possible, since the Perl6’s distro itself has a bunch of moar files
05:35 dataf3l I don’t know how to run the files after they were generated.
05:36 ugexe they still need a perl6 entry point afaik
05:36 dataf3l has anybody stumbled into an step by step article or guid ?
05:36 dataf3l guide*
05:36 ugexe the source
05:36 ugexe thats about your only option right now
05:37 AlexDaniel dataf3l: well, you should definitely write one if you find a way to do that :)
05:37 dataf3l I’m assuming the source is readable
05:37 dataf3l I’ve taken peeks here and there, but haven’t decided to “read the whole shebang” yet
05:37 dataf3l I suppose it can be a great learning experience
05:39 ugexe have you tried --target=jar?
05:39 ugexe or --target=moar?
05:39 AlexDaniel hehe, America. 「use MONKEY;」
05:40 dataf3l in other news, I decided to open source the simple examples and tests i’ve been writing these days, after watching pmichaud’s videos
05:40 dataf3l https://github.com/dataf3l/perl6-examples
05:40 ugexe i imagine there is probably some way to make the output files work but it'd have to be done inside a perl6 script
05:41 dataf3l this is just a list of personal programs, based on  pmichaud’s slides among other sources
05:41 dataf3l uexe: I tried —target=jar , but to no avail
05:41 ugexe you were using jvm rakudo with that command too?
05:41 dataf3l yes
05:42 AlexDaniel dataf3l: what happens if you do --target=jar?
05:42 ugexe hmm, it worked at one time. i dont have a jvm rakudo installed to see if it still does
05:42 dataf3l I can’t run that specific command at this very moment, I re-installed everything and only have moar at the moment
05:42 dataf3l about the examples: I think everybody here knows more about perl6 than I do, but perhaps they can be useful for your modification, or maybe trainig other people?, I don’t know.
05:42 dataf3l I hope you guys find it useful, pull requests welcome :)
05:43 ugexe https://github.com/dataf3l/per​l6-examples/blob/master/p64.p6 this does not make sense
05:44 ugexe gather/take in void context
05:45 dataf3l I think I was researching list comprehensions, and somebody on the internet suggested that syntax
05:45 dataf3l I’m not sure, but I think it’s a lazy list
05:45 ugexe its in void context
05:45 ugexe you aren't assigning it to anything
05:45 dataf3l what do you meany by void context
05:45 dataf3l AH
05:46 dataf3l you are correct
05:47 dataf3l ok, I fixed it
05:48 ugexe p61.p6 is exactly the same as p62.p6
05:48 dataf3l that must be my mistake
05:49 dataf3l I’m flattered people are interested in my code, but at the same time, ashamed of my newbie-ness
05:49 ugexe https://github.com/dataf3l/per​l6-examples/blob/master/p64.p6 this should use `prompt($msg)` instead of `get`
05:49 dataf3l I must live with shame, that is the only way I know...
05:50 ugexe my $table-name = prompt("Enter Table name");
05:50 dataf3l 64?
05:50 ugexe oops
05:51 dataf3l 58?
05:51 ugexe ah 58, but you used prompt in 57
05:51 dataf3l I think 57 is a “not so awesome” example, and 58 is a more refined one
05:51 ugexe er prompt in 58, get in 57
05:51 dataf3l like I said before, VERY basic examples
05:55 ugexe my last suggestion would be to rename the files so it represents what its demonstrating
05:56 ugexe so someone searching for "lazy lists" may actually end up on your example
05:56 dataf3l I agree, that’s a a good suggestion
05:56 dataf3l I’ll create a bug
06:05 pierre_ joined #perl6
06:07 wamba joined #perl6
06:13 CIAvash joined #perl6
06:39 pierre_ joined #perl6
06:39 Rawriful joined #perl6
06:40 pierre_ joined #perl6
06:47 ggoebel joined #perl6
06:48 RabidGravy joined #perl6
06:59 darutoko joined #perl6
07:02 dataf3l joined #perl6
07:02 neuraload joined #perl6
07:09 Woodi joined #perl6
07:24 nadim_ joined #perl6
07:25 labster joined #perl6
07:27 domidumont joined #perl6
07:28 Rawriful joined #perl6
07:31 domidumont joined #perl6
07:33 Xliff_ joined #perl6
07:36 Lucas_One joined #perl6
07:37 firstdayonthejob joined #perl6
07:38 pierre_ joined #perl6
07:39 cpage_ joined #perl6
07:42 brrt joined #perl6
07:45 Woodi joined #perl6
07:49 pierre_ joined #perl6
07:54 nadim_ Good Morning.  I am having a discussion with Dmitry about Prima https://github.com/dk/Prima and how to use it from P6, which he thinks won't work via Inline. I like Prima and have used it before, it platform independent (linux gtk, windows). It is a pity that we, as a community, did not make more usage of it. Any thoughts about using it from P6 or thoughts about some independent UI lib to use from P6?
07:55 dataf3l joined #perl6
07:55 dataf3l hey guys
07:55 dataf3l I’m reading the source if DBIsh
07:56 dataf3l I’m curious as to what does line 27 does
07:56 dataf3l https://github.com/perl6/DBIish/blob/ma​ster/lib/DBDish/StatementHandle.pm6#L27
07:56 dataf3l and how would I google that question
07:57 moritz dataf3l: google isn't very good at search for punctuation
07:57 dataf3l I guess that’s my point
07:58 TimToady joined #perl6
07:58 moritz dataf3l: what you can do is enter some elements of the syntax that interest you into the search box at https://docs.perl6.org/
07:58 arnsholt dataf3l: Which part are you wondering about?
07:58 moritz dataf3l: for example if you enter ... it suggests ... (forward declaration)
07:58 moritz (among other things)
07:58 arnsholt ... (yada yada yada) makes the definition a stub declaration
07:59 moritz and --> leads to https://docs.perl6.org/type/Signature#index-e​ntry---%3E-returns-Constraining_Return_Types
07:59 bjz joined #perl6
08:04 dataf3l Thanks!
08:04 dataf3l :)
08:04 dataf3l maybe we need a “search for this string” that translates each part of the string into a link into perl6 docs
08:05 dataf3l so I search for my $a + $b
08:05 dataf3l and $a, + and $b are each a link
08:05 dataf3l into each section
08:05 dataf3l so I can click the + link
08:05 dataf3l into the explaination of what is + called anyway
08:05 dataf3l maybe small p6 sample on a html textarea -> AST -> links could be useful for newbies?
08:10 moritz dataf3l: your contributions towards such a system would be very welcome
08:11 [ptc] dataf3l++
08:12 dataf3l I think every language could be benefited from a system like that one, but since perl in particular likes weird syntax and strange operators, it might benefit a bunch
08:12 dataf3l even perl5
08:12 dataf3l or languages like php
08:12 dataf3l something like “opsearch”
08:15 arnsholt Best part is that it's en eminently reachable project for someone new to the language
08:15 arnsholt (I think)
08:15 arnsholt Extracting the AST from a string is less tricky than you might think
08:17 dataf3l I’ll take your word for it
08:17 dataf3l clearly, you have a better understanding than I do!!!!
08:19 arnsholt It helps having hacked on the guts
08:19 arnsholt But it really is pretty simple
08:19 brrt also, for americans, I know of a company in amsterdam that is hiring
08:19 brrt just saying
08:22 dataf3l Hiring, perl6 people?
08:22 dataf3l PERL6 JOBS?????
08:22 dataf3l Finally!?!?!?!? :)
08:25 arnsholt m: use nqp; my Mu $compiler = nqp::getcomp("perl6"); say $compiler.eval("1 + 2", :target<ast>).^name; # dataf3l
08:25 camelia rakudo-moar fb5676: OUTPUT«QAST::CompUnit␤»
08:25 arnsholt Only niggle is that the AST types are NQP types, not Perl 6 types
08:26 dataf3l use nqp; my Mu $compiler = nqp::getcomp("perl6"); say $compiler.eval("1 + 2", :target<ast>).perl
08:26 brrt well, perl jobs, didn't say nothing about perl6
08:26 dataf3l Interesting.
08:26 arnsholt But that's the root of the object graph that gets dumped when you do "perl6 --target=ast -e '1+2'"
08:26 brrt although I know of perl6 being used, actually
08:26 dataf3l so would you recommend learning perl5, or is that a waste of time?
08:26 dataf3l m: use nqp; my Mu $compiler = nqp::getcomp("perl6"); say $compiler.eval("1 + 2", :target<ast>).
08:26 camelia rakudo-moar fb5676: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed postfix call␤at <tmp>:1␤------> 3y $compiler.eval("1 + 2", :target<ast>).7⏏5<EOL>␤»
08:26 dataf3l use nqp; my Mu $compiler = nqp::getcomp("perl6"); say $compiler.eval("1 + 2", :target<ast>).perl
08:26 moritz dataf3l: learning is nearly never a waste of time :-)
08:27 brrt learning is very rarely a waste of time
08:27 dataf3l m: use nqp; my Mu $compiler = nqp::getcomp("perl6"); say $compiler.eval("1 + 2", :target<ast>).
08:27 camelia rakudo-moar fb5676: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Malformed postfix call␤at <tmp>:1␤------> 3y $compiler.eval("1 + 2", :target<ast>).7⏏5<EOL>␤»
08:27 brrt it's the dot
08:27 arnsholt And you can't say the object directly
08:27 brrt and, I personally think perl5 is a really nice langauge
08:27 arnsholt Since it doesn't have a gist method (being an NQP object)
08:28 dataf3l NQP!!
08:28 dataf3l :)
08:28 dataf3l so, in summary, I should learn perl5.
08:28 arnsholt The QAST types are defined in nqp/src/QAST/*.nqp
08:28 arnsholt Perl 5 is useful
08:29 dataf3l the thing is, I’m learning perl6, I think if I learn them both at the same time, things may get tangled in my head...
08:29 arnsholt If you already know, say Python, it's not *that* different (except the syntax, of course). The main difference is what's considered idiomatic, not the semantics of the language
08:31 zakharyas joined #perl6
08:32 brrt per6 is a more perly perl. perl5 is already very perly
08:32 brrt I don't think things will be that confusing, just.... considerably less elegant
08:32 rindolf joined #perl6
08:34 dataf3l please define perl6
08:34 dataf3l perly*
08:36 brrt 'fits into the culture of the perl community', i guess, but I'm not an authority
08:36 abraxxa joined #perl6
08:36 brrt and, yeah, that is vague
08:37 brrt one of the core values of that community is expressivity, which is often confused with brevity
08:37 dataf3l I’m sorry for being a newbie, but I HAVE to ask
08:38 brrt but it is really about being able to say things in a way that makes sense to you
08:38 dataf3l what is the difference bttween a LIST and an ARRAY ???
08:38 brrt well, everybody is a newbie once
08:38 brrt i'm not sure if you're asking specifically for perl6 or for perl
08:38 dataf3l never mind
08:38 dataf3l i’ll read this
08:38 dataf3l https://docs.perl6.org/language/containers.html
08:38 dataf3l this is #perl6
08:38 maybekoo2 joined #perl6
08:38 brrt in general, a list is a collection of values in a sequence
08:39 dataf3l I’m asking about it since I’m trying yo get some DBIish results into a HTML table
08:39 brrt an array is a data structure that stores a collection of values in a contiguous section of memory
08:39 brrt so the idea of list is more abstract and the idea of array is more specific
08:40 dataf3l DBI returns a weird object, iterable, but not quite what my array_of_hashes_to_html() function was expecting
08:40 dataf3l I see...
08:40 brrt I haven't used DBIish myself, but I think it returns a (lazy) list
08:40 brrt so for instance (correct me if I'm wrong, anyone):
08:40 brrt m: my @a := (1,2,3); say @a.WHAT;
08:40 camelia rakudo-moar fb5676: OUTPUT«(List)␤»
08:41 brrt m: my @a = (1,2,3); say @a.WHAT;
08:41 camelia rakudo-moar fb5676: OUTPUT«(Array)␤»
08:41 dataf3l WHAT
08:41 brrt in the first case, i've bound @a to the object on the right-hand-side, which was the list containing 1,2, and 3
08:42 brrt in the second case, i've assigned the right-hand-side to the left-hand-side, which means that the list (1,2,3) has been stored into the array @A
08:42 dataf3l the difference appears to be using := instead of =
08:42 brrt yes
08:43 brrt but the thing is, a gather { take } construct is also a list (a lazy list), but it is never an array
08:43 dataf3l of course
08:43 brrt it can be assigned to an array, which will consume (iirc) all values of the lazy list (up to a point if that is specified)
08:43 brrt I think I can also do this:
08:44 brrt m: my @a := [1,2,3]. say @a.WHAT;
08:44 camelia rakudo-moar fb5676: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Two terms in a row␤at <tmp>:1␤------> 3my @a := [1,2,3]. say7⏏5 @a.WHAT;␤    expecting any of:␤        infix␤        infix stopper␤        postfix␤        statement end␤        statemen…»
08:44 brrt ;
08:44 brrt m: my @a := [1,2,3]; say @a.WHAT;
08:44 camelia rakudo-moar fb5676: OUTPUT«(Array)␤»
08:44 brrt now I've bound the @a to the array construct [1,2,3]
08:44 brrt and dutifully, it is an array
08:44 brrt does that make sense? :-)
08:45 dataf3l it does
08:45 bjz joined #perl6
08:45 brrt this wouldn't be complete without the fibonacci sequence, of course..
08:45 dataf3l I have a small function, runsql()
08:46 dataf3l it takes as input a sql statement and (ideally) would return a list of hashes
08:46 dataf3l I guess I’m not sure if I want a list of hashes or an array of hashes
08:46 dataf3l in any event, hashes, are the records
08:46 dataf3l the function can be used like this:
08:46 dataf3l $ref = runsql("select id, name from table");
08:46 dataf3l for @( $ref ) -> %row {
08:46 dataf3l #say $row.elems;
08:46 dataf3l say %row<id>;
08:46 dataf3l say %row<name>;
08:46 dataf3l # @( $row ).[1].join.say;
08:46 dataf3l }
08:47 dataf3l and that works perfectly, it even prints stuff coming from the database and everything.
08:47 dataf3l however,
08:47 moritz dataf3l: in future, please use a pastebin when you paste more than one line of code
08:47 dataf3l OK, will do.
08:47 dataf3l before I could go to the DB, I was mocking the db by just returning a harcoded list of hashes
08:48 dataf3l method get_all_records(){
08:48 dataf3l my @data;
08:48 dataf3l @data[0] = {id=>"1", name=>"poll1"};
08:48 dataf3l @data;
08:48 dataf3l }
08:48 dataf3l so, this function returned an array of hashes, which was later consumed by a HTML function, which is supposed to generate an HTML table (I know, I know, kiddie stuff)
08:48 dataf3l anyway,
08:49 dataf3l this function looks like this:
08:49 dataf3l http://pastebin.com/5YSLZQUQ
08:49 dataf3l and it prints stuff coming from the get_all_records() function just fine
08:50 dataf3l but when I feed it the “list of hashes”, which came from dbi’s my $ref = $sth.fetchall-AoH(); i get an error
08:50 dataf3l the error says:
08:50 dataf3l Type check failed in binding to %row; expected Associative but got List ($(${:id("1"), :name("...)
08:50 dataf3l I googled this error, and was directed to logs on this very channel.
08:50 dataf3l any ideas?
08:51 dataf3l should I just start over?
08:51 moritz don't start over
08:51 moritz where exactly does the error happen?
08:51 pierre_ joined #perl6
08:52 Woodi hi, just found Swagger (meta-API ?) application: https://community.eveonline.com/news/dev-blo​gs/introducing-esi/?utm_source=launcher_news​&amp;utm_medium=launcher&amp;utm_campaign=
08:53 dataf3l when tbl() (see the pastebin) to print stuff coming from runsql()
08:54 dataf3l error happens on line 9 of the pastebin
08:54 dataf3l line 82 of the actual program
08:55 moritz dataf3l: so it seems that iterating over @data doesn't produce a hash, but rather a List
08:55 moritz dataf3l: so the list you pass in might need some flattening
08:55 dataf3l how do I do said flatenning?
08:55 moritz (or maybe it's constructed incorrectly; the $(...) looks suspicious)
08:56 moritz dataf3l: start by doing a  "dd @data" to get a better idea of what's actually in @data
08:56 moritz dataf3l: oh, and what Rakudo version are you using?
08:57 dataf3l this is the result of dd @data
08:57 dataf3l (List)
08:57 dataf3l (${:id("1"), :name("0 - \$140.000")}, ${:id("2"), :name("\$140.000 - \$280.000")}, ${:id("3"), :name("\$280.000 - \$425.000")}, ${:id("4"), :name("\$425.000 - \$567.000")}, ${:id("5"), :name("\$567.000 - \$850.000")}, ${:id("6"), :name("\$850.000 - \$1.134.000")}, ${:id("7"), :name("Mas de \$1.134.000")})
08:57 dataf3l also This is Rakudo version 2016.10 built on MoarVM version 2016.10
08:57 dataf3l implementing Perl 6.c.
08:58 dataf3l the $( … ) was taken from a website.
08:58 dataf3l I’m calling this method from DBIish
08:58 dataf3l https://github.com/perl6/DBIish/blob/mas​ter/lib/DBDish/StatementHandle.pm6#L149
08:59 brrt m: my @a := 1,1, * + *; my @b = @a[^10]; say @b;
08:59 camelia rakudo-moar fb5676: OUTPUT«[1 1 { ... } (Any) (Any) (Any) (Any) (Any) (Any) (Any)]␤»
08:59 dataf3l but I think perhaps I could call another method, a simpler method, one that simply returns an array of hashes, but I guess that request is too simple, and DBI probably does the right thing…
08:59 brrt hmm, that wasn't quite right
08:59 moritz brrt: did your forget a ... *
09:00 brrt m: my @a := 1, 1, * + * .... *; my @b = @a[^10]; say @b;
09:00 camelia rakudo-moar fb5676: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unsupported use of . to concatenate strings; in Perl 6 please use ~␤at <tmp>:1␤------> 3my @a := 1, 1, * + * ....7⏏5 *; my @b = @a[^10]; say @b;␤»
09:00 moritz dataf3l: I don't understand. Does the $() come from DBIish, or was that code that you copied & pasted?
09:00 moritz m: my @a := 1, 1, * + *, .... *; my @b = @a[^10]; say @b
09:00 camelia rakudo-moar fb5676: OUTPUT«5===SORRY!5===␤Unsupported use of . to concatenate strings; in Perl 6 please use ~␤at <tmp>:1␤------> 3my @a := 1, 1, * + *, ....7⏏5 *; my @b = @a[^10]; say @b␤Other potential difficulties:␤    Comma found before apparent sequence opera…»
09:00 brrt one to many dot
09:00 dataf3l wait guys
09:00 moritz oh
09:00 dataf3l I think I found the example I was looking for
09:00 brrt m: my @a := 1,1, * + *, ... *; my @b := @a[^10]; say @b;
09:00 camelia rakudo-moar fb5676: OUTPUT«Potential difficulties:␤    Comma found before apparent sequence operator; please remove comma (or put parens around the ... call, or use 'fail' instead of ...)␤    at <tmp>:1␤    ------> 3my @a := 1,1, * + *,7⏏5 ... *; my @b := @a[^10]; say @b;…»
09:00 dataf3l right here: “次に HashRef の ArrayRef として取得したい場合は fetchall_arrayref(+{}) とします。”
09:01 dataf3l http://d.hatena.ne.jp/ZIGOROu/20090731/1249050735
09:01 brrt m: my @a := 1,1, * + * ... *; my @b := @a[^10]; say @b;
09:01 camelia rakudo-moar fb5676: OUTPUT«Type check failed in binding; expected Positional but got Seq (?)␤  in block <unit> at <tmp> line 1␤␤»
09:01 brrt m: my $a := 1,1, * + * ... *; my @b := $a[^10]; say @b;
09:01 camelia rakudo-moar fb5676: OUTPUT«(1 1 2 3 5 8 13 21 34 55)␤»
09:01 moritz dataf3l: that doesn't answer my question
09:02 dataf3l it comes from code copied and pasted
09:02 dataf3l but,
09:02 dataf3l not from the link before
09:02 dataf3l that link is the wrong one
09:02 dataf3l OK
09:03 dataf3l I just read DBIish readme’s and I think I found what I’m looking for
09:03 dataf3l wil report back shortly
09:03 moritz so, don't use $()
09:03 dataf3l THANK YOU EVERYONE for the kind and patient support, you guys rock :)
09:03 * brrt wonders if we can do the factorial series
09:03 moritz and be carewful with Perl 6 code from 2009 :-)
09:04 brrt m: my $a = 1,2, * * * ... *; say $a[^10];
09:04 camelia rakudo-moar fb5676: OUTPUT«(timeout)»
09:05 labster I wonder what that's even doing.
09:05 labster m: my $a = 1,2, * * * ... *; say $a[^4];
09:06 camelia rakudo-moar fb5676: OUTPUT«(timeout)»
09:11 wamba joined #perl6
09:12 ocbtec joined #perl6
09:14 dataf3l it works!
09:14 dataf3l yay!
09:14 dataf3l :)
09:14 dataf3l thank you guys
09:14 dataf3l for DBI:
09:14 dataf3l call this
09:14 dataf3l my @records = $sth.allrows(:array-of-hash);
09:14 dataf3l and then something like this:
09:14 dataf3l method p2(@a) {
09:14 dataf3l for @a -> $row {
09:14 dataf3l for $row.kv -> $k,$v {
09:14 dataf3l say $k ~$v;
09:14 dataf3l }
09:14 dataf3l }
09:14 dataf3l }
09:14 dataf3l that is all, I’m going to bed :)
09:25 masak ahojte, #perl6
09:26 DrForr o/
09:30 llfourn joined #perl6
09:33 brrt dataf3l: pastebin please
09:34 brrt but good to know that it owrks
09:35 Lucas_One joined #perl6
09:36 jonas1 joined #perl6
09:46 bjz joined #perl6
09:56 gregf_ joined #perl6
09:58 n0xff joined #perl6
09:59 ChoHag joined #perl6
10:14 g4 joined #perl6
10:14 g4 joined #perl6
10:20 pierre_ joined #perl6
10:36 kurahaupo__ joined #perl6
10:50 bjz joined #perl6
10:50 pmurias joined #perl6
10:58 samcv using proc::async and the supply seems to be lagging. i know it's getting the programs messages because if i kill the program the messages will then come through
10:58 samcv i mean sometimes it's fine. then will not respond for a while. then sometimes just spurt out a bunch of stuff. sometimes it's delayed
10:59 CIAvash joined #perl6
11:04 andrzejku_ joined #perl6
11:06 * viki is amused to wake up to a sight of Murican meltdown.
11:07 viki I guess I better buy a couple of cots to harbor refugees :P
11:11 samcv yes viki
11:12 samcv there isn't enough alcohol to fix this tonight
11:12 samcv the worst part is they won the house and senate, the presidency. and the president is going to appoint a new supreme court judge. so
11:13 samcv they will control all 3 branches of government now :(
11:13 samcv and the supreme court decision will affect things 40+ years from now so. it's pretty bad
11:24 viki Yup. It's the worst possible result. I'm guessing all the progress will be reverted now.
11:25 viki Meanwhile in Canada: tax-paid healthcare and no one cares if you're gay. Bonus for USA immigrants: get 34 extra Canadian cents for every US dollar you exchange! :D
11:25 viki 😂😂😂
11:25 * viki feels a bout of schadenfreude for some strange reason.
11:29 pierre_ joined #perl6
11:32 u-ou shit
11:33 u-ou how did this happen
11:33 viki Easy: corruption.
11:33 samcv well. marijuana is legal for recreation in my state now. but it's been medically legal for like. 12 years?
11:33 u-ou calif?
11:33 samcv yea
11:34 samcv it happened because people vote more with their emotion than they do their logic
11:34 viki Here it's been legal to smoke but not to sell for at least 15 years... and I *think* they're making it legal to buy from licensed dispensaries or something
11:34 u-ou I'm in NZ where it's just 200% illegal
11:34 samcv ah. yeah in california since 12 years it's easy to get a medical card
11:35 u-ou I don't use it, but... it should be available to people who need it
11:35 u-ou e.g. seizures
11:35 samcv that helps but not as much as legalizing recreation. stop putting kids in jail for weed
11:35 samcv yeah i don't either
11:35 u-ou I used to :p
11:35 samcv but it's sad how many people the usa has locked up
11:35 u-ou the war on drugs
11:36 samcv also. the vice president is even worse than trump
11:37 samcv as bad as trump is. Pence is worse
11:37 samcv so killing him won't fix the problem :P make it worse
11:38 samcv Pence co-sponsored Todd Akin’s infamous anti-abortion bill that would have redefined rape as “forcible rape.”
11:38 samcv He pushed Indiana’s new law, stayed by a federal judge, which bans abortion for disabled fetuses and requires women who’ve had abortions or miscarriages, no matter how early, to arrange for either burial or cremation of the remains.
11:38 samcv guy is fucked
11:39 samcv cut a million in domestic violence prevention programs, even more for helping families with young children
11:39 samcv he's pro birth but anti life. really so bad.
11:40 samcv and it's sad that the news hasn't made an issue of Pence. but. i am just depressed. at least there's Perl 6 to make me happy
11:40 u-ou pro life just means anti women
11:40 ilmari he also believes in electrocuting gay people until they're straight
11:40 yoleaux 6 Nov 2016 12:14Z <tbrowder> ilmari: last chance to object to my module breakup/naming scheme at github.com/tbrowder/Misc-Utils-Perl6
11:41 ilmari .tell tbrowder I don't care about the actual naming, I was just snarking at the meaninglessness of the original one
11:41 yoleaux ilmari: I'll pass your message to tbrowder.
11:43 samcv yeah that too ilmari
11:44 bjz_ joined #perl6
11:44 u-ou i feel sad
11:44 samcv i'm sure if you electrocute them enough they will tell you that they're cured
11:45 samcv disgusting though
11:46 pmurias shouldn't politics be kept out of #perl6? :/
11:49 cdg joined #perl6
11:51 samcv yeah sorry
11:55 pierre__ joined #perl6
11:58 MARTIMM joined #perl6
11:58 MARTIMM o/
11:59 MARTIMM m: enum X (:a0(0x00),:a1(0x4),:a2(0x8),:a3(0x10))
11:59 camelia rakudo-moar fb5676: ( no output )
11:59 MARTIMM m: my X @a = a2, a3
11:59 camelia rakudo-moar fb5676: OUTPUT«5===SORRY!5===␤Package X is insufficiently type-like to qualify a variable␤at <tmp>:1␤------> 3my X @a7⏏5 = a2, a3␤Undeclared routines:␤    a2 used at line 1␤    a3 used at line 1␤␤␤»
12:01 MARTIMM camelia does not keep history of course
12:01 MARTIMM ok, by words then...
12:01 jnthn m: enum X (:a0(0x00),:a1(0x4),:a2(0x8),:a3(0x10)); my X @a = a2, a3
12:01 camelia rakudo-moar fb5676: ( no output )
12:02 MARTIMM suppose i've got an enum X and want to use it in a method
12:02 chris2_ joined #perl6
12:03 MARTIMM like method Y ( X :@a ) {}
12:04 MARTIMM then calling it without parameters it errors with Type check failed in binding to @a  expected Positional[QueryFindFlags] but got Array ($[])
12:05 MARTIMM how can i change the type or default assignment to get this right?
12:06 jnthn m: class C { method m(Int :@a) { } }; C.m
12:06 camelia rakudo-moar fb5676: OUTPUT«Type check failed in binding to @a; expected Positional[Int] but got Array ($[])␤  in method m at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
12:06 MARTIMM QueryFindFlags sould be X
12:06 jnthn m: class C { method m(Int :@a = Array[Int].new) { } }; C.m
12:06 camelia rakudo-moar fb5676: ( no output )
12:06 jnthn You can do it with an explcit default
12:06 jnthn Though we should really fix it up to do that for you
12:10 MARTIMM jnthn: thanks, i've tried it like so in my code like: QueryFindFlags :@flags = Positional[QueryFindFlags].new but got another error: No such method 'value' for invocant of type 'Positional[QueryFindFlags]'
12:10 jnthn Positional is just a role rather than an actual implementation type
12:12 MARTIMM jnhtn: oeps, saw that the error was a bit further in the code now. So the method interface part works now.
12:12 ccakes joined #perl6
12:23 nadim joined #perl6
12:24 MARTIMM m: enum X <a1 a2 a3>
12:24 camelia rakudo-moar fb5676: ( no output )
12:24 andrzejku joined #perl6
12:25 andrzejku joined #perl6
12:25 MARTIMM m: enum X <a1 a2 a3>; class C { method m(X :@a) { } }; C.m
12:25 camelia rakudo-moar fb5676: OUTPUT«Type check failed in binding to @a; expected Positional[X] but got Array ($[])␤  in method m at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
12:25 MARTIMM m: enum X <a1 a2 a3>; class C { method m(X :@a = Positional[X].new) { } }; C.m
12:25 camelia rakudo-moar fb5676: ( no output )
12:27 MARTIMM m: enum X <a1 a2 a3>; class C { method m(X :@a = Positional[X].new) {my Int $s = [+] ( 0x00, |@a)>>.value; say $s } }; C.m
12:27 camelia rakudo-moar fb5676: OUTPUT«No such method 'value' for invocant of type 'Int'␤  in method m at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
12:29 MARTIMM jnhtn: this the problem I have now, on  the default value there is no .value method which is understandable because it is not in the role Positional. Its in the enum. somehow the default is not a right default
12:30 MARTIMM m: enum X <a1 a2 a3>; class C { method m(X :@a = Positional[X].new) {my Int $s = [+] ( 0x00, |@a)>>.value; say $s } }; C.m((a1,a2)
12:30 camelia rakudo-moar fb5676: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Unable to parse expression in argument list; couldn't find final ')' ␤at <tmp>:1␤------> 0, |@a)>>.value; say $s } }; C.m((a1,a2)7⏏5<EOL>␤»
12:31 MARTIMM m: enum X <a1 a2 a3>; class C { method m(X :@a = Positional[X].new) {my Int $s = [+] ( 0x00, |@a)>>.value; say $s } }; C.m((a1,a2))
12:31 camelia rakudo-moar fb5676: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤  in method m at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
12:31 MARTIMM m: enum X <a1 a2 a3>; class C { method m(X :@a = Positional[X].new) {my Int $s = [+] ( 0x00, |@a)>>.value; say $s } }; C.m: (a1,a2)
12:31 camelia rakudo-moar fb5676: OUTPUT«Too many positionals passed; expected 1 argument but got 2␤  in method m at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
12:31 MARTIMM m: enum X <a1 a2 a3>; class C { method m(X :@a = Positional[X].new) {my Int $s = [+] ( 0x00, |@a)>>.value; say $s } }; C.m: :@a(a1,a2)
12:31 camelia rakudo-moar fb5676: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '@a' is not declared␤at <tmp>:1␤------> 3( 0x00, |@a)>>.value; say $s } }; C.m: :7⏏5@a(a1,a2)␤»
12:32 CIAvash joined #perl6
12:32 MARTIMM m: enum X <a1 a2 a3>; class C { method m(X :@a = Positional[X].new) {my Int $s = [+] ( 0x00, |@a)>>.value; say $s } }; C.m(:@a(a1,a2))
12:32 camelia rakudo-moar fb5676: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '@a' is not declared␤at <tmp>:1␤------> 3 ( 0x00, |@a)>>.value; say $s } }; C.m(:7⏏5@a(a1,a2))␤»
12:33 MARTIMM m: enum X <a1 a2 a3>; class C { method m(X :@a = Positional[X].new) {my Int $s = [+] ( 0x00, |@a)>>.value; say $s } }; C.m(:@a('a1','a2'))
12:33 camelia rakudo-moar fb5676: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Variable '@a' is not declared␤at <tmp>:1␤------> 3 ( 0x00, |@a)>>.value; say $s } }; C.m(:7⏏5@a('a1','a2'))␤»
12:33 MARTIMM m: enum X <a1 a2 a3>; class C { method m(X :@a = Positional[X].new) {my Int $s = [+] ( 0x00, |@a)>>.value; say $s } }; C.m(:a('a1','a2'))
12:33 camelia rakudo-moar fb5676: OUTPUT«Type check failed in binding to @a; expected Positional[X] but got List ($("a1", "a2"))␤  in method m at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
12:34 MARTIMM m: enum X <a1 a2 a3>; class C { method m(X :@a = Positional[X].new) {my Int $s = [+] ( 0x00, |@a)>>.value; say $s } }; C.m(:a(['a1','a2']))
12:34 camelia rakudo-moar fb5676: OUTPUT«Type check failed in binding to @a; expected Positional[X] but got Array ($["a1", "a2"])␤  in method m at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
12:35 MARTIMM m: enum X <a1 a2 a3>; class C { method m(X :@a = Positional[X].new) {my Int $s = [+] ( 0x00, |@a)>>.value; say $s } }; my $x = a1, a3; C.m(:a($x))
12:35 camelia rakudo-moar fb5676: OUTPUT«Type check failed in binding to @a; expected Positional[X] but got X (X::a1)␤  in method m at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
12:35 jnthn Why are you writing Positional[X].new instead of Array[X].new like I showed?
12:36 MARTIMM I did not understand it very well, because of the error messages I think
12:37 MARTIMM m: enum X <a1 a2 a3>; class C { method m(X :@a = Array[X].new) {my Int $s = [+] ( 0x00, |@a)>>.value; say $s } }; my $x = a1, a3; C.m(:a($x))
12:37 camelia rakudo-moar fb5676: OUTPUT«Type check failed in binding to @a; expected Positional[X] but got X (X::a1)␤  in method m at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
12:38 MARTIMM jnhtn: didn't work
12:39 jnthn ah, there's a problem on the calling side too
12:39 jnthn my $x = a1, a3; # this is a precedence problem
12:39 jnthn But also if you're going to use types on the callee side, you need to send in a typed data structure
12:40 jnthn m: enum X <a1 a2 a3>; class C { method m(X :@a = Array[X].new) {my Int $s = [+] ( 0x00, |@a)>>.value; say $s } }; my X @x = a1, a3; C.m(:a(@x))
12:40 camelia rakudo-moar fb5676: OUTPUT«No such method 'value' for invocant of type 'Int'␤  in method m at <tmp> line 1␤  in block <unit> at <tmp> line 1␤␤»
12:41 jnthn Now it calls fine but 0x00 doesn't have a .value method
12:41 MARTIMM jnhtn: that's because the Array doesn't have .value
12:41 jnthn m: enum X <a1 a2 a3>; class C { method m(X :@a = Array[X].new) {my Int $s = [+] @a>>.value; say $s } }; my X @x = a1, a3; C.m(:a(@x))
12:41 camelia rakudo-moar fb5676: OUTPUT«2␤»
12:42 jnthn Note that [+] on an empty list will produce 0 anyway, so there's no need for the 0x00 in there.
12:43 MARTIMM jnhtn: I that also true for [+|] because i am using that one
12:43 jnthn m: say [+|] ()
12:43 camelia rakudo-moar fb5676: OUTPUT«0␤»
12:45 MARTIMM jnthn: I understand now, thanks for helping
12:46 jnthn np :)
13:20 ggoebel joined #perl6
13:22 nicq20 joined #perl6
13:22 nicq20 Hello
13:23 viki \o
13:23 Xliff_ Can anyone from Canada sponsor me for emigration?
13:23 Xliff_ Is there anyone from Canada here?
13:23 * viki raises hand
13:23 Xliff_ HELP!
13:23 viki :)
13:23 Xliff_ viki: Srsly?
13:24 viki Yes.
13:24 Xliff_ :-O
13:24 Xliff_ Name your price.
13:24 viki Two unicorns!
13:24 Xliff_ My country has abandoned me and I need refuge.
13:24 Xliff_ Er. Unicorns are hard.
13:24 Xliff_ Can I do dress up?
13:25 tadzik because of all this US drama there'll be no room in canada for us poor europeans
13:25 tadzik but I guess Netherlands is nice too
13:25 Xliff_ tadzik: Europe is fine compared to what will descend on the US come January.
13:25 viki No room? Have you *been* here? :)
13:25 tadzik Xliff: does your government consider banning contraception yet?
13:26 Xliff_ tadzik: February.
13:26 Xliff_ And I'm being generous.
13:26 Xliff_ Roe v. Wade sometime around then as well.
13:26 tadzik we've had morons for a year now, thank heavens we're too poor and stupid for them to have any international impact
13:26 Xliff_ First: the ACA.
13:26 tadzik so it's only shitty here
13:27 Xliff_ OMG. The media was saying this vote was a repudiation of "Washington not doing anything for the voters"
13:27 Xliff_ I puked in my mouth.
13:27 Xliff_ The only reason these people didn't get what they want was because of Republican gridlock!
13:28 Xliff_ I didn't manage to drink all of my liquor last night.
13:28 Xliff_ I don't give a fsck if it is before noon.
13:28 Xliff_ I am drowning my sorrows.
13:29 Xliff_ For those of you NOT in the US.
13:29 Xliff_ Imagine: Trump with the Nuclear Football
13:29 nicq20 left #perl6
13:29 Xliff_ I leave you on that note....
13:29 Xliff_ (viki -- Srsly! Sponsor meeeee!)
13:30 pmurias Xliff_: I can imagine Trump trying to kick it ;)
13:31 Xliff_ pmurias: I wish
13:31 Xliff_ Of course, Trump is not Charlie Brown, and the American Public as Lucy is all too happy to have him try.
13:31 brrt XLiff_: as I said earlier today, I know of a company in Amsterdam that is looking for developers
13:31 Xliff_ ..... without pulling the ball away, first.
13:31 Xliff_ brrt: Ooo!
13:32 viki Amsterdam you say...
13:32 brrt seriously, if you want to leave USA, why not consider it
13:32 DrForr Booking.
13:32 brrt of course :-)
13:32 Xliff_ brrt: Actually, all of this is in jest.
13:32 Xliff_ I cannot leave the US for various reasons, at this time.
13:33 DrForr A few others as well I think but I need to do some more research.
13:33 Xliff_ Family related.
13:33 Xliff_ I just need to blow off some steam.
13:33 Xliff_ I left the election coverage with Hilary still having an outside chance.
13:33 Xliff_ Then I wake up to pre-Armageddon.
13:34 viki Xliff_: heh, I've seen magazines in a grocerry store the other day... Like three of them with Hillary on the cover and ominous "WWIII" warnings :)
13:34 viki ... had she won.
13:34 Xliff_ Those editors will get their wish, now.
13:34 viki Nah, I think for the rest of the world, Hillary would be more dangerous.
13:35 Xliff_ No.
13:35 Xliff_ Just wait. Some state functionary will make a joke about the size of Trump's hands and he will launch.
13:35 moritz they are both dangerous
13:35 moritz Trump because he questions the seriousness of NATO defense pacts
13:35 Xliff_ Trump is not capable of functioning as a Statesman.
13:36 moritz and Hillary because she seems to be pro war
13:36 Xliff_ Hilary at least has the experience and the gravitas to pull that off.
13:36 brrt moritz: can you qualify the 'pro war' statement?
13:36 viki Well, that's not unreasonable to question them. If Russia attacks.. Lithuania... Canada will have to fight them, and I wouldn't even be able to find that country ont he map.
13:36 brrt I've heard it before, but I'm not sure where it comes from
13:36 Xliff_ Hilary may be pro war. I will grant you that. But she is not pro meaningless conflict.
13:37 Xliff_ And then there's Russia.,
13:37 viki And I'm sure many Canadians would feel that way, making NATO pact rather laughable.
13:37 brrt meaning is in the eye of the beholder
13:37 brrt especially with conflict
13:37 Xliff_ And I really need to stop talking now. The [virtual]? walls have ears.
13:37 DrForr o/' It's the end of the 'verse as we know it o/'
13:37 moritz brrt: well, she talks about securing economic interests abroad *and* opposes TTP. What else can that mean?
13:38 * viki returns to writing code
13:38 moritz good idea :-)
13:38 * Xliff_ returns to wishing he was writing code.
13:38 * moritz returns to wondering why people or bots are trying to hack is freenode account
13:38 moritz *his
13:39 Xliff_ Blame Putin.
13:39 * Xliff_ flees.
13:39 brrt I'm not sure what that means, actually
13:40 brrt but then, I'm probably somewhat naive
13:40 Xliff_ Me neither.
13:40 Xliff_ But when has saying something without knowing what it means stopped anyone.
13:40 brrt for what it is worth, I do think that an organisation like e.g. United Nations has a peacekeeping obligation that they are not living up to right now
13:40 Xliff_ (insert Elephant here)
13:41 brrt but whether or not to consider such thoughts pro-war, i'm not sure
13:41 Xliff_ brrt: The problem is... the UN doesn't have much teeth without the US.
13:41 Xliff_ *ach* Stop dragging me back into the conversation!!!
13:41 Xliff_ I am in hiding!!!!!
13:42 brrt I guess that is true
13:42 * Xliff_ hides behind viki.
13:42 brrt (about the UN and their teeth)
13:43 Xliff_ brrt: And moritz was complaining about someone hacking... and Russia has been accused of hacking.
13:43 Xliff_ Hence my asinine comment.
13:43 Xliff_ Just so you are clued in.
13:43 brrt :-)
13:43 * Xliff_ goes back to hiding behind viki.
13:43 * kurahaupo__ has become trapped in a maze of twisty chat rooms, all alike; in fact all discussing American politics
13:43 moritz I just have lots of "There have been 35 failed login attempts since your last successful login." message from freenode
13:43 brrt hmm, that is weird
13:44 moritz kurahaupo__: please do start with some Perl 6 topics
13:44 Xliff_ kurahaupo__: You want to get away from American Politics? Dig a hole. Find a rock. You can figure out the rest.
13:44 lizmat so when should we have a 6.d ?
13:44 brrt how does perl6 survive the nuclear holocaust
13:44 brrt divali was a few days ago, right....
13:44 huf what does a trump presidency mean for perl6?
13:44 Xliff_ brrt: Have the perl6 devs move to the Moon.
13:44 brrt SpaceX, duh
13:44 moritz I'll talk a bit about my schedule, then, and how it relates to Perl 6
13:44 Xliff_ huf: That the perl6 devs should move to the Moon.
13:45 moritz I'm currently in the last review of https://leanpub.com/deploy before it goes to layouting
13:45 huf what does a trump presidency mean for the moon?
13:45 huf i mean, it's been mooning all of us forever
13:45 tadzik colonization
13:45 huf shouldnt we kinda ... do something about that?
13:45 moritz when that's done, I have to prepare for a Perl 6 training course I'll give on Dec 01/02
13:45 Xliff_ Actually...
13:45 moritz and after that, I'll have more time for Perl 6 blogging/book writing. Finally.
13:45 moritz speaking of which
13:45 Xliff_ If things go badly enough, the Moon might be forever crescent.
13:45 DrForr moritz: I'm doing one a day later.
13:45 moritz we need perl 6 advent posts!
13:46 tadzik !
13:46 brrt yes!
13:46 viki lizmat: October 18th
13:46 brrt and it is going to be december in less than a month
13:46 lizmat moritz: I'm considering doing an advent post about iterator internals
13:46 DrForr I can do at least one.
13:46 moritz lizmat: please do!
13:46 tadzik I think I want to do one with Perl 6 threads and Perl 5 code through Inline::Perl5 and traps related to that
13:46 moritz DrForr: please do! Sign up now!
13:46 viki lizmat++ I'd read it.
13:46 moritz tadzik: please add your name to the schedule!
13:46 DrForr Sign up where?
13:46 Xliff_ lizmat++
13:47 wamba joined #perl6
13:47 tadzik okay! :)
13:47 Xliff_ Thank you for changing the subject!!!!!
13:47 moritz DrForr: mu repo, file misc/perl6-advent/schedule, or something like
13:47 viki DrForr: book a spot: https://github.com/perl6/mu/blob/ma​ster/misc/perl6advent-2016/schedule
13:47 Xliff_ Consider me a volunteer for all of your experimenting needs.
13:47 viki huggable: advent :is: https://github.com/perl6/mu/blob/ma​ster/misc/perl6advent-2016/schedule
13:47 huggable viki, Added advent as https://github.com/perl6/mu/blob/ma​ster/misc/perl6advent-2016/schedule
13:47 moritz we haven't had an advent post about zef. Who wants to write one?
13:48 DrForr Nod.
13:48 dalek mu: 0625487 | tadzik++ | misc/perl6advent-2016/schedule:
13:48 dalek mu: Dibs on 13th
13:48 dalek mu: review: https://github.com/perl6/mu/commit/0625487734
13:48 Xliff lizmat: Pls let me be your Igor!!!!
13:49 lizmat :-)
13:49 Xliff lizmat: If Igor is taken... I can be your Mini Me
13:50 itaipu joined #perl6
13:51 brrt i'm not sure if i have something to talk about in december....
13:52 nicq20 joined #perl6
13:52 brrt what I wanted to talk about is how the new jit is designed to be hackable / approachable by regular folks, i.e. people who don't know assembly and too much of compiler internals... but I'm not sure if that is true
13:54 brrt what I'm meaning to say is, I want to help out, but I'm not sure yet how
13:54 [ptc] .oO( Mini Me likes chocolate ... )
13:54 * TimToady waves from among 50K people or so at Web Summit
13:54 [ptc] o/
13:54 viki brrt: How about some tips/tutorial/whatever for how to hack on that stuff?
13:55 viki IMO we could get more core hackers if we had more docs on how to hack on that stuff :/
13:55 viki The "just jump in" method I saw people recommending is painful and slow
13:55 brrt I can definitely spend time on documenting the JIT, and it could potentially help
13:56 brrt however, it would not make for a good advent calendar post
13:56 viki oh :(
13:57 brrt compilers ... can be complicated. don't have to be, but to deal with the realities of CPUs and interpreted languages, that usually is
13:59 nicq20 Where does the JIT live on github?
13:59 nicq20 Which repo really...
14:00 viki nicq20: https://github.com/MoarVM/MoarVM/
14:08 ajr_ joined #perl6
14:08 brrt yeah :-)
14:08 brrt i'm working on a branch even-moar-jit to develop a better code generator
14:09 nine ++tadzik # looking forward to that post
14:09 nine ++tadzik # looking forward to the bug reports :D
14:09 nicq20 brrt: lolz, diggin the name
14:10 tadzik nine: I think all the bugs I had with that one were on my side :)
14:11 nine tadzik: try harder *g*
14:11 tadzik hahahah
14:12 skids joined #perl6
14:20 canopus joined #perl6
14:21 nicq20 viki: Are you planning on continuing the weather module tutorial?
14:21 viki nicq20: nope
14:22 cdg joined #perl6
14:26 pmurias joined #perl6
14:26 Cole_ns joined #perl6
14:28 pmurias brrt: re hackability, one thing that's important for me when approaching a compiler is the ability to easily look at the irs it produces
14:28 brrt hmmm that is a decent point
14:28 brrt we do have graphviz visualization for expression trees :-)
14:29 timotimo and the spesh graph visualizer (which could definitely use more usability improvements, tbh)
14:31 brrt yep, but I don't know as much about that
14:31 Rawriful joined #perl6
14:31 timotimo i don't exactly pimp it in blog posts or anything like that
14:31 brrt (and I want a better IR dumper for the JIT, but it is not feasible for me to promise that before december)
14:31 brrt and also not the main priority
14:31 timotimo the most annoying part is that you have to copy-paste individual parts of the spesh log into the program (or a file)
14:32 Cole_ns Hi, Perl6!
14:32 brrt that seems fixable....
14:32 brrt hi Cole_ns
14:32 Cole_ns Has anyone run into problems with Rakudo being unable to rename files in .precomp?
14:32 timotimo though with the recent speed-ups it may be feasible to go through the whole file, parse the bits, and offer them
14:32 viki Cole_ns: that sounds vaguely familiar. Are you on Windows and with 2016.10 version?
14:33 Cole_ns I'm on Windows, but I'm on 2016.07, there's no .msi for the .10 Rakudo Star yet.
14:34 viki aww
14:34 Cole_ns I agree.  :D
14:34 viki Cole_ns: well, I know recently some sort of issues like that were fixed on Windows.
14:34 jnthn I think the fix for it was actually more recent than 2016.10 even
14:35 jnthn Yeah, I fixed it in 44a4c7549601, which was a few days after 2016.10.
14:37 Cole_ns Well, I'll put on my patient hat and keep working around it then.  Thanks!
14:37 brrt thanks for understanding Cole_ns :-)
14:39 Cole_ns brrt:  Sure!  I still get to use Perl 6, I just have to delete my .precomp folder a lot.  And if I was still using .NET parser frameworks, my project would still be stuck in Limbo.
14:40 Cole_ns Perl6 grammars are the best.
14:42 mspo bytecode caching--
14:44 brrt bytecode caching can be awesome, it's just difficult to get right :-)
14:45 DrForr Cole_ns: That's what I've found too.
14:46 pierre_ joined #perl6
14:46 timotimo https://www.reddit.com/r/perl6/comments/5bx66y/​matching_adverbs_difference_between_p2_and_c2/ - perhaps someone would like to add a few words to the docs for this?
14:47 Cole_ns DrForr:  Thanks for your articles on JavaScript parsing.  They provided me with a crucial boost to get the grammar for my language going.  Your example was small, simple, and (no offense!) messy enough that I was drawn into playing...
14:49 DrForr None taken, I didn't want something that was just a computer science textbook exercise
14:49 DrForr s/$/./
14:57 Rawriful joined #perl6
15:04 cdg_ joined #perl6
15:10 mspo brrt: it should be off by default
15:10 mspo imho
15:26 viki *sigh* everyone at work just won't STFU about US election.
15:26 viki THERE'S NO ESCAPE!
15:28 dalek doc: 8ddd8d1 | (Zoffix Znet)++ | doc/Language/regexes.pod6:
15:28 dalek doc: Add clarification for :pos/:continue
15:28 synopsebot6 Link: http://doc.perl6.org/language/regexes
15:28 dalek doc:
15:28 dalek doc: hobbified++ # https://www.reddit.com/r/perl6/com​ments/5bx66y/matching_adverbs_diff​erence_between_p2_and_c2/d9s589q/
15:28 dalek doc: review: https://github.com/perl6/doc/commit/8ddd8d19c6
15:28 viki timotimo: done
15:28 timotimo cool
15:31 pyrimidine joined #perl6
15:32 dalek doc: 2830ab9 | (Zoffix Znet)++ | doc/Language/regexes.pod6:
15:32 dalek doc: Remove spurious comma
15:32 synopsebot6 Link: http://doc.perl6.org/language/regexes
15:32 dalek doc: review: https://github.com/perl6/doc/commit/2830ab9f11
15:41 Rawriful joined #perl6
15:41 acrussell joined #perl6
15:42 skids joined #perl6
15:42 nicq20 left #perl6
15:43 nicq20 joined #perl6
15:45 nicq20 left #perl6
15:51 Rawriful joined #perl6
16:04 Rawriful joined #perl6
16:08 pyrimidine joined #perl6
16:10 pyrimidine joined #perl6
16:15 Rawriful joined #perl6
16:18 dataf3l joined #perl6
16:22 viki Free dev books: https://devfreebooks.github.io/
16:23 * viki hopes to see Perl 6 among the squares one day.
16:23 viki huggable: books :is: Free dev books (any Perl 6?): https://devfreebooks.github.io/
16:23 huggable viki, Added books as Free dev books (any Perl 6?): https://devfreebooks.github.io/
16:38 viki m: await IO::Socket::Async.connect("260​0:3c03::f03c:91ff:fe91:d028", 80).then: -> $p { if $p.status { given $p.result { .print: "GET / HTTP/1.0\n\n"; react { whenever .Supply { .say } } } } }
16:38 camelia rakudo-moar b46a62: OUTPUT«===SORRY!===␤bindexpayload needs a VMException␤»
16:39 viki :o
16:44 harmil_wk joined #perl6
16:45 timotimo interesting find
16:45 timotimo it ought to output the actual REPR and its debug_name, IMO
16:46 viki Interesting, from my Ubuntu box, I get "Failed to resolve host name", from a Debian and Windows boxes on the same network I get "network is unreachable" and if I run it on that box (whose IPv6 that is) then it works.
16:46 * viki was reading https://www.iab.org/documents/correspondence-r​eports-documents/2016-2/iab-statement-on-ipv6/ and got curious
16:48 * timotimo pushed
16:51 * viki rakudobuggerd https://rt.perl.org/Ticket/Display.html?id=130064
16:51 * timotimo also going to merge POSTBUILD_method now
16:51 viki \o/
16:52 * [ptc] hopes to see Perl *5* among the squares one day...
16:53 timotimo viki: with your code i get an http forbidden response
16:53 viki [ptc]: that's actually realizable this instant, considering Modern Perl is free
16:53 [ptc] ... as well as Perl 6, naturally
16:53 viki timotimo: that's accurate. That means it's working.
16:53 timotimo but i wanted to figure out why that explosion happens?
16:54 viki timotimo: well, I dunno why it happens. So far, I can only reproduce it on camelia
16:54 timotimo dangit.
16:54 [ptc] viki: true.  Can any mere mortal add to the list?
16:54 timotimo well, there's a "add ebook" button at the top
16:54 timotimo maybe that'll let you suggest languages/products that aren't already in there?
16:54 pyrimidine joined #perl6
16:55 ggoebel joined #perl6
16:55 [ptc] timotimo: thanks :-)  Just saw that and thought, duh: didn't need to make the comment :-/
16:55 timotimo no worries :)
16:57 pyrimidi_ joined #perl6
17:12 viki m: use NativeCall; sub system(Str) is native {}; system 'curl http://[2600:3c03::f03c:91ff:fe91:d028]'
17:12 camelia rakudo-moar b46a62: OUTPUT«curl: (7) Couldn't connect to server␤»
17:12 viki m: use NativeCall; sub system(Str) is native {}; system 'curl -v http://[2600:3c03::f03c:91ff:fe91:d028]'
17:12 camelia rakudo-moar b46a62: OUTPUT«* Rebuilt URL to: http://[2600:3c03::f03c:91ff:fe91:d028]/␤*   Trying 2600:3c03::f03c:91ff:fe91:d028...␤* Immediate connect fail for 2600:3c03::f03c:91ff:fe91:d028: Network is unreachable␤* Closing connection 0␤curl: (7) Couldn't connect to server␤»
17:15 timotimo oh, nine's server doesn't have ipv6 connectivity?
17:15 timotimo that'd be a bit weird
17:16 viki committable6, HEAD await IO::Socket::Async.connect("260​0:3c03::f03c:91ff:fe91:d028", 80).then: -> $p { if $p.status { given $p.result { .print: "GET / HTTP/1.0\n\n"; react { whenever .Supply { .say } } } } }
17:16 committable6 viki, https://gist.github.com/
17:16 viki erm... thanks, committable6 :"}
17:16 timotimo m)
17:18 viki I don't know any of those things, but maybe libwhatever on that server was built without IPv6 support in it and that's why that exception gets thrown?
17:18 timotimo libuv without ipv6 support? seems unlikely?
17:20 vendethiel joined #perl6
17:26 atweiden joined #perl6
17:33 wamba joined #perl6
17:35 vendethiel joined #perl6
17:48 harmil_wk Do we have docs for all our bots?
17:48 harmil_wk Or should I be asking a bot that? ;-)
17:48 Rawriful joined #perl6
17:49 cognominal joined #perl6
17:54 viki harmil_wk: what sort of docs?
17:54 harmil_wk Usage?
17:55 viki Most of them accept a "help" command"
17:55 viki NeuralAnomaly: help
17:55 NeuralAnomaly viki, stats | blockers
17:55 viki NeuralAnomaly: stats
17:55 NeuralAnomaly viki, [✘] Next release will be in 1 week and 2 days. Since last release, there are 27 new still-open tickets (1 unreviewed and 1 blockers) and 233 unreviewed commits. See http://perl6.fail/release/stats for details
17:55 viki harmil_wk: also: https://github.com/perl6/doc/issues/711
17:56 rurban joined #perl6
17:57 viki buggable: eco
17:57 buggable viki, Out of 741 Ecosystem dists, 152 have warnings and 0 have errors. See https://modules.perl6.org/update.log for details
17:58 viki SourceBaby: help
17:58 SourceBaby viki, Use s: trigger with args to give to sourcery sub. e.g. s: Int, 'base'. See http://modules.perl6.org/d​ist/CoreHackers::Sourcery
17:59 viki Gee 15 bots :o
17:59 viki m: say "{15/314*100}% of the population"
17:59 camelia rakudo-moar b46a62: OUTPUT«4.777070% of the population␤»
18:00 xtt joined #perl6
18:03 Rawriful joined #perl6
18:05 domidumont joined #perl6
18:06 maybekoo2 joined #perl6
18:11 firstdayonthejob joined #perl6
18:12 FROGGS joined #perl6
18:14 harmil_wk Do we expect BUILD to be called when the signature matches, regardless of what your base class is... even if it's NQP?
18:15 nine mspo: would you really want to wait a couple of minutes for a moderately sized program to start? That's what you get without the bytecode cache.
18:17 nine timotimo: my server does have IPv6. But maybe camelia's VM doesn't.
18:17 timotimo that's possible
18:18 nine Yep, the VM doesn't have a v6 address
18:19 acrussell joined #perl6
18:19 timotimo hm
18:19 timotimo maybe we want to try to figure out how that error comes to be, though
18:20 timotimo the SORRY one
18:20 troys joined #perl6
18:22 viki m: dd [ .foo, .bar ] with class { has $.foo = 42; has $.bar; submethod TWEAK (:$!bar) {} }.new: :72bar
18:22 camelia rakudo-moar cee101: OUTPUT«[42, 72]␤»
18:22 viki \o/ timotimo++
18:24 viki m: dd [ .foo, .bar ] with class { has $.foo = 42; has $.bar; submethod TWEAK (:$meow) { $!bar = $meow } }.new: :72meow
18:24 camelia rakudo-moar cee101: OUTPUT«[42, 72]␤»
18:24 viki Better example :)
18:25 timotimo mhm
18:26 harmil_wk m: sub thing-class(::Type) { class :: is ::Type { submethod BUILD(|c) { die; } } }; use Test; for <Hash Set Int List Routine> -> $name { my $type = ::($name); dies-ok {my $f = thing-class($type).new }, "Expect BUILD to be called for thing-class: $name"
18:26 camelia rakudo-moar cee101: OUTPUT«Unhandled exception: No such method 'item' for invocant of type 'Type'␤   at <unknown>:1  (/home/camelia/rakudo-m-inst-2/share/perl6/r​untime/CORE.setting.moarvm:print_exception)␤ from gen/moar/m-CORE.setting:27020  (/home/camelia/rakudo-m-inst-2/share/…»
18:26 harmil_wk I apparently did a bad.
18:38 viki m: -> ::T { class :: is ::T {} }
18:38 camelia rakudo-moar 0cf7b3: OUTPUT«Unhandled exception: No such method 'item' for invocant of type 'T'␤   at <unknown>:1  (/home/camelia/rakudo-m-inst-1/share/perl6/r​untime/CORE.setting.moarvm:print_exception)␤ from gen/moar/m-CORE.setting:27045  (/home/camelia/rakudo-m-inst-1/share/per…»
18:38 viki The error looks similar to https://rt.perl.org/Ticket/Displ​ay.html?id=129906#ticket-history
18:40 jnthn That should probably say T is too late-bound to use in this case.
18:41 viki Ah
18:41 jnthn (Classes are formed at BEGIN time, but a ::T type capture is never going to take a value until runtime)
18:41 jnthn m: -> ::T { class :: is T {} }
18:41 camelia rakudo-moar 0cf7b3: OUTPUT«Unhandled exception: No such method 'item' for invocant of type 'T'␤   at <unknown>:1  (/home/camelia/rakudo-m-inst-1/share/perl6/r​untime/CORE.setting.moarvm:print_exception)␤ from gen/moar/m-CORE.setting:27045  (/home/camelia/rakudo-m-inst-1/share/per…»
18:42 jnthn Hm, note how it fails inside printing the exception though
18:42 jnthn m: EVAL '-> ::T { class :: is T {} }'; say $!.^name
18:42 camelia rakudo-moar 0cf7b3: OUTPUT«Unhandled exception: No such method 'item' for invocant of type 'T'␤   at <unknown>:1  (/home/camelia/rakudo-m-inst-1/share/perl6/r​untime/CORE.setting.moarvm:print_exception)␤ from gen/moar/m-CORE.setting:27045  (/home/camelia/rakudo-m-inst-1/share/per…»
18:42 viki m: try EVAL '-> ::T { class :: is T {} }'; say $!.^name
18:42 jnthn m: EVAL '-> ::T { class :: is T {} }'; say $!.WHAT
18:42 camelia rakudo-moar 0cf7b3: OUTPUT«Unhandled exception: No such method 'item' for invocant of type 'T'␤   at <unknown>:1  (/home/camelia/rakudo-m-inst-1/share/perl6/r​untime/CORE.setting.moarvm:print_exception)␤ from gen/moar/m-CORE.setting:27045  (/home/camelia/rakudo-m-inst-1/share/per…»
18:42 camelia rakudo-moar 0cf7b3: OUTPUT«X::Inheritance::Unsupported␤»
18:42 jnthn oh, d'oh :)
18:43 jnthn Ah
18:43 harmil_wk Wow
18:43 jnthn That's not a bad exception type
18:43 jnthn m: try EVAL '-> ::T { class :: is T {} }'; say $!.WHAT
18:43 camelia rakudo-moar 0cf7b3: OUTPUT«(Unsupported)␤»
18:43 jnthn m: try EVAL '-> ::T { class :: is T {} }'; say $!.gist
18:43 camelia rakudo-moar 0cf7b3: OUTPUT«No such method 'item' for invocant of type 'T'␤  in block <unit> at <tmp> line 1␤␤»
18:43 jnthn m: try EVAL '-> ::T { class :: is T {} }'; say $!.message
18:43 camelia rakudo-moar 0cf7b3: OUTPUT«No such method 'item' for invocant of type 'T'␤  in block <unit> at <tmp> line 1␤␤»
18:43 jnthn Probably that message method wants a look
18:43 Rawriful joined #perl6
18:44 jnthn Can detect that it's a typevar and produce a nice message
18:44 jnthn m: try EVAL '-> ::T { class :: is T {} }'; dd $!
18:44 camelia rakudo-moar 0cf7b3: OUTPUT«No such method 'perl' for invocant of type 'T'␤  in block <unit> at <tmp> line 1␤␤»
18:44 harmil_wk So, LTA error handling aside, is there a way to construct a class at run-time that has as its base class a parametric type?
18:44 viki OK. I'll take a look
18:44 jnthn m: try EVAL '-> ::T { class :: is T {} }'; dd $!.^attributes
18:44 camelia rakudo-moar 0cf7b3: OUTPUT«(Attribute.new, Attribute.new, Attribute.new, Attribute.new, Attribute.new, Attribute.new, Attribute.new, Attribute.new, Attribute.new, Attribute.new, Attribute.new, Attribute.new, Attribute.new)␤»
18:44 jnthn m: try EVAL '-> ::T { class :: is T {} }'; say $!.^attributes
18:44 camelia rakudo-moar 0cf7b3: OUTPUT«(Mu $!child-typename Mu $!parent Mu $!filename Mu $!pos Mu $!line Mu $!column Positional @!modules Mu $!is-compile-time Mu $!pre Mu $!post Positional @!highexpect Mu $!ex Mu $!bt)␤»
18:44 jnthn m: try EVAL '-> ::T { class :: is T {} }'; say $!.parent.archetypes.generic
18:44 camelia rakudo-moar 0cf7b3: OUTPUT«No such method 'archetypes' for invocant of type 'T'␤  in block <unit> at <tmp> line 1␤␤»
18:44 jnthn m: try EVAL '-> ::T { class :: is T {} }'; say $!.parent.HOW.archetypes.generic
18:45 camelia rakudo-moar 0cf7b3: OUTPUT«1␤»
18:45 jnthn Can go on that
18:46 telex joined #perl6
18:47 viki m: -> ::T { class Foo {}.new but ::T }( role { has $.meow = 42 } ).perl.say
18:47 camelia rakudo-moar 0cf7b3: OUTPUT«Foo+{<anon|80665552>}.new(meow => 42)␤»
18:47 viki harmil_wk: you can do that with roles. There's also `does` and .^mixin. Not sure about how to do with adding  parent classes
18:48 firstdayonthejob joined #perl6
18:50 harmil_wk roles and does don't change mro, though, do they?
18:51 jnthn A role can bring along a parent
18:51 harmil_wk Oh!
18:51 harmil_wk Okay, thanks
18:51 viki :o
18:51 jnthn m: role R is Exception { }; class C does R { }; say C.^mro
18:51 camelia rakudo-moar 0cf7b3: OUTPUT«((C) (Exception) (Any) (Mu))␤»
18:51 viki TIL
18:54 harmil_wk m: role Foo[::T] is T { }
18:54 camelia rakudo-moar 0cf7b3: OUTPUT«Unhandled exception: No such method 'item' for invocant of type 'T'␤   at <unknown>:1  (/home/camelia/rakudo-m-inst-2/share/perl6/r​untime/CORE.setting.moarvm:print_exception)␤ from gen/moar/m-CORE.setting:27045  (/home/camelia/rakudo-m-inst-2/share/per…»
18:54 harmil_wk So, don't think I can parameterize it that way either.
18:55 kent\n joined #perl6
18:55 Rawriful joined #perl6
18:55 kent\n joined #perl6
18:56 harmil_wk .^mixin might need to be the way...
18:58 harmil_wk There we go!
18:58 harmil_wk m: role Thrower { submethod BUILD(|c) { die; } }; use Test; for <Any Hash Set Int List Routine Mu> -> $name { my $type = ::($name); my $thing = $type.^mixin(Thrower); dies-ok {$thing.new }, "Expect BUILD on (class :: is $name // {$type.perl} // {$thing.perl})" }
18:58 camelia rakudo-moar 0cf7b3: OUTPUT«ok 1 - Expect BUILD on (class :: is Any // Any // Any+{Thrower})␤not ok 2 - Expect BUILD on (class :: is Hash // Hash // Hash+{Thrower})␤␤# Failed test 'Expect BUILD on (class :: is Hash // Hash // Hash+{Thrower})'␤# at <tmp> line 1␤not ok 3 - Ex…»
18:58 harmil_wk So, it blows up in useful ways that actually tell me what I wanted to know, now.
19:00 harmil_wk Classes derived from Mu, Any, Routine and Int will call their BUILD submethods, but classes derived from Hash, Set and List will not.
19:00 viki Right. It's the same stuff as the defaults on attributes that you ticketed last week
19:01 harmil_wk Yep, I was trying to work around that by giving defaults on BUILD arguments.
19:01 harmil_wk So, I wanted to be sure of the shape of it... anyway, back to $work
19:01 viki I think I showed a work around last week? Was it not applicable?
19:01 harmil_wk Maybe I missed it? Not sure. There was a lot of conversation.
19:05 harmil_wk Updated the ticket with that.
19:06 viki m: class Foo is Hash { has $.meows; method new { self.bless: |{:42meows}, |%_ } }.new(:72meows).meows.say
19:06 camelia rakudo-moar 0cf7b3: OUTPUT«72␤»
19:07 viki m: class Foo is Hash { has $.meows; method new { self.bless: |{:42meows}, |%_ } }.new.meows.say
19:07 camelia rakudo-moar 0cf7b3: OUTPUT«42␤»
19:07 viki There's likely a cleaner version too where you'd call Mu's.new or whatever
19:07 harmil_wk Ah, I see
19:08 harmil_wk That's kind of arcane, I think for my purposes, I'm just going to back off to delegation to a hash.
19:08 viki Declaring your own new with your own bless isn't too archane.
19:10 viki Interesting
19:10 viki m: method { %_ }
19:10 camelia rakudo-moar 0cf7b3: ( no output )
19:10 viki m: method { @_ }
19:10 camelia rakudo-moar 0cf7b3: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Placeholder variables cannot be used in a method␤at <tmp>:1␤------> 3method7⏏5 { @_ }␤»
19:10 viki But... %_ can be used... and it does work :/
19:11 lizmat viki: %_ is just always there when you use it
19:11 lizmat it just contains the unaccounted named variables
19:11 lizmat m: sub a() { dd %_ }; a foo => 42
19:11 camelia rakudo-moar 0cf7b3: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Placeholder variable '%_' cannot override existing signature␤at <tmp>:1␤------> 3sub7⏏5 a() { dd %_ }; a foo => 42␤»
19:11 avuserow m: say (method {}).signature
19:11 camelia rakudo-moar 0cf7b3: OUTPUT«(Mu $: *%_)␤»
19:11 lizmat m: sub a { dd %_ }; a foo => 42
19:11 camelia rakudo-moar 0cf7b3: OUTPUT«{:foo(42)}␤»
19:12 lizmat viki: just like using $_ autogenerates a -> $_ sig
19:12 lizmat m: sub a { dd $_ }; a 42
19:12 camelia rakudo-moar 0cf7b3: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Calling a(Int) will never work with declared signature ()␤at <tmp>:1␤------> 3sub a { dd $_ }; 7⏏5a 42␤»
19:13 lizmat hmmm
19:13 lizmat ah, for blocks
19:13 viki m: { dd @_ }(42)
19:13 camelia rakudo-moar 0cf7b3: OUTPUT«[42]␤»
19:13 lizmat m: my $a := { dd $_ }; $a(42)
19:13 camelia rakudo-moar 0cf7b3: OUTPUT«42␤»
19:13 viki m: -> :$moo { dd %_ }(:meow, :moo)
19:13 camelia rakudo-moar 0cf7b3: OUTPUT«5===SORRY!5=== Error while compiling <tmp>␤Placeholder variable '%_' cannot override existing signature␤at <tmp>:1␤------> 3<BOL>7⏏5-> :$moo { dd %_ }(:meow, :moo)␤»
19:13 Rawriful joined #perl6
19:14 viki lizmat: I don't see the difference between @_ and %_, so I'm still confused why %_ works for methods, but @_ is disallowed.
19:14 dalek doc: 7f7977d | moritz++ | doc/Language/objects.pod6:
19:14 dalek doc: Some initial documentation for TWEAK
19:14 synopsebot6 Link: http://doc.perl6.org/language/objects
19:14 dalek doc: review: https://github.com/perl6/doc/commit/7f7977dca5
19:14 moritz viki: maybe it's related to methods having an implicit *%_ in their signature?
19:14 FROGGS viki: methods swallow nameds, but not positionals
19:15 shmibs joined #perl6
19:15 viki Ah
19:15 moritz m: say (method { }).signature
19:15 camelia rakudo-moar 0cf7b3: OUTPUT«(Mu $: *%_)␤»
19:15 viki m: say (sub { }).signature
19:15 camelia rakudo-moar 0cf7b3: OUTPUT«()␤»
19:18 viki m: class Foo is Hash { has $.meows = 72; method new (|c){ self.Mu::new(|c) } }.new(:72meows).meows.say
19:18 camelia rakudo-moar 0cf7b3: OUTPUT«72␤»
19:18 viki harmil_wk: ^ I think this is the cleaner thing I meantiooned ^
19:18 viki m: class Foo is Hash { has $.meows = 72; method new (|c){ self.Mu::new(|c) } }.new(:42meows).meows.say
19:18 camelia rakudo-moar 0cf7b3: OUTPUT«42␤»
19:18 viki m: class Foo is Hash { has $.meows = 72; method new (|c){ self.Mu::new(|c) } }.new.meows.say
19:18 camelia rakudo-moar 0cf7b3: OUTPUT«72␤»
19:19 viki m: class Foo is Hash { has $.meows = 72; method new (|c){ self.Mu::new(|c) } }; my $h = Foo.new; $h<a b c> = (3, 4, 5); dd $h;
19:19 camelia rakudo-moar 0cf7b3: OUTPUT«Foo $h = ${:a(3), :b(4), :c(5)}␤»
19:19 viki \o/
19:21 Rawriful joined #perl6
19:22 kent\n joined #perl6
19:22 andrzejku_ joined #perl6
19:23 viki Seems the X::Inheritance::Unsupported issue is fixed by just changing $. twigils to $! in method message.
19:25 andreoss joined #perl6
19:26 RabidGravy joined #perl6
19:27 user9 joined #perl6
19:28 RabidGravy boom!
19:28 yoleaux 8 Nov 2016 22:36Z <japhb> RabidGravy: Would Term::Cap allow us to avoid using tput in https://github.com/ab5tract/Terminal-Print/bl​ob/master/lib/Terminal/Print/Commands.pm6#L38 (and thus avoid having to do the crazy dance in which we cache a bunch of terminal escape strings at module precompilation time)?
19:28 andreoss can i somehow specify the way .. unfold? pass some extra argument to .succ?
19:28 yoleaux 16 Sep 2016 19:35Z <TimToady> andreoss: traits are from Smalltalk, but we renamed them roles because we also use them for interfaces and for generics; otoh if by 'traits' you mean 'is foo()' and such, we borrowed those mostly from English
19:28 yoleaux 16 Sep 2016 19:37Z <TimToady> andreoss: as for method/submethod, we just made that up ourselves because we wanted to be able to isolate the initialization work for each part of an object, class by class, so we needed methods that aren't inherited
19:29 Rawriful joined #perl6
19:29 viki andreoss: but it doesn't take any arguments?
19:30 harmil_wk viki: that's great.
19:30 viki But you can use a sequence operator instead of a range to go fancy pants
19:30 viki m: say 1, { say "meows $_"; .succ } ... 3
19:30 camelia rakudo-moar 0cf7b3: OUTPUT«meows 1␤meows 2␤(1 2 3)␤»
19:30 RabidGravy japhb, yes - the only reason I've avoided finishing it was because parsing the termcap file was somewhat slow
19:31 mohae joined #perl6
19:35 ale1ster joined #perl6
19:35 kent\n joined #perl6
19:37 setty1 joined #perl6
19:38 viki m: say 2, 4, 6 … 30
19:38 camelia rakudo-moar 0cf7b3: OUTPUT«(2 4 6 8 10 12 14 16 18 20 22 24 26 28 30)␤»
19:38 viki m: say 1, 3, 9 … 30
19:38 camelia rakudo-moar 0cf7b3: OUTPUT«(1 3 9 27)␤»
19:38 viki m: say 1, 1, *+* … 20000
19:38 camelia rakudo-moar 0cf7b3: OUTPUT«(1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 2178309 3524578 5702887 9227465 14930352 24157817 39088169 63245986 102334155 165580141 267914296 433494437 7014087…»
19:39 viki andreoss: ^ other ways. So to me it sounds like you want to explore the sequence op, rather than tweak the .. (which just creates a new Range object with two end points)
19:42 AlexDaniel joined #perl6
19:42 andreoss m: class Foo { has $.i ; method succ { Foo.new(i => $.i + 1 ) } }; my @x = (Foo.new(0)...*)[0..3]; say @x
19:42 camelia rakudo-moar 0cf7b3: OUTPUT«Default constructor for 'Foo' only takes named arguments␤  in block <unit> at <tmp> line 1␤␤»
19:42 andreoss m: class Foo { has $.i ; method succ { Foo.new(i => $.i + 1 ) } }; my @x = (Foo.new(:i(0))...*)[0..3]; say @x
19:42 camelia rakudo-moar 0cf7b3: OUTPUT«[Foo.new(i => 0) Foo.new(i => 1) Foo.new(i => 2) Foo.new(i => 3)]␤»
19:43 andreoss m: class Foo { has $.i ; method succ(:$e = 1) { Foo.new(i => $.i + $e ) } }; my @x = (Foo.new(:i(0))...*)[0..3]; say @x;
19:43 camelia rakudo-moar 0cf7b3: OUTPUT«[Foo.new(i => 0) Foo.new(i => 1) Foo.new(i => 2) Foo.new(i => 3)]␤»
19:43 andreoss can i pass $e thorough  ... ?
19:43 andreoss *through
19:45 viki m: class Foo { has $.i ; method succ(:$e = 1) { Foo.new(i => $.i + $e ) } }; my @x = (Foo.new(:i(0)), *.succ(:42e) ...*)[0..3]; say @x;
19:45 camelia rakudo-moar 0cf7b3: OUTPUT«[Foo.new(i => 0) Foo.new(i => 42) Foo.new(i => 84) Foo.new(i => 126)]␤»
19:46 Tonik joined #perl6
19:46 andreoss i was hoping for something like ` $x ... $y :2e`
19:47 viki heh
19:47 viki s: &infix:<...>
19:47 SourceBaby viki, Sauce is at https://github.com/rakudo/rakudo/blo​b/0cf7b36/src/core/operators.pm#L436
19:48 viki Well, you could probably write your own ... op :D
19:48 viki $x ... $y :2e to me looks to magical
19:48 andreoss left #perl6
19:50 Rawriful joined #perl6
19:51 labster joined #perl6
19:56 Actualeyes joined #perl6
20:25 canopus joined #perl6
20:50 pyrimidine joined #perl6
20:51 nadim_ joined #perl6
20:53 perigrin joined #perl6
20:57 bjz joined #perl6
21:07 girafe joined #perl6
21:07 cdg joined #perl6
21:35 samcv working more on getting proc async working here. it was working before. but atm i don't receive anything on the .stdout supply until i do stdin-close on it. but i need the script to be long running
21:35 samcv argh
21:38 samcv and i know the process isn't waiting before printing it out.. if i don't tap stdout it prints out fine to terminal. and if it prints out a bunch of stuff eventually i'll get some of the things on the supply... eventually. though often not always
21:39 Actualeyes joined #perl6
21:42 pyrimidine joined #perl6
21:48 Rawriful joined #perl6
21:50 ajr_ joined #perl6
21:51 stanley joined #perl6
21:57 Woodi joined #perl6
22:01 Rawriful joined #perl6
22:05 kaare_ joined #perl6
22:32 pyrimidine joined #perl6
22:33 Tonik joined #perl6
22:39 wisti joined #perl6
22:42 pyrimidine joined #perl6
22:52 pyrimidine joined #perl6
22:54 Rawriful joined #perl6
22:58 pyrimidine joined #perl6
23:07 Rawriful joined #perl6
23:17 Rawriful joined #perl6
23:20 pyrimidine joined #perl6
23:32 skids joined #perl6
23:41 pyrimidine joined #perl6
23:51 pyrimidine joined #perl6
23:56 samcv i condensed the problem i'm having down as far as i could. http://vpaste.net/7Bm0L
23:57 samcv if anybody can look and see why the stdout doesn't receive anything until i close stdin? i need process started by proc::async to be running continuously and react to messages it prints out.
23:59 timotimo samcv: may want/need autoflush?

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

Perl 6 | Reference Documentation | Rakudo