»ö« Welcome to Perl 6! | perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, or /msg camelia p6: ... | irclog: irc.perl6.org or colabti.org/irclogger/irclogger_logs/perl6 | UTF-8 is our friend! Set by moritz on 22 December 2015. |
|||
00:11
kyclark_ joined
00:13
kyclark_ left
00:17
Rawriful left
00:19
ggoebel left
00:32
ggoebel joined
|
|||
tony-o | valgrindr | 00:34 | |
where vals find one another | |||
00:36
nadim_ left
00:42
pierre_ joined
00:44
Rawriful joined
|
|||
japhb | .oO( Come and play in our new thread pool! ) |
00:46 | |
00:48
Rawriful left
01:04
seatek joined,
aborazmeh joined,
aborazmeh left,
aborazmeh joined
01:09
wamba left
01:13
andlrc joined
01:16
andlrc left
01:17
girafe left
01:21
jameslenz joined
|
|||
Xliff | Hmmm.... | 01:23 | |
01:24
cog_ joined
|
|||
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:24 | |
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:28 | |
Xliff | :-O | 01:30 | |
D'oh! | |||
\/o | |||
Er. | |||
/o\ | |||
OK. It's election night and it's obvious I am too drunk to code but not drunk enough to watch the Election Map. | |||
Time to choose. | |||
seatek++ for the obvious solution. | 01:31 | ||
seatek | hey i excel at the obvious :) | ||
Xliff | :D | ||
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» | ||
Xliff | I should. | ||
01:48
cpage_ left
01:54
cdg left
02:00
pierre_ left
02:01
pierre_ joined
02:05
pierre_ left
02:08
sufrostico left
02:09
canopus left
|
|||
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:14 | |
02:15
canopus joined,
pierre_ joined
02:16
BenGoldberg joined
02:36
aindilis joined
02:45
hyer joined,
ilbot3 left
02:46
ggoebel left
02:47
ilbot3 joined,
hyer left
02:48
Rawriful joined
02:54
Rawriful left
02:56
Rawriful joined
03:11
mildbill_ joined
03:12
mildbill_ left
03:14
Rawriful left,
Rawriful joined
03:15
Rawriful left
03:19
ggoebel joined
03:20
cyphase left
03:24
cyphase joined
03:28
pierre_ left
03:33
pierre_ joined
|
|||
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
03:52
noganex_ left
03:58
lichtkind left
04:00
Rawriful joined
04:01
aborazmeh left
04:10
Rawriful left
04:12
Rawriful joined
04:28
pierre_ left
04:31
pierre_ joined
04:38
pierre_ left,
llll joined
04:40
llll left,
Bork joined,
Bork left
04:47
pierre_ joined
04:52
pierre_ left
05:07
grondilu left
05:28
Cabanossi left
05:30
Cabanossi joined
05:33
dataf3l joined,
dataf3l left,
dataf3l joined
|
|||
dataf3l | hi guys | 05:33 | |
I reported bug #129909 indicating the need for compilation to jvm jar files | |||
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=129909 | ||
AlexDaniel | 🙋 | 05:34 | |
dataf3l | i kinda wanted to do something like this | ||
> perl6 --target=jvm --output=guess.jar guess.p6 | |||
the perl6 team indicated they didn’t have it in immediate plans, which sucks for me I guess | |||
ugexe | --target=jar | ||
dataf3l | the team’s response was: | ||
“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." | |||
I’m now looking for an alternative, using moarvm t | 05:35 | ||
to generate moar files, which can then be fed into the vm, but I have zero clue as to how to do that | |||
ugexe | --target=moar? | ||
dataf3l | I assuming it must be possible, since the Perl6’s distro itself has a bunch of moar files | ||
I don’t know how to run the files after they were generated. | |||
ugexe | they still need a perl6 entry point afaik | 05:36 | |
dataf3l | has anybody stumbled into an step by step article or guid ? | ||
guide* | |||
ugexe | the source | ||
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 :) | ||
dataf3l | I’m assuming the source is readable | ||
I’ve taken peeks here and there, but haven’t decided to “read the whole shebang” yet | |||
I suppose it can be a great learning experience | |||
ugexe | have you tried --target=jar? | 05:39 | |
or --target=moar? | |||
AlexDaniel | hehe, America. 「use MONKEY;」 | ||
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 | |
github.com/dataf3l/perl6-examples | |||
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 | ||
dataf3l | this is just a list of personal programs, based on pmichaud’s slides among other sources | 05:41 | |
uexe: I tried —target=jar , but to no avail | |||
ugexe | you were using jvm rakudo with that command too? | ||
dataf3l | yes | ||
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 | ||
dataf3l | I can’t run that specific command at this very moment, I re-installed everything and only have moar at the moment | ||
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. | |||
I hope you guys find it useful, pull requests welcome :) | |||
ugexe | github.com/dataf3l/perl6-examples/...ter/p64.p6 this does not make sense | 05:43 | |
gather/take in void context | 05:44 | ||
dataf3l | I think I was researching list comprehensions, and somebody on the internet suggested that syntax | 05:45 | |
I’m not sure, but I think it’s a lazy list | |||
ugexe | its in void context | ||
you aren't assigning it to anything | |||
dataf3l | what do you meany by void context | ||
AH | |||
you are correct | 05:46 | ||
ok, I fixed it | 05:47 | ||
ugexe | p61.p6 is exactly the same as p62.p6 | 05:48 | |
dataf3l | that must be my mistake | ||
05:49
labster left
|
|||
dataf3l | I’m flattered people are interested in my code, but at the same time, ashamed of my newbie-ness | 05:49 | |
ugexe | github.com/dataf3l/perl6-examples/...ter/p64.p6 this should use `prompt($msg)` instead of `get` | ||
dataf3l | I must live with shame, that is the only way I know... | ||
ugexe | my $table-name = prompt("Enter Table name"); | 05:50 | |
dataf3l | 64? | ||
ugexe | oops | ||
dataf3l | 58? | 05:51 | |
ugexe | ah 58, but you used prompt in 57 | ||
dataf3l | I think 57 is a “not so awesome” example, and 58 is a more refined one | ||
ugexe | er prompt in 58, get in 57 | ||
dataf3l | like I said before, VERY basic examples | ||
ugexe | my last suggestion would be to rename the files so it represents what its demonstrating | 05:55 | |
so someone searching for "lazy lists" may actually end up on your example | 05:56 | ||
dataf3l | I agree, that’s a a good suggestion | ||
I’ll create a bug | |||
05:58
BenGoldberg left
05:59
AlexDaniel left
06:01
BillSussman left
06:05
pierre_ joined
06:07
wamba joined
06:13
CIAvash joined
06:31
pierre_ left
06:35
ggoebel left
06:37
Rawriful left
06:39
pierre_ joined,
Rawriful joined
06:40
dataf3l left,
pierre_ left,
pierre_ joined
06:47
ggoebel joined
06:48
RabidGravy joined
06:59
darutoko joined
07:02
dataf3l joined,
neuraload joined
07:09
Woodi joined
07:23
Rawriful left
07:25
nadim_ joined,
labster joined
07:27
domidumont joined,
Lucas_One left
07:28
Rawriful joined,
RabidGravy left,
Rawriful left
07:31
pierre_ left,
domidumont left,
domidumont joined
07:33
Xliff_ joined
07:34
domidumont left
07:35
Xliff left
07:36
Lucas_One joined
07:37
firstdayonthejob joined
07:38
pierre_ joined
07:39
cpage_ joined
07:42
brrt joined
07:43
pierre_ left,
firstdayonthejob left
07:45
Woodi left,
Woodi joined
07:49
wamba left,
pierre_ joined
07:53
dataf3l left
|
|||
nadim_ | Good Morning. I am having a discussion with Dmitry about Prima 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:54 | |
07:55
dataf3l joined
|
|||
dataf3l | hey guys | 07:55 | |
I’m reading the source if DBIsh | |||
I’m curious as to what does line 27 does | 07:56 | ||
github.com/perl6/DBIish/blob/maste...le.pm6#L27 | |||
and how would I google that question | |||
07:56
TimToady left
|
|||
moritz | dataf3l: google isn't very good at search for punctuation | 07:57 | |
dataf3l | I guess that’s my point | ||
07:58
TimToady joined
|
|||
moritz | dataf3l: what you can do is enter some elements of the syntax that interest you into the search box at docs.perl6.org/ | 07:58 | |
arnsholt | dataf3l: Which part are you wondering about? | ||
moritz | dataf3l: for example if you enter ... it suggests ... (forward declaration) | ||
(among other things) | |||
arnsholt | ... (yada yada yada) makes the definition a stub declaration | ||
moritz | and --> leads to docs.perl6.org/type/Signature#inde...turn_Types | 07:59 | |
07:59
bjz joined
|
|||
dataf3l | Thanks! | 08:04 | |
:) | |||
maybe we need a “search for this string” that translates each part of the string into a link into perl6 docs | |||
so I search for my $a + $b | 08:05 | ||
and $a, + and $b are each a link | |||
into each section | |||
so I can click the + link | |||
into the explaination of what is + called anyway | |||
maybe small p6 sample on a html textarea -> AST -> links could be useful for newbies? | |||
moritz | dataf3l: your contributions towards such a system would be very welcome | 08:10 | |
[ptc] | dataf3l++ | 08:11 | |
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 | |
even perl5 | |||
or languages like php | |||
something like “opsearch” | |||
arnsholt | Best part is that it's en eminently reachable project for someone new to the language | 08:15 | |
(I think) | |||
Extracting the AST from a string is less tricky than you might think | |||
dataf3l | I’ll take your word for it | 08:17 | |
clearly, you have a better understanding than I do!!!! | |||
arnsholt | It helps having hacked on the guts | 08:19 | |
But it really is pretty simple | |||
brrt | also, for americans, I know of a company in amsterdam that is hiring | ||
just saying | |||
08:21
bjz left
|
|||
dataf3l | Hiring, perl6 people? | 08:22 | |
PERL6 JOBS????? | |||
Finally!?!?!?!? :) | |||
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» | ||
arnsholt | Only niggle is that the AST types are NQP types, not Perl 6 types | ||
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 | ||
dataf3l | Interesting. | ||
arnsholt | But that's the root of the object graph that gets dumped when you do "perl6 --target=ast -e '1+2'" | ||
brrt | although I know of perl6 being used, actually | ||
dataf3l | so would you recommend learning perl5, or is that a waste of time? | ||
m: use nqp; my Mu $compiler = nqp::getcomp("perl6"); say $compiler.eval("1 + 2", :target<ast>). | |||
camelia | rakudo-moar fb5676: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Malformed postfix callat <tmp>:1------> 3y $compiler.eval("1 + 2", :target<ast>).7⏏5<EOL>» | ||
dataf3l | use nqp; my Mu $compiler = nqp::getcomp("perl6"); say $compiler.eval("1 + 2", :target<ast>).perl | ||
moritz | dataf3l: learning is nearly never a waste of time :-) | 08:27 | |
brrt | learning is very rarely a waste of time | ||
dataf3l | m: use nqp; my Mu $compiler = nqp::getcomp("perl6"); say $compiler.eval("1 + 2", :target<ast>). | ||
camelia | rakudo-moar fb5676: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Malformed postfix callat <tmp>:1------> 3y $compiler.eval("1 + 2", :target<ast>).7⏏5<EOL>» | ||
brrt | it's the dot | ||
arnsholt | And you can't say the object directly | ||
brrt | and, I personally think perl5 is a really nice langauge | ||
arnsholt | Since it doesn't have a gist method (being an NQP object) | ||
dataf3l | NQP!! | 08:28 | |
:) | |||
so, in summary, I should learn perl5. | |||
arnsholt | The QAST types are defined in nqp/src/QAST/*.nqp | ||
Perl 5 is useful | |||
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
|
|||
brrt | per6 is a more perly perl. perl5 is already very perly | 08:32 | |
I don't think things will be that confusing, just.... considerably less elegant | |||
08:32
rindolf joined
|
|||
dataf3l | please define perl6 | 08:34 | |
perly* | |||
brrt | 'fits into the culture of the perl community', i guess, but I'm not an authority | 08:36 | |
08:36
abraxxa joined
|
|||
brrt | and, yeah, that is vague | 08:36 | |
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 | ||
dataf3l | what is the difference bttween a LIST and an ARRAY ??? | ||
brrt | well, everybody is a newbie once | ||
i'm not sure if you're asking specifically for perl6 or for perl | |||
dataf3l | never mind | ||
i’ll read this | |||
docs.perl6.org/language/containers.html | |||
this is #perl6 | |||
08:38
maybekoo2 joined
|
|||
brrt | in general, a list is a collection of values in a sequence | 08:39 | |
08:39
CIAvash left
|
|||
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 | ||
so the idea of list is more abstract and the idea of array is more specific | |||
dataf3l | DBI returns a weird object, iterable, but not quite what my array_of_hashes_to_html() function was expecting | 08:40 | |
I see... | |||
brrt | I haven't used DBIish myself, but I think it returns a (lazy) list | ||
so for instance (correct me if I'm wrong, anyone): | |||
m: my @a := (1,2,3); say @a.WHAT; | |||
camelia | rakudo-moar fb5676: OUTPUT«(List)» | ||
brrt | m: my @a = (1,2,3); say @a.WHAT; | 08:41 | |
camelia | rakudo-moar fb5676: OUTPUT«(Array)» | ||
dataf3l | WHAT | ||
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 | ||
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 = | ||
brrt | yes | ||
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 | ||
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) | ||
I think I can also do this: | 08:44 | ||
m: my @a := [1,2,3]. say @a.WHAT; | |||
camelia | rakudo-moar fb5676: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Two terms in a rowat <tmp>:1------> 3my @a := [1,2,3]. say7⏏5 @a.WHAT; expecting any of: infix infix stopper postfix statement end statemen…» | ||
brrt | ; | ||
m: my @a := [1,2,3]; say @a.WHAT; | |||
camelia | rakudo-moar fb5676: OUTPUT«(Array)» | ||
brrt | now I've bound the @a to the array construct [1,2,3] | ||
and dutifully, it is an array | |||
does that make sense? :-) | |||
dataf3l | it does | 08:45 | |
08:45
bjz joined
|
|||
brrt | this wouldn't be complete without the fibonacci sequence, of course.. | 08:45 | |
dataf3l | I have a small function, runsql() | ||
it takes as input a sql statement and (ideally) would return a list of hashes | 08:46 | ||
I guess I’m not sure if I want a list of hashes or an array of hashes | |||
in any event, hashes, are the records | |||
the function can be used like this: | |||
$ref = runsql("select id, name from table"); | |||
for @( $ref ) -> %row { | |||
#say $row.elems; | |||
say %row<id>; | |||
say %row<name>; | |||
# @( $row ).[1].join.say; | |||
} | |||
and that works perfectly, it even prints stuff coming from the database and everything. | 08:47 | ||
however, | |||
moritz | dataf3l: in future, please use a pastebin when you paste more than one line of code | ||
dataf3l | OK, will do. | ||
08:47
pierre_ left
|
|||
dataf3l | before I could go to the DB, I was mocking the db by just returning a harcoded list of hashes | 08:47 | |
method get_all_records(){ | 08:48 | ||
my @data; | |||
@data[0] = {id=>"1", name=>"poll1"}; | |||
@data; | |||
} | |||
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) | |||
anyway, | |||
this function looks like this: | 08:49 | ||
pastebin.com/5YSLZQUQ | |||
and it prints stuff coming from the get_all_records() function just fine | |||
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 | ||
the error says: | |||
Type check failed in binding to %row; expected Associative but got List ($(${:id("1"), :name("...) | |||
I googled this error, and was directed to logs on this very channel. | |||
any ideas? | |||
should I just start over? | 08:51 | ||
moritz | don't start over | ||
where exactly does the error happen? | |||
08:51
pierre_ joined
|
|||
Woodi | hi, just found Swagger (meta-API ?) application: community.eveonline.com/news/dev-b..._campaign= | 08:52 | |
dataf3l | when tbl() (see the pastebin) to print stuff coming from runsql() | 08:53 | |
error happens on line 9 of the pastebin | 08:54 | ||
line 82 of the actual program | |||
moritz | dataf3l: so it seems that iterating over @data doesn't produce a hash, but rather a List | 08:55 | |
dataf3l: so the list you pass in might need some flattening | |||
dataf3l | how do I do said flatenning? | ||
moritz | (or maybe it's constructed incorrectly; the $(...) looks suspicious) | ||
dataf3l: start by doing a "dd @data" to get a better idea of what's actually in @data | 08:56 | ||
dataf3l: oh, and what Rakudo version are you using? | |||
dataf3l | this is the result of dd @data | 08:57 | |
(List) | |||
(${: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")}) | |||
also This is Rakudo version 2016.10 built on MoarVM version 2016.10 | |||
implementing Perl 6.c. | |||
the $( … ) was taken from a website. | 08:58 | ||
I’m calling this method from DBIish | |||
github.com/perl6/DBIish/blob/maste...e.pm6#L149 | |||
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)]» | ||
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… | ||
brrt | hmm, that wasn't quite right | ||
moritz | brrt: did your forget a ... * | ||
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;» | ||
moritz | dataf3l: I don't understand. Does the $() come from DBIish, or was that code that you copied & pasted? | ||
m: my @a := 1, 1, * + *, .... *; my @b = @a[^10]; say @b | |||
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 @bOther potential difficulties: Comma found before apparent sequence opera…» | ||
brrt | one to many dot | ||
dataf3l | wait guys | ||
moritz | oh | ||
dataf3l | I think I found the example I was looking for | ||
brrt | m: my @a := 1,1, * + *, ... *; my @b := @a[^10]; say @b; | ||
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;…» | ||
dataf3l | right here: “次に HashRef の ArrayRef として取得したい場合は fetchall_arrayref(+{}) とします。” | 09:01 | |
d.hatena.ne.jp/ZIGOROu/20090731/1249050735 | |||
brrt | m: my @a := 1,1, * + * ... *; my @b := @a[^10]; say @b; | ||
camelia | rakudo-moar fb5676: OUTPUT«Type check failed in binding; expected Positional but got Seq (?) in block <unit> at <tmp> line 1» | ||
brrt | m: my $a := 1,1, * + * ... *; my @b := $a[^10]; say @b; | ||
camelia | rakudo-moar fb5676: OUTPUT«(1 1 2 3 5 8 13 21 34 55)» | ||
moritz | dataf3l: that doesn't answer my question | ||
dataf3l | it comes from code copied and pasted | 09:02 | |
but, | |||
not from the link before | |||
that link is the wrong one | |||
OK | 09:03 | ||
I just read DBIish readme’s and I think I found what I’m looking for | |||
wil report back shortly | |||
moritz | so, don't use $() | ||
dataf3l | THANK YOU EVERYONE for the kind and patient support, you guys rock :) | ||
brrt wonders if we can do the factorial series | |||
moritz | and be carewful with Perl 6 code from 2009 :-) | ||
brrt | m: my $a = 1,2, * * * ... *; say $a[^10]; | 09:04 | |
camelia | rakudo-moar fb5676: OUTPUT«(timeout)» | ||
labster | I wonder what that's even doing. | 09:05 | |
m: my $a = 1,2, * * * ... *; say $a[^4]; | |||
camelia | rakudo-moar fb5676: OUTPUT«(timeout)» | 09:06 | |
09:11
wamba joined
09:12
ocbtec joined
|
|||
dataf3l | it works! | 09:14 | |
yay! | |||
:) | |||
thank you guys | |||
for DBI: | |||
call this | |||
my @records = $sth.allrows(:array-of-hash); | |||
and then something like this: | |||
method p2(@a) { | |||
for @a -> $row { | |||
for $row.kv -> $k,$v { | |||
say $k ~$v; | |||
} | |||
} | |||
} | |||
that is all, I’m going to bed :) | |||
masak | ahojte, #perl6 | 09:25 | |
DrForr | o/ | 09:26 | |
09:26
Lucas_One left
09:28
wamba left
09:30
llfourn joined,
ChoHag left
09:32
llfourn_ left
|
|||
brrt | dataf3l: pastebin please | 09:33 | |
but good to know that it owrks | 09:34 | ||
09:35
Lucas_One joined
09:36
jonas1 joined
09:43
bjz left
09:46
bjz joined
09:56
gregf_ joined,
bjz left
09:58
n0xff joined
09:59
ChoHag joined
10:14
g4 joined,
g4 left,
g4 joined
10:17
pierre_ left
10:20
pierre_ joined
10:21
pierre_ left
10:36
kurahaupo__ joined
10:39
dataf3l left
10:50
bjz joined,
pmurias joined
|
|||
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 | |
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
11:04
andrzejku left,
andrzejku_ joined
|
|||
viki is amused to wake up to a sight of Murican meltdown. | 11:06 | ||
I guess I better buy a couple of cots to harbor refugees :P | 11:07 | ||
11:09
labster left
|
|||
samcv | yes viki | 11:11 | |
there isn't enough alcohol to fix this tonight | 11:12 | ||
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 | ||
they will control all 3 branches of government now :( | |||
and the supreme court decision will affect things 40+ years from now so. it's pretty bad | |||
viki | Yup. It's the worst possible result. I'm guessing all the progress will be reverted now. | 11:24 | |
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 feels a bout of schadenfreude for some strange reason. | |||
11:29
pierre_ joined
|
|||
u-ou | shit | 11:32 | |
how did this happen | 11:33 | ||
viki | Easy: corruption. | ||
samcv | well. marijuana is legal for recreation in my state now. but it's been medically legal for like. 12 years? | ||
u-ou | calif? | ||
samcv | yea | ||
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 | ||
u-ou | I'm in NZ where it's just 200% illegal | ||
samcv | ah. yeah in california since 12 years it's easy to get a medical card | ||
u-ou | I don't use it, but... it should be available to people who need it | 11:35 | |
e.g. seizures | |||
samcv | that helps but not as much as legalizing recreation. stop putting kids in jail for weed | ||
yeah i don't either | |||
u-ou | I used to :p | ||
samcv | but it's sad how many people the usa has locked up | ||
u-ou | the war on drugs | ||
samcv | also. the vice president is even worse than trump | 11:36 | |
as bad as trump is. Pence is worse | 11:37 | ||
so killing him won't fix the problem :P make it worse | |||
Pence co-sponsored Todd Akin’s infamous anti-abortion bill that would have redefined rape as “forcible rape.” | 11:38 | ||
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. | |||
guy is fucked | |||
cut a million in domestic violence prevention programs, even more for helping families with young children | 11:39 | ||
he's pro birth but anti life. really so bad. | |||
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 | ||
ilmari | he also believes in electrocuting gay people until they're straight | ||
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 | ||
ilmari | .tell tbrowder I don't care about the actual naming, I was just snarking at the meaninglessness of the original one | 11:42 | |
yoleaux | ilmari: I'll pass your message to tbrowder. | ||
samcv | yeah that too ilmari | 11:43 | |
11:44
bjz left,
bjz_ joined
|
|||
u-ou | i feel sad | 11:44 | |
samcv | i'm sure if you electrocute them enough they will tell you that they're cured | ||
disgusting though | 11:45 | ||
pmurias | shouldn't politics be kept out of #perl6? :/ | 11:46 | |
11:47
chris2 left
11:49
cdg joined
|
|||
samcv | yeah sorry | 11:51 | |
11:55
pierre__ joined
11:56
pierre_ left
11:58
MARTIMM joined
|
|||
MARTIMM | o/ | 11:58 | |
m: enum X (:a0(0x00),:a1(0x4),:a2(0x8),:a3(0x10)) | 11:59 | ||
camelia | ( no output ) | ||
MARTIMM | m: my X @a = a2, a3 | ||
camelia | rakudo-moar fb5676: OUTPUT«5===SORRY!5===Package X is insufficiently type-like to qualify a variableat <tmp>:1------> 3my X @a7⏏5 = a2, a3Undeclared routines: a2 used at line 1 a3 used at line 1» | ||
MARTIMM | camelia does not keep history of course | 12:01 | |
ok, by words then... | |||
jnthn | m: enum X (:a0(0x00),:a1(0x4),:a2(0x8),:a3(0x10)); my X @a = a2, a3 | ||
camelia | ( no output ) | ||
MARTIMM | suppose i've got an enum X and want to use it in a method | 12:02 | |
12:02
chris2_ joined
|
|||
MARTIMM | like method Y ( X :@a ) {} | 12:03 | |
then calling it without parameters it errors with Type check failed in binding to @a expected Positional[QueryFindFlags] but got Array ($[]) | 12:04 | ||
how can i change the type or default assignment to get this right? | 12:05 | ||
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» | ||
MARTIMM | QueryFindFlags sould be X | ||
jnthn | m: class C { method m(Int :@a = Array[Int].new) { } }; C.m | ||
camelia | ( no output ) | ||
jnthn | You can do it with an explcit default | ||
Though we should really fix it up to do that for you | |||
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:11 | |
MARTIMM | jnhtn: oeps, saw that the error was a bit further in the code now. So the method interface part works now. | 12:12 | |
12:12
ccakes joined
12:18
cdg left
12:22
chris2_ is now known as chris2
12:23
nadim joined
12:24
andrzejku_ left
|
|||
MARTIMM | m: enum X <a1 a2 a3> | 12:24 | |
camelia | ( no output ) | ||
12:24
andrzejku joined,
andrzejku left
12:25
andrzejku joined
|
|||
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» | ||
MARTIMM | m: enum X <a1 a2 a3>; class C { method m(X :@a = Positional[X].new) { } }; C.m | ||
camelia | ( no output ) | ||
12:26
seatek left
|
|||
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:27
nadim_ left
12:28
CIAvash left
|
|||
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:29 | |
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«5===SORRY!5=== Error while compiling <tmp>Unable to parse expression in argument list; couldn't find final ')' at <tmp>:1------> 030, |@a)>>.value; say $s } }; C.m((a1,a2)7⏏5<EOL>» | ||
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)) | ||
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» | ||
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) | ||
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» | ||
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) | ||
camelia | rakudo-moar fb5676: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Variable '@a' is not declaredat <tmp>:1------> 3( 0x00, |@a)>>.value; say $s } }; C.m: :7⏏5@a(a1,a2)» | ||
12:32
CIAvash joined
|
|||
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 declaredat <tmp>:1------> 3 ( 0x00, |@a)>>.value; say $s } }; C.m(:7⏏5@a(a1,a2))» | ||
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 declaredat <tmp>:1------> 3 ( 0x00, |@a)>>.value; say $s } }; C.m(:7⏏5@a('a1','a2'))» | ||
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')) | ||
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» | ||
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» | ||
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» | ||
jnthn | Why are you writing Positional[X].new instead of Array[X].new like I showed? | ||
MARTIMM | I did not understand it very well, because of the error messages I think | 12:36 | |
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» | ||
MARTIMM | jnhtn: didn't work | 12:38 | |
jnthn | ah, there's a problem on the calling side too | 12:39 | |
my $x = a1, a3; # this is a precedence problem | |||
But also if you're going to use types on the callee side, you need to send in a typed data structure | 12:40 | ||
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)) | |||
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» | ||
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 | ||
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)) | ||
camelia | rakudo-moar fb5676: OUTPUT«2» | ||
jnthn | Note that [+] on an empty list will produce 0 anyway, so there's no need for the 0x00 in there. | 12:42 | |
MARTIMM | jnhtn: I that also true for [+|] because i am using that one | 12:43 | |
jnthn | m: say [+|] () | ||
camelia | rakudo-moar fb5676: OUTPUT«0» | ||
MARTIMM | jnthn: I understand now, thanks for helping | 12:45 | |
jnthn | np :) | 12:46 | |
13:09
Lucas_One left
13:19
ggoebel left
13:20
ggoebel joined
13:22
nicq20 joined
|
|||
nicq20 | Hello | 13:22 | |
viki | \o | 13:23 | |
Xliff_ | Can anyone from Canada sponsor me for emigration? | ||
Is there anyone from Canada here? | |||
viki raises hand | |||
Xliff_ | HELP! | ||
viki | :) | ||
Xliff_ | viki: Srsly? | ||
viki | Yes. | 13:24 | |
Xliff_ | :-O | ||
Name your price. | |||
viki | Two unicorns! | ||
Xliff_ | My country has abandoned me and I need refuge. | ||
Er. Unicorns are hard. | |||
Can I do dress up? | |||
tadzik | because of all this US drama there'll be no room in canada for us poor europeans | 13:25 | |
but I guess Netherlands is nice too | |||
Xliff_ | tadzik: Europe is fine compared to what will descend on the US come January. | ||
viki | No room? Have you *been* here? :) | ||
tadzik | Xliff: does your government consider banning contraception yet? | ||
Xliff_ | tadzik: February. | 13:26 | |
And I'm being generous. | |||
Roe v. Wade sometime around then as well. | |||
tadzik | we've had morons for a year now, thank heavens we're too poor and stupid for them to have any international impact | ||
Xliff_ | First: the ACA. | ||
tadzik | so it's only shitty here | ||
Xliff_ | OMG. The media was saying this vote was a repudiation of "Washington not doing anything for the voters" | 13:27 | |
I puked in my mouth. | |||
13:27
cosimo left
|
|||
Xliff_ | The only reason these people didn't get what they want was because of Republican gridlock! | 13:27 | |
I didn't manage to drink all of my liquor last night. | 13:28 | ||
I don't give a fsck if it is before noon. | |||
I am drowning my sorrows. | |||
For those of you NOT in the US. | 13:29 | ||
Imagine: Trump with the Nuclear Football | |||
13:29
nicq20 left
|
|||
Xliff_ | I leave you on that note.... | 13:29 | |
(viki -- Srsly! Sponsor meeeee!) | |||
pmurias | Xliff_: I can imagine Trump trying to kick it ;) | 13:30 | |
Xliff_ | pmurias: I wish | 13:31 | |
Of course, Trump is not Charlie Brown, and the American Public as Lucy is all too happy to have him try. | |||
brrt | XLiff_: as I said earlier today, I know of a company in Amsterdam that is looking for developers | ||
Xliff_ | ..... without pulling the ball away, first. | ||
brrt: Ooo! | 13:32 | ||
viki | Amsterdam you say... | ||
brrt | seriously, if you want to leave USA, why not consider it | ||
DrForr | Booking. | ||
brrt | of course :-) | ||
Xliff_ | brrt: Actually, all of this is in jest. | ||
I cannot leave the US for various reasons, at this time. | |||
DrForr | A few others as well I think but I need to do some more research. | 13:33 | |
Xliff_ | Family related. | ||
I just need to blow off some steam. | |||
I left the election coverage with Hilary still having an outside chance. | |||
Then I wake up to pre-Armageddon. | |||
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 | |
... had she won. | |||
Xliff_ | Those editors will get their wish, now. | ||
viki | Nah, I think for the rest of the world, Hillary would be more dangerous. | ||
Xliff_ | No. | 13:35 | |
Just wait. Some state functionary will make a joke about the size of Trump's hands and he will launch. | |||
moritz | they are both dangerous | ||
Trump because he questions the seriousness of NATO defense pacts | |||
Xliff_ | Trump is not capable of functioning as a Statesman. | ||
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. | ||
brrt | moritz: can you qualify the 'pro war' statement? | ||
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. | ||
brrt | I've heard it before, but I'm not sure where it comes from | ||
Xliff_ | Hilary may be pro war. I will grant you that. But she is not pro meaningless conflict. | ||
And then there's Russia., | 13:37 | ||
viki | And I'm sure many Canadians would feel that way, making NATO pact rather laughable. | ||
brrt | meaning is in the eye of the beholder | ||
especially with conflict | |||
Xliff_ | And I really need to stop talking now. The [virtual]? walls have ears. | ||
DrForr | o/' It's the end of the 'verse as we know it o/' | ||
moritz | brrt: well, she talks about securing economic interests abroad *and* opposes TTP. What else can that mean? | ||
viki returns to writing code | 13:38 | ||
moritz | good idea :-) | ||
Xliff_ returns to wishing he was writing code. | |||
moritz returns to wondering why people or bots are trying to hack is freenode account | |||
*his | |||
Xliff_ | Blame Putin. | 13:39 | |
Xliff_ flees. | |||
brrt | I'm not sure what that means, actually | ||
but then, I'm probably somewhat naive | 13:40 | ||
Xliff_ | Me neither. | ||
But when has saying something without knowing what it means stopped anyone. | |||
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 | ||
Xliff_ | (insert Elephant here) | ||
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
pmurias left
|
|||
Xliff_ | *ach* Stop dragging me back into the conversation!!! | 13:41 | |
I am in hiding!!!!! | |||
brrt | I guess that is true | 13:42 | |
Xliff_ hides behind viki. | |||
brrt | (about the UN and their teeth) | ||
Xliff_ | brrt: And moritz was complaining about someone hacking... and Russia has been accused of hacking. | 13:43 | |
Hence my asinine comment. | |||
Just so you are clued in. | |||
brrt | :-) | ||
Xliff_ goes back to hiding behind viki. | |||
kurahaupo__ has become trapped in a maze of twisty chat rooms, all alike; in fact all discussing American politics | |||
moritz | I just have lots of "There have been 35 failed login attempts since your last successful login." message from freenode | ||
brrt | hmm, that is weird | ||
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. | ||
lizmat | so when should we have a 6.d ? | ||
brrt | how does perl6 survive the nuclear holocaust | ||
divali was a few days ago, right.... | |||
huf | what does a trump presidency mean for perl6? | ||
Xliff_ | brrt: Have the perl6 devs move to the Moon. | ||
brrt | SpaceX, duh | ||
moritz | I'll talk a bit about my schedule, then, and how it relates to Perl 6 | ||
Xliff_ | huf: That the perl6 devs should move to the Moon. | ||
moritz | I'm currently in the last review of leanpub.com/deploy before it goes to layouting | 13:45 | |
huf | what does a trump presidency mean for the moon? | ||
i mean, it's been mooning all of us forever | |||
tadzik | colonization | ||
huf | shouldnt we kinda ... do something about that? | ||
moritz | when that's done, I have to prepare for a Perl 6 training course I'll give on Dec 01/02 | ||
Xliff_ | Actually... | ||
moritz | and after that, I'll have more time for Perl 6 blogging/book writing. Finally. | ||
13:45
pierre__ left
|
|||
moritz | speaking of which | 13:45 | |
Xliff_ | If things go badly enough, the Moon might be forever crescent. | ||
DrForr | moritz: I'm doing one a day later. | ||
moritz | we need perl 6 advent posts! | 13:46 | |
tadzik | ! | ||
brrt | yes! | ||
viki | lizmat: October 18th | ||
brrt | and it is going to be december in less than a month | ||
lizmat | moritz: I'm considering doing an advent post about iterator internals | ||
DrForr | I can do at least one. | ||
moritz | lizmat: please do! | ||
tadzik | I think I want to do one with Perl 6 threads and Perl 5 code through Inline::Perl5 and traps related to that | ||
moritz | DrForr: please do! Sign up now! | ||
viki | lizmat++ I'd read it. | ||
moritz | tadzik: please add your name to the schedule! | ||
DrForr | Sign up where? | ||
Xliff_ | lizmat++ | ||
13:47
wamba joined
|
|||
tadzik | okay! :) | 13:47 | |
Xliff_ | Thank you for changing the subject!!!!! | ||
moritz | DrForr: mu repo, file misc/perl6-advent/schedule, or something like | ||
viki | DrForr: book a spot: github.com/perl6/mu/blob/master/mi...6/schedule | ||
Xliff_ | Consider me a volunteer for all of your experimenting needs. | ||
viki | huggable: advent :is: github.com/perl6/mu/blob/master/mi...6/schedule | ||
huggable | viki, Added advent as github.com/perl6/mu/blob/master/mi...6/schedule | ||
13:47
Xliff_ is now known as Xliff
|
|||
moritz | we haven't had an advent post about zef. Who wants to write one? | 13:47 | |
DrForr | Nod. | 13:48 | |
dalek | : 0625487 | tadzik++ | misc/perl6advent-2016/schedule: Dibs on 13th |
||
Xliff | lizmat: Pls let me be your Igor!!!! | ||
lizmat | :-) | 13:49 | |
Xliff | lizmat: If Igor is taken... I can be your Mini Me | ||
13:50
itaipu joined
|
|||
brrt | i'm not sure if i have something to talk about in december.... | 13:51 | |
13:52
nicq20 joined
|
|||
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:52 | |
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 ... ) |
||
TimToady waves from among 50K people or so at Web Summit | |||
[ptc] | o/ | ||
viki | brrt: How about some tips/tutorial/whatever for how to hack on that stuff? | ||
IMO we could get more core hackers if we had more docs on how to hack on that stuff :/ | 13:55 | ||
The "just jump in" method I saw people recommending is painful and slow | |||
brrt | I can definitely spend time on documenting the JIT, and it could potentially help | ||
however, it would not make for a good advent calendar post | 13:56 | ||
viki | oh :( | ||
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:57 | |
nicq20 | Where does the JIT live on github? | 13:59 | |
Which repo really... | |||
viki | nicq20: github.com/MoarVM/MoarVM/ | 14:00 | |
14:08
ajr_ joined
|
|||
brrt | yeah :-) | 14:08 | |
i'm working on a branch even-moar-jit to develop a better code generator | |||
nine | ++tadzik # looking forward to that post | 14:09 | |
++tadzik # looking forward to the bug reports :D | |||
nicq20 | brrt: lolz, diggin the name | ||
tadzik | nine: I think all the bugs I had with that one were on my side :) | 14:10 | |
14:10
bjz_ left
|
|||
nine | tadzik: try harder *g* | 14:11 | |
tadzik | hahahah | ||
14:11
canopus left
14:12
skids joined
14:20
canopus joined
|
|||
nicq20 | viki: Are you planning on continuing the weather module tutorial? | 14:21 | |
viki | nicq20: nope | ||
14:22
cdg joined
14:24
skids left
14:26
pmurias joined,
Cole_ns joined
|
|||
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 | |
14:28
itaipu left
|
|||
brrt | hmmm that is a decent point | 14:28 | |
we do have graphviz visualization for expression trees :-) | |||
timotimo | and the spesh graph visualizer (which could definitely use more usability improvements, tbh) | 14:29 | |
brrt | yep, but I don't know as much about that | 14:31 | |
14:31
Rawriful joined
|
|||
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) | ||
and also not the main priority | |||
timotimo | the most annoying part is that you have to copy-paste individual parts of the spesh log into the program (or a file) | ||
brrt | that seems fixable.... | 14:32 | |
Cole_ns | Hi, Perl6! | ||
brrt | hi Cole_ns | ||
Cole_ns | Has anyone run into problems with Rakudo being unable to rename files in .precomp? | ||
timotimo | though with the recent speed-ups it may be feasible to go through the whole file, parse the bits, and offer them | ||
viki | Cole_ns: that sounds vaguely familiar. Are you on Windows and with 2016.10 version? | ||
Cole_ns | I'm on Windows, but I'm on 2016.07, there's no .msi for the .10 Rakudo Star yet. | 14:34 | |
14:34
ajr_ left
|
|||
viki | aww | 14:34 | |
Cole_ns | I agree. :D | ||
viki | Cole_ns: well, I know recently some sort of issues like that were fixed on Windows. | ||
jnthn | I think the fix for it was actually more recent than 2016.10 even | ||
Yeah, I fixed it in 44a4c7549601, which was a few days after 2016.10. | 14:35 | ||
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 :-) | ||
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:39 | |
Perl6 grammars are the best. | 14:40 | ||
mspo | bytecode caching-- | 14:42 | |
brrt | bytecode caching can be awesome, it's just difficult to get right :-) | 14:44 | |
DrForr | Cole_ns: That's what I've found too. | 14:45 | |
14:46
pierre_ joined
|
|||
timotimo | www.reddit.com/r/perl6/comments/5b...p2_and_c2/ - perhaps someone would like to add a few words to the docs for this? | 14:46 | |
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:47 | |
DrForr | None taken, I didn't want something that was just a computer science textbook exercise | 14:49 | |
s/$/./ | |||
14:50
pierre_ left
14:54
Rawriful left
14:57
Rawriful joined
15:01
maybekoo2 left
15:04
cdg_ joined,
cdg left
|
|||
mspo | brrt: it should be off by default | 15:10 | |
imho | |||
15:18
wamba left
|
|||
viki | *sigh* everyone at work just won't STFU about US election. | 15:26 | |
THERE'S NO ESCAPE! | |||
dalek | c: 8ddd8d1 | (Zoffix Znet)++ | doc/Language/regexes.pod6: Add clarification for :pos/:continue hobbified++ # www.reddit.com/r/perl6/comments/5b...2/d9s589q/ |
15:28 | |
synopsebot6 | Link: doc.perl6.org/language/regexes | ||
viki | timotimo: done | ||
timotimo | cool | ||
15:31
pyrimidine joined
|
|||
dalek | c: 2830ab9 | (Zoffix Znet)++ | doc/Language/regexes.pod6: Remove spurious comma |
15:32 | |
synopsebot6 | Link: doc.perl6.org/language/regexes | ||
15:39
Rawriful left
15:41
Rawriful joined,
acrussell joined
15:42
skids joined,
nicq20 left
15:43
nicq20 joined
15:45
nicq20 left
15:48
Rawriful left
15:51
Rawriful joined
15:59
neuraload left
16:00
CIAvash left
16:01
Rawriful left
16:04
Rawriful joined
16:07
pyrimidine left
16:08
pyrimidine joined,
jonas1 left
16:09
g4 left,
pyrimidine left
16:10
pyrimidine joined,
Rawriful left
16:14
gregf_ left
16:15
Rawriful joined
16:18
dataf3l joined
16:20
MARTIMM left
|
|||
viki | Free dev books: devfreebooks.github.io/ | 16:22 | |
viki hopes to see Perl 6 among the squares one day. | 16:23 | ||
huggable: books :is: Free dev books (any Perl 6?): devfreebooks.github.io/ | |||
huggable | viki, Added books as Free dev books (any Perl 6?): devfreebooks.github.io/ | ||
16:24
dataf3l left
16:31
cpin left
16:33
ggoebel left
|
|||
viki | m: await IO::Socket::Async.connect("2600: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» | ||
viki | :o | 16:39 | |
16:44
harmil_wk joined
|
|||
timotimo | interesting find | 16:45 | |
it ought to output the actual REPR and its debug_name, IMO | |||
16:45
kent\n left
|
|||
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 www.iab.org/documents/corresponden...t-on-ipv6/ and got curious | |||
timotimo pushed | 16:48 | ||
viki rakudobuggerd rt.perl.org/Ticket/Display.html?id=130064 | 16:51 | ||
timotimo also going to merge POSTBUILD_method now | |||
viki | \o/ | ||
[ptc] hopes to see Perl *5* among the squares one day... | 16:52 | ||
16:53
cog_ left
|
|||
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 | ||
[ptc] | ... as well as Perl 6, naturally | ||
viki | timotimo: that's accurate. That means it's working. | ||
timotimo | but i wanted to figure out why that explosion happens? | ||
16:54
pyrimidine left
|
|||
viki | timotimo: well, I dunno why it happens. So far, I can only reproduce it on camelia | 16:54 | |
timotimo | dangit. | ||
[ptc] | viki: true. Can any mere mortal add to the list? | ||
timotimo | well, there's a "add ebook" button at the top | ||
maybe that'll let you suggest languages/products that aren't already in there? | |||
16:54
pyrimidine joined
16:55
ggoebel joined
|
|||
[ptc] | timotimo: thanks :-) Just saw that and thought, duh: didn't need to make the comment :-/ | 16:55 | |
timotimo | no worries :) | ||
16:56
pyrimidine left
16:57
pyrimidi_ joined
|
|||
viki | m: use NativeCall; sub system(Str) is native {}; system 'curl [2600:3c03::f03c:91ff:fe91:d028]' | 17:12 | |
camelia | rakudo-moar b46a62: OUTPUT«curl: (7) Couldn't connect to server» | ||
viki | m: use NativeCall; sub system(Str) is native {}; system 'curl -v [2600:3c03::f03c:91ff:fe91:d028]' | ||
camelia | rakudo-moar b46a62: OUTPUT«* Rebuilt URL to: [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 0curl: (7) Couldn't connect to server» | ||
17:13
pierrot_ left
|
|||
timotimo | oh, nine's server doesn't have ipv6 connectivity? | 17:15 | |
that'd be a bit weird | |||
viki | committable6, HEAD await IO::Socket::Async.connect("2600: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, gist.github.com/ | ||
viki | erm... thanks, committable6 :"} | ||
timotimo | m) | ||
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
17:26
atweiden joined
17:33
wamba joined,
vendethiel left,
acrussell left
17:35
vendethiel joined
17:46
Rawriful left
|
|||
harmil_wk | Do we have docs for all our bots? | 17:48 | |
Or should I be asking a bot that? ;-) | |||
17:48
Rawriful joined
17:49
cognominal joined
17:52
Actualeyes left
|
|||
viki | harmil_wk: what sort of docs? | 17:54 | |
harmil_wk | Usage? | ||
viki | Most of them accept a "help" command" | 17:55 | |
NeuralAnomaly: help | |||
NeuralAnomaly | viki, stats | blockers | ||
viki | NeuralAnomaly: stats | ||
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 perl6.fail/release/stats for details | ||
viki | harmil_wk: also: github.com/perl6/doc/issues/711 | ||
17:56
rurban joined
|
|||
viki | buggable: eco | 17:57 | |
buggable | viki, Out of 741 Ecosystem dists, 152 have warnings and 0 have errors. See modules.perl6.org/update.log for details | ||
viki | SourceBaby: help | 17:58 | |
SourceBaby | viki, Use s: trigger with args to give to sourcery sub. e.g. s: Int, 'base'. See modules.perl6.org/dist/CoreHackers::Sourcery | ||
viki | Gee 15 bots :o | 17:59 | |
m: say "{15/314*100}% of the population" | |||
camelia | rakudo-moar b46a62: OUTPUT«4.777070% of the population» | ||
18:00
xtt joined
18:01
Rawriful left
18:03
Rawriful joined
18:05
domidumont joined
18:06
maybekoo2 joined
18:07
xtt left
18:11
firstdayonthejob joined
18:12
zakharyas left,
FROGGS joined
|
|||
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:14 | |
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:15 | |
18:16
Rawriful left
|
|||
nine | timotimo: my server does have IPv6. But maybe camelia's VM doesn't. | 18:17 | |
timotimo | that's possible | ||
nine | Yep, the VM doesn't have a v6 address | 18:18 | |
18:19
acrussell joined
|
|||
timotimo | hm | 18:19 | |
maybe we want to try to figure out how that error comes to be, though | |||
the SORRY one | 18:20 | ||
18:20
troys joined
|
|||
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]» | ||
viki | \o/ timotimo++ | ||
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]» | ||
viki | Better example :) | ||
timotimo | mhm | 18:25 | |
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/runtime/CORE.setting.moarvm:print_exception) from gen/moar/m-CORE.setting:27020 (/home/camelia/rakudo-m-inst-2/share/…» | ||
harmil_wk | I apparently did a bad. | ||
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/runtime/CORE.setting.moarvm:print_exception) from gen/moar/m-CORE.setting:27045 (/home/camelia/rakudo-m-inst-1/share/per…» | ||
viki | The error looks similar to rt.perl.org/Ticket/Display.html?id...et-history | ||
18:40
firstdayonthejob left
|
|||
jnthn | That should probably say T is too late-bound to use in this case. | 18:41 | |
viki | Ah | ||
jnthn | (Classes are formed at BEGIN time, but a ::T type capture is never going to take a value until runtime) | ||
m: -> ::T { class :: is T {} } | |||
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/runtime/CORE.setting.moarvm:print_exception) from gen/moar/m-CORE.setting:27045 (/home/camelia/rakudo-m-inst-1/share/per…» | ||
jnthn | Hm, note how it fails inside printing the exception though | 18:42 | |
m: EVAL '-> ::T { class :: is T {} }'; say $!.^name | |||
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/runtime/CORE.setting.moarvm:print_exception) from gen/moar/m-CORE.setting:27045 (/home/camelia/rakudo-m-inst-1/share/per…» | ||
jnthn | m: EVAL '-> ::T { class :: is T {} }'; say $!.WHAT | ||
viki | m: try EVAL '-> ::T { class :: is T {} }'; say $!.^name | ||
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/runtime/CORE.setting.moarvm:print_exception) from gen/moar/m-CORE.setting:27045 (/home/camelia/rakudo-m-inst-1/share/per…» | ||
rakudo-moar 0cf7b3: OUTPUT«X::Inheritance::Unsupported» | |||
jnthn | oh, d'oh :) | ||
Ah | 18:43 | ||
harmil_wk | Wow | ||
jnthn | That's not a bad exception type | ||
m: try EVAL '-> ::T { class :: is T {} }'; say $!.WHAT | |||
camelia | rakudo-moar 0cf7b3: OUTPUT«(Unsupported)» | ||
jnthn | m: try EVAL '-> ::T { class :: is T {} }'; say $!.gist | ||
camelia | rakudo-moar 0cf7b3: OUTPUT«No such method 'item' for invocant of type 'T' in block <unit> at <tmp> line 1» | ||
jnthn | m: try EVAL '-> ::T { class :: is T {} }'; say $!.message | ||
camelia | rakudo-moar 0cf7b3: OUTPUT«No such method 'item' for invocant of type 'T' in block <unit> at <tmp> line 1» | ||
jnthn | Probably that message method wants a look | ||
18:43
Rawriful joined
|
|||
jnthn | Can detect that it's a typevar and produce a nice message | 18:44 | |
m: try EVAL '-> ::T { class :: is T {} }'; dd $! | |||
camelia | rakudo-moar 0cf7b3: OUTPUT«No such method 'perl' for invocant of type 'T' in block <unit> at <tmp> line 1» | ||
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? | ||
viki | OK. I'll take a look | ||
jnthn | m: try EVAL '-> ::T { class :: is T {} }'; dd $!.^attributes | ||
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)» | ||
jnthn | m: try EVAL '-> ::T { class :: is T {} }'; say $!.^attributes | ||
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)» | ||
jnthn | m: try EVAL '-> ::T { class :: is T {} }'; say $!.parent.archetypes.generic | ||
camelia | rakudo-moar 0cf7b3: OUTPUT«No such method 'archetypes' for invocant of type 'T' in block <unit> at <tmp> line 1» | ||
jnthn | m: try EVAL '-> ::T { class :: is T {} }'; say $!.parent.HOW.archetypes.generic | 18:45 | |
camelia | rakudo-moar 0cf7b3: OUTPUT«1» | ||
jnthn | Can go on that | ||
18:45
telex left
18:46
telex joined
|
|||
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)» | ||
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
|
|||
harmil_wk | roles and does don't change mro, though, do they? | 18:50 | |
jnthn | A role can bring along a parent | 18:51 | |
harmil_wk | Oh! | ||
Okay, thanks | |||
viki | :o | ||
jnthn | m: role R is Exception { }; class C does R { }; say C.^mro | ||
camelia | rakudo-moar 0cf7b3: OUTPUT«((C) (Exception) (Any) (Mu))» | ||
viki | TIL | ||
18:52
Rawriful left
|
|||
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/runtime/CORE.setting.moarvm:print_exception) from gen/moar/m-CORE.setting:27045 (/home/camelia/rakudo-m-inst-2/share/per…» | ||
18:54
user9 left
|
|||
harmil_wk | So, don't think I can parameterize it that way either. | 18:54 | |
18:55
kent\n joined,
Rawriful joined,
kent\n left,
kent\n joined
|
|||
harmil_wk | .^mixin might need to be the way... | 18:56 | |
There we go! | 18:58 | ||
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})" } | |||
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 1not ok 3 - Ex…» | ||
harmil_wk | So, it blows up in useful ways that actually tell me what I wanted to know, now. | ||
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 | ||
harmil_wk | Yep, I was trying to work around that by giving defaults on BUILD arguments. | 19:01 | |
So, I wanted to be sure of the shape of it... anyway, back to $work | |||
viki | I think I showed a work around last week? Was it not applicable? | ||
harmil_wk | Maybe I missed it? Not sure. There was a lot of conversation. | ||
Updated the ticket with that. | 19:05 | ||
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» | ||
viki | m: class Foo is Hash { has $.meows; method new { self.bless: |{:42meows}, |%_ } }.new.meows.say | 19:07 | |
camelia | rakudo-moar 0cf7b3: OUTPUT«42» | ||
viki | There's likely a cleaner version too where you'd call Mu's.new or whatever | ||
harmil_wk | Ah, I see | ||
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:09
cdg_ left
|
|||
viki | Interesting | 19:10 | |
m: method { %_ } | |||
camelia | ( no output ) | ||
viki | m: method { @_ } | ||
camelia | rakudo-moar 0cf7b3: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Placeholder variables cannot be used in a methodat <tmp>:1------> 3method7⏏5 { @_ }» | ||
viki | But... %_ can be used... and it does work :/ | ||
lizmat | viki: %_ is just always there when you use it | 19:11 | |
19:11
Rawriful left
|
|||
lizmat | it just contains the unaccounted named variables | 19:11 | |
m: sub a() { dd %_ }; a foo => 42 | |||
camelia | rakudo-moar 0cf7b3: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Placeholder variable '%_' cannot override existing signatureat <tmp>:1------> 3sub7⏏5 a() { dd %_ }; a foo => 42» | ||
avuserow | m: say (method {}).signature | ||
camelia | rakudo-moar 0cf7b3: OUTPUT«(Mu $: *%_)» | ||
lizmat | m: sub a { dd %_ }; a foo => 42 | ||
camelia | rakudo-moar 0cf7b3: OUTPUT«{:foo(42)}» | ||
lizmat | viki: just like using $_ autogenerates a -> $_ sig | 19:12 | |
m: sub a { dd $_ }; a 42 | |||
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» | ||
lizmat | hmmm | 19:13 | |
ah, for blocks | |||
viki | m: { dd @_ }(42) | ||
camelia | rakudo-moar 0cf7b3: OUTPUT«[42]» | ||
lizmat | m: my $a := { dd $_ }; $a(42) | ||
camelia | rakudo-moar 0cf7b3: OUTPUT«42» | ||
viki | m: -> :$moo { dd %_ }(:meow, :moo) | ||
camelia | rakudo-moar 0cf7b3: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Placeholder variable '%_' cannot override existing signatureat <tmp>:1------> 3<BOL>7⏏5-> :$moo { dd %_ }(:meow, :moo)» | ||
19:13
Rawriful joined
|
|||
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 | c: 7f7977d | moritz++ | doc/Language/objects.pod6: Some initial documentation for TWEAK |
||
synopsebot6 | Link: doc.perl6.org/language/objects | ||
moritz | viki: maybe it's related to methods having an implicit *%_ in their signature? | ||
FROGGS | viki: methods swallow nameds, but not positionals | ||
19:15
shmibs joined
|
|||
viki | Ah | 19:15 | |
moritz | m: say (method { }).signature | ||
camelia | rakudo-moar 0cf7b3: OUTPUT«(Mu $: *%_)» | ||
viki | m: say (sub { }).signature | ||
camelia | rakudo-moar 0cf7b3: OUTPUT«()» | ||
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» | ||
viki | harmil_wk: ^ I think this is the cleaner thing I meantiooned ^ | ||
19:18
Rawriful left
|
|||
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» | ||
viki | m: class Foo is Hash { has $.meows = 72; method new (|c){ self.Mu::new(|c) } }.new.meows.say | 19:19 | |
camelia | rakudo-moar 0cf7b3: OUTPUT«72» | ||
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; | ||
camelia | rakudo-moar 0cf7b3: OUTPUT«Foo $h = ${:a(3), :b(4), :c(5)}» | ||
viki | \o/ | ||
19:21
Rawriful joined,
darutoko left
19:22
kent\n left,
kent\n joined,
andrzejku_ joined
|
|||
viki | Seems the X::Inheritance::Unsupported issue is fixed by just changing $. twigils to $! in method message. | 19:23 | |
19:25
andreoss joined
19:26
RabidGravy joined
19:27
Rawriful left,
user9 joined
|
|||
RabidGravy | boom! | 19:28 | |
yoleaux | 8 Nov 2016 22:36Z <japhb> RabidGravy: Would Term::Cap allow us to avoid using tput in github.com/ab5tract/Terminal-Print...ds.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)? | ||
andreoss | can i somehow specify the way .. unfold? pass some extra argument to .succ? | ||
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 | ||
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
|
|||
viki | andreoss: but it doesn't take any arguments? | 19:29 | |
harmil_wk | viki: that's great. | 19:30 | |
viki | But you can use a sequence operator instead of a range to go fancy pants | ||
m: say 1, { say "meows $_"; .succ } ... 3 | |||
camelia | rakudo-moar 0cf7b3: OUTPUT«meows 1meows 2(1 2 3)» | ||
RabidGravy | japhb, yes - the only reason I've avoided finishing it was because parsing the termcap file was somewhat slow | ||
19:31
mohae_ left,
mohae joined
19:35
ale1ster joined,
kent\n left,
ale1ster left,
kent\n joined
19:36
setty1 left
19:37
setty1 joined
|
|||
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)» | ||
viki | m: say 1, 3, 9 … 30 | ||
camelia | rakudo-moar 0cf7b3: OUTPUT«(1 3 9 27)» | ||
viki | m: say 1, 1, *+* … 20000 | ||
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…» | ||
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:39 | |
19:40
troys is now known as troys_
19:42
AlexDaniel joined
|
|||
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» | ||
andreoss | m: class Foo { has $.i ; method succ { Foo.new(i => $.i + 1 ) } }; my @x = (Foo.new(:i(0))...*)[0..3]; say @x | ||
camelia | rakudo-moar 0cf7b3: OUTPUT«[Foo.new(i => 0) Foo.new(i => 1) Foo.new(i => 2) Foo.new(i => 3)]» | ||
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)]» | ||
andreoss | can i pass $e thorough ... ? | ||
*through | |||
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
|
|||
andreoss | i was hoping for something like ` $x ... $y :2e` | 19:46 | |
viki | heh | 19:47 | |
19:47
Rawriful left
|
|||
viki | s: &infix:<...> | 19:47 | |
SourceBaby | viki, Sauce is at github.com/rakudo/rakudo/blob/0cf7...rs.pm#L436 | ||
viki | Well, you could probably write your own ... op :D | 19:48 | |
19:48
andreoss left
|
|||
viki | $x ... $y :2e to me looks to magical | 19:48 | |
19:50
Rawriful joined
19:51
labster joined
19:56
Actualeyes joined
20:21
canopus left
20:25
canopus joined
20:29
FROGGS left
20:33
AlexDaniel left
20:41
domidumont left
20:44
atweiden left
20:49
kurahaupo__ is now known as kurahaupo,
pyrimidi_ left
20:50
pyrimidine joined
20:51
nadim left,
nadim_ joined
20:53
perigrin joined
20:57
bjz joined,
pyrimidine left
21:02
Tonik left
21:07
girafe joined,
cdg joined
21:23
Actualeyes left
21:27
acrussell left
21:31
andrzejku_ left
21:33
troys_ is now known as troys
|
|||
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 | |
argh | |||
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:38 | ||
21:39
Actualeyes joined
21:41
stanley left
21:42
pyrimidine joined
21:46
Rawriful left,
pyrimidine left
21:48
Rawriful joined
21:50
ajr_ joined,
nadim_ left
21:51
stanley joined
21:57
Woodi left,
Woodi joined
22:00
Rawriful left
22:01
ajr_ left,
Rawriful joined
22:05
kaare_ left,
kaare_ joined
22:06
RabidGravy left,
bjz left
22:08
skids left
22:10
zrr left
22:21
kurahaupo left
22:32
pyrimidine joined
22:33
Tonik joined
22:36
pyrimidine left
22:39
wisti joined,
girafe left,
Tonik left
22:42
pyrimidine joined
22:45
wamba left
22:49
pyrimidine left
22:51
Rawriful left
22:52
pyrimidine joined
22:54
Rawriful joined
22:57
pyrimidine left
22:58
maybekoo2 left,
pyrimidine joined
23:05
Rawriful left,
pyrimidine left
23:07
Rawriful joined
23:15
Rawriful left
23:17
Rawriful joined
23:20
pyrimidine joined
23:26
pyrimidine left,
firstdayonthejob left
23:27
troys is now known as troys_
23:32
skids joined
23:41
pyrimidine joined
23:45
pyrimidine left
23:51
pyrimidine joined
23:52
cpage_ left
23:55
pyrimidine left
|
|||
samcv | i condensed the problem i'm having down as far as i could. vpaste.net/7Bm0L | 23:56 | |
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:57 | ||
timotimo | samcv: may want/need autoflush? | 23:59 |