»ö« 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. |
|||
ugexe | my $p = Proc::Async.new: "perl6", "-e", "exit 255"; my ($stdout, $stderr) = "", ""; $p.stdout.tap: $stdout ~= *; $p.stderr.tap: $stderr ~= *; try { CATCH { default { say "Caught: {$_.perl}" }}; await $p.start; $p.result }; put "OUT: `$stdout`\n\nERR: `$stderr`"; | 00:02 | |
Zoffix: | |||
00:03
RabidGravy left
|
|||
Zoffix | m: try X::AdHoc.new.throw; say 42 | 00:03 | |
camelia | rakudo-moar 8cfd34: OUTPUT«42» | ||
Zoffix | ugexe, how come this is catchable but in Proc::Async's case you need the CATCH/default stufF? | 00:04 | |
ugexe | you really only need `try { await $p.start; $p.result; };` | 00:05 | |
00:06
cyphase left
|
|||
Zoffix | m: try await start die; say 42 | 00:06 | |
camelia | rakudo-moar 8cfd34: OUTPUT«42» | ||
ugexe | otherwise the exception may not be sunk yet | ||
Zoffix | Seems to work fine above, with die | 00:07 | |
Which looks to me the same as this version with Proc::Async: rt.perl.org/Ticket/Display.html?id=128674 | |||
00:10
captain-adequate left,
cyphase joined
00:13
khw joined
00:15
girafe left
|
|||
gfldex | that's pretty steady grown: redditmetrics.com/r/perl6 | 00:21 | |
ugexe | my $p = Proc::Async.new: "perl6", "-e", "exit 255"; my $foo = await $p.start; say "still here"; say $foo.exitcode; # this works without the try. probably a clue | 00:31 | |
Zoffix | Ahhh | 00:39 | |
So it gives try a Proc and that's all fine, but then that Proc sinks and explodes: github.com/rakudo/rakudo/blob/nom/...oc.pm#L129 | 00:40 | ||
ugexe++ | 00:41 | ||
00:44
kurahaupo left
|
|||
dalek | c: 7f007f5 | (Zoffix Znet)++ | doc/Type/Proc (2 files): Document behaviour and caveats due to sunk unsuccessful Proc |
00:55 | |
00:57
dvinciguerra_ joined
00:58
araujo_ joined
00:59
araujo left,
araujo_ left
01:00
araujo_ joined,
BenGoldberg joined
|
|||
gfldex | lolibloggedtwicetoday gfldex.wordpress.com/2016/07/20/sneaky-methods/ | 01:16 | |
dalek | c: ed4d87e | (Wenzel P. P. Peppmeyer)++ | doc/Type/Method.pod6: improve free floating methods |
01:27 | |
c: 3354008 | (Wenzel P. P. Peppmeyer)++ | doc/HomePage.pod6: better strict then sorry |
|||
01:31
cdg left,
cdg joined
|
|||
Zoffix | m: <a b c>.&({dd $^a; $^a}).say; | 01:36 | |
camelia | rakudo-moar 58dc8c: OUTPUT«List $a = $("a", "b", "c")(a b c)» | ||
Zoffix | m: <a b c>.&(my method ::(List:D){dd self; self}).say; | 01:37 | |
camelia | rakudo-moar 58dc8c: OUTPUT«("a", "b", "c")(a b c)» | ||
Zoffix | m: my method foo {dd self; self}; <a b c>.&foo.say; | ||
camelia | rakudo-moar 58dc8c: OUTPUT«("a", "b", "c")(a b c)» | ||
Zoffix | Neat. gfldex++ | ||
01:37
cdg left
01:46
ilbot3 left,
molaf left
01:47
ilbot3 joined
01:49
kalkin- joined
01:53
kalkin-_ left
01:58
molaf joined
02:00
silug left
|
|||
Zoffix | m: <a b c>.&(my method {dd self; self}).say; | 02:07 | |
camelia | rakudo-moar 58dc8c: OUTPUT«("a", "b", "c")(a b c)» | ||
Zoffix | m: <a b c>.&(my method (List:D:) {dd self; self}).say; | 02:08 | |
camelia | rakudo-moar 58dc8c: OUTPUT«("a", "b", "c")(a b c)» | ||
02:12
CoconutCrab joined
02:14
rindolf joined
02:15
silug joined
02:17
dvinciguerra_ left
|
|||
lucs | I just did 「use Foo:From<Perl5>」, and got 「===SORRY!=== Could not find Foo.pm in … CompUnit::Repository::Perl5<-122…>」, which makes sense, because I forgot that I hadn't installed Foo in my Perl5. | 02:26 | |
So I installed it, and yet I still get the same error. | |||
Do I need to force something somewhere? | 02:27 | ||
(I don't have a very recent Perl 6 by the way) | 02:28 | ||
02:33
kyclark joined
|
|||
Zoffix | lucs, it's :from, not :From. | 02:34 | |
Do you still get the same error when that is fixed? | 02:35 | ||
I can't reproduce that error with either spelling. What's your Perl 6's version? | 02:36 | ||
Oh, yeah, it's the :From bit. | |||
lucs | 'from' appears to fix it. Thanks. | 02:38 | |
Zoffix | No problem. | ||
We should probably cry about it. | 02:39 | ||
m: use Foo:form<Perl5> | |||
camelia | rakudo-moar 58dc8c: OUTPUT«===SORRY!===Could not find Foo at line 1 in: /home/camelia/.perl6 /home/camelia/rakudo-m-inst-2/share/perl6/site /home/camelia/rakudo-m-inst-2/share/perl6/vendor /home/camelia/rakudo-m-inst-2/share/perl6 CompUnit::Repositor…» | ||
02:39
noganex_ joined
02:42
noganex left
02:47
kyclark left
03:02
Senj joined,
Senji left
03:03
araujo__ joined
03:06
araujo_ left
03:07
Senj left
03:09
TreyHarr1 left
03:10
AlexDaniel left
03:11
cdg joined
03:12
kyclark joined
03:13
BenGoldberg left,
BenGoldberg joined,
labster left,
labster joined
|
|||
lucs | A difficulty with Inline::Perl5: gist.github.com/lucs/95aa2da8f383f...cdd97b301e | 03:14 | |
03:16
TimToady joined
03:17
AlexDaniel joined
03:18
kyclark left
|
|||
geekosaur | the fails is correct. "use Bar;" in perl5 also will not look for Foo.pm, but Bar.pm. | 03:20 | |
the other... it does look like it's making an unwarranted assumption. then again I don't think it can get that right... | 03:22 | ||
not without e.g. snapshotting the whole package hierarchy before and after the load to see what it actually loaded | 03:23 | ||
lucs | I'm thinking that it must be relatively frequent for a Foo.pm to have a 「package Bar」 within it though (both times I've tried Inline::Perl5, both times it appears to have happened). | 03:24 | |
03:25
AlexDaniel left
03:26
adu left
|
|||
dj_goku | any nativecall hackers in here? | 03:30 | |
geekosaur | it's not uncommon when there's a parent class and small stub subclasses that the subclasses are defined in the same module as the parent | 03:33 | |
03:42
avalokite joined
03:47
kyclark joined
03:49
TreyHarr1 joined
03:53
kyclark left
|
|||
parabolize | :m <a b c>.&(-> \o {dd o; o}).say | 03:54 | |
m: <a b c>.&(-> \o {dd o; o}).say | 03:55 | ||
camelia | rakudo-moar 58dc8c: OUTPUT«("a", "b", "c")(a b c)» | ||
03:56
addison left
04:01
TreyHarr1 left
04:03
kyclark joined
04:08
petercommand left,
petercommand joined
04:16
kyclark left
04:17
zakharyas joined
04:28
skids left
04:32
molaf left
04:34
_28_ria left
04:39
TreyHarr1 joined
04:40
holyghost joined
04:42
labster left
04:44
cdg left
04:50
TreyHarr1 left,
labster joined
04:56
Cabanossi left
04:58
Cabanossi joined
04:59
jack_rabbit joined
05:02
zakharyas left
05:11
zakharyas joined
05:14
[particle] joined
05:15
Actualeyes left,
Actualeyes joined
05:25
remmie joined,
kentnl joined,
kent\n left
05:31
[particle] left
05:38
TreyHarr1 joined
05:43
BenGoldberg left
05:49
TreyHarr1 left
06:02
rindolf left,
sno left
06:08
holyghost left
06:11
rindolf joined
06:15
andrzejku joined
|
|||
andrzejku | hi | 06:16 | |
rindolf | andrzejku: hello | ||
andrzejku | rindolf, looking for Perl6 coder for work sharing with funny project (I am beginner) | 06:17 | |
rindolf | andrzejku: a funny project or a fun project? | ||
andrzejku | rindolf, funny | ||
rindolf | andrzejku: a funny project sounds bad. | 06:18 | |
andrzejku | rindolf, why? | ||
06:18
cyphase left
|
|||
andrzejku | rindolf, are you kind of sad man? | 06:18 | |
rindolf | andrzejku: no. | ||
nine | geekosaur: yes there is this assumption in Inline::Perl5. And I also snapshot the main:: namespace to find out which subs were imported. So I may as well use the same mechanism for finding out which packages were created. | 06:19 | |
lucs: ^^^ | |||
06:23
cyphase joined
06:24
ddelony joined
06:25
firstdayonthejob joined
06:29
wamba joined
06:35
melezhik left
06:40
labster left
06:43
TreyHarr1 joined
06:48
firstdayonthejob left,
domidumont joined
06:52
domidumont left
06:53
domidumont joined,
TreyHarr1 left
06:55
labster joined
06:59
Matthew[m] left,
M-Illandan left
07:00
darutoko joined,
tadzik left,
andrzejku left
|
|||
masak | aww -- seems we missed an opportunity to guide andrzejku towards something he might've liked :/ | 07:05 | |
07:13
CIAvash joined
07:22
TreyHarr1 joined
07:26
telex left
07:28
telex joined
07:34
sno joined
|
|||
nine | ~/win 15 | 07:38 | |
07:40
khw left
07:44
TreyHarr1 left
07:46
zakharyas left
07:48
RabidGravy joined
07:54
TreyHarr1 joined
07:56
brrt joined
08:02
TreyHarr1 left
|
|||
Woodi | nine: 10 isn't enought ?? | 08:09 | |
08:12
brrt left
|
|||
nine | Woodi: appears so :) | 08:13 | |
08:14
araujo__ left
|
|||
moritz works hard to keep is window list limited to about 20 | 08:21 | ||
08:21
wamba left
08:22
cyphase left
|
|||
Woodi | btw. while reading TimToady answers I started thinking we are starving camelia... becouse there is no list of 10% subset of features "for noobs and kids", at least I didn't saw it. so we are a bit like C++ on that matter :) | 08:23 | |
08:24
brrt joined
|
|||
konobi | jnthn: morning | 08:26 | |
Woodi | incidentally I had opened 5to6 intro and, IMO, it looks like good prototype for such 10% list. some FP-for-kids and other things and it is done | ||
08:27
cyphase joined
08:31
gregf_ left
08:39
RabidGravy left,
TreyHarr1 joined
08:45
Actualeyes left
08:50
TreyHarr1 left
09:02
gregf_ joined,
TreyHarr1 joined
09:04
tadzik joined
09:07
TreyHarr1 left
09:24
aries_liuxueyang joined
09:27
Matthew[m] joined,
M-Illandan joined
09:30
zakharyas joined
09:35
[particle] joined
09:48
wamba joined
09:49
pmurias joined
09:51
TreyHarr1 joined
09:54
Actualeyes joined
10:02
TreyHarr1 left
10:03
LeCamarade joined
10:04
LeCamarade left,
LeCamarade joined
10:05
LeCamarade left
10:06
LeCamarade joined,
xiaomiao left
10:08
LeCamarade left
10:09
dLeCamarae joined,
dLeCamarae left,
LeCamarade joined
10:10
LeCamarade left,
LeCamarade joined
|
|||
LeCamarade | Hello, guys; is there is a Mersenne Twister module anywhere for Perl 6 as yet? | 10:10 | |
It seems that srand/rand are not implemented as MT. | 10:11 | ||
psch | LeCamarade: fwiw, the MoarVM backends calls a C function called 'tinymt_generate_double' for nqp::rand_n | 10:14 | |
LeCamarade: the jvm backend uses Javas Random class | |||
10:14
Actualeyes left
|
|||
LeCamarade | No, I am on Moar. So that looks good, any TinyMT should suffice. | 10:14 | |
Problem is, the numbers do not seem to agree with MT proper. :-( | 10:15 | ||
psch | i'm no number theoretician | ||
how are you testing that? | 10:16 | ||
LeCamarade | Against Ruby's MT. :-/ | ||
timotimo | if you have a C implementation handy, you can use that via NativeCall | 10:17 | |
LeCamarade | Of course, the assumption here is that Ruby is Japanese enough to have an accurate MT. It is accurate; it gives the expected series when I seed it with a constant and then run for a constant number of ints. The Perl 6 one, apparently not. I may be using the Perl 6 one all wrong. | ||
timotimo | so you don't have to implement it yourself | ||
LeCamarade | Isn't NativeCall the best thing since make world? | ||
timotimo | it's pretty great :) | 10:18 | |
the performance is not as good as it could be, but making it better will require a re-write of how nativecall works on moarvm | |||
10:19
rindolf left
|
|||
psch | m: use NativeCall; sub srandom(uint32 $s) is native {*}; sub random is native returns Int { }; srandom(10); say random; say random | 10:19 | |
camelia | rakudo-moar 58dc8c: OUTPUT«12150692951311962008» | ||
psch | that's stdlib, fwiw | ||
timotimo | but once that rewrite has happened, you will hardly be able to tell the difference between calling C from perl6 and calling C from C :P | ||
psch | but that's not MT, says the manpage | 10:20 | |
parabolize | LeCamarade: Does this do what you want? github.com/bluebear94/Math-Random/...dom/MT.pm6 | ||
psch | ...i think | ||
parabolize | There is a synopsis in the README | 10:22 | |
psch | hm, one thing i can see that might throw off the series is marshalling of a double to a Num | ||
like, create.stephan-brumme.com/mersenne-twister/ doesn't generate doubles, but signed ints | 10:23 | ||
...do we have rand_I? | |||
LeCamarade | parabolize may have found excatly what I need. | ||
psch | m: use nqp; srand(1); say nqp::rand_i; say nqp::rand_i | 10:24 | |
camelia | rakudo-moar 58dc8c: OUTPUT«5687185841269489465-6099459382516868944» | ||
10:24
xiaomiao joined
|
|||
psch | oh hm, the side i found to get that for C++, C and JS is 32bit i think | 10:24 | |
well, nvm | |||
gregf_ | wow, NativeCall++ | 10:26 | |
does that call c functions directly? | |||
psch | ...FSDO "directly" | ||
i mean, we have to wrap stuff around and all | |||
10:26
labster left
|
|||
LeCamarade | Okay, now that I have rememebered to panda search, which I should have done first-thing, I have found the Math::Random that parabolize mentioned, and even a Crypto::Random which I will use later. | 10:27 | |
gregf_ | psch: ok. in Ruby i can use something called Fiddle to invoke c functions. like so, libc = Fiddle.dlopen("/lib/x86_64-linux-gnu/libc.so.6"); @alarm = Fiddle::Function.new(libc["alarm"], [Fiddle::TYPE_INT], Fiddle::TYPE_INT) | 10:28 | |
anyways | 10:29 | ||
10:29
Actualeyes joined,
rindolf joined
10:31
kurahaupo joined,
bbkr joined
|
|||
bbkr | hi. is it possible to create self-contained, movable build with rakudobrew? I'l looking for something like -Duserelocatableinc switch in perlbrew. So every dependency (moar) and libraries are in relative path. | 10:35 | |
10:35
kurahaupo left
|
|||
DrForr | gregf_: NativeCall is the equivalent to Fiddle there. | 10:36 | |
gregf_ | yeah, i though so :) | ||
10:37
pmurias left
|
|||
gregf_ | s/though/thought/ | 10:37 | |
LeCamarade | It worked! | 10:52 | |
For posterity, and .away log files ...: | |||
panda install Math::Random | 10:53 | ||
use v6.c; | |||
use Math::Random::MT; | |||
Zoffix | LeCamarade, we have an ecosystem website BTW: modules.perl6.org/ | ||
LeCamarade | my $rng = Math::Random::MT.mt19937; | ||
Zoffix | and modules.zef.pm if I got the url right (same ecosystem) | 10:54 | |
LeCamarade | After something like $rng.setSeed(27);, the result of the next $rng.nextInt is like the grosser Ruby equivalent that requires an unpack of binary bytes. | ||
10:55
TreyHarr1 joined
|
|||
DrForr | Mersenne twister, I assume? | 10:55 | |
LeCamarade | Zoffix Thanks. I have only been using Perl 6 for two weeks or so ... Worth the wait! | ||
timotimo | that's right, DrForr | ||
LeCamarade | DrForr yes, MT. | ||
DrForr | Party on, it's great to see new blood! | 11:00 | |
parabolize | bbkr: by default everything rakudobrew installs is under one directory. you clone rakudobrew's source where you want it and add its bin directory to your path | 11:02 | |
bbkr | parabolize: what I need is to build rakudo on one machine, let's say in /home/x/rakudobrew and then copy /home/x/rakudobrew/moar-2016.07/install to N production machines to /home/x/myproductionperl6 | 11:05 | |
11:06
TreyHarr1 left
11:07
TEttinger left
|
|||
moritz | bbkr: no, iirc rakudo doesn't support any kind of relation | 11:08 | |
*relocation | |||
bbkr | parabolize: so I don't want to have rakudobrew on production machines (they even don't have make utils installed) and I need to get rid of original absolute path where build was made | ||
moritz | the best you can do is to use fakeroot to build with the same absolute path that you want on the production machines | ||
or patch rakudo and nqp, which would be highly appreciated as well | 11:09 | ||
bbkr | moritz: thanks. I'll try fakeroot. | ||
nine | bbkr: rakudobrew is absolutely the wrong tool for the job and unnecessary | 11:10 | |
bbkr: rakudobrew is solely for when you really want multiple rakudos with each their own installed modules on the same machine | |||
El_Che | just parachuting here: use docker | ||
moritz | or a native package for your OS | 11:11 | |
nine | bbkr: what's keeping you from installing to /home/x/rakudo on your build machine and copy that directory to your production machines? | ||
El_Che | imho is docker or native packaging the only proper ways for production | 11:12 | |
11:13
pmurias joined,
kyclark joined
|
|||
nine | El_Che: so if Perl 6 is used for a maintenance cronjob on those production machines, you'd use docker for installing rakudo? | 11:13 | |
El_Che | yes | 11:14 | |
bbkr | nine: path is not relative. so I cannot for example install on production /home/x/rakudo-experiment, run code with this version and then simply rename it to /home/x/rakudo to replace previous one. | ||
El_Che | docker run --rm | ||
rakudo is a moving target, if you have more than one program running off the same physical install you get tricky upgrades | 11:15 | ||
nine | El_Che: actually we promise backwards compatibility | ||
El_Che | i run something in production with cron and docker (runs once a day) | ||
nine: think of modules etc | 11:16 | ||
do you want aplications to share modules? etc | |||
moritz | it really depends on the infrastructure you already have | ||
El_Che | it's a choice with overhaed | ||
nine | El_Che: we do support versioning of modules :) | ||
El_Che | but worth it in my case | 11:17 | |
i like to test apps in isolation | |||
moritz | if you have infrastructure for the whole docker zoo, then building rakudo in a docker container is likely the most sensible thing | ||
if you do everything with native packages, you could either have a package for rakudo, or fat-package your application with a copy of rakudo (like dh-virtualenv does for python) | 11:18 | ||
11:18
kyclark left
|
|||
El_Che | docker gives me that | 11:18 | |
crapu wifi sorry | |||
konobi | well, that was a packed chat... but really informative... thanks jnthn ! | ||
11:19
avenj left
|
|||
El_Che | moritz: we have the docker zoo (jenkins and co) but the cron example is one without the infra, not on our typical docker hosts | 11:19 | |
moritz | El_Che: do you use jenkins to build the containers/images? | 11:23 | |
and then test them, I guess | 11:24 | ||
El_Che | yes | 11:25 | |
locally and jenkins | |||
through a makefile that the jenkins host calls and can be tun locally as well | 11:26 | ||
sorry, terrible wifi | 11:27 | ||
bbl | |||
11:28
cyphase left,
avenj joined,
avenj left,
avenj joined
11:32
cyphase joined
|
|||
konobi | is there a reference lexer/tokenizer for NQP in perl5 at all ? | 11:37 | |
DrForr | There's one out there but it's badly code-rotted. | ||
11:37
TreyHarr1 joined
|
|||
konobi | even that'd be okay i think | 11:38 | |
DrForr | It's on github, something like nqp-perl5, I don't remember the exact name unfortunately. | 11:39 | |
11:44
TreyHarr1 left
11:47
pmurias left
11:48
canopus left
11:53
canopus joined
12:00
zakharyas left
12:15
TreyHarr1 joined
12:16
brrt left
12:24
scovit joined
|
|||
scovit | m: given ("ciao") { say $^s;} # Is it documented anywhere? | 12:24 | |
camelia | rakudo-moar 58dc8c: OUTPUT«ciao» | ||
timotimo | m: given "ciao" { say $^s } # no need for the parenthesis | 12:25 | |
camelia | rakudo-moar 58dc8c: OUTPUT«ciao» | ||
moritz | scovit: probably not explicitly | ||
scovit | what does the $^ mean? | ||
moritz | scovit: given just calls the block with the object as an argument | ||
that's an implicit parameter | |||
let me search some docs for you... | |||
scovit | Ok thanks | 12:26 | |
I found something in sort documentation | 12:27 | ||
12:27
kid51 joined
|
|||
R[DaneelOlivaw] | scovit: it's the ^ twigil: docs.perl6.org/language/variables#The_^_Twigil | 12:28 | |
dalek | c: 7b35964 | (Wenzel P. P. Peppmeyer)++ | doc/ (5 files): the parsed does not .trim |
||
12:29
brrt joined
|
|||
moritz | ah, R[DaneelOlivaw]++ was faster | 12:29 | |
R[DaneelOlivaw] | m: given "ciao" { say $^ʕ } | 12:30 | |
camelia | rakudo-moar 58dc8c: OUTPUT«ciao» | ||
scovit | m: { say "$^ʕ $_" given "hello" } given "ciao" # it was not easy to understand this | 12:31 | |
camelia | rakudo-moar 58dc8c: OUTPUT«ciao hello» | ||
scovit | m: { { say "$^a $_" given "bella" } given "ciao" } given "hello" # A pity nesting three given is not as straightforward ;) | 12:33 | |
camelia | rakudo-moar 58dc8c: OUTPUT«ciao bella» | ||
12:33
TreyHarr1 left
|
|||
R[DaneelOlivaw] | Well, it is. Both "ciao" and "hello" use $_, so naturally you get the "ciao" in it | 12:34 | |
*bella and hello | 12:35 | ||
scovit | yeah but there is no easy way to get hello from there | ||
R[DaneelOlivaw] | Dammit! I guess I proved self wrong :) | ||
m: given "hello" -> $h { { say "$h $^a $_" given "bella" } given "ciao" } | |||
camelia | rakudo-moar 58dc8c: OUTPUT«hello ciao bella» | ||
12:36
AlexDaniel joined
|
|||
gregf_ | is that like 3 (if defined)'s ? | 12:36 | |
R[DaneelOlivaw] | 0. if defined is `with` | 12:37 | |
scovit | -> $h { { say "$h $^a $_" given "bella" } given "ciao" } given "hello" # Do you know why this does not work ? | ||
m: -> $h { { say "$h $^a $_" given "bella" } given "ciao" } given "hello" # Do you know why this does not work ? | |||
camelia | ( no output ) | ||
R[DaneelOlivaw] | scovit: I think because the point block doesn't get executed. It just gets sunk | 12:38 | |
*pointy | |||
m: -> $h { { say "$h $^a $_" given "bella" } given "ciao" }($_) given "hello" | |||
camelia | rakudo-moar 58dc8c: OUTPUT«hello ciao bella» | ||
R[DaneelOlivaw] | yup | ||
12:39
brrt left
|
|||
scovit | m: -> $h { { say "$h $^a $_" given "bella" } given "ciao" }("hello") # This is enough | 12:39 | |
camelia | rakudo-moar 58dc8c: OUTPUT«hello ciao bella» | ||
12:40
ptolemarch joined
|
|||
scovit | m: -> $h { { { say "$h $^a $_" }("bella") }("ciao") }("hello") # to me it looks funny | 12:40 | |
camelia | rakudo-moar 58dc8c: OUTPUT«hello bella ciao» | ||
R[DaneelOlivaw] | :) | ||
perlpilot | scovit: I agree. Why would you write that? ;) | ||
R[DaneelOlivaw] | m: -> $h { { (("$h $^a" ~ *).say)("bella") }("ciao") }("hello") | 12:41 | |
camelia | rakudo-moar 58dc8c: OUTPUT«hello ciaobella» | ||
12:41
AlexDaniel left
12:42
pmurias joined
|
|||
R[DaneelOlivaw] | m: (*, *, *)(<bella ciao hello>).say | 12:45 | |
camelia | rakudo-moar 58dc8c: OUTPUT«Invocant requires a type object of type List, but an object instance was passed. Did you forget a 'multi'? in block <unit> at <tmp> line 1» | ||
R[DaneelOlivaw] | I wonder what that error is about... | ||
moritz | R[DaneelOlivaw]: you'r trying to invoke a List object | ||
R[DaneelOlivaw] | Ah | ||
moritz | m: say [,] <bella ciao hello> | 12:46 | |
camelia | rakudo-moar 58dc8c: OUTPUT«(bella ciao hello)» | ||
moritz | infix:<,> does not auto-curry with the Whatever star | ||
dalek | c: ef2afea | (Wenzel P. P. Peppmeyer)++ | doc/Language/variables.pod6: add complete twigils to index |
12:49 | |
gfldex | scovit++ # for asking the right question | ||
scovit | thanks | ||
12:57
mcmillhj joined
13:01
kyclark joined
13:06
dvinciguerra_ joined
13:10
adrusi joined
13:12
brrt joined
13:13
skids joined
|
|||
Psy-Q | atom-perl6-editor-tools say that perl6 isn't on the PATH (or it can't find it for other reasons). i've installed it using rakudobrew and it is on the path. what could be the issue? | 13:14 | |
i'll probably be using mostly vim anyway, but would be fun to find out | 13:15 | ||
moritz | Psy-Q: compare the PATH in atom-perl6-editor-tools and in your shell | ||
Psy-Q | moritz: oh, ok, didn't know it had its own | ||
R[DaneelOlivaw] | I had the same issue :/ | ||
moritz | Psy-Q: every process has a copy of its environment variables | ||
Psy-Q | moritz: i thought it was perhaps inherited from the spawning shell | 13:16 | |
but i'm looking through the atom-perl6-editor-tools source now | 13:17 | ||
moritz | Psy-Q: it usually is | ||
Psy-Q: but there are lots of ways to screw up, like applications setting their own PATH, or accidentally spawning the program before PATH is set, or some other fun | |||
like, launching it from a desktop launcher that doesn't start a login shell | 13:18 | ||
Psy-Q | ah, interesting. if started from alt-f2 (in xfce) it does not grab a PATH, but if started from a bash, it does inherit the PATH that includes rakudobrew | ||
moritz: i think that was the issue indeed | |||
i'll have to find out if xfce's launchers can use login shells | |||
moritz | bash -l -c 'atom-perl6-editor-tools' | 13:19 | |
as the launch command | |||
maybe | |||
Psy-Q | hm. with bash -l -c 'atom' it doesn't get it | ||
but from a true interactive shell it does | 13:20 | ||
ah, i see. /usr/bin/atom is a wrapper script. it does things before actually invoking the binary | 13:21 | ||
nine | Psy-Q: When an interactive shell that is not a login shell is started, bash reads and executes commands from /etc/bash.bashrc then ~/.bashrc when those files exist and are readable. | 13:22 | |
from man bash | |||
moritz | Psy-Q: you might need to include .bashrc from .bash_profile (or vice versa, can't ever remember that) | ||
Psy-Q | maybe i set the paths in the wrong bash config files | ||
moritz | or you could try bash -i instead of bash -l | ||
Psy-Q | ah! yes, bash -i -c does it | 13:23 | |
thanks | |||
i will have to clean up my bash configs and put all my rakudobrew stuff in the correct places | |||
13:25
cdg joined
13:27
TreyHarr1 joined
|
|||
CIAvash | m: { { put [OUTER::OUTER::<$_>, $_, OUTER::<$_>] given "bella" } given "ciao" } given "hello" | 13:29 | |
camelia | rakudo-moar 58dc8c: OUTPUT«hello bella ciao» | ||
dj_goku | I am working on documentation but would like some input: github.com/djgoku/p6-Net-Utils | ||
[Coke] wakes up | 13:33 | ||
perlpilot | dj_goku: the description is a little light ;) | 13:34 | |
[Coke] | xkcd.com/1709/ is relevant. I especially like the mouseover. | 13:38 | |
13:39
TreyHarr1 left
|
|||
dj_goku | perlpilot: yeah I am doing that now. Other than code and tests I didn't make changes to the generated bits. | 13:40 | |
perlpilot | dj_goku: were you also going to change the module name to Net::Utils ? | 13:48 | |
13:52
araujo joined,
araujo left
|
|||
scovit | m: { say &?BLOCK.signature }() # Where can I find the documentation for ";;" (if it means something)? | 13:56 | |
camelia | rakudo-moar 58dc8c: OUTPUT«(;; $_? is raw)» | ||
R[DaneelOlivaw] | scovit: docs.perl6.org/type/Signature | ||
scovit: it excludes the stuff from being considered in multi dispatch | 13:57 | ||
scovit | ok, found | ||
R[DaneelOlivaw] | docs.perl6.org/type/Signature#Long_Names more speficication | ||
scovit | thanks | ||
R[DaneelOlivaw] | *specifically | ||
scovit | m: { my $x = 4; -> ;; $x? is raw { say $x, " and ", &?BLOCK.signature }() } # there is something that a bit magic about the standard signature | 13:58 | |
camelia | rakudo-moar 58dc8c: OUTPUT«(Mu) and (;; $x? is raw)» | ||
scovit | m: { $_ = 4; { say $_, " and ", &?BLOCK.signature }() } | ||
camelia | rakudo-moar 58dc8c: OUTPUT«4 and (;; $_? is raw)» | ||
13:58
TreyHarr1 joined
|
|||
R[DaneelOlivaw] | What's the magic bit? :) | 13:59 | |
psch | m: { my $x = 4; -> ;; $x? is raw { say $x, " and ", &?BLOCK.signature }($x) } | ||
camelia | rakudo-moar 58dc8c: OUTPUT«4 and (;; $x? is raw)» | ||
psch | that's just normal $_ behavior | ||
actually, lexical lookup rather | |||
m: { my $x = 4; { say $x, " and ", &?BLOCK.signature }($x) } | |||
camelia | rakudo-moar 58dc8c: OUTPUT«4 and (;; $_? is raw)» | ||
13:59
kyclark left
|
|||
psch | m: { my $x = 4; { say $x, " and ", &?BLOCK.signature }() } | 14:00 | |
camelia | rakudo-moar 58dc8c: OUTPUT«4 and (;; $_? is raw)» | ||
scovit | $x? overrides $x, while $_? does not | ||
I like that it does not | |||
but it seems magic | |||
cannot be easily exchanged with another signature | |||
psch | right, that is a bit specific for $_ | 14:01 | |
jnthn | I think it may actually be lying a bit | ||
psch | the signature? | ||
jnthn | .perl of the Signature | ||
14:01
Autopilot joined
|
|||
jnthn | Well, or Parameter :) | 14:01 | |
But iirc there's a flag which is "grab default from outer" or so | |||
14:02
Autopilot left
|
|||
jnthn | Which can be expressed in Perl 6 proper as $_ = OUTER::<$_> | 14:02 | |
R[DaneelOlivaw] | m: { my $_ = 4; -> ;; $_? is raw { say $_, " and ", &?BLOCK.signature }() } | ||
camelia | rakudo-moar 58dc8c: OUTPUT«Potential difficulties: Redeclaration of symbol $_ at <tmp>:1 ------> 3{ my $_7⏏5 = 4; -> ;; $_? is raw { say $_, " and "(Mu) and (;; $_? is raw)» | ||
jnthn | Except it's so common if we really impelemtned it like that we'd hose performance, so it's got a special flag. | ||
scovit | m: { $_ = 4; -> ;; $_? is raw { say $_, " and ", &?BLOCK.signature }() } | ||
camelia | rakudo-moar 58dc8c: OUTPUT«(Mu) and (;; $_? is raw)» | ||
jnthn | So we may want to fix the .perl of it :) | ||
psch | isn't it just implicit $_ falling outwards..? | 14:03 | |
i mean, it is a Block thing | |||
m: sub f { .say }; $_ = "foo"; &f.signature.perl.say; f | |||
camelia | rakudo-moar 58dc8c: OUTPUT«:()(Any)» | 14:04 | |
jnthn | github.com/rakudo/rakudo/blob/cd42....nqp#L1849 | ||
There is an implicit "take it from the outer" *too*, but that's for bare blocks | |||
Or immediate blocks like in an if | |||
14:04
TreyHarr1 left
|
|||
jnthn | Not for closure blocks | 14:04 | |
Those do it the signature way so you can pass 'em a topic, but otherwise they get $_ from outer | 14:05 | ||
psch | i see | ||
14:08
brrt left
|
|||
ugexe | m: (1..5).map({ say $_; once &?BLOCK(); }) # should &?BLOCK count for explicit blocks only? (i.e. not implied as once { &?BLOCK() }) | 14:10 | |
camelia | rakudo-moar 58dc8c: OUTPUT«1Memory allocation failed; could not allocate 131072 bytes» | ||
jnthn | ugexe: I think so. I guess maybe once's thunking doesn't mark things up properly or something. | 14:11 | |
ugexe | i think something similar affects state vars but i forget the incantation | 14:14 | |
14:15
cdg left
14:16
cdg joined
14:18
khw joined
14:19
ribasushi left
14:21
ribasushi joined
14:29
TreyHarr1 joined
14:31
tbrowder joined
14:33
kalkin- left
|
|||
LeCamarade | jnthn Thanks for the work you do on Perl 6 implementation, in general, and on Rakudo, in particular. | 14:34 | |
14:34
LeCamarade left
14:35
kyclark joined
|
|||
kyclark | \ | 14:36 | |
14:36
kyclark left
|
|||
gregf_ | oh - so World.pm is where the entire container magic exists :) | 14:39 | |
psch | i think it's more where it's used and elevated? as in, containers belong to sixmodel, don't they? | 14:40 | |
gregf_ | sixmodel? - *wonders what that even is* :| #pass | 14:41 | |
psch | well, Moar is "Metamodel On A Runtime" | 14:42 | |
and sixmodel is that metamodel | |||
which we use to bootstrap the nqp metamodel, which we use to bootstrap the perl6 metamodel | |||
14:43
kurahaupo joined,
kurahaupo left
14:45
kurahaupo joined
14:46
user9 left
14:47
user9 joined
|
|||
dj_goku | perlpilot: so I used App::Mi6 to create a skeleton module. It seems to remove pluralism | 14:47 | |
perlpilot: good catch. Wonder if that is a feature or a bug in Mi6 | 14:48 | ||
14:49
wamba left,
wamba1 joined
14:54
wamba1 left
|
|||
dj_goku | oh looks like I messed up I did: mi6 new Net::Util :D | 14:54 | |
15:02
adrusi left
15:07
acrussell joined
15:12
Possum left
15:15
CoconutC1ab joined
15:16
CoconutCrab left
15:21
Amnez777 joined
|
|||
bbkr | ugexe: is there any way to use zef if perl6 is not in PATH? for example from zef directory: ../someperlbuild/bin/perl6 -I lib zef install ... | 15:26 | |
R[DaneelOlivaw] | m: "bc" ~~ /||@(<b bc>) >>/ or say "Failed" | 15:27 | |
camelia | rakudo-moar 58dc8c: OUTPUT«Failed» | ||
R[DaneelOlivaw] | That's a bug, right? | ||
m: "bc" ~~ /|@(<b bc>) >>/ or say "Failed" | |||
camelia | ( no output ) | ||
R[DaneelOlivaw] | m: "bc" ~~ /||@(<b bc>)/ or say "Failed" | ||
camelia | ( no output ) | ||
15:28
kyclark joined
|
|||
kyclark | I would appreciate comments on how to improve this binary search: | 15:28 | |
pastie.org/10913220 | |||
15:29
Tonik joined,
dvinciguerra_ left
15:36
cyphase left
|
|||
moritz | kyclark: what kind of improvements are you looking for? | 15:38 | |
kyclark | Just generally using the power of Perl6. I just repasted with a version that handles both strings and numbers and uses a "given" which I'm still learning. | 15:39 | |
Sorry, I should have said that I'm just practising with a binary search. I also showed my son and challenged him to do it in Python which he's learning. | 15:40 | ||
15:40
Possum joined,
cyphase joined
|
|||
moritz | kyclark: you could replace those recursive search calls with callsame(args) | 15:41 | |
or even nextsame, which iirc eliminates the current stack frame | |||
kyclark | That is a performance advantage? | ||
hahainternet | reducing the number or depth of stack frames can have performance advantages | 15:42 | |
kyclark | I'm also trying to figure how to indicate failure. In Haskell I might use a Maybe Int so that I could return Nothing when not found and Just x when found. | ||
hahainternet | but it also prevents performance downgrades | ||
kyclark: the type you're looking for there is Failure | |||
it's not an Exception, but it can become one if you try to use it | |||
jferrero | m: say 「Hola」 | 15:43 | |
camelia | rakudo-moar 58dc8c: OUTPUT«5===SORRY!5===Argument to "say" seems to be malformedat <tmp>:1------> 3say7⏏5 「Hola」Bogus postfixat <tmp>:1------> 3say 7⏏5「Hola」 expecting any of: infix infix stopper postfix…» | ||
hahainternet | you can also rely on the 'definedness' of 'Int' vs '0' | ||
jferrero: wrong square brackets i think | |||
jferrero: you want the japanese quotes | |||
R[DaneelOlivaw] | m: say q「Hola」 | ||
camelia | rakudo-moar 58dc8c: OUTPUT«Hola» | ||
R[DaneelOlivaw] | :) | ||
hahainternet shrugs | 15:44 | ||
jferrero | What is the diference for LEFT CORNER BRACKET and HALFWIDTH LEFT CORNER BRACKET? | ||
R[DaneelOlivaw] | m: say 「meow」 | 15:45 | |
camelia | rakudo-moar 58dc8c: OUTPUT«meow» | ||
R[DaneelOlivaw] | .u LEFT CORNER BRACKET | ||
yoleaux | U+300C LEFT CORNER BRACKET [Ps] (「) | ||
R[DaneelOlivaw] | .u HALFWIDTH LEFT CORNER BRACKET | ||
yoleaux | U+FF62 HALFWIDTH LEFT CORNER BRACKET [Ps] (「) | ||
moritz | jferrero: HALFWIDTH :-) | ||
hahainternet | i don't know why one works and the other doesn't though | ||
i just found the same when i tried them | |||
R[DaneelOlivaw] | A better question is why both of them should work :) | 15:46 | |
hahainternet | why not? quotes are quotes are quotes | ||
if they are semantically equivalent to ' or " or similar, then that's all that's required to me, but i am not an implementor | |||
R[DaneelOlivaw] | Why not is a poor argument for increasing: code to maintain, code to debug, and usage to document :) | 15:47 | |
.u bracket | |||
yoleaux | U+005B LEFT SQUARE BRACKET [Ps] ([) | ||
U+005D RIGHT SQUARE BRACKET [Pe] (]) | |||
U+007B LEFT CURLY BRACKET [Ps] ({) | |||
jferrero | both are in category Unicode Punctuaction, open. | ||
hahainternet | R[DaneelOlivaw]: this is #perl6 though, it's more 'why not' vs 'why' | 15:48 | |
R[DaneelOlivaw] | m: say ^0xFFFFF .grep({.uniname ~~ /BRACKET/})».chr | ||
camelia | rakudo-moar 58dc8c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Missing « or »at <tmp>:1------> 030xFFFFF .grep({.uniname ~~ /BRACKET/})».7⏏5chr» | ||
R[DaneelOlivaw] | m: say ^0xFFFFF .grep({.uniname ~~ /BRACKET/}).map({.chr}) | 15:49 | |
camelia | rakudo-moar 58dc8c: OUTPUT«([ ] { } ⁅ ⁆ 〈 〉 ⎡ ⎢ ⎣ ⎤ ⎥ ⎦ ⎧ ⎨ ⎩ ⎪ ⎫ ⎬ ⎭ ⎰ ⎱ ⎴ ⎵ ⎶ ⏞ ⏟ ⏠ ⏡ ❬ ❭ ❰ ❱ ❲ ❳ ❴ ❵ ⟦ ⟧ ⟨ ⟩ ⟪ ⟫ ⟬ ⟭ ⦃ ⦄ ⦇ ⦈ ⦉ ⦊ ⦋ ⦌ ⦍ ⦎ ⦏ ⦐ ⦑ ⦒ ⦓ ⦔ ⦕ ⦖ ⦗ ⦘…» | ||
R[DaneelOlivaw] | hahainternet: then why not all of those ^? :) | ||
psch | m: say ^0xFFFFF .grep({.uniname ~~ /LEFT BRACKET/}).elems | ||
hahainternet | R[DaneelOlivaw]: many of them probably work | ||
camelia | rakudo-moar 58dc8c: OUTPUT«Potential difficulties: Space is not significant here; please use quotes or :s (:sigspace) modifier (or, to suppress this warning, omit the space, or otherwise change the spacing) at <tmp>:1 ------> 3say ^0xFFFFF .grep({.uniname ~~ /LEFT…» | ||
R[DaneelOlivaw] | Nope. | ||
psch | m: say ^0xFFFFF .grep({.uniname ~~ /LEFT' 'BRACKET/}).elems | ||
camelia | rakudo-moar 58dc8c: OUTPUT«0» | ||
R[DaneelOlivaw] | hahainternet: you can see the full list on docs.perl6.org/language/unicode_texas.html | ||
psch | m: say ^0xFFFFF .grep({.uniname ~~ /LEFT.+BRACKET/}).elems | 15:50 | |
15:50
abraxxa left
|
|||
camelia | rakudo-moar 58dc8c: OUTPUT«64» | 15:50 | |
psch | m: say ^0xFFFFF .grep({.uniname ~~ /RIGHT.+BRACKET/}).elems | ||
camelia | rakudo-moar 58dc8c: OUTPUT«63» | ||
psch | that's just great | 15:51 | |
R[DaneelOlivaw] | hahaha | ||
m: say ^0xFFFFFF .grep({.uniname ~~ /RIGHT.+BRACKET/}).elems | |||
camelia | rakudo-moar 58dc8c: OUTPUT«(timeout)» | 15:52 | |
kyclark | How does one return Failure from a method, and how does one pattern match on it/catch it? | 15:55 | |
R[DaneelOlivaw] | kyclark: fail 'meow' | 15:56 | |
moritz | and you can check with .defined or a type check for Failure | ||
R[DaneelOlivaw] | m: sub meow { fail 'meow' }; unless meow { "something is wrong"; }; if meow ~~ Failure { "oh yeah, def a failure" } | 15:57 | |
camelia | rakudo-moar 58dc8c: OUTPUT«5===SORRY!5===Function 'meow' needs parens to avoid gobbling blockat <tmp>:1------> 3}; unless meow { "something is wrong"; }7⏏5; if meow ~~ Failure { "oh yeah, def a fMissing block (apparently claimed by 'meow')at <tmp>:1------…» | ||
R[DaneelOlivaw] | m: sub meow { fail 'meow' }; unless meow() { "something is wrong"; }; if meow ~~ Failure { "oh yeah, def a failure" } | ||
camelia | rakudo-moar 58dc8c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Expected a term, but found either infix ~~ or redundant prefix ~ (to suppress this message, please use a space like ~ ~)at <tmp>:1------> 3() { "something is wrong"; }; if meow ~~7⏏5 Failure {…» | ||
R[DaneelOlivaw] | Well... something like that :) | ||
psch | m: sub meow { fail 'meow' }; unless meow() { "something is wrong"; }; if meow() ~~ Failure { "oh yeah, def a failure" } | ||
camelia | rakudo-moar 58dc8c: OUTPUT«WARNINGS for <tmp>:Useless use of constant string "something is wrong" in sink context (line 1)Useless use of constant string "oh yeah, def a failure" in sink context (line 1)» | ||
psch | m: sub meow { fail 'meow' }; say do unless meow() { "something is wrong"; }; say do if meow() ~~ Failure { "oh yeah, def a failure" } | ||
camelia | rakudo-moar 58dc8c: OUTPUT«something is wrongoh yeah, def a failure» | ||
R[DaneelOlivaw] | psch++ :) | 15:58 | |
15:58
AlexDaniel joined
|
|||
ugexe | bbkr: yes zef will work without perl6 being in PATH. Note that you need git/wget/curl or something in the PATH unless you are installing from a local path (or you create/add a pure-perl6 plugin to the config) | 15:59 | |
kyclark | OK, did I do this right? | 16:00 | |
pastie.org/10913254 | |||
dj_goku | perlpilot: thanks btw. I'll be updating more tonight when I get home. | 16:01 | |
kyclark | Oh, I didn't incorporate callsame ... Not sure how that would work. | 16:02 | |
16:02
johanholmberg joined
|
|||
R[DaneelOlivaw] | m: given my $foo = 42 { when 42 { say "meow" } } | 16:02 | |
camelia | rakudo-moar 58dc8c: OUTPUT«meow» | ||
R[DaneelOlivaw] | huh, TIL | ||
16:02
finanalyst joined
|
|||
finanalyst | @search chima shattered realms | 16:03 | |
disregard | |||
pls | |||
ovibos | lol | ||
16:04
finanalyst left
|
|||
R[DaneelOlivaw] | What's the point of the default {} block in kyclark's construct? | 16:04 | |
I see it documented in the same form in our docs, but to my eye it looks utterly pointless. | |||
perlpilot | m: say chr(65048).uniname | 16:05 | |
camelia | rakudo-moar 58dc8c: OUTPUT«PRESENTATION FORM FOR VERTICAL RIGHT WHITE LENTICULAR BRAKCET» | ||
R[DaneelOlivaw] | m: say chr(65048) | 16:06 | |
camelia | rakudo-moar 58dc8c: OUTPUT«︘» | ||
16:06
johanholmberg left
|
|||
perlpilot | just note the spelling of that last word | 16:06 | |
R[DaneelOlivaw] | Oh, LMAO! | ||
m: say 65048.base: 16 | |||
camelia | rakudo-moar 58dc8c: OUTPUT«FE18» | ||
R[DaneelOlivaw] | For a second I feared it was just Rakudo, but no: www.fileformat.info/info/unicode/ch.../index.htm | 16:07 | |
perlpilot | yep | ||
How do you submit bug reports to unicode? :) | |||
R[DaneelOlivaw] | funny | ||
16:07
ovibos is now known as ireland
16:08
ireland is now known as ovibos
|
|||
R[DaneelOlivaw] | They probably already know: en.wikipedia.org/wiki/Unicode_anomaly | 16:08 | |
ugexe | docs.perl6.org/language/control#de...t_and_when | ||
gfldex | so the fix is to say: "we know, we know" | 16:09 | |
psch | j: say chr(65048).uniname | ||
camelia | rakudo-jvm cd19db: OUTPUT«PRESENTATION FORM FOR VERTICAL RIGHT WHITE LENTICULAR BRAKCET» | ||
kyclark | Why do both of these unpackings work? | 16:10 | |
m: for ((1,2), (3,4)) -> [$x, $y] { put "x ($x) y ($y)" } | |||
camelia | rakudo-moar 58dc8c: OUTPUT«x (1) y (2)x (3) y (4)» | ||
kyclark | m: for ((1,2), (3,4)) -> ($x, $y) { put "x ($x) y ($y)" } | ||
camelia | rakudo-moar 58dc8c: OUTPUT«x (1) y (2)x (3) y (4)» | ||
perlpilot | kyclark: what would you have rakudo do otherwise? | ||
R[DaneelOlivaw] | ugexe: well, yeah, that's the section I referenced in my question. The three code examples after the first seem to have default {} for no reason. | ||
kyclark | Are [] and () eqv? | ||
R[DaneelOlivaw] | no | ||
m: (1,).WHAT.say; [1,].WHAT.say | 16:11 | ||
camelia | rakudo-moar 58dc8c: OUTPUT«(List)(Array)» | ||
psch | m: die "foo"; CATCH { default { } } | ||
camelia | ( no output ) | ||
perlpilot | m: say so (1,2,3) eqv [1,2,3] | ||
camelia | rakudo-moar 58dc8c: OUTPUT«False» | ||
perlpilot | ;) | ||
kyclark | I'm fairly confused by List and Array in Perl6, mostly because I can't seem to come up with function sigs that handle them well. | 16:12 | |
e.g., sub foo(Int @list) {...} | |||
R[DaneelOlivaw] | psch: but is there a reason to use it in for {} or given {} ? That the examples show? | ||
gfldex | my $a = Array[Int]; dd $a; | ||
m: my $a = Array[Int]; dd $a; | |||
camelia | rakudo-moar 58dc8c: OUTPUT«Cannot look up attributes in a type object in block <unit> at <tmp> line 1» | ||
R[DaneelOlivaw] | kyclark: lists are immutable, arrays are mutable | 16:13 | |
kyclark | m: sub foo (Int @list) { dd @list }; foo 1..10 | ||
camelia | rakudo-moar 58dc8c: OUTPUT«Type check failed in binding @list; expected Positional[Int] but got Range (1..10) in sub foo at <tmp> line 1 in block <unit> at <tmp> line 1» | ||
gfldex | m: my Array[Int] $a; dd $a; | ||
camelia | rakudo-moar 58dc8c: OUTPUT«Cannot look up attributes in a type object in block <unit> at <tmp> line 1» | ||
R[DaneelOlivaw] | m: sub foo (@list of Int) { dd @list }; foo 1..10 | ||
camelia | rakudo-moar 58dc8c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Cannot resolve caller trait_mod:<of>(Parameter, Int); none of these signatures match: (Mu:U $target, Mu:U $type) (Routine:D $target, Mu:U $type)at <tmp>:1» | ||
psch | R[DaneelOlivaw]: uh, yeah? 'default { }' is kinda 'when * { }' | ||
R[DaneelOlivaw] | m: sub foo (@list where .all ~~ Int) { dd @list }; foo 1..10 | ||
camelia | rakudo-moar 58dc8c: OUTPUT«1..10» | ||
psch | kyclark: types are nominal, if you're not passing a Positional[Int] it won't match | ||
gfldex | kyclark: `Int @list` does not mean: a list that happens to have Ints in it | 16:14 | |
psch | m: say (1,2,3).WHAT; say (my Int @ = 1,2,3).WHAT | ||
camelia | rakudo-moar 58dc8c: OUTPUT«(List)(Array[Int])» | ||
R[DaneelOlivaw] | psch: but it's a last statement :/ | ||
when * {} is just as useless | |||
psch | R[DaneelOlivaw]: what exactly is the example you're refering to? | ||
16:15
bob777 left,
araujo joined
|
|||
R[DaneelOlivaw] | psch: the three examples here in the docs, sans the first one: docs.perl6.org/language/control#de...t_and_when | 16:15 | |
+1 that kyclark is using :) | |||
gfldex | kyclark: you man want to re-read: docs.perl6.org/language/list#Typing | ||
R[DaneelOlivaw] | m: given 5 { when 42 { say 42 }; default { say "huh?" }; }; given 5 { when 42 { say 42 }; say "huh?"; } | ||
camelia | rakudo-moar 58dc8c: OUTPUT«huh?huh?» | ||
16:15
araujo left
|
|||
psch | m: given "foo" { when Int { say "Int" }; when Num { say "num" }; default { say "something else" } } | 16:16 | |
camelia | rakudo-moar 58dc8c: OUTPUT«something else» | ||
psch | i don't get the confusion? given/when is a smart-match powered switch/case, and default is the same default as in switch/case | ||
CIAvash | kyclark: docs.perl6.org/language/traps#Type...parameters | ||
psch | R[DaneelOlivaw]: oh, you're saying you could just put it as last statement in the given block | 16:17 | |
R[DaneelOlivaw] | Yes. | ||
gfldex | kyclark: also, if you want a sub to iterate over stuff, assume what it gets to be an iterator (we don't expose iterators explicitely in Perl 6) | ||
R[DaneelOlivaw] | m: given "foo" { when Int { say "Int" }; when Num { say "num" }; say "something else" } | ||
camelia | rakudo-moar 58dc8c: OUTPUT«something else» | ||
16:17
domidumont left
|
|||
psch | yeah, i suppose you could, but you can't rearrange that | 16:17 | |
R[DaneelOlivaw] | The `when`s will bail out if they match. | ||
psch | m: given 5 { when 5 { say "cool"; proceed }; say "something else" } # you can also proceed into the block | ||
camelia | rakudo-moar 58dc8c: OUTPUT«coolsomething else» | ||
psch | well, or into default | ||
R[DaneelOlivaw] | m: given 5 { when 5 { say "cool"; proceed }; default { say "something else" } } | 16:18 | |
camelia | rakudo-moar 58dc8c: OUTPUT«coolsomething else» | ||
psch | m: given 5 { default { say "default" }; when 5 { say 5 } } | ||
camelia | rakudo-moar 58dc8c: OUTPUT«default» | ||
psch | oh right | ||
it *is* sequential | |||
m: given 5 { default { say "default"; proceed; }; when 6 { }; when 5 { say 5 } } | |||
camelia | rakudo-moar 58dc8c: OUTPUT«default5» | ||
gfldex | kyclark: typed arrays are useful if you did some input validation already and don't want to repeat the validation later on for each value. At the other hand, it specialises your subs. Having a multi can help in that case. | ||
R[DaneelOlivaw] | huh | 16:19 | |
kyclark | OK, still processing this. Thanks. | ||
R[DaneelOlivaw] | Why did that print `default`? | ||
psch | because 5 ~~ * | ||
R[DaneelOlivaw] | Oh | ||
So it *is* useless then? :P | 16:20 | ||
I don't know what proceeds is /me looks up | |||
psch | yeah, the same way that the first statement in a Block is useless because we have ENTER :P | ||
...or the other way around for ENTER and the first statement in a Block | 16:21 | ||
just like statement_mod:<if> is useless because we have the block form | |||
R[DaneelOlivaw] | I don't see the parallel | ||
m: { say "one"; ENTER { say "two" } } | |||
camelia | rakudo-moar 58dc8c: OUTPUT«twoone» | ||
R[DaneelOlivaw] | But with the default, it matches first if you put it first | ||
psch | right, it's not really a parellel in anything but TIMTOWTDI :) | ||
R[DaneelOlivaw] | ok | 16:22 | |
gfldex | in a give block order matters, what makes default as a first statement questionable. | ||
psch | but not necessarily bad or wrong | ||
R[DaneelOlivaw] | Just more typing for no reason :trollface: | 16:23 | |
ugexe | it lets you align the braces nicely and makes your ocd happy | 16:24 | |
16:25
cooper joined
16:26
hankache joined,
girafe joined
|
|||
gfldex | m: sub f(@a where all(@a) ~~ Int){ dd @a }; f 1..10; | 16:27 | |
camelia | rakudo-moar 58dc8c: OUTPUT«1..10» | ||
gfldex | kyclark: ^^^ | ||
R[DaneelOlivaw] | I prefer my version, since it lets you avoid duplicating variable's name. Fewer sources of bugs. | 16:30 | |
16:30
canopus_ joined
|
|||
hankache | hola #perl6 | 16:30 | |
yoleaux | 10 Jul 2016 18:34Z <hoelzro> hankache: let me know if you want some guidance in improving the Perl 6 lexer; I haven't worked on it in a while, but it shouldn't be too hard to change | ||
R[DaneelOlivaw] | \o\ | ||
hankache | m: my $a; my $b; $b := $a; | 16:31 | |
camelia | ( no output ) | ||
R[DaneelOlivaw] | You get a two-arm wave thanks to my buggy keyboard :( | ||
16:31
canopus left
|
|||
hankache | if you breakdown the above code to three lines (a statement per line) en use the repl it doesn't work any ideas why? | 16:31 | |
16:32
Actualeyes left
|
|||
psch | hankache: what does "doesn't work" mean? | 16:33 | |
R[DaneelOlivaw] | psch: gives "Cannot use bind operator with this left-hand side" | ||
hankache | yes ^^ | ||
if you put all three statements in one line it works fine. | 16:34 | ||
psch | does it? as in, if you assign $a afterwards, does $b get the value? | ||
'cause iirc there was lots broken with binding in the repl | |||
R[DaneelOlivaw] | Yeah, works: gist.github.com/zoffixznet/46e1cc8...0ca5b56f15 | 16:35 | |
psch | right, that was #122914 | 16:36 | |
synopsebot6 | Link: rt.perl.org/rt3//Public/Bug/Displa...?id=122914 | ||
psch | just found that fixed too | ||
maybe the fix there has a hint | |||
hankache | psch it does | 16:37 | |
psch | complaints about the LHS usually means that the parser didn't find anythat that looks container-y enough | ||
hankache | m: my $a; my $b; $b := $a; $a = 7; say $b; | ||
camelia | rakudo-moar 58dc8c: OUTPUT«7» | ||
psch | m: my $x = 5; say MY::<$x>; ::($x) := "foo"; | 16:38 | |
camelia | rakudo-moar 58dc8c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Cannot use bind operator with this left-hand sideat <tmp>:1------> 3my $x = 5; say MY::<$x>; ::($x) := "foo"7⏏5;» | ||
16:38
domidumont joined
|
|||
psch | well, "containery enough" is badly worded i suppose | 16:38 | |
16:38
zacts joined
|
|||
R[DaneelOlivaw] | Ahh | 16:38 | |
psch | so, yeah, i'd check if it parses everything correctly | ||
gfldex | m: f(Array[Int](Array) @a){}; my @a = 1,2,3; f(@a); | ||
camelia | rakudo-moar 58dc8c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Unable to parse expression in argument list; couldn't find final ')' at <tmp>:1------> 3f(Array[Int](Array)7⏏5 @a){}; my @a = 1,2,3; f(@a); expecting any of: infix infix…» | ||
psch | if that's not it, i'd probably look into the lexpad-y stuff - the REPL cheats in a weird way there afaik | 16:39 | |
hankache | thanks | 16:41 | |
16:43
furelypunctional joined
16:50
araujo joined
16:51
ribasushi left
16:55
ribasushi joined
16:56
lambd0x joined,
noganex_ left,
sno left
|
|||
R[DaneelOlivaw] | ... unless a powered up jet is on the ground :P | 16:57 | |
16:59
dvinciguerra_ joined
|
|||
lambd0x | Hi everyone! I'm currently having some trouble with I/O binary operations. I undestood that now instead of working with a regular str, it's done using a buf type, but how can I think I might be not knowing how to properly work with this type. Can someone what exactly a buf type holds and how to work back and forth with str? | 16:59 | |
R[DaneelOlivaw] | encode/decode | 17:00 | |
m: say "foo".encode; say "foo".encode.decode | |||
camelia | rakudo-moar 58dc8c: OUTPUT«utf8:0x<66 6f 6f>foo» | ||
moritz | and a buf is just a sequence of integers | ||
lambd0x | would an @str work with .encode in the same way? | 17:01 | |
moritz | what do you mean by @str? | 17:03 | |
lambd0x | a string held in a variable of such. | ||
moritz | @str is an array variable | 17:04 | |
so you can say @str[0].encode for example | |||
or $str.encode | |||
lambd0x | Because it wasn't working.... might be syntax error... | ||
Yes, I was iterating over its parts and calling it to a buf variable. | 17:05 | ||
Just clarifying, how is the right way of declaring a buf variable? | 17:06 | ||
moritz | my $buf | 17:07 | |
or my Blob $buf | |||
17:07
zacts left
|
|||
moritz | or my Buf $buf if you really need a Buf, and a Blob isn't enough | 17:07 | |
17:08
noganex joined
|
|||
lambd0x | ok, will try again. Thanks for moritz | 17:08 | |
17:13
molaf joined
17:16
avalokite left
17:21
cdg left
|
|||
lambd0x | m: {my @lines = "Test"; my Buf $buf = @lines[0].encode; say $buf} | 17:21 | |
camelia | rakudo-moar 58dc8c: OUTPUT«Type check failed in assignment to $buf; expected Buf but got utf8 (utf8.new(84,101,115,116)) in block <unit> at <tmp> line 1» | ||
psch | m: say "Test".encode('ascii').WHAT | 17:22 | |
camelia | rakudo-moar 58dc8c: OUTPUT«(Blob[uint8])» | ||
psch | m: say utf8.^mro; say Buf.^mro | ||
camelia | rakudo-moar 58dc8c: OUTPUT«((utf8) (Any) (Mu))Method 'mro' not found for invocant of class 'Perl6::Metamodel::ParametricRoleGroupHOW' in block <unit> at <tmp> line 1» | ||
psch | m: say utf8.^mro; say Buf.new.^mro | ||
camelia | rakudo-moar 58dc8c: OUTPUT«((utf8) (Any) (Mu))((Buf) (Any) (Mu))» | ||
psch | m: say utf8.^roles; say Buf.new.^roles | 17:23 | |
camelia | rakudo-moar 58dc8c: OUTPUT«Cannot unbox a type object in block <unit> at <tmp> line 1» | ||
psch | ...anyway, my point is somewhere along the lines of "utf8 does Blob, Buf does Blob, but they're not really related" | ||
in a liskov way that is | |||
lambd0x | psch: :) | 17:25 | |
17:26
hankache left
17:30
FROGGS joined
17:35
kurahaupo left
17:45
zacts joined
|
|||
lambd0x | Ok undestood Buf, therefore I must confirm if I'm missing something while using spurt. Can it write binary just by adding as the third argument the adverb :bin? | 17:53 | |
*while using buf. :P | 17:54 | ||
17:55
araujo left,
araujo joined
|
|||
lambd0x | m: my $line = "Test"; my $buf = $line.encode; say $buf; spurt "file.bin", $buf, :bin; | 17:57 | |
camelia | rakudo-moar 58dc8c: OUTPUT«utf8:0x<54 65 73 74>spurt is disallowed in restricted setting in sub restricted at src/RESTRICTED.setting line 1 in sub spurt at src/RESTRICTED.setting line 17 in block <unit> at <tmp> line 1» | ||
gfldex | lambd0x: you can use the same options then in method spurt, see docs.perl6.org/routine/spurt#class_IO%3A%3APath | ||
17:57
araujo left
|
|||
gfldex | the doc on sub spurt is missleading | 17:57 | |
17:57
araujo joined
|
|||
R[DaneelOlivaw] | lambd0x: that works fine. What issues are you experiencing? | 17:58 | |
lambd0x | gfldex: Thanks. | ||
trying to print an array in lines binary basically. | 17:59 | ||
*binary lines... :P | |||
It's printing but as regular text. So I'm guessing something is wrong in my use of spurt | 18:00 | ||
R[DaneelOlivaw] | lambd0x: what are you printing? | 18:01 | |
spurt :bin, "foo", "Test".encode; would show up as 'Test' in the file | |||
dalek | c: 574783c | (Wenzel P. P. Peppmeyer)++ | doc/Type/IO.pod6: spurt got :bin |
18:02 | |
lambd0x | something like: $str = "text" to a buf variable after encoding it and passing as argument in the second area of spurt along with :bin adverb | ||
such as: spurt "file.bin", $buf, :bin ; | 18:03 | ||
R[DaneelOlivaw] | lambd0x: well, you're encoding it into utf-8 and then when you read the file (presumably also in utf-8) you'd see "test" | ||
psch | m: my $line = "Test"; my $buf = $line.encode; print $buf; # to illustrate | 18:04 | |
camelia | rakudo-moar 58dc8c: OUTPUT«Test» | ||
R[DaneelOlivaw] | lambd0x: as compared to say, this: perl6 -e 'my @lines = "©" xx 4; spurt :bin, "file.bin", @lines.join("\n").encode: "latin1"' | ||
lambd0x | yes yes ... | ||
psch | a $buf is a per-"character" (FSDO) representation of a string | ||
R[DaneelOlivaw] | I get trash when I view that file with `less` | ||
psch: what's "D" in FSDO? | |||
psch | definition | ||
because "character", "grapheme" and whatelsehaveyou | 18:05 | ||
and then there's ascii where "character" works | |||
m: my $line = "Test"; .say for $line.NFKD # this might be what lambd0x wants..? | |||
camelia | rakudo-moar 58dc8c: OUTPUT«84101115116» | ||
psch | but yeah, as R[DaneelOlivaw] says, :bin-spurting means "write those bytes", and those bytes are valid utf8, so they stay text | 18:06 | |
18:07
sjoshi joined
|
|||
lambd0x | Now I get it. | 18:08 | |
R[DaneelOlivaw] | :) | ||
lambd0x | Thanks everybody. | ||
R[DaneelOlivaw] | Any time | ||
18:09
domidumont left
|
|||
psch | m: my $line = "Test"; my $buf = $line.encode; print $buf>>.Int; | 18:09 | |
camelia | rakudo-moar 58dc8c: OUTPUT«84 101 115 116» | ||
psch | also works i suppose | ||
but that gives you a List, which stringifies with spaces | |||
18:11
domidumont joined
|
|||
R[DaneelOlivaw] | m: my $buf = '♥'.encode; print $buf».Int; | 18:11 | |
camelia | rakudo-moar 58dc8c: OUTPUT«226 153 165» | ||
R[DaneelOlivaw] | neat \o/ | ||
lambd0x | Yeah, I was looking into this just to see how this works in binary. But the fist answers you guys gave me solved my doubts | 18:12 | |
Another thing, does perl6 has modules for good encryption standards? | |||
18:12
Tonik left
|
|||
psch | modules.perl6.org/#q=crypt looks pretty decent, but i don't really know crypto vOv | 18:13 | |
18:13
spider-mario joined
|
|||
lambd0x | pgp, aes, rsa...etc. I was looking for a way to encrypt files in perl | 18:13 | |
psch: I looked at it, but seems to be a work in progress still. | 18:14 | ||
R[DaneelOlivaw] | We have decent interop with Perl 5. So you can use most modules on metacpan.org/ | ||
psch | lambd0x: which "it"? | ||
lambd0x: there's like 6 modules :) | |||
lambd0x | psch: RC4. sorry for the delay.. | 18:16 | |
R[DaneelOlivaw]: Is there some use flag to be declared in order to use those modules from perl5? | 18:17 | ||
18:17
sjoshi left
|
|||
moritz | lambd0x: you need Inline::Perl5 for that | 18:19 | |
psch | lambd0x: ah, i see. well, as i said, i don't really know crypto vOv | 18:20 | |
m/ & | |||
psch & | |||
lambd0x | psch: Thanks anyway :) | 18:21 | |
moritz: nice :) | 18:23 | ||
18:23
___ joined,
araujo_ joined
18:25
zacts left
|
|||
___ | lambd0x: once you have Inline::Perl5 installed. You can just use Foo:from<Perl5>; to load a Perl 5 module. | 18:25 | |
Without having to `use Inline::Perl5` in your code. | |||
lambd0x | \o/ ___ | 18:27 | |
18:27
araujo left
|
|||
timotimo | the floor is talking o_O | 18:31 | |
___ | m: "{floor 0o0} is talking".say | 18:33 | |
camelia | rakudo-moar 58dc8c: OUTPUT«0 is talking» | ||
18:34
Guest66 joined
18:35
sjoshi joined
|
|||
Guest66 | p6: my @t = word1 word2 | 18:36 | |
camelia | rakudo-moar 58dc8c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Undeclared routines: word1 used at line 1. Did you mean 'words', 'ords'? word2 used at line 1. Did you mean 'words', 'ords'?» | ||
___ | m: say 0o9 | ||
camelia | rakudo-moar 58dc8c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>'9' is not a valid numberat <tmp>:1------> 3say 0o97⏏5<EOL>» | ||
___ | Huh :/ | ||
Guest66 | p6: my @t = "word1 word2" | ||
camelia | ( no output ) | ||
Guest66 | p6: my @t = "word1 word2" ; say @t | 18:37 | |
camelia | rakudo-moar 58dc8c: OUTPUT«[word1 word2]» | ||
Guest66 | p6: my @t = "word1 word2" ; say @t[0] | ||
camelia | rakudo-moar 58dc8c: OUTPUT«word1 word2» | ||
Guest66 | why say@t[0] is not word1 pls ? | 18:38 | |
<__ | |||
mspo | p6: my @t = "word1 word2".split; say @t[0] | ||
camelia | rakudo-moar 58dc8c: OUTPUT«Cannot resolve caller split(Str: ); none of these signatures match: (Cool $: Regex:D $pat, $limit = Inf;; :$all, *%_) (Cool $: Cool:D $pat, $limit = Inf;; :$all, *%_) (Str:D $: Regex:D $pat, $limit is copy = Inf;; :$v is copy, :$k, :$kv, …» | ||
mst | because @t is an array of one element, containing 'word1 word2' | ||
___ | Guest66: because @t contains just one element, the string "word 1 word2" | ||
p6: my @t = "word1 word2".words; say @t[0] | 18:39 | ||
camelia | rakudo-moar 58dc8c: OUTPUT«word1» | ||
mst | p6: my @t = <word1 word2>; say @t[0] | ||
camelia | rakudo-moar 58dc8c: OUTPUT«word1» | ||
mspo | p6: my @t = "word1 word2".split(\s+); say @t[0] | ||
camelia | rakudo-moar 58dc8c: OUTPUT«5===SORRY!5===Null regex not allowedat <tmp>:1------> 3my @t = "word1 word2".split(\s+7⏏5); say @t[0]Couldn't find terminator +at <tmp>:1------> 3my @t = "word1 word2".split(\s+7⏏5); say @t[0] expecting any of: …» | ||
mspo | anyway .words is better | ||
lambd0x | prob what u want is @t = "word1", "word2"; | ||
Guest66 | yeah ! thanks mspo | ||
mst | or the <> form I showed | ||
mspo | yess <> is also good | ||
kyclark | @t = <word1 word2> | ||
___ | m: say 0o8 | 18:40 | |
camelia | rakudo-moar 58dc8c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>'8' is not a valid numberat <tmp>:1------> 3say 0o87⏏5<EOL>» | ||
gfldex | m: my sub term:<o.O> {Failure.new("Wut‽")}; say o.O; | ||
camelia | rakudo-moar 58dc8c: OUTPUT«Wut‽Actually thrown at: in block <unit> at <tmp> line 1» | ||
lambd0x | mst: \o/ | ||
Guest66 | i'm french & love P6 but there is not many tutorial | ||
___ | Guest66: there's perl6intro.com/ and perl6.party/ | ||
tbrowder | please review roast PR 136 <github.com/perl6/roast/pull/136> and its spectest log at gist <gist.github.com/tbrowder/0a4e05800...1675f6> | 18:41 | |
kyclark | FWIW, I'm trying P6 with the Rosalind problems if you want to look at what I'm doing (github.com/kyclark/rosalind.info) | ||
___ | Guest66: oh, and of course: learnxinyminutes.com/docs/perl6/ | ||
18:41
huggable joined
|
|||
tbrowder | the added tests are for known bad (illegal) Perl 6 pod tables | 18:41 | |
mspo | p6: my @t = "word1 word2".split(/\s+/); say @t[0] | ||
camelia | rakudo-moar 58dc8c: OUTPUT«word1» | ||
perlpilot | Guest66: also, feel free to ask questions here. :) | 18:42 | |
lambd0x | Guest66: Guess it's new and still changing, but there's already quite a few tutorials over the net I think. | ||
18:42
girafe2 joined,
Guest66_ joined
|
|||
Guest66_ | re | 18:42 | |
gfldex | we didn't doc term:<> yet and I can't come up with a good example | ||
___ | tbrowder: it would be nice to have some test description here. Including the file name: github.com/perl6/roast/pull/136/fi...2b15feR214 | 18:43 | |
perlpilot | lambd0x: it's not changing that much. | ||
lambd0x | Docs are awesome: docs.perl6.org/ | ||
___ | m: use Test; dies-ok {;} | ||
camelia | rakudo-moar 58dc8c: OUTPUT«not ok 1 - # Failed test at <tmp> line 1» | ||
gfldex | in fact I can't come up with a bad example either | ||
___ | tbrowder: ^ otherwise, the failures aren't obvious with regard to what test exactly failed. | ||
18:43
sjoshi left
|
|||
lambd0x | perlpilot: considering since it's start I think it did. but not much recently, yes. | 18:44 | |
Guest66_ | gfldex <> use prompt ? for capted the answer the users ? | ||
18:45
domidumont left,
Guest66 left,
girafe left,
cdg joined
18:46
Guest66_ is now known as P6fr
|
|||
___ | tbrowder: oh, another issue I spotted, you're shelling out to 'perl6' but that won't work. | 18:46 | |
perlpilot | P6fr: looks like you're thinking of perl 5 there. | ||
tbrowder | the file modified was "t/spec/S26-documentation/07-tables.t" where a loop of 5 tests was added at the end, and files for those 5 tests are in a new sub-directory | ||
P6fr | yes perlpilot | 18:47 | |
___ | tbrowder: I'm pretty sure those tests are passing because it dies for the wrong reason, so it's best to test the output too. | ||
m: use Test; dies-ok { shell "zomfbufdfas" } | 18:48 | ||
camelia | rakudo-moar 58dc8c: OUTPUT«ok 1 - » | ||
perlpilot | P6fr: <> in P6 is like qw() in P5. thus my @t = <word1 word2>; | 18:49 | |
tbrowder | zoffix: if you can figure out how i can do that i would appreciate it. I've tried capturing the output using Proc and :out, etc., but can't get anything to work--ideas appreciated!! | ||
gfldex | m: my sub term:<o.O> {Failure.new("Wut‽")}; say o.O.VAR; | ||
camelia | rakudo-moar 58dc8c: OUTPUT«Wut‽Actually thrown at: in block <unit> at <tmp> line 1» | ||
gfldex | m: my sub term:<o.O> {Failure.new("Wut‽")}; say &o.O.VAR; | 18:50 | |
camelia | rakudo-moar 58dc8c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Undeclared routine: o used at line 1» | ||
gfldex | m: my sub term:<o.O> {Failure.new("Wut‽")}; say &(o.O).VAR; | ||
camelia | rakudo-moar 58dc8c: OUTPUT«Wut‽Actually thrown at: in block <unit> at <tmp> line 1» | ||
gfldex | m: my sub term:<o.O> {Nil}; say &(o.O).VAR; | ||
camelia | rakudo-moar 58dc8c: OUTPUT«Nil» | ||
tbrowder | all is for nought if I can't call Perl6 in the shell | 18:51 | |
s/ | 18:52 | ||
___ | tbrowder: you can, you just have to use $*EXECUTABLE. | 18:53 | |
tbrowder: something like this: perl6 -e 'use Test; my $p = run $*EXECUTABLE, "0.pod", :out, :err; is $p.out.slurp-rest, "meow", "STDOUT looks good"; is $p.err.slurp-rest, "foo", "STDERR looks good";' | |||
tbrowder | ah! just thought of something--back later, closing the PR for now | ||
___ | tbrowder: actually, a better approach would be to use is_run() from Test::Util. Just slurp the file and give it as code: github.com/perl6/roast/blob/master...st/Util.pm | 18:54 | |
perlpilot still finds slurp-rest annoyingly named | |||
___ | (some examples of its usage: github.com/perl6/roast/search?utf8...p;q=is_run ) | 18:55 | |
tbrowder | zoffix: that looks like it may work--back later | 18:56 | |
gfldex | m: my sub term:<o.O>{&?ROUTINE.signature.perl}; say o.O; | 18:57 | |
camelia | rakudo-moar 58dc8c: OUTPUT«:()» | ||
gfldex | m: my sub term:<o.O>{say $_; &?ROUTINE.signature.perl}; say o.O; | ||
camelia | rakudo-moar 58dc8c: OUTPUT«(Any):()» | ||
18:59
harmil joined
|
|||
harmil | Couple minor nits with EVAL: 1) "MONKEY-SEE-NO-EVAL" is a really non-intuitive name and do we generally use all-caps for pragmas in P6? Would "use unsafe-eval" make more sense? 2) the error is ambiguous, and at first I thought it was saying "MONKEY-SEE-NO-EVAL" was the new function I had to use, not "use MONKEY-SEE-NO-EVAL" should go in my code... | 19:01 | |
___ | m: my $x; EVAL "$x" | 19:02 | |
camelia | rakudo-moar 58dc8c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>EVAL is a very dangerous function!!! (use MONKEY-SEE-NO-EVAL to override,but only if you're VERY sure your data contains no injection attacks)at <tmp>:1------> 3my $x; EVAL "$x"7⏏5<EOL>» | ||
harmil | Perhaps as a clearer error message, "use the MONKEY-SEE-NO-EVAL pragma"... | ||
___ | harmil: sure. I'll fix that right now. As for MONKEYs... there's a whole bunch of other MONKEY's so I don't think that will get changed :) | 19:04 | |
harmil | "there's a whole bunch of other MONKEY's" -- story of my professional life | ||
___ | lol | ||
For anyone curious about other MONKEYs (though many of them are just reserved for future use): gist.github.com/zoffixznet/166cc31...a6319d7738 | 19:09 | ||
19:10
sufrostico joined
|
|||
perlpilot | harmil: the loudness and obnoxiousness of MONKEY-* is purposeful. | 19:10 | |
19:10
pmqs_ left
|
|||
timotimo | as is the upper-casing of EVAL | 19:10 | |
mst | and then the fact it isn't MONKEY_SEE_NO_EVAL is because the perl6 developers hate you and want you to fail to type it all the time | 19:11 | |
___ | :D | ||
mst | (the _ to - rename for caps things was incredibly user hostile and I've still never managed to get anybody to justify it) | 19:12 | |
___ | To make it harder to type :) | ||
19:13
Tonik joined
|
|||
harmil | I like snake-case, now. It took a while. I understand my Lisp friends a bit more every day I use Perl 6 | 19:14 | |
___ | CAPSLOCK... IT'S CRUISE CONTROL FOR MONKEY-SEE-NO-EVAL :) | ||
harmil | m: my &smap = &say ∘ ↦ my &smapcrement = &smap.assuming({$_+1}); smapcrement 1,2,3 | ||
camelia | rakudo-moar 58dc8c: OUTPUT«234» | ||
harmil | m: say map {$_+1}, 1,2,3 | ||
camelia | rakudo-moar 58dc8c: OUTPUT«(2 3 4)» | ||
harmil | Why are those two different output? | 19:15 | |
timotimo | perhaps the assuming is losing ta slurpy positional argument or something? | 19:17 | |
19:18
acrussell left
|
|||
___ | gfldex: what's term:<> ? | 19:18 | |
19:19
acrussell joined
|
|||
___ is reminded of perl6.party/post/Anguish--Invisible...Data-Theft | 19:19 | ||
19:21
darutoko left
|
|||
___ | m: my $x = 'use NativeCall; sub system (Str) is native {}; system "ls"'; EVAL "$x" | 19:21 | |
camelia | rakudo-moar 58dc8c: OUTPUT«5===SORRY!5=== Error while compiling <tmp>EVAL is a very dangerous function!!! (use MONKEY-SEE-NO-EVAL to override,but only if you're VERY sure your data contains no injection attacks)at <tmp>:1------> 3r) is native {}; system "ls"'; EVAL …» | ||
___ | m: my $x = 'use NativeCall; sub system (Str) is native {}; system "ls"'; "$x".EVAL | ||
camelia | rakudo-moar 58dc8c: OUTPUT«Perlitobarbindalek-queueevalbotevalbot.logfooliblogmboxnqp-jsp1p2p6eval-tokenperl5rakudo-j-1rakudo-j-2rakudo-j-instrakudo-j-inst-1rakudo-j-inst-2rakudo-m-1rakudo-m-2rakudo-m-instrakudo-m-…» | ||
gfldex | ___: it's the term declarator and that concludes my knowledge about term:<> | ||
___ | Ah. Now I get it | 19:22 | |
19:23
wamba joined,
pmqs_ joined,
sno joined
|
|||
arnsholt | A term:<...> declares something that functions as a term in the syntax | 19:23 | |
Numbers, strings, etc | |||
There are a few special terms though, now being the one that comes to mind right away | 19:24 | ||
gfldex | m: my \term:<o.O> = { sub {2*$^a} }; say o.O(42); | 19:25 | |
camelia | rakudo-moar 58dc8c: OUTPUT«sub ($a) { #`(Sub|51211320) ... }» | ||
mst | harmil: I like foo-bar but would prefer FOO_BAR to FOO-BAR because it's easier to type | ||
19:26
Tonik left
|
|||
gfldex | m: my \term:<o.O> = { sub {2*$^a} }; say o.O()(42); | 19:26 | |
camelia | rakudo-moar 58dc8c: OUTPUT«84» | ||
19:29
labster joined
|
|||
gfldex | it seams similar to constant but without restrictions on it's name | 19:29 | |
m: my \term:<.oO> = ¬e; .oO('This is rather odd.'); | 19:31 | ||
harmil | timotimo: no, it seems as if it's the function compositing that's doing that, but yeah, that's the shape of it. | ||
camelia | rakudo-moar 59d808: OUTPUT«This is rather odd.» | ||
harmil | m: my &mapcrement = &map.assuming(*+1); say mapcrement 1,2,3 | ||
camelia | rakudo-moar 59d808: OUTPUT«(2 3 4)» | ||
___ | m: my $x; EVAL "$x" | ||
camelia | rakudo-moar 59d808: OUTPUT«5===SORRY!5=== Error while compiling <tmp>EVAL is a very dangerous function!!! (use the MONKEY-SEE-NO-EVAL pragma to override this error,but only if you're VERY sure your data contains no injection attacks)at <tmp>:1------> 3my $x; EVAL "$…» | ||
___ | harmil: ^ | ||
19:31
bbkr left,
mcmillhj left,
bbkr joined
|
|||
harmil | ___: nice! | 19:32 | |
19:33
addison joined
19:34
avalokite joined,
ambs left
19:35
zacts joined
19:40
firstdayonthejob joined
19:45
addison left
|
|||
harmil | mst: Ah, I see the issue. I get that, but if we're going to prefer snake-case in general, it seems messy to switch for caps... dunno. I could make the case the other way, but I think it's slightly weaker. | 19:48 | |
19:54
kyclark left
19:55
addison joined
|
|||
lambd0x | ls | 19:58 | |
geekosaur | .: No such file or directory | 19:59 | |
lambd0x | geekosaur: rsrs. Why me? | ||
:) | |||
El_Che | good evening/other-time-of-the-day | 20:00 | |
AlexDaniel | o/ | 20:01 | |
20:04
Amnez777 left
20:05
addison left
20:08
ggoebel joined
20:11
Amnez777 joined
20:12
furelypunctional left,
avenj left
20:15
Ven joined
20:16
stanrifkin_ joined
|
|||
stanrifkin_ | what means the "nom" in moar-nom or moar-blead-nom? | 20:16 | |
hoelzro | stanrifkin_: nom is the name of Rakudo's default branch | 20:17 | |
[Coke] | it meant: "new object model" | 20:22 | |
AlexDaniel | by the way, why not call it “master”? | ||
[Coke] | now it's just nom. hasn't been new in many years | ||
AlexDaniel: because we never switched it back. historical reasons. | 20:23 | ||
master is just the default default, so ours is nom. there was talk of changing it, but the inertia is real. | |||
hoelzro | if it bugs you... git symbolic-ref master nom | ||
disclaimer - I have no idea how badly that may break things like fetching and pushing >:) | 20:24 | ||
20:27
addison joined
20:29
CIAvash left
20:35
kaare_ left
20:37
lambd0x left,
bbkr left
|
|||
harmil | Pretty sure nom came from the pugs repo days. | 20:38 | |
Now I can't find a reference to that, and I'm doubting myself.... | 20:39 | ||
El_Che | I am working on a Solaris perl5 package. It would be fun if I could make one for perl6. But no luck with libuv :( | 20:40 | |
timotimo | no, "nom" isn't that old | ||
nom was when what is now known as "sixmodel" appeared, it's the "New Object Model" | 20:41 | ||
hoelzro | judging from git, nom is at least 5 years old | ||
jnthn | I *think* it was probably around 2010 or 2011 | ||
hoelzro | 0998d86 | ||
2011-02-12 | |||
jnthn | It may well have been me who made the branch :) | ||
20:42
sufrostico left
|
|||
hoelzro | I think it was you jnthn: 317ff57 | 20:42 | |
hoelzro kind of wishes dalek would throw in links for commit hashes | |||
jnthn | nom was a huge architectural overhaul; Rakudo's present architecture is a pretty direct descendent of what was introduced then. | 20:43 | |
20:43
sufrostico joined
|
|||
timotimo | that's a testament to how good the architecture is, or how stubborn & boneheaded we are :) | 20:44 | |
jnthn | In changing so much, it also caused a lot of upheavel (and a lot of whining, because darn humans :P). And so master was left as the "original" Rakudo. | ||
Eventually it became rather clear that yes, nom decidedly was the way forward, and the master branch was deleted...leaving nom. | 20:45 | ||
And because git really doesn't care, and everyone was used to this, it stayed that way :) | 20:46 | ||
20:47
acrussell left,
Zoffix left
20:48
dj_goku left,
sufrostico left
|
|||
AlexDaniel | I know that rocks are going to fly into my direction after I say this, but given that it serves no useful information *today*, there's no reason to keep something that only makes people ask questions like “wtf is nom?” | 20:49 | |
timotimo | "come to rakudo, we have nom!" | 20:50 | |
hoelzro | wasn't there talk last year or so about renaming nom to master | ||
? | |||
stanrifkin_ | AlexDaniel: right :) | ||
[Coke] | yes, there was talk about it. | ||
nine | Yes. We came close to gaining momentum for a rename after the GLR but I guess the travels surrounding SPW and YAPC killed it off again. | ||
20:51
kid51 left
|
|||
[Coke] | AlexDaniel: given that github lets you pick a default other than master, it's not really stopping anyone from using the repo | 20:51 | |
And I'll write this convo today up into a wiki entry. | |||
jnthn | I'm quite curious how many folks have scripts that depend on the name nom. I've no idea if, for example, rakudobrew does :) | ||
nine | Nowadays I sometimes git checkout nom on projects where it's actually master ;) | 20:52 | |
AlexDaniel | jnthn: what a nice opportunity to find out! | ||
jnthn | But yeah, I don't *think* anyone was strongly against it, it's just that nearly everyone has more useful things to be doing. :) | ||
Uh, *had. | 20:54 | ||
Last year, during the time of the GLR work and just about everything else. :) | |||
hoelzro | I think the rename is the easy part | ||
jnthn | The muscle memory is the hard part? :) | ||
hoelzro | not breaking scripts and getting every dev to switch to working on master is a bit harder =) | ||
20:54
cpage_ left
|
|||
AlexDaniel | [Coke]: … actually, I think that instead of documenting old warts it is better to work on removing them… | 20:55 | |
jnthn | Yeah, it'll have a non-zero cost :) | ||
otoh, people asking about it every few months does too, so :P | |||
20:55
sufrostico joined
20:57
skids left
|
|||
hoelzro | we could start transitioning by having the core devs add some push refspecs that made master a mirror of nom | 20:59 | |
20:59
holyghost joined
|
|||
hoelzro | and then, once that's working, remove nom on GH and see what happens | 21:00 | |
21:01
kyclark joined,
cpage_ joined
21:04
Ven left
21:05
kurahaupo joined
|
|||
harmil | Doc issue: docs.perl6.org/type/Callable#infix:<∘>_ says that ∘ requires both args to have arity 1, and that's not true: my &mulneg = &prefix:<-> ∘ &infix:<*>; | 21:07 | |
21:07
bbkr joined
|
|||
AlexDaniel | huggable: doc issue | 21:07 | |
huggable | AlexDaniel, github.com/perl6/doc/issues/new | ||
AlexDaniel | harmil: ↑ can you submit it there? | 21:08 | |
harmil | Sure | ||
AlexDaniel | m: my &mulneg = &prefix:<-> ∘ &infix:<*>; say &mulneg(8, 3) | ||
camelia | rakudo-moar 59d808: OUTPUT«-24» | ||
AlexDaniel | m: my &mulneg = &prefix:<*> ∘ &infix:<->; say &mulneg(8, 3) | 21:09 | |
camelia | rakudo-moar 59d808: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Undeclared routine: prefix:<*> used at line 1. Did you mean 'prefix:<~>', 'prefix:<->', 'prefix:<+>', 'prefix:<!>', 'prefix:<|>'?» | ||
21:09
TreyHarr1 left
|
|||
dalek | c: 9a5d53b | (Jan-Olof Hendig)++ | doc/Type/Baggy.pod6: Added docs for Baggy.classify-list |
21:09 | |
21:10
rindolf left
21:11
dvinciguerra_ left
21:12
holyghost left
21:14
slurpy joined
21:15
slurpy left
21:17
ptolemarch left
|
|||
harmil | m: my sub prefix:<for>(&block) { block() }; &prefix:<for>({ say 1}) | 21:18 | |
camelia | rakudo-moar 59d808: OUTPUT«1» | ||
harmil | m: my sub prefix:<for>(&block) { block() }; for {say 1} | ||
camelia | rakudo-moar 59d808: OUTPUT«5===SORRY!5===Expression needs parens to avoid gobbling blockat <tmp>:1------> 3x:<for>(&block) { block() }; for {say 1}7⏏5<EOL>Missing block (apparently claimed by expression)at <tmp>:1------> 3x:<for>(&block) { block() }; for…» | ||
harmil | I was sad, but not shocked ;-) | ||
21:18
rindolf joined
21:19
FROGGS left
21:21
holyghost joined
|
|||
holyghost | m: say "do" or "die" | 21:21 | |
camelia | rakudo-moar 59d808: OUTPUT«do» | ||
21:22
spider-mario left
21:23
cdg left
|
|||
dalek | c: f0a5384 | (Jan-Olof Hendig)++ | doc/Type/Baggy.pod6: Fixed typo |
21:23 | |
21:25
TEttinger joined
21:28
cpage_ left
21:33
cpage_ joined
21:35
furelypunctional joined,
cpage_ left
21:38
cpage_ joined
21:39
TreyHarr1 joined
21:44
holyghost left
21:45
kyclark left
21:49
stmuk_ left
22:00
stanrifkin_ left
22:01
stmuk_ joined
22:03
holyghost joined
|
|||
holyghost | m: say dir "or" do | 22:04 | |
camelia | rakudo-moar 59d808: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Two terms in a rowat <tmp>:1------> 3say dir "or"7⏏5 do expecting any of: infix infix stopper postfix statement end statement modifier …» | ||
22:06
pmqs_ left,
vike joined
22:08
sufrostico left
22:09
avenj joined,
avenj left,
avenj joined
|
|||
P6fr | m: $date-of-birth = "21/07/2016".split("/") | 22:15 | |
22:15
TreyHarr1 left
|
|||
camelia | rakudo-moar 59d808: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Variable '$date-of-birth' is not declaredat <tmp>:1------> 3<BOL>7⏏5$date-of-birth = "21/07/2016".split("/")» | 22:15 | |
P6fr | m: my $date-of-birth = "21/07/2016".split("/") | ||
camelia | ( no output ) | ||
P6fr | m: my $date-of-birth = "21/07/2016".split("/").say | ||
camelia | rakudo-moar 59d808: OUTPUT«(21 07 2016)» | ||
22:16
kyclark joined
|
|||
P6fr | how to do to take $1 ? | 22:16 | |
(21) | |||
pls | |||
without passing by a array | 22:17 | ||
gfldex | m: my $date-of-birth = "21/07/2016".split("/")[0]; dd $date-of-birth; | ||
camelia | rakudo-moar 59d808: OUTPUT«Str $date-of-birth = "21"» | ||
P6fr | woooow | ||
i love p6 | |||
<3 | |||
dd ?? | 22:18 | ||
22:18
skids joined
|
|||
gfldex | build in datadump function | 22:18 | |
22:19
bbkr_ joined
|
|||
gfldex | success! one page doc works with proper linkage now, preview: raw.githubusercontent.com/gfldex/p...html.xhtml | 22:19 | |
CSS needs quite some work | |||
lizmat | P6fr: dd is the Tiny Data Dumper: so tiny it lost the T | ||
geekosaur | much better that Data::Dumper->Dump :p | 22:20 | |
*than | |||
22:21
bbkr left,
pmqs_ joined
22:22
pmurias left
22:24
TreyHarr1 joined
22:30
acrussell joined
22:41
huggable left,
dj_goku joined,
huggable joined,
firstdayonthejob left,
jack_rabbit left,
jack_rabbit joined
22:42
acrussell left
|
|||
tbrowder | zoffix: i think i have a good solution based on your suggestions. however, my new tests are not valid with the current nom (hopefully soon to be renamed master) branch, so i will present them after i get my GTPR (Grand Table Pod Refactor project ready for a PR. | 22:48 | |
timotimo | tbrowder: oh, cool. have you seen the code i built like 2 years ago for that purpose? | 22:49 | |
man, i wonder if i still have that | |||
ugexe | wheres my damn data dumper that outputs the Big O of a block? | 22:50 | |
timotimo | tbrowder: gist.github.com/timo/6132249 | ||
m: gist.github.com/timo/6132249 | 22:51 | ||
camelia | rakudo-moar 59d808: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Can only use 'is rw' on a scalar ('$' sigil) parameterat <tmp>:10» | ||
timotimo | oops | ||
m: gist.github.com/timo/6132249 | |||
camelia | rakudo-moar 59d808: OUTPUT«5===SORRY!5=== Error while compiling <tmp>Can only use 'is rw' on a scalar ('$' sigil) parameterat <tmp>:38» | ||
timotimo | m: gist.github.com/timo/6132249 | 22:52 | |
camelia | rakudo-moar 59d808: OUTPUT«Superhero, 4Secret, 38Identity, 20Superpower, 38[["Superhero"], "Identity", ["Secret"]]2The Shoveller, 4[Any]0Eddie Stevens, 20[["The Shoveller"],]1King Arthur's, 38[["The Shoveller"], ["Eddie Stevens"]]2singing…» | ||
timotimo | \o/ | ||
hm, i thought i had code in there for handling multi-line formatting codes | 22:53 | ||
i don't seem to, though | |||
tbrowder | timotimo: I don't think I had seen that, but I have seen ShimmerFairy's grammar project. My effort is to mod the sub table in Pod.npq to do the right thing with the list of table rows that comes with the table match object--no change in grammar required. | 22:54 | |
timotimo | OK | 22:55 | |
i'll go to bed now | |||
tbrowder | But the grammar change would be the best way to go someday i think, but not so easy IMHO. | 22:56 | |
AlexDaniel prepares for another portion of rocks for github.com/perl6/doc/issues/728 | 22:59 | ||
23:01
Actualeyes joined
|
|||
kyclark | If I 'fail "foo"' out of a sub, how do I get the failure message (foo) from the caller? | 23:03 | |
m: sub t { fail 'foo' }; say t; | |||
camelia | rakudo-moar 59d808: OUTPUT«foo in sub t at <tmp> line 1 in block <unit> at <tmp> line 1Actually thrown at: in block <unit> at <tmp> line 1» | ||
ugexe | AlexDaniel: why not allow bisectable to be msg'd? | ||
23:05
TreyHarr1 left
|
|||
AlexDaniel | ugexe: good question. Basically I'm scared of people trying to crap over my server (restricted setting is no help). It would've been better if I wasn't lazy and had an LXC container set up or something. Until then (or until I finally find enough time to move it to hack) you probably have to use #perl6-dev, I guess. | 23:08 | |
geekosaur | m: sub t { fail 'foo' }; my $x = t; if $x ~~ Failure { say "whoops: {$x.exception.message}" } # kyclark | ||
camelia | rakudo-moar 59d808: OUTPUT«whoops: foo» | ||
23:12
frew joined,
TimToady left
23:13
TimToady joined
|
|||
mspo | AlexDaniel: isn't the search powered by a big static list of terms that gets generated somehow? | 23:14 | |
AlexDaniel | mspo: yeah. Why would you ask? | 23:15 | |
gfldex | it's generated for all but 2 entries | 23:17 | |
mspo | == new glossary? | 23:18 | |
23:23
kyclark left
|
|||
AlexDaniel | This is funny: en.wikipedia.org/wiki/Talk:Larry_W...rl_creator | 23:26 | |
mspo | I wonder if TimToady can satisfy the [citation needed] for his birthday | 23:31 | |
en.wikipedia.org/wiki/Larry_Wall | |||
23:37
kyclark joined
23:39
kurahaupo left
23:40
wamba left
23:41
kurahaupo joined
23:45
kurahaupo left
23:49
kyclark left
23:58
khw left
|