Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2014-12-25

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:00 Timbus naddiseo, .can
00:01 Timbus m: class Foo { method bar($a, :@b) { [@b, $a] } }; my @c = (1,2,3); my &f := Foo.^can('bar')[0].assuming(b => @c); say Foo.&f(4);
00:01 camelia rakudo-moar e86167: OUTPUT«1 2 3 4␤»
00:02 Timbus its still a list, but only a problem if theres multimethods
00:06 erkan joined #perl6
00:07 Timbus naddiseo, but why is it a method and not a sub?
00:09 Timbus if its gotta be a method, just remember they're subs with an extra parameter
00:09 * raydiak is mildly surprised that he cannot find in the design docs some syntactic twist which means "return the routine after dispatch resolution, instead of calling it"
00:10 Timbus m: class Foo { method bar($a, :@b) { [@b, $a] } }; my @c = (1,2,3); my &f := Foo.^can('bar')[0].assuming(Foo, b => @c); say f(4);
00:10 camelia rakudo-moar e86167: OUTPUT«1 2 3 4␤»
00:11 Timbus raydiak, i agree
00:12 Timbus but  from what little I know, the only way is can, or find_method, and then you use .cando on the multi to find the candidate
00:13 Timbus .cando takes a Capture of the parameters
00:15 Timbus oh, there was another way.. uh.
00:15 Timbus m: my $m; class A { $m = method foo() {42} }; say $m(A)
00:15 camelia rakudo-moar e86167: OUTPUT«42␤»
00:15 Timbus yeah
00:16 raydiak that is the least awkward way I've seen so far
00:16 raydiak .WALK makes a 4th less-than-optimal solution :)
00:16 Timbus using the metamodel is always awkward
00:16 Timbus but the multis make it especially so
00:19 Timbus +1 for a gimmie-the-method way to do it
00:22 telex joined #perl6
00:30 Timbus m: class A { method gimmie-the-method() { method foo {42} } }  my $a = A.gimmie-the-method; say $a(A); say A.foo
00:30 camelia rakudo-moar e86167: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/nlxcbfKHTrâ�¤Two terms in a rowâ�¤at /tmp/nlxcbfKHTr:1â�¤------> [32mmie-the-method() { method foo {42} } }  [33mâ��[31mmy $a = A.gimmie-the-method; say $a(A); [0mâ�¤    expecting any of:â�¤    â€¦Â»
00:30 Timbus aw
00:30 Timbus m: class A { method gimmie-the-method() { method foo {42} } };  my $a = A.gimmie-the-method; say $a(A); say A.foo
00:30 camelia rakudo-moar e86167: OUTPUT«42␤42␤»
00:31 raydiak m: class Foo { my &.barref = method bar () {}; }; say Foo.bar; say Foo.barref
00:31 camelia rakudo-moar e86167: OUTPUT«Nil␤bar␤»
00:31 raydiak m: class Foo { my &.barref = method bar () {42}; }; say Foo.bar; say Foo.barref
00:31 camelia rakudo-moar e86167: OUTPUT«42␤bar␤»
00:31 Timbus haha
00:44 atroxaper joined #perl6
00:44 raydiak m: class A { our method foo () {42} }; my &a = &A::foo; a
00:44 camelia rakudo-moar e86167: OUTPUT«Too few positionals passed; expected 1 argument but got 0␤  in method foo at /tmp/VR7q0N6a9c:1␤  in block <unit> at /tmp/VR7q0N6a9c:1␤␤»
00:44 raydiak m: class A { our method foo () {42} }; my &a = &A::foo; A.&a
00:44 camelia rakudo-moar e86167: ( no output )
00:46 raydiak m: class A { our method foo () {42} }; my &a = &A::foo; A.&a.say # you know what I mean :)
00:46 camelia rakudo-moar e86167: OUTPUT«42␤»
00:49 Timbus hmmm
01:03 raydiak m: say 42 # factored that nasty problem out of my elegant solution...
01:03 camelia rakudo-moar e86167: OUTPUT«42␤»
01:04 BenGoldberg joined #perl6
01:27 KCL_ joined #perl6
01:31 wobblingjelly joined #perl6
01:31 wobblingjelly left #perl6
01:42 ninjazach joined #perl6
01:50 yeahnoob joined #perl6
02:20 rmgk_ joined #perl6
02:27 Spot__ joined #perl6
02:38 atroxaper joined #perl6
02:50 zmisc joined #perl6
03:12 Mso150_f_x joined #perl6
03:51 noganex_ joined #perl6
03:58 atroxaper joined #perl6
04:01 systemd-borg left #perl6
04:18 jack_rabbit joined #perl6
04:21 jack_rabbit joined #perl6
04:28 raiph joined #perl6
04:38 colomon joined #perl6
04:56 dj_goku joined #perl6
05:08 dj_goku_ joined #perl6
05:18 dj_goku joined #perl6
05:18 dj_goku joined #perl6
05:19 baest_ joined #perl6
05:46 naddiseo Timbus: it doesn't have to be a method, but I was getting "No such method 'bar' for invocant of type 'Foo'" if I use "sub"
05:48 naddiseo raydiak: that "our" solution is neat, thanks!
05:49 atroxaper joined #perl6
05:49 Timbus well, i mean why is it a method. are you using the class?
05:50 naddiseo Yeah, I'm using the class. the sub/method returns a new instance of the class, so I thought it belongs there.
05:51 naddiseo class A { sub foo($a, :@b) { return A.new($a, @b); }; method new { ... } }
05:52 Timbus oh, i see
05:57 Timbus .. so do you want to call it without using the class name?
05:58 cosimo joined #perl6
05:59 bowtie joined #perl6
05:59 PerlJam joined #perl6
05:59 naddiseo No, I wanted to call it without explictly passing that last parameter.
05:59 MilkmanDan joined #perl6
06:00 naddiseo If I were to write it in python, it'd look like: http://ideone.com/wv0viQ
06:01 yakudza joined #perl6
06:13 bowtie_ joined #perl6
06:15 dayangkun joined #perl6
06:19 mr-foobar joined #perl6
06:19 Timbus naddiseo, ooh okay
06:24 Timbus well since 'reducer' is just a helper method, why not export it as a sub?
06:24 perlpilot joined #perl6
06:25 naddiseo Yeah, I've done that now. Originally I was referring to it via &(Tree.reducer) so it was giving that "not such method reducer for invocant of type Tree" error
06:25 naddiseo changing to "method" fixed that.
06:25 naddiseo But, now I've changed 'our sub reducer', it works as expected.
06:25 Timbus well i meant like..  class Foo { sub bar($a) is export { Foo.new(a => $a) }; };
06:26 naddiseo Hm, ok., how do I refer to it outside the class?
06:26 Timbus then you can just use bar()
06:26 naddiseo Didn't know I could do that.
06:26 Timbus if your class is in the same file, youll need to import Foo;
06:27 Timbus (you won't if its in another file since use Foo; will handle that)
06:28 bowtie_ joined #perl6
06:28 naddiseo ^_^
06:29 naddiseo Now everything works, and is ~2 lines of code compared to my earlier naive approach that was ~25
06:29 naddiseo Thanks,
06:29 Timbus neat
06:29 naddiseo now I can go to bed without having to think about that.
06:29 naddiseo So, thanks again, and happy holidays.
06:29 Timbus you too
06:41 bowtie_ joined #perl6
06:49 davido_ joined #perl6
06:50 moritz \o good morning
06:50 bowtie_ joined #perl6
06:51 moritz masaq: should I kill your irssi session on feather?
06:54 atroxaper joined #perl6
07:12 bowtie joined #perl6
07:23 darutoko joined #perl6
07:45 kaare_ joined #perl6
07:52 mtj_ joined #perl6
07:52 jdurand joined #perl6
07:52 xfix joined #perl6
07:52 petercommand joined #perl6
07:53 sunnavy joined #perl6
08:05 andreoss left #perl6
08:19 lue joined #perl6
08:19 darutoko- joined #perl6
08:19 kjs_ joined #perl6
08:24 Mso150_f_x joined #perl6
08:31 mickcy_ca joined #perl6
08:31 mickcy_ca Merry Christmas to all!
08:32 mickcy_ca And ... anyone on here that knows postgresql and connecting to Perl 6
08:33 mickcy_ca Maybe with DBIish or DB::ORM::Quicky
08:34 moritz DBIish worked pretty well with postgres, last I tried
08:35 mickcy_ca moritz: Do you know if I need anything but the basic database to get this to work?
08:36 moritz mickcy_ca: what's "the basic database"?
08:37 mickcy_ca postrgresql 9.3 Ubuntu packages ... Do I need the perl drivers?
08:38 moritz no
08:38 moritz you need the client library
08:38 mickcy_ca Looking at the synopsis ... it is clear how to connect to SQlite, by I see no information on other databases.
08:39 mickcy_ca I have the client installed.
08:39 awoodland joined #perl6
08:40 moritz driver is 'Pg', you can pass host, port, database, user and password
08:40 mickcy_ca Thank you ... that is what I was looking for.
08:40 moritz I guess we do need better documentation for the other drivers
08:41 mickcy_ca That would be appreciated, as if it were there, I would not be bothering you today.
08:42 moritz mickcy_ca: did you read the README.pod? or the pod in lib/DBIish.pm6?
08:42 xfix "Missing <user> config"
08:42 xfix Hm, I have a question, why Pg DBIish requires specifying an user?
08:43 mickcy_ca I need lib/DBIish.pm6
08:44 mickcy_ca moritz: I have all that I need at this end now.
08:45 xfix How to get username in Perl 6?
08:45 moritz xfix: which username?
08:45 xfix Current user
08:45 moritz xfix: do you want to connect via local socket/pipe?
08:46 xfix Yep.
08:46 moritz xfix: then you'll have to patch DBDish::Pg
08:46 xfix Oh, right, just not specify user and password.
08:46 moritz currently it always connects via network
08:47 xfix Ok, gonna do that.
08:47 moritz currently Pg.pm6 always includes the host
08:47 xfix Ok, gonna fix it so it could connect using UNIX sockets.
08:47 moritz and uses localhost if nonis specified
08:47 moritz *none is
08:48 moritz a good solution would be to only require username and password when the host is als specified
08:48 xfix With trust setting, password is not needed, but who would use trust for external networks?
08:50 rurban joined #perl6
08:54 mickcy_ca Okay ... from postgresql to unix domain sockets ... I see lots of P5 examples, any Perl6 options?
08:55 mickcy_ca What I mean is are there any options to connect and transfer information on Unix Domain Sockets.
08:56 mickcy_ca IO::Socket::INET?
08:56 virtualsue joined #perl6
09:04 mickcy_ca I send questions before research ... Sorry to all ... I am still pretty new to Perl 6 and am wondering how I can get that which a method found using .^methods needs for operation.  The only way I know to try is to run the code and hopefully debug what exactly is required.
09:06 kjs_ joined #perl6
09:10 dalek DBIish: b56f4e1 | (Konrad Borowski)++ | lib/DBDish/Pg.pm6:
09:10 dalek DBIish: Support local PostgreSQL connections.
09:10 dalek DBIish: review: https://github.com/perl6/DBIish/commit/b56f4e1ebd
09:11 sunnavy joined #perl6
09:11 dakkar joined #perl6
09:12 xfix (by the way, it appears that connections to non-existant databases make a wrong error, even before my change.
09:12 xfix Quite odd...
09:13 xfix Cannot look up attributes in a type object, when the object is OpaquePointer.new(170331840).
09:14 xfix Oh, right, I'm calling DBIish incorrectly.
09:16 moritz mickcy_ca: well, the canonical answer is to consult the documentation. http://perl6.org/documentation/ has some pointers, and between doc.perl6.org and design.perl6.org, most methods that are part of the public API should be covered
09:17 petercommand joined #perl6
09:19 dalek DBIish: 6c3f394 | (Konrad Borowski)++ | lib/DBDish/Pg.pm6:
09:19 dalek DBIish: Properly handle all internal values.
09:19 dalek DBIish:
09:19 dalek DBIish: DBDish puts keys like AutoCommit, which DBDish::Pg doesn't use as of now.
09:19 dalek DBIish: However, they still have to be handled somehow.
09:19 dalek DBIish: review: https://github.com/perl6/DBIish/commit/6c3f39455c
09:19 mickcy_ca moritz: I just need to dig deeper ...
09:19 xfix (it was a while since I programmed Perl 6, and I do silly mistakes... oh well)
09:26 dalek DBIish: 925b33a | (Konrad Borowski)++ | lib/DBDish/Pg.pm6:
09:26 dalek DBIish: Disable all PostgreSQL connection keys with nonlowercase characters.
09:26 dalek DBIish:
09:26 dalek DBIish: My previous change allowed keys like `!@#$`. While such keys shouldn't be
09:26 dalek DBIish: dangerous, as PostgreSQL would refuse those, they are completely pointless.
09:26 dalek DBIish: review: https://github.com/perl6/DBIish/commit/925b33aeaf
09:27 xfix Ok, now PostgreSQL correctly reports errors. That's how it should work.
09:28 xfix NativeCall is neat.
09:29 xfix I once have said that LuaJIT FFI is neat, but this is even easier to use.
09:31 moritz jnthn++, arnsholt_++ # nativecall
09:32 xfix sub PQresultStatus (OpaquePointer $result) returns Int is native(lib) { ... }
09:32 xfix This is amazing.
09:32 xfix OpaquePointer is void *, right?
09:33 Timbus well its any kind of pointer
09:33 xfix Which is what void * star.
09:33 xfix s/star/is/
09:34 moritz well, at run time, there are just pointers
09:34 Timbus thats true
09:34 moritz void * vs int * vs ... is just C compile time
09:34 moritz pointer type erasure!
09:35 xfix Yes, I know, C pointers don't know their types.
09:36 xfix And you don't know if arbitrary location in memory is a pointer, an 64-bit integer, a double floating point number, or whatever else it is
09:40 atroxaper joined #perl6
09:50 sqirrel_ joined #perl6
09:56 atroxaper joined #perl6
10:03 Akagi201 joined #perl6
10:03 xfix r: use v7
10:03 camelia rakudo-{parrot,moar} e86167: ( no output )
10:03 xfix In my opinion, this should make an error.
10:07 moritz yes
10:07 moritz known issue
10:07 moritz feel free to patch :-)
10:08 moritz (though in a way that doesn't break v5)
10:09 xfix Of course.
10:10 xfix https://github.com/rakudo/rakudo/blo​b/8154bd396afb7ca30a53e702d301996fb4​460a91/src/Perl6/Grammar.nqp#L1579
10:10 xfix Let's see...
10:10 xfix I want stuff like v6.3.4 and v7 to be disallowed, but without disallowing use v5.10.
10:10 xfix (and use v6.0.0 should be allowed)
10:10 xfix (as well as use v6)
10:12 xfix Now I need to analyze how to report an error from "use" statement.
10:13 spider-mario joined #perl6
10:13 xfix r: use v6.;
10:13 camelia rakudo-{parrot,moar} e86167: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/tmpfile�Missing semicolon.�at /tmp/tmpfile:1�------> [32muse v6.[33m�[31m;[0m�»
10:13 xfix So, the semicolon is missing between "." and ";".
10:15 mickcy_ca How do I encode to utf-8
10:16 moritz $str.encode('UTF-8')
10:18 mickcy_ca Thanks ...
10:23 masaq good antenoon, #perl6
10:23 masaq we have snow! \o/
10:23 moritz good *, masaq
10:23 moritz tidelibom
10:24 mickcy_ca Snow here too.
10:29 dalek DBIish: 833eeaf | moritz++ | / (2 files):
10:29 dalek DBIish: Add some docs, mickcy_ca++
10:29 dalek DBIish: review: https://github.com/perl6/DBIish/commit/833eeaf3d8
10:29 xfix moritz, what do you think should be exception name for invalid use?
10:29 xfix Like "use v7".
10:30 moritz xfix: X::Language::Unsupported maybe
10:30 mickcy_ca dalek: Great work.
10:30 xfix Good.
10:30 mickcy_ca Off to bed ... 03:31 where I am.
10:31 moritz good night mickcy_ca, and dream of well-documented drivers :-)
10:31 mickcy_ca Will Do.
10:31 mickcy_ca left #perl6
10:32 moritz masaq: should I kill your irssi and/or screen session on feather?
10:32 moritz masaq: or re-enable your login so that you can terminate it gracefully?
10:33 andreoss joined #perl6
10:35 andreoss m: use Shell::Command;
10:35 camelia rakudo-moar e86167: OUTPUT«===SORRY!===␤Could not find Shell::Command in any of: /home/camelia/rakudo-inst-2/languages/perl6/lib, /home/camelia/rakudo-inst-2/languages/perl6␤»
10:35 moritz star: use Shell::Command
10:35 camelia star-{m,p} 2014.09: ( no output )
10:36 andreoss Shell::Command and panda are broken with 2014.12
10:37 moritz andreoss: in what way?
10:37 moritz andreoss: and on what backend
10:37 xfix How can I disable Rakudo optimizations. Modifying grammar makes it build for a long time.
10:37 moritz --optimize=off
10:38 andreoss % perl6 -e 'use Shell::Command;'
10:38 andreoss Segmentation fault (core dumped)
10:38 andreoss
10:38 andreoss % panda
10:38 andreoss ===SORRY!===
10:38 andreoss Segmentation fault (core dumped)
10:38 andreoss
10:38 moritz andreoss: which backend is that?
10:39 andreoss moritz: moarvm
10:39 andreoss This is perl6 version 2014.12-34-ge861672 built on MoarVM version 2014.12
10:39 moritz so pretty new
10:39 moritz I thought you meant the release
10:40 andreoss the release is a branch in git?
10:41 moritz no, a tag
10:41 xfix Should I use typed_sorry or typed_panic?
10:41 moritz xfix: panic
10:41 xfix (I assume typed_panic, because reporting errors for Perl 7 code is pointless)
10:42 moritz andreoss: trying with that revision now
10:43 moritz andreoss: works here; most likely you have some old files in your install directory somewhere
10:43 moritz andreoss: try cleaning it out, and the sour dir too, and rebuild from scratch
10:48 sqirrel_ joined #perl6
10:53 rurban joined #perl6
10:54 masaq moritz: preferably re-enable, thank you. sorry for the trouble... :/
10:59 xfix Is there a way to make grammar compilation faster?
10:59 moritz xfix: yes, through lots of optimizations
11:00 moritz masak: login shell reset to /bin/bash
11:00 xfix I don't want to wait 2 minutes for each recompilation (I guess I just should buy a better computer).
11:00 pmurias joined #perl6
11:01 pmurias hi
11:01 xfix hi
11:03 pmurias what would be the best way to create a android app with javascript (which is in turn created with nqp-js)?
11:03 pmurias phonegap?
11:05 xfix xfix@papaya ~/P/rakudo> ./perl6-m -e 'use v6.0.5'
11:05 xfix ===SORRY!=== Error while compiling -e
11:05 xfix No compiler available for Perl v6.0.5
11:05 xfix ok
11:06 kjs_ joined #perl6
11:06 xfix By the way, I have a question
11:06 xfix [ <?{ ~$<version><vnum>[0] eq '6' }> {
11:06 xfix Should it check for string? This makes `use v06` unrecognized as Perl 6.
11:07 moritz comparing by string is fine, I think
11:08 masak joined #perl6
11:09 masak \o/
11:09 masak back in the correct spelling again!
11:09 masak moritz++
11:09 xfix Should 'use v05' be recognized as Perl 5 or not?
11:09 xfix What about 'use v4'?
11:11 FROGGS joined #perl6
11:13 FROGGS[tab] joined #perl6
11:14 pmurias m: use v4;
11:14 camelia rakudo-moar e86167: ( no output )
11:14 pmurias m: use v4;say("hi")
11:14 camelia rakudo-moar e86167: OUTPUT«hi␤»
11:14 pmurias m: use v5;say("hi")
11:14 camelia rakudo-moar e86167: OUTPUT«===SORRY!===␤Could not find Perl5 in any of: /home/camelia/rakudo-inst-2/languages/perl6/lib, /home/camelia/rakudo-inst-2/languages/perl6␤»
11:15 xfix Or should "use v4" be an error. It's not that actual Perl 4 ever accepted this syntax.
11:15 xfix Hm, let's go with "use v4" being an error.
11:20 FROGGS raydiak: ping
11:21 FROGGS .tell raydiak https://github.com/rakudo/rakudo/commit/​50ff378fb8b3390614fbe28b3b97028daabc548f
11:21 yoleaux FROGGS: I'll pass your message to raydiak.
11:29 pmurias perl5 accepts v4
11:30 pmurias 'use v4' is legal perl5
11:30 xfix Sure, but actual Perl 4 doesn't accept "use v4".
11:31 xfix Besides, currently "use v4" is interpreted as absolutely nothing.
11:31 xfix (which means running in v6 mode)
11:35 FROGGS I'd say that every major version except 6 in a use statement should try to load that module
11:35 xfix Even v7?
11:35 FROGGS sure
11:35 FROGGS why not?
11:35 FROGGS like, 'v6' is built in, but everything else needs to be loaded
11:36 xfix Ok, so "v4" should be Perl5.
11:36 FROGGS Perl 4 actually
11:37 xfix Do you think anyone will write Perl4 module?
11:37 xfix (IMO, Perl 5 is reasonably compatible with Perl 4)
11:37 FROGGS I have no idea if somebody will do that
11:37 xfix (and "use v4" is not a valid syntax in Perl 4)
11:38 FROGGS that does not matter...
11:38 FROGGS 'use COBOL' is also not valid in COBOL I guess
11:38 xfix Uhm...
11:41 xfix Could not find Perl4 in any of: /home/xfix/Build-dev/languages/perl6/lib, /home/xfix/Build-dev/languages/perl6
11:41 xfix Do you seriously propose this?
11:45 FROGGS why not?
11:46 pmurias checking for a Perl4 seems resonable
11:47 pmurias we might want to have a better error message if it's missing
11:49 xfix Anyway, https://rt.perl.org/Public/​Bug/Display.html?id=123496
11:52 pmurias OTOH 'use v4' in Perl 5 means Perl 4 or higher
11:59 xfix r: Inf.Int
11:59 camelia rakudo-parrot e86167: OUTPUT«Cannot coerce Inf or NaN to an Int␤current instr.: 'throw' pc 489664 (src/gen/p-CORE.setting.pir:202104) (gen/parrot/CORE.setting:12241)␤called from Sub 'sink' pc 533358 (src/gen/p-CORE.setting.pir:218004) (gen/parrot/CORE.setting:13817)␤called fro…»
11:59 camelia ..rakudo-moar e86167: OUTPUT«Unhandled exception: Cannot coerce Inf or NaN to an Int␤   at <unknown>:1  (/home/camelia/rakudo-inst-2/languages/perl6/r​untime/CORE.setting.moarvm:throw:4294967295)␤ from src/gen/m-CORE.setting:13877  (/home/camelia/rakudo-inst​-2/languages/perl6/runti…»
12:15 psch joined #perl6
12:15 rindolf joined #perl6
12:15 psch merry christmas, #perl6 o/
12:16 moritz \o psch, mery christmas to you too
12:24 erkan joined #perl6
12:25 erkan joined #perl6
12:32 sqirrel_ joined #perl6
12:33 kjs_ joined #perl6
12:34 zakharyas joined #perl6
12:43 mvuets joined #perl6
12:49 erkan joined #perl6
12:54 atroxaper joined #perl6
13:00 TheovandenHeuvel joined #perl6
13:08 erkan joined #perl6
13:14 timotimo merry christmas, dear perl6ers
13:14 telex joined #perl6
13:15 colomon Merry Christmas!
13:18 TheovandenHeuvel HI, can anyone point me to info on destructors? Can;t seem to find any.
13:19 atroxaper joined #perl6
13:24 timotimo there's only a DESTROY implementation on MoarVM
13:24 timotimo and even then it's not guaranteed to run
13:24 xfix It's an issue with garbage collectors, you don't know when they get called.
13:24 psch DESTROY was implemented for some marshalling case for Inline::Perl5, wasn't it?
13:25 psch something with refcounting in perl5 or so ISTR
13:26 xfix I wonder, does Perl 6 have some syntax to handle destruction of objects...
13:26 xfix (Python has with for that purpose)
13:27 KCL joined #perl6
13:27 moritz xfix: well yes, DESTROY
13:27 TheovandenHeuvel Ok. I wanted to associate a side effect with the end of scope. I will have to think of another approach.
13:27 moritz TheovandenHeuvel: LEAVE phasers
13:28 TheovandenHeuvel Ahh. Great.
13:28 moritz m: for ^3 { .say; LEAVE say "leaving $_" }
13:28 camelia rakudo-moar e86167: OUTPUT«0␤leaving 0␤1␤leaving 1␤2␤leaving 2␤»
13:28 psch m: { say "doing things" for 1..((^5).pick); LEAVE { say "done doing things" } }
13:28 camelia rakudo-moar e86167: OUTPUT«doing things␤doing things␤doing things␤done doing things␤»
13:28 psch moritz++ # for the less weird example :P
13:29 xfix By the way, why Perl 6 specification doesn't mention DESTROY anywhere, and the only reference to it is one test in roast?
13:30 moritz xfix: yes, it has been unspecced and needs to be respecced
13:41 erkan joined #perl6
13:50 masak what's the magic Unix command to make hack.p6c.org play better with UTF-8? it's been too long since I last did this -- don't even know what to Google for. :)
13:51 moritz masak: http://perlgeek.de/en/article/s​et-up-a-clean-utf8-environment
13:51 moritz masak: UTF-8 locales are installed, so you can skip this part :-)
13:52 xfix Set up LANG environment variable.
13:52 erkan left #perl6
13:52 xfix For example, en_US.UTF-8
13:52 masak moritz++
13:53 moritz with screen, that's sometimes not enough
13:53 xfix alias screen='screen -U' IMO.
13:53 masak oh, I always run screen with -U
13:53 moritz /set term_charset utf-8
13:54 moritz /set recode_autodetect_utf8 ON
13:54 moritz if you use irssi
13:54 xfix Unicode is so hard.
13:54 moritz /set recode ON
13:54 moritz xfix: getting better
13:54 masak hm, I've now done all this, but the newlines from camelia still come out as "NL" :/
13:55 moritz masak: then it might be a missing font
13:55 moritz masak: if it were an UTF-8 problem, it would come out as Mojibake instead
13:55 masak well, it worked on feather, and I haven't changed fonts.
13:55 xfix »ö« is purely ISO-8859-1, I don't think it's font problem ;-).
13:55 masak camelia in the topic comes out as >>o<<
13:56 moritz ouch
13:56 xfix Then your client converts characters into ASCII.
13:56 masak yes, thank you.
13:56 masak that much is clear.
13:57 moritz masak: do the usual debugging steps: first copy&paste on your terminal; if that works, do the ssh to hack and test there again; if that works, test it inside screen too
13:57 xfix /set term_charset utf-8
13:57 xfix Oh wait, moritz already gave this command.
13:58 xfix I'm somewhat curious what the issue is, but I don't have feather server access, and screen in my system supports Unicode without specifying -U.
13:59 moritz masak: oh, irssi has the recode_transliterate option; you might want to try to switch that off
14:00 xfix That's probably why.
14:00 xfix Except recode_transliterate should only trigger when the character set doesn't have a character.
14:00 xfix So probably disabling it will make "?" appear instead.
14:01 moritz "If enabled, irssi tells iconv to try and replace characters that don't recode well with similar looking ones that exist in the target character set."
14:01 moritz now it'd be interesting to know what "don't recode well" means
14:01 masak test: ☺
14:01 xfix Doesn't exist in target character set.
14:01 xfix :-)
14:02 masak that comes out right in the irc logs.
14:02 xfix Read UTF-8 correctly.
14:02 masak but it looks like question mark, X, question mark on my monitor.
14:02 moritz tromsø
14:02 masak yep, got the ø correctly.
14:03 masak that one looks right. only the ☺ doesn't.
14:03 FROGGS »ö«
14:03 xfix question mark, X, and question mark... hm...
14:03 moritz the difference is that ø is in Latin-1, the ☺ doesn't
14:03 masak FROGGS: looks fine, too.
14:03 FROGGS that's enough then :o)
14:03 moritz as are » and «
14:03 xfix ☺ is 0xE2 0x98 0xBA.
14:03 FROGGS m: say "a" ~~ /a/
14:03 masak even the ☺ looks fine as long as it is on my input line in irssi. when it ends up in the backlog in irssi, it turns wrong. :/
14:04 camelia rakudo-moar e86167: OUTPUT«「a」␤␤»
14:04 FROGGS that might be important to see right
14:04 masak oh, now the camelia newlines show up as question-mark, P, question-mark. improvement :)
14:05 xfix 0x98 is ~ in Windows-1252...
14:05 moritz masak: ok, at least now we know it's an irssi issue, not screen or locale
14:05 masak but the camelia logo in the topic is still ">>o<<"
14:05 xfix Odd.
14:05 xfix masak, probably wasn't refreshed, or something.
14:06 moritz masak: the irssi versions on feather and hack differ only slightly. Might I suggest you rsync your .irssi dir from feather to hack?
14:06 moritz unless you've already done that, of course :-)
14:06 masak that's a good idea. will do.
14:08 masak joined #perl6
14:09 masak m: say 3
14:09 camelia rakudo-moar e86167: OUTPUT«3␤»
14:09 masak ok, back to "NL".
14:09 masak grr
14:10 masak Unicode is not my friend today.
14:14 moritz ansible all -m apt -a 'update_cache=yes upgrade=yes' # ♥
14:22 xfix Old feather feels so dead. Only I'm online...
14:26 sergot masak: ping :)
14:28 masak sergot: pong
14:29 xfix Hm... >>?<<
14:31 xfix masak, can you run `/script exec print $ENV{LANG}`, and check main buffer?
14:31 masak xfix: en_US.UTF-8
14:32 xfix As it should be. Odd...
14:33 mvuets joined #perl6
14:41 BenGoldberg joined #perl6
14:59 koo6 joined #perl6
15:09 xfix moritz, sent you an e-mail
15:16 davido_ joined #perl6
15:23 rindolf joined #perl6
15:34 zakharyas joined #perl6
15:39 * arnsholt_ now has to learn group theory, due to Christmas
15:40 arnsholt_ Yay, I guess? :-D
15:40 masak yay! \o/
15:40 masak arnsholt_: I am here for all your group theory needs :D
15:41 arnsholt_ Good to know :-)
15:41 arnsholt_ Although I'll persevere for a bit longer before resorting to cheat codes
15:42 masak makes sense.
15:44 arnsholt_ The cube was confiscated at various points last night though
15:44 arnsholt_ Apparently my attention was a bit divided ^_^
15:45 colomon The cube?
15:45 masak a Rubik one, presumably.
15:46 arnsholt_ Yep. But with Christmas themed pictures on the sides, rather than the classic one
15:46 arnsholt_ A very vexing gift :-)
15:47 * masak .oO( ho ** 3 )
15:53 arnsholt_ So far I've managed to assemble one complete face (including the bits of the neighbouring faces). But that just makes it that much harder
15:55 masak :)
15:56 dalek perl6.org: e8e4314 | timotimo++ | includes/header:
15:56 dalek perl6.org: On small-screen devices, don't try for three columns.
15:56 dalek perl6.org: review: https://github.com/perl6/p​erl6.org/commit/e8e431455f
15:56 timotimo ^- i hope this doesn't break things
16:00 dalek perl6.org: f4dbe8d | timotimo++ | source/ (5 files):
16:00 dalek perl6.org: optipng gives ~15% decrease, or 21% for p6-overview.png
16:00 dalek perl6.org: review: https://github.com/perl6/p​erl6.org/commit/f4dbe8d78b
16:15 * colomon got a Rubik's cube for Christmas, oh, 30-something years ago.  :)
16:17 * TimToady actually had a lot more fun with his Soma cube
16:17 xfix ho ** 3 == hohoho
16:18 TimToady m: say 'ho' xx 3
16:18 camelia rakudo-moar e86167: OUTPUT«ho ho ho␤»
16:18 rindolf TimToady: what is xx?
16:18 TimToady list repetition
16:19 rindolf TimToady: ah.
16:19 TimToady same as ('ho') x 3 in Perl 5
16:19 rindolf TimToady: ah.
16:19 rindolf TimToady: nice.
16:19 rindolf TimToady: Happy Christmas.
16:19 rindolf TimToady: what's up?
16:19 timotimo TimToady: happy christmas :)
16:19 xfix I don't really like that parenthesis thing. x is like the only thing in Perl that behaves like that.
16:19 xfix Forcing me to write (@list) x $count instead of logical @list x $count.
16:20 TimToady yes, that was a wart
16:20 xfix (well, and `my ($item) = stuff`, but at least in this case it isn't that bad)
16:21 TimToady rindolf: the small ones have been up for more than two hours already, processing the contents of their stockings
16:22 TimToady I don't know how why it started, but these days the christmas stockings serve primarily as a diversion to keep the kids from tearing into the regular presents before the adults are out of bed :)
16:22 TimToady or the grandkids and grandadults, in this case :)
16:23 timotimo perl6.org used to be rated this for mobile: 91 / 100User Experience
16:24 timotimo er, no. *is now* rated this
16:25 TimToady well, it was certainly designed for wide screens, not so much for skinny ones
16:25 TimToady but we did design it to degrade as whole boxes when narrow
16:26 TimToady the box ordering makes less sense though
16:27 timotimo the /community/ page still has 65 / 100User Experience
16:27 timotimo because of tiny font sizes
16:27 TimToady we have a tiny community
16:27 timotimo correct, it's designed to degrade as whole boxes, but if you don't put a viewport thingie, it'll try to scale the page so that it fills the width of the screen as if it were a desktop
16:27 TimToady "God bless us, every one!" --Tiny TimToady
16:28 timotimo so it gave you three columns on phones in portrait
16:28 timotimo TimToady: every god bless us? :)
16:28 TimToady timotimo: works for monotheistic logicians :)
16:28 timotimo indeed
16:28 timotimo sadly, the change i made to the header include doesn't fix the other pages for mobile
16:29 timotimo it seems to use a different snippet/include/thingie
16:30 sqirrel_ joined #perl6
16:40 DarthGandalf joined #perl6
16:42 atroxaper joined #perl6
16:44 anaeem1_ joined #perl6
16:53 rurban joined #perl6
17:02 masak rindolf: the rindolf spec at http://www.shlomifish.org/rindolf/rindolf-spec.xml seems to cut off after "LISP-like Features\nRe-usable Virtual Machines Instances". I was eager to read the rest...
17:04 mr-foobar joined #perl6
17:04 rindolf masak: I neglected it.
17:04 rindolf masak: and didn't see too much point to it.
17:11 ptc_p6 joined #perl6
17:20 gtodd hmm there are a lot of wise persons on camels  in here :-)
17:20 gtodd t'is the way of the camel ...
17:27 psch 120 less lines in the invokedynamic logic for shortname interop methods \o/
17:27 psch i've also been wondering if i should hook up perl6 .gist to java .toString(), it seems sensible on first glance
17:28 psch oh, actually i should hook up .Str to .toString() i guess
17:37 dakkar joined #perl6
17:38 masak rindolf: oh, so there never was more?
17:38 masak moritz: hack.p6c.org is on Zulu time?
17:42 rindolf masak: no, there was not.
17:43 atroxaper joined #perl6
17:43 masak rindolf: I'm fascinated by rindolf in its role as one of the more well-defined "alternatives" to Perl 6.
17:44 vendethiel by rindolf?
17:44 vendethiel oh
17:44 masak rindolf: I'm curious what your current thoughts about Perl 5 and Perl 6 are.
17:44 masak vendethiel: http://www.shlomifish.org/rindolf/rindolf-spec.xml
17:44 rindolf masak: well, I'm still using Perl 5.
17:44 vendethiel read it
17:45 rindolf masak: I played a little with Perl 6 implementations, and they were too incomplete, buggy and slow. Maybe it's better now.
17:47 moritz masak: yes, it's on UTC
17:52 masak rindolf: a little, yes.
18:00 gtodd left #perl6
18:00 vendethiel masak: it's still a bit slow, but incomplete? not really
18:00 gtodd joined #perl6
18:07 xfix joined #perl6
18:09 masak vendethiel: it's much better, but I don't want to oversell it either.
18:09 masak vendethiel: there will be a day when I can say that we're fast and virtually bug free. but it's not today.
18:10 vendethiel masak: we're slow. That's a given, even with the JIT
18:10 masak complete? depends what you mean. I'm working on macros. we still have GLR and other stuff left.
18:10 vendethiel masak: but I think that we have most features I use completly working
18:10 masak we're much closer to completion than we were back in 2005 when I joined.
18:10 masak much, much closer.
18:10 xfix Perl 6 is still slow, but it's like 1,000 times faster than 5 years ago.
18:10 Mso150 joined #perl6
18:11 vendethiel xfix: which is both interesting and not interesting, depending from where you look at it :p
18:12 xfix In any case, improvements are still done.
18:12 xfix Currently, the work is on MoarVM, a virtual machine designed to run Perl 6.
18:13 masak that's a bit one-sided. work is still ongoing on the JVM and Parrot backends, too.
18:13 xfix Yes, of course.
18:13 FROGGS not only designed to run Perl 6 - it also was created after knowing what Perl 6 is
18:13 FROGGS (MoarVM)
18:14 xfix http://www.moarvm.com/roadmap.html - there is still lots to improve, but MoarVM is getting here.
18:14 xfix JVM and Parrot also get improvements.
18:15 xfix (NQP ports that is, JVM itself is very stable)
18:16 xfix But well, it also has to be admitted that Perl 6 is a quite complex language, which makes optimizations more complex.
18:17 xfix JIT somewhat reduces the issue, but it's still here.
18:18 xfix Other languages have similar issues. For example, in JavaScript, __proto__ causes huge performance issues.
18:35 Mso150_a joined #perl6
18:36 gtodd at Xmas there's often lots of gifts ....   :-)
18:37 gtodd 'inspration to perl5' => [  perl6 , rindolf , rust, [ sub { ... # returns a long list }  ] ]  ;
18:37 xfix s/# returns a long list/#`(returns a long list)/
18:38 gtodd :-D
18:38 * psch .oO( unsp, unsp, unsp baby )
18:38 vendethiel xfix: which is why it's nonstandart :p
18:39 xfix vendethiel, EcmaScript 6 made it standard because browsers implemented it.
18:39 vendethiel xfix: oh, it's standardized now? that's the wrong way of standardizing stuff :p
18:39 xfix (because they had do in order to support mobile websites written for WebKit)
18:47 psch m: 1 R= my $x; say $x
18:47 camelia rakudo-moar e86167: OUTPUT«1␤»
18:47 psch std: 1 R= my $x; say $x
18:47 camelia std 76ccee1: OUTPUT«[31m===[0mSORRY![31m===[0m�Cannot reverse the args of = because list assignment operators are too fiddly at /tmp/PktMvnXTmB line 1:�------> [32m1 R=[33m�[31m my $x; say $x[0m�Check failed�FAILED 00:00 138m�»
18:47 psch i think that ties into RT #77114 as well, doesn't it
18:47 synopsebot Link: https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=77114
18:47 pmurias joined #perl6
18:47 psch looks like can_meta should be used more...
18:50 xfix m: roll 20, 1..20
18:50 camelia rakudo-moar e86167: ( no output )
18:50 xfix m: say roll 20, 1..20
18:50 camelia rakudo-moar e86167: OUTPUT«12 3 16 16 14 9 14 13 13 7 13 7 13 9 8 6 12 1 8 1␤»
18:51 xfix Neat.
18:51 xfix m: say [+] roll 20, 1..20
18:51 camelia rakudo-moar e86167: OUTPUT«242␤»
18:51 xfix m: say [+](roll 20, 1..20) xx 20
18:51 camelia rakudo-moar e86167: OUTPUT«187 243 152 223 186 236 215 235 209 218 232 217 184 242 197 205 157 183 188 209␤»
18:51 vendethiel xfix: xx autothunks
18:52 xfix I know.
18:52 vendethiel just checking :p
18:52 xfix And this is generally what user wants. The user doesn't want [] xx 20 to return 20 identical objects.
18:53 moritz are you guys interested in web stats for the various *.perl6.org sites?
18:53 moritz and if yes, what software would you recommend for generating them? (from apache logs; I don't want to embed any tracking JS into the sites)
18:54 xfix Write the software in Perl 6 (just kidding).
18:54 xfix (although, I wonder... perhaps)
18:54 xfix [] xx 20 in Perl 6 definitely shouldn't do https://gist.github.com/xfix/f972708d972e6912e9e7
18:54 xfix (that's actually harmful, in my opinion)
18:55 moritz that's the main reason it thunks
18:56 xfix And then Python users write code like ([] for e in range(20))
19:18 ptc_p6 joined #perl6
19:18 timotimo m: say 128, 128, -> $a, $b { (($a div 2) .. ($b + 1)).roll(2) } ... * < 16
19:18 camelia rakudo-moar e86167: OUTPUT«128 128 120 97 74 90 78 66 56 49 45 43 23 28 26 16 16 13␤»
19:19 timotimo m: say 128, 128, -> $a, $b { (($a div 2) .. ($b + 1)).roll(3) } ... * < 16
19:19 camelia rakudo-moar e86167: OUTPUT«128 128 124 74 84 70 56 73 47 53 72 54 43 39 33 26 25 25 14 13␤»
19:25 masak m: macro foo { quasi { BEGIN { say "merry christmas!" } } }; foo; foo
19:25 camelia rakudo-moar e86167: OUTPUT«merry christmas!␤»
19:26 masak m: macro foo { quasi { BEGIN say "merry christmas!" } }; BEGIN say "jingle bells"; foo; foo
19:26 camelia rakudo-moar e86167: OUTPUT«merry christmas!␤jingle bells␤»
19:26 * masak is of the opinion that this should actually print "jingle bells" and then "merry christmas" twice
19:27 masak turns out I blogged about this back in April 2012: http://strangelyconsistent.org/bl​og/revenge-of-the-oslo-hackathon
19:27 masak but then I didn't have an opinion, just an explosion.
19:28 mst surely the BEGIN means it should say merry christmas twice at compile time, then jingle bells once at runtime
19:29 masak `BEGIN say "jingle bells";`
19:30 masak my main rationale is this: quasis are "inert code"; they are in a sense not participating in the code document yet; a bit like "shadow DOM".
19:31 mst oh, I'd misread it and missed that BEGIN
19:31 mst ok, then I agree with you
19:31 masak if a BEGIN document fires ASAP but once the compiler reaches the end of the BEGIN block, then it should fire after macro insertion.
19:31 masak because the BEGIN block in the quasi is just a ghost.
19:31 mst right
19:32 masak my lesser rationale is that if you want code to fire while parsing a macro, you don't need to put it in the quasi at all.
19:33 xfix By the way, "But braces? In Python? I thought that was SyntaxError: not a chance."
19:33 * masak .oO( what happens when an unstoppable BEGIN block meets an immovable quasi )
19:33 xfix Only for flow control blocks. Sets, dictionaries use braces.
19:33 masak xfix: that's true.
19:34 masak xfix: it was more poking fun than rational argument.
19:34 xfix I personally like Python 3 formatting.
19:34 xfix It's quite neat in my opinion.
19:34 masak I like it too.
19:35 xfix The reason why formatting strings exist is localization.
19:35 masak then again, it's not that hard to improve on the C string formatting format.
19:35 xfix Sure, you can have "My name is $name.", but good luck translating that, when Perl internally sees it as concatenation..
19:36 xfix Of course, I'm sure there are solutions for this problem.
19:37 TimToady your internationalization can key on 'My name is $name'
19:37 xfix Something like ECMAScript quasis.
19:38 TimToady we just need, like, macros or something
19:38 masak xfix: ECMAScript doesn't have quasis.
19:38 xfix Sure it doesn't.
19:38 mst masak: LISPCEPTION
19:38 xfix I just refer to one of ECMAScript proposals.
19:38 xfix http://wiki.ecmascript.org/​doku.php?id=harmony:quasis
19:39 masak oh dear :)
19:39 xfix The issues with "My name is $name." is that it's internally just "My name is " ~ $name ~ ".".
19:39 TimToady not at macro time
19:39 xfix Hm, interesting.
19:39 masak there are senses in which it is and senses in which it ain't.
19:40 xfix So, macros could do something like _("My name is $name.").
19:40 TimToady well, sure
19:40 TimToady macros are all about "unwarranted chumminess with the compiler"
19:41 TimToady a good argument for not only having AST macros, perhaps
19:41 TimToady either that, or some way of AST tree matching in the rewrite rules
19:42 TimToady or both, this being Perl :)
19:42 xfix It would be neat if something like i18n("My name is $name.") could be translated to something like python-format(gettext("My name is {name}."), name => $name).
19:42 xfix (:$name is shorter, but whatever)
19:43 mst xfix: like http://p3rl.org/i18n
19:43 TimToady well, $:name is a nmaed parameter
19:43 TimToady named, even
19:47 xfix Macros are a neat thing. You don't have preprocess code.
19:48 FROGGS_ joined #perl6
19:50 * TimToady notes that the match tree of a quote notionally can return either the original text or the parsed structure
19:50 TimToady so you could even use the normal quote parser, but just give it a different action
19:51 virtualsue joined #perl6
19:52 xfix Extensible syntax is also interesting.
19:52 xfix It allows you to do stuff like E4X in Perl 6.
19:53 xfix my $sales = <sales vendor="John" />;
19:54 TimToady you could say that <foo bar> is a tag, while < foo bar > is a qw
19:55 xfix Oh, right, it conflicts with qw[].
19:55 dakkar joined #perl6
19:55 TimToady there's always tradeoffs
19:56 TimToady and even if you use code that is currently a syntax error, the tradeoff is that you'll get worse syntax errors :)
19:57 xfix So, my $sales = xml <sales vendor="John" />;
19:57 xfix That could be an interesting module.
19:57 Sqirrel joined #perl6
19:58 TimToady my $sales = xml qw:s<sales vendor="$who" />;
19:59 TimToady unfortunately, «sales vendor="$who" /» is not gonna dwim
19:59 TimToady or dwym
19:59 TimToady or dwtm
19:59 * FROGGS_ .oO( dwwm )
20:00 xfix In E4X, it would look like <sales vendor={who}>, so in Perl 6 it would be like <sales vendor=$who>.
20:00 TimToady well, my point is that «» loses the quotes
20:01 TimToady if you want {} instead of $, that's easily arranged with qw:c instead of qw:s
20:02 TimToady and eventually xml itself could be a quote macro that does qw:c or so
20:02 TimToady well, could do that now if we had text macros
20:26 itz what's the best graphics lib binding to just plot simple coloured points? SDL?
20:27 moritz itz: SVG
20:29 naddiseo m: sub reducer($l, $r, :@ops) { [$l, @ops, $r] }; say reduce(&reducer.assuming(opts => ('+', )), (1, 2));
20:29 camelia rakudo-moar e86167: OUTPUT«␤  in sub reducer at /tmp/DzFK1QiHfF:1␤  in sub CURRIED at src/gen/m-CORE.setting:3572␤  in method reduce at src/gen/m-CORE.setting:1␤  in sub reduce at src/gen/m-CORE.setting:9371␤  in block <unit> at /tmp/DzFK1QiHfF:1␤␤»
20:29 naddiseo Bug, or no?
20:29 naddiseo It's caused by a spelling error, but doesn't tell me what the error is
20:30 xfix Empty error message for me. Yeah, I'm pretty sure it's a bug.
20:32 naddiseo K next, bug with perl6, or moar...
20:32 xfix Probably Perl 6.
20:32 xfix pj: sub reducer($l, $r, :@ops) { [$l, @ops, $r] }; say reduce(&reducer.assuming(opts => ('+', )), (1, 2));
20:32 xfix p: sub reducer($l, $r, :@ops) { [$l, @ops, $r] }; say reduce(&reducer.assuming(opts => ('+', )), (1, 2));
20:32 camelia rakudo-parrot e86167: OUTPUT«Unexpected named parameter 'opts' passed␤  in sub reducer at /tmp/gswWQu_a1p:1␤  in sub CURRIED at gen/parrot/CORE.setting:3577␤  in method reduce at gen/parrot/CORE.setting:9215␤  in sub reduce at gen/parrot/CORE.setting:9303␤  in block <unit>…»
20:33 xfix Ok, Moar.
20:33 psch opts <> ops
20:33 xfix psch, the issue is error message.
20:33 xfix Yes, the code should error, but it shouldn't error with empty message.
20:33 psch ohh
20:33 naddiseo I spent an hour trying to track that down.
20:33 psch yeah, just saw the last eval, my bad :)
20:34 psch .assuming needs work, in any case
20:34 xfix It does.
20:34 naddiseo all because I'm more used to typing "opts" than "ops"
20:35 naddiseo Okay, so do I report the bug on github, or is does moar have another bug tracker somewhere?
20:35 xfix You probably should report the error to Perl 6.
20:35 xfix It may be issue with Perl 6 code handling MoarVM.
20:37 FROGGS[tab] joined #perl6
20:37 xfix Speaking of, I'm not sure if it should work this way.
20:37 xfix r: sub reducer($l, $r, :$ops) { [$l, $ops, $r] }; say reduce(&reducer.assuming(opts => ('+', )), (1, 2));
20:37 camelia rakudo-moar e86167: OUTPUT«1 (Any) 2␤»
20:37 camelia ..rakudo-parrot e86167: OUTPUT«Unexpected named parameter 'opts' passed␤  in sub reducer at /tmp/tmpfile:1␤  in sub CURRIED at gen/parrot/CORE.setting:3577␤  in method reduce at gen/parrot/CORE.setting:9215␤  in sub reduce at gen/parrot/CORE.setting:9303␤  in block <unit> at…»
20:37 xfix Yeah, something is really wrong here.
20:37 xfix It SHOULDN'T work.
20:38 naddiseo yup
20:39 naddiseo which bug tracker should I use? since there seems to be so many.l.
20:40 FROGGS_ report it to rakudobug@perl.org
20:40 xfix rakudobug@perl.org
20:41 psch m: sub foo(&s, *%nameds) { return &s(|%nameds) }; sub bar(:$a) { }; foo :b(1)
20:41 camelia rakudo-moar e86167: OUTPUT«Too few positionals passed; expected 1 argument but got 0␤  in sub foo at /tmp/5x5KFYv8lc:1␤  in block <unit> at /tmp/5x5KFYv8lc:1␤␤»
20:41 psch m: sub foo(&s, *%nameds) { return &s(|%nameds) }; sub bar(:$a) { }; foo &bar, :b(1)
20:41 camelia rakudo-moar e86167: ( no output )
20:41 psch that's about what .assuming does :/
20:41 psch p: sub foo(&s, *%nameds) { return &s(|%nameds) }; sub bar(:$a) { }; foo &bar, :b(1)
20:41 camelia rakudo-parrot e86167: OUTPUT«Unexpected named parameter 'b' passed␤  in sub bar at /tmp/bcvAexqlQI:1␤  in sub foo at /tmp/bcvAexqlQI:1␤  in block <unit> at /tmp/bcvAexqlQI:1␤␤»
20:44 atroxaper joined #perl6
20:46 dalek roast: 4c74616 | (Konrad Borowski)++ | S06-currying/named.t:
20:46 dalek roast: Add a test case for unknown named parameter in assuming.
20:46 dalek roast: review: https://github.com/perl6/roast/commit/4c74616610
20:48 naddiseo That test case works fine for me..
20:48 anaeem1_ joined #perl6
20:49 Alula joined #perl6
20:49 xfix r: sub {}.assuming(named => True)()
20:49 camelia rakudo-parrot e86167: OUTPUT«Unexpected named parameter 'named' passed␤  in sub  at /tmp/tmpfile:1␤  in sub CURRIED at gen/parrot/CORE.setting:3577␤  in block <unit> at /tmp/tmpfile:1␤␤»
20:49 camelia ..rakudo-moar e86167: ( no output )
20:50 naddiseo hm, yeah, works on moar
20:50 xfix The thing is, the test tests whether it fails.
20:50 xfix Because dies_ok.
20:52 psch std: my @a>>= 1,2,3
20:52 camelia std 76ccee1: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Missing << or >> at /tmp/uzRMyGVZ_T line 1:â�¤------> [32mmy @a>>=[33mâ��[31m 1,2,3[0mâ�¤    expecting infix_circumfix_meta_operatorâ�¤Parse failedâ�¤FAILED 00:00 136mâ�¤Â»
20:52 psch std: my @a >>=>> 1,2,3
20:52 camelia std 76ccee1: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤Missing << or >> at /tmp/1XnsOlpXye line 1:â�¤------> [32mmy @a >>=>[33mâ��[31m> 1,2,3[0mâ�¤    expecting infix_circumfix_meta_operatorâ�¤Parse failedâ�¤FAILED 00:00 136mâ�¤Â»
20:53 psch std: my @a >>[=]>> 1,2,3
20:53 camelia std 76ccee1: OUTPUT«[31m===[0mSORRY![31m===[0m�Cannot hyper with = because list assignment operators are too fiddly at /tmp/fHqHr8OVSo line 1:�------> [32mmy @a >>[=]>>[33m�[31m 1,2,3[0m�Check failed�FAILED 00:00 138m�»
20:53 psch m: my @a >>[=]>> 1,2,3
20:53 camelia rakudo-moar e86167: ( no output )
20:55 naddiseo p: sub (:@a) {}.assuming(named => (2,))();
20:55 camelia rakudo-parrot e86167: OUTPUT«Unexpected named parameter 'named' passed␤  in sub  at /tmp/ojDCTDF3eH:1␤  in sub CURRIED at gen/parrot/CORE.setting:3577␤  in block <unit> at /tmp/ojDCTDF3eH:1␤␤»
20:55 naddiseo m: sub (:@a) {}.assuming(named => (2,))();
20:55 camelia rakudo-moar e86167: OUTPUT«␤  in sub  at /tmp/fkksuznGI4:1␤  in sub CURRIED at src/gen/m-CORE.setting:3572␤  in block <unit> at /tmp/fkksuznGI4:1␤␤»
20:55 naddiseo that's the minimal I got it down to
20:55 naddiseo needs the parameters in the signature for it to fail on moar
20:56 beastd joined #perl6
20:56 naddiseo and needs to be an array,
20:56 naddiseo I got no error with a scalar
21:02 moritz the error it should produce is "Unexpected named parameter 'named' passed"
21:02 naddiseo yeah
21:04 moritz p: sub (:@a) {}.assuming(named => (2,))();
21:04 camelia rakudo-parrot e86167: OUTPUT«Unexpected named parameter 'named' passed␤  in sub  at /tmp/SU05Q0PEvg:1␤  in sub CURRIED at gen/parrot/CORE.setting:3577␤  in block <unit> at /tmp/SU05Q0PEvg:1␤␤»
21:05 naddiseo Reported as perl #123498
21:05 synopsebot Link: https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=123498
21:05 xfix naddiseo, Thanks :-).
21:06 Mso150_a joined #perl6
21:06 xfix I was curious what issue 123456 was.
21:06 xfix A spam, apparently :-(.
21:08 naddiseo No problem, xfix. Glad to help, I sort of wish I could actually fix it myself, but the code base would probably take too long to learn.
21:08 xfix No problem, sending bug reports is a great help :-).
21:09 psch considering it depends on the backend it probably would take a bit, yeah
21:09 psch it's not --optimize, that much i found out already :)
21:09 psch i forget what the mvm env vars are to turn off OSR and all those fancy things or i'd have looked there
21:10 moritz psch: there's a moar.pod in the MoarVM repo that documents them
21:11 naddiseo well, I'm off to game with my siblings. thanks guys, have a good christmas!
21:12 xfix https://github.com/rakudo/rakudo/blob​/72703bf358b03030d1075a353c5849fd703c​1a69/src/vm/parrot/guts/bind.c#L1065
21:12 xfix This code reports an error in Parrot.
21:13 Mso150 joined #perl6
21:13 xfix This is probably why it behaves so in Moar.
21:13 moritz with --ll-exception I get a backtrace into the bind_sig
21:13 xfix JVM version also has similar code.
21:18 xfix r: sub {}(|{named => True})
21:18 camelia rakudo-parrot e86167: OUTPUT«Unexpected named parameter 'named' passed␤  in sub  at /tmp/tmpfile:1␤  in block <unit> at /tmp/tmpfile:1␤␤»
21:18 camelia ..rakudo-moar e86167: ( no output )
21:18 moritz m: sub {}(named => True)
21:18 camelia rakudo-moar e86167: OUTPUT«Unexpected named parameter 'named' passed␤  in sub  at /tmp/Qn4wD95KYO:1␤  in block <unit> at /tmp/Qn4wD95KYO:1␤␤»
21:18 moritz xfix++
21:20 xfix r: sub {}(|:named)
21:20 camelia rakudo-moar e86167: ( no output )
21:20 camelia ..rakudo-parrot e86167: OUTPUT«Unexpected named parameter 'named' passed␤  in sub  at /tmp/tmpfile:1␤  in block <unit> at /tmp/tmpfile:1␤␤»
21:20 xfix The issue is with | and named parameters.
21:20 virtualsue joined #perl6
21:21 gfldex joined #perl6
21:24 moritz I think I know where the error is coming from
21:29 moritz ./perl6-m -e 'sub (:@a) {}.assuming(named => (2,))()'
21:29 moritz ./perl6-m -e 'sub (:@a) {}.assuming(named => (2,))()'
21:29 moritz ./perl6-m -e 'sub (:@a) {}.assuming(named => (2,))()'
21:29 moritz eeks
21:29 moritz Unexpected named parameter 'named' passed in sub  at -e:1 in sub CURRIED at src/gen/m-CORE.setting:3572 in block <unit> at -e:1
21:29 psch moritz++
21:29 moritz spectesting now
21:30 * moritz shouldn't commit debug output from the signature binder, that could turn out weird :-)
21:30 xfix Yes, you should avoid accidentally committing debug output.
21:31 xfix (I saw it a few times back when I was responsible for "Perl 6 updates" long time ago)
21:31 moritz and pretty much every code uses the binder, so that would be double bad
21:31 xfix By the way, once again, timotimo++
21:32 TimToady it's especially peculiar if you put it to stdout, and then use it in the build to, say, concatenate files for compilation...oops...
21:32 * moritz hopes for new weeklys, now that advent is over
21:32 TimToady so in nqp I've started to avoid say() and use nqp::printfh(nqp::getstderr(), ...)
21:33 * TimToady keeps wishing for note() in nqp
21:33 moritz TimToady: which isn't impossible, given that this is BOOTSTRAP.nqp :-)
21:33 moritz (I mean, accidentally printing into generated files)
21:33 moritz TimToady: add it to NQP's setting?
21:33 TimToady should probably live right next to say(), wherever that is...
21:34 moritz git grep 'sub say'
21:34 moritz points to src/core/IO.nqp
21:34 TimToady otoh, if it has to look up stderr every time, that's something I tend to factor out with my $err := nqp::getstderr() in routines that use it a lot
21:35 * TimToady doesn't know what the overhead of nqp::getstderr() is
21:35 xfix Probably not high, if used for debugging output removed before committing ;-).
21:36 * TimToady has left debugging code all over the NFA stuff because I *know* I'll be coming back there again :)
21:38 FROGGS_ TimToady: I just tripped over an nqp::say() messing up the nqp build 30 minutes ago :o)
21:39 moritz m: sub {}.assuming(named => True)()
21:39 camelia rakudo-moar e86167: ( no output )
21:41 masak 'night, #perl6
21:41 BenGoldberg joined #perl6
21:41 dalek rakudo/nom: 964e0dd | moritz++ | src/Perl6/Metamodel/BOOTSTRAP.nqp:
21:41 dalek rakudo/nom: RT #123498: Empty binding error in some cases (partial fix)
21:41 synopsebot Link: https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=123498
21:41 dalek rakudo/nom:
21:41 dalek rakudo/nom: On MoarVM, if unexpected named parameters came in through capture or hash
21:41 dalek rakudo/nom: interpolation, the error message would be empty.
21:41 dalek rakudo/nom:
21:41 dalek rakudo/nom: An "if $error" would be false in the case, because $error is usually an empty
21:41 dalek rakudo/nom: array. Changing it to an "if nqp::defined($error)" as the rest of the code
21:41 dalek rakudo/nom: uses should prevent error messages from going missing.
21:41 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/964e0ddc6d
21:42 moritz this fixes the case   ./perl6-m -e 'sub (:@a) {}.assuming(named => (2,))()'
21:42 moritz but not with empty signature :(
21:43 moritz sub () {}.assuming(named => (2,))() # still no error :(
21:43 xfix So, the test I pushed to roast still fails.
21:43 dalek roast: 3f00b5b | peschwa++ | S03-metaops/ (4 files):
21:43 dalek roast: Add tests for RT #77114 and related cases.
21:43 dalek roast: review: https://github.com/perl6/roast/commit/3f00b5b12c
21:43 synopsebot Link: https://rt.perl.org/rt3//Publ​ic/Bug/Display.html?id=77114
21:45 moritz xfix: aye
21:45 moritz xfix: at least the case with the empty error message is now gone
21:46 psch https://github.com/rakudo/rakudo/pull/340 to go with the tests, assuming travis agrees with my local compile success :)
21:47 psch although i have to say <1 R= my $x> is kind of entrancing :)
21:48 xfix It's definitely different.
21:48 moritz jnthn: any reason why the $BIND_RESULT_ consts in NQP are not declared as 'int' ?
21:54 xfix I hope that Perl 6 won't ever have `(1, 2)R something`
21:55 psch space is (luckily?) not an operator
21:56 psch hm, meta'ing circumfix... say R. R)1,2,3( # o.o
21:57 psch that's definitely luckily not legal :P
22:02 dalek rakudo/nom: 0521a3c | moritz++ | src/Perl6/Metamodel/BOOTSTRAP.nqp:
22:02 dalek rakudo/nom: native-type some constants in the binder
22:02 dalek rakudo/nom:
22:02 dalek rakudo/nom: should not make things slower, I hope :-)
22:02 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/0521a3cc4b
22:07 TimToady m: sub postfix:<R>(\c) { c.reverse }; say (1,2)R
22:07 camelia rakudo-moar e86167: OUTPUT«2 1␤»
22:07 TimToady oh, didn't see the 'something' :)
22:10 moritz TimToady: do you happen to know if the |c in a sub call mysub(|c) is flattened in the binder? Or somewhere else?
22:13 moritz or maybe there is a shortcut somewhere for subs with empty signatures?
22:18 Topic for #perl6 is now »ö« Welcome to Perl 6! | http://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:,  niecza:, std:, or /msg camelia p6: ... | irclog: http://irc.perl6.org | UTF-8 is our friend!
22:18 Topic for #perl6 is now »ö« Welcome to Perl 6! | http://perl6.org/ | evalbot usage: 'p6: say 3;' or rakudo:, std:, or /msg camelia p6: ... | irclog: http://irc.perl6.org | UTF-8 is our friend!
22:30 dalek roast: 4c48e78 | moritz++ | S06-currying/mixed.t:
22:30 dalek roast: remove S06-currying/mixed.t
22:30 dalek roast:
22:30 dalek roast: it was based on the assumption that you cah fill positionals by name,
22:30 dalek roast: which has been abolished a few years ago
22:30 dalek roast: review: https://github.com/perl6/roast/commit/4c48e78c17
22:30 Rounin joined #perl6
22:31 virtualsue joined #perl6
22:33 dalek roast: 0367948 | moritz++ | S06-currying/named.t:
22:33 dalek roast: Fudge failing test for RT 123498
22:33 dalek roast: review: https://github.com/perl6/roast/commit/0367948dbe
22:36 vendethiel "subset ... where &.assuming" wow
22:36 atroxaper joined #perl6
22:42 awoodland joined #perl6
22:47 davido_ joined #perl6
22:47 dalek rakudo/nom: 8e5c5e9 | moritz++ | src/core/Routine.pm:
22:47 dalek rakudo/nom: Micro-optimize Routine.assuming
22:47 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/8e5c5e9429
22:56 * psch sleeps &
22:57 * vendethiel convinced two friends to give perl6 a go with the advent calendar, and is pretty happy with that
22:58 moritz vendethiel++
22:58 vendethiel moritz: http://i.imgur.com/bF7fBKF.png ! yay!
23:06 virtualsue joined #perl6
23:25 Alula joined #perl6
23:36 telex joined #perl6

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

Perl 6 | Reference Documentation | Rakudo