Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2012-10-04

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 sorear generally, that means that some code tried to use $!foo when "self" isn't defined
00:00 sorear it can be secondary to trying to call methods on undefined values
00:03 bro_grammer joined #perl6
00:03 Circlepuller_ joined #perl6
00:08 [Coke] hurm. thanks.
00:10 [Coke] I suspect this is an issue with the conversion of everything to a method.
00:17 tokuhiro_ joined #perl6
00:23 [Coke] nqp: class EEK {}; my $a:= EEK.new(); say +$a;
00:23 p6eval nqp: OUTPUT«No applicable candidates found to dispatch to for 'Numeric'. Available candidates are:␤␤current instr.: 'Numeric' pc 3450 (src/stage2/gen/NQPCORE.setting.pir:1608) (src/stage2/NQPCORE.setting:171)␤»
00:23 [Coke] nqp: class EEK {method Numeric() {return 3}}; my $a:= EEK.new(); say(+$a);
00:23 p6eval nqp: OUTPUT«No applicable candidates found to dispatch to for 'Numeric'. Available candidates are:␤␤current instr.: 'Numeric' pc 3450 (src/stage2/gen/NQPCORE.setting.pir:1608) (src/stage2/NQPCORE.setting:171)␤»
00:23 [Coke] how do I fix that one?
00:27 cognominal TimToady, I wish one could write   .%a   for  %a{$_}   so that    (*++).%a became  { %a{$_}++ }   # need sleep to say if it make any sense. See you tomorrow.
00:29 [Coke] r: class EEK {method Numeric() {return 3}}; my $a:= EEK.new(); say(+$a);
00:29 p6eval rakudo fb11f1: OUTPUT«3␤»
00:29 [Coke] hurm. nqpbug?
00:31 sorear good question; no clue.
00:32 [Coke] : class EEK {method Numeric() {return 3}}; my $a:= EEK.new(); say(+$a);
00:32 [Coke] n: class EEK {method Numeric() {return 3}}; my $a:= EEK.new(); say(+$a);
00:32 p6eval niecza v22-6-g9e5350d: OUTPUT«3␤»
00:34 [Coke] https://github.com/perl6/nqp/issues/59
00:48 kst joined #perl6
00:53 cognominal joined #perl6
01:08 [Coke] nqp: module String { sub eek() { say("eek");} } String::eek();
01:08 p6eval nqp: OUTPUT«Confused at line 2, near "module Str"␤current instr.: 'panic' pc 19999 (src/stage2/gen/NQPHLL.pir:7315) (src/stage2/gen/NQPHLL.pm:324)␤»
01:08 [Coke] nqp: module String { sub eek() { say("eek");} }; String::eek();
01:08 p6eval nqp: OUTPUT«invoke() not implemented in class 'NQPMu'␤current instr.: '' pc 91 ((file unknown):53) (/tmp/sA6ucNekpn:1)␤»
01:08 [Coke] rakudo: module String { sub eek() { say("eek");} }; String::eek();
01:08 p6eval rakudo fb11f1: OUTPUT«Could not find symbol '&eek'␤  in method <anon> at src/gen/CORE.setting:9934␤  in  at src/gen/Metamodel.pm:2380␤  in any find_method_fallback at src/gen/Metamodel.pm:2368␤  in any find_method at src/gen/Metamodel.pm:922␤  in  at src/gen/BOOTSTRAP.pm:827␤  in any  a…
01:09 [Coke] rakudo: module ring { sub eek() { say("eek");} }; ring::eek();
01:09 p6eval rakudo fb11f1: OUTPUT«Could not find symbol '&eek'␤  in method <anon> at src/gen/CORE.setting:9934␤  in  at src/gen/Metamodel.pm:2380␤  in any find_method_fallback at src/gen/Metamodel.pm:2368␤  in any find_method at src/gen/Metamodel.pm:922␤  in  at src/gen/BOOTSTRAP.pm:827␤  in any  a…
01:09 [Coke] Should that work (in rakudo or nqp?)
01:25 kurahaupo left #perl6
01:31 fgomez joined #perl6
02:01 jaldhar joined #perl6
02:04 arnsholt joined #perl6
02:15 sorear [Coke]: last one should not work, since subs are "my" by default.
02:15 jaldhar joined #perl6
02:16 sorear nr: module ring { our sub eek() { say("eek");} }; ring::eek();
02:16 p6eval rakudo fb11f1, niecza v22-6-g9e5350d: OUTPUT«eek␤»
02:16 sorear nqp: module ring { our sub eek() { say("eek");} }; ring::eek();
02:16 p6eval nqp: OUTPUT«eek␤»
02:17 macae joined #perl6
02:23 sivoais joined #perl6
02:39 skids joined #perl6
02:41 simcop2387 joined #perl6
02:42 orafu joined #perl6
02:49 VXZ joined #perl6
02:57 raiph joined #perl6
02:58 fgomez joined #perl6
03:29 xinming joined #perl6
03:30 fgomez joined #perl6
03:41 adeux joined #perl6
03:43 adeux helo
03:43 adeux hello
03:44 sorear ehlo
03:46 adeux i think i have to have lunch
04:00 gootle joined #perl6
04:17 seedlings joined #perl6
04:20 popl joined #perl6
04:22 seedlings left #perl6
04:22 telex joined #perl6
04:26 kaleem joined #perl6
04:38 VXZ joined #perl6
04:38 telex joined #perl6
04:40 fgomez joined #perl6
04:44 mjreed joined #perl6
05:00 mjreed is HLL supposed to work in NQP still?
05:00 sorear What do you mean by HLL?
05:01 sorear Also, which of the three incompatible languages named NQP do you mean?
05:01 mjreed in this case, the one I get when I configure rakudo star with --gen-nqp.
05:02 mjreed and by HLL I mean the high-level-language compiler parent classes loaded by 'use HLL' from inside said NQP.
05:02 mjreed > use HLL;
05:02 mjreed A method named 'backtrack' already exists in class 'PAST;Regex'. It may have been supplied by a role.
05:02 mjreed > class TinyLang::Grammar is HLL::Grammar { }
05:02 mjreed Null PMC access in find_method('new')
05:03 kst joined #perl6
05:10 mjreed1 joined #perl6
05:10 sorear mjreed1: it's certainly still possible to write hll compilers in the new nqp which rakudo star has shipped with for a year or less.  it's possible some details have changed
05:16 mjreed1 ok, I'll poke around some more..
05:17 mjreed1 guess my example code is out o fdate
05:18 sorear quite likely
05:18 sorear alas I'm not much use as an nqp resourse
05:19 mjreed1 np.  thanks for answering!
05:19 mjreed1 left #perl6
05:22 sjohnson joined #perl6
05:25 _daniel-s__ joined #perl6
05:30 aharoni joined #perl6
05:30 hoelzro|away joined #perl6
05:31 changedNicks joined #perl6
05:49 birdwindupbird joined #perl6
05:53 moritz good morning
05:54 sorear good morning moritz.
05:56 moritz \o sorear
06:04 wtw joined #perl6
06:05 raiph hi sorear, moritz
06:06 sorear hello raiph
06:06 sjohnson joined #perl6
06:20 raiph I emailed Viacheslav Tykhanovskyi who runs http://perltuts.com/. He said "Perl6 would be nice. ... isn't a problem if it's a .deb package. .. As for motivation... That's simple. A tutorial in Perl6 ;)" I said I'd share this on #perl6.
06:30 mikemol joined #perl6
06:36 VXZ joined #perl6
06:43 flightrecorder joined #perl6
06:49 FROGGS joined #perl6
07:17 raiph exit
07:40 Psyche^ joined #perl6
07:41 flightrecorder joined #perl6
07:41 FROGGS joined #perl6
07:50 grondilu joined #perl6
07:50 grondilu n: say pack "s", -1
07:50 phenny grondilu: 03 Oct 21:25Z <_edwin> tell grondilu you could use the known digest of some constant data to find out (e.g. digest of empty message)
07:50 phenny grondilu: 03 Oct 21:25Z <sorear> tell grondilu Why not just have the digest function return a Buf?
07:50 p6eval niecza v22-6-g9e5350d: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Undeclared routine:â�¤      'pack' used at line 1â�¤â�¤Unhandled exception: Check failedâ�¤â�¤  at /home/p6eval/niecza/boot/lib/CORE.setting line 1437 (die @ 5) â�¤  at /home/p6eval/niecza/src/STD.pm6 line 1147 (P6.comp_unit @ 37) â�¤  at /home…
07:52 grondilu r: say pack "s", -1
07:52 p6eval rakudo fb11f1: OUTPUT«Unrecognized directive 's'␤  in block  at src/gen/CORE.setting:7231␤  in method reify at src/gen/CORE.setting:5282␤  in method reify at src/gen/CORE.setting:5184␤  in method reify at src/gen/CORE.setting:5184␤  in method gimme at src/gen/CORE.setting:5562␤  in meth…
07:53 grondilu if I submit a patch for signed integers in pack/unpack, do I have submit one for the spectest as well?
07:54 moritz it would be nice if you did
07:54 am0c joined #perl6
08:00 fhelmberger joined #perl6
08:05 kst joined #perl6
08:11 kresike joined #perl6
08:11 kresike good morning all you happy perl6 people
08:21 flightrecorder joined #perl6
08:22 FROGGS joined #perl6
08:31 dakkar joined #perl6
08:31 daniel-s joined #perl6
08:45 tadzik hello #perl6
08:46 sorear tadzik!
08:48 tadzik sorear!
08:49 kurahaupo joined #perl6
08:49 kresike hello tadzik o/
08:51 SamuraiJack joined #perl6
08:53 grondilu I've noticed something.  If I make a modif in one of src/core/ module (Buf.pm for instance), I must recomple everything thing to test it, right?  Is there a way not to?
08:54 moritz you can augment classes and redefine subroutines from outside the setting
08:57 grondilu Oh I can redefine subroutines?  I thought I had tried that with no success once.  I'll try again.  It's MONKEY_PATCH or something, right?
08:58 tadzik r: my &sort = sub (*@a) { say @a.perl }; sort <a b c>
08:58 p6eval rakudo fb11f1: OUTPUT«Array.new("a", "b", "c")␤»
08:58 tadzik this way probably
08:59 grondilu would it work with class methods?
09:00 tadzik for that you probably have to augment class
09:00 tadzik and use MONKEY_TYPING I think
09:00 spider-mario joined #perl6
09:01 grondilu that's what I tried once.  I could add methods, but I don't think I managed to redefine one.
09:01 xinming joined #perl6
09:03 tadzik maybe what you want is to subclass it
09:04 grondilu yeah that's probably the best, but I'll have to use a custom name everywhere in the code.  But I guess that makes sense for a customization.
09:05 * grondilu will do that.
09:06 moritz grondilu: you can also remove the method from the class once, recompile
09:06 moritz then augment
09:06 moritz and once you're done, you can copy the method back in
09:09 lorn joined #perl6
09:09 grondilu moritz: oh yeah, that's smart
09:12 grondilu though if I remove a method form a core class, isn't there a risk that compilation fails?
09:13 moritz only for something central as Attribute or List or so
09:13 moritz if you remove some helper method, or from IO/Buf/Version/... it won't care
09:13 tadzik do we catch missing methods in compile time?
09:13 moritz no
09:13 moritz the compilation can only fail if the compiler calls that method
09:13 tadzik right
09:14 * grondilu has an other question about panda
09:15 tadzik go ahead
09:15 grondilu Once I added a personal module in ~/.perl6/lib, and panda messed it up when I reboostraped it.
09:15 tadzik oh yes, sorry for that :(
09:15 tadzik panda clears ~/.perl6/lib when you rebootstrap
09:16 grondilu that's not nice
09:16 tadzik it should probably only clear things that it installed before
09:16 tadzik I know, sorry
09:16 grondilu :)
09:16 grondilu no problem.
09:17 moritz I now firmly believe that panda should never touch ~/.perl6/lib
09:17 moritz and that we shouldn't look there by default either
09:17 grondilu it was a symlink anyway, so panda did not actually remove anything.
09:17 moritz it makes it impossible to use two different rakudos
09:17 grondilu moritz: where should I put my personal modules, then?
09:17 tadzik true
09:18 moritz grondilu: rakudo should offer a variable containing an install path for that specific rakudo version
09:18 moritz r: say @*INC
09:18 p6eval rakudo fb11f1: OUTPUT«/home/p6eval/.perl6/lib /home/p6eval/nom-inst/lib/parrot/​4.8.0-devel/languages/perl6/lib␤»
09:18 moritz so probably $INSTALL/lib/parrot/$PARROT_VERS​ION/languages/perl6/custom-lib/ or so
09:18 grondilu so you advise me to put *my* modules there?
09:19 moritz once we have that mechanism in place, yes
09:19 moritz if you still want a global location, you can just set PERL6LIB
09:19 sorear sleep&
09:20 grondilu ok
09:26 grondilu r: role Foo { method gist { "Foo" } }; my $x = Mu but Foo; say $x;
09:26 p6eval rakudo fb11f1: OUTPUT«Foo␤»
09:27 grondilu ^ maybe I can use this to redefine methods?
09:27 grondilu r: role Foo { method gist { "Foo" } }; my $x = Mu but Foo; say $x.WHAT;
09:27 p6eval rakudo fb11f1: OUTPUT«Foo␤»
09:27 domidumont joined #perl6
09:29 grondilu ah, no actually.  Nevermind.
09:38 xinming joined #perl6
09:54 daxim joined #perl6
10:15 mtk joined #perl6
10:33 jlaire joined #perl6
10:44 jaldhar joined #perl6
10:51 mucker joined #perl6
10:58 wk joined #perl6
11:02 kurahaupo joined #perl6
11:03 spider-mario joined #perl6
11:05 Su-Shee_ joined #perl6
11:11 dalek Perlito: 805d42e | (Flavio S. Glock)++ | / (2 files):
11:11 dalek Perlito: Perlito5 - perl5 - fix emitted code for $$x[0]
11:11 dalek Perlito: review: https://github.com/fglock/​Perlito/commit/805d42e23c
11:12 jnthn evening o/
11:12 phenny jnthn: 03 Oct 20:15Z <moritz> ask jnthn to please check my latest reply to https://rt.perl.org/rt3/Ti​cket/Display.html?id=75640 for sanity
11:12 phenny jnthn: 03 Oct 20:30Z <mathw> tell jnthn his YAPC::Asia talk is awesome
11:13 jnthn moritz: In your "if we work around..." section, it looks like you mean tto add "multi", but forgot?
11:15 moritz jnthn: erm, yes
11:15 moritz copy&paste gone wrong :(
11:15 moritz r: proto sub f(Int) { nextsame }; multi sub f() { };  f(3)
11:15 p6eval rakudo fb11f1: OUTPUT«===SORRY!===␤CHECK FAILED:␤Calling 'f' will never work with argument types (int) (line 1)␤    Expected any of:␤    :()␤»
11:16 moritz r: proto sub f(Int) { nextsame }; multi sub f(*@) { };  f(3)
11:16 p6eval rakudo fb11f1: OUTPUT«nextsame is not in the dynamic scope of a dispatcher␤  in block  at src/gen/CORE.setting:485␤  in sub f at /tmp/7oyYakAueD:1␤  in block  at /tmp/7oyYakAueD:1␤␤»
11:16 moritz and I think the line above is a premature optimization
11:16 jnthn hm...
11:16 moritz but the real question from that ticket is if 'nextsame is not in the dynamic scope of a dispatcher' is the correct error message
11:17 moritz or if nextsame should try to re-dispatch to the multis of the proto
11:17 jnthn r: sub foo() { nextsame }
11:17 p6eval rakudo fb11f1:  ( no output )
11:17 jnthn er
11:17 jnthn r: sub foo() { nextsame }; foo()
11:17 p6eval rakudo fb11f1: OUTPUT«nextsame is not in the dynamic scope of a dispatcher␤  in block  at src/gen/CORE.setting:485␤  in sub foo at /tmp/REGItfmhny:1␤  in block  at /tmp/REGItfmhny:1␤␤»
11:17 jnthn I expect consistency with that, which is what we have
11:17 jnthn No, the syntax for entering the dispatcher is {*}. nextsame is for iterating in a dispatch that is already ongoing, not for entering a dispatcher.
11:18 jnthn Plus nextsame in a proto method already has a meaning :)
11:18 moritz ok, then what I wrote in the ticket seems fine
11:18 moritz modulo copy&paste error
11:18 jnthn aye
12:29 GlitchMr joined #perl6
12:33 benabik joined #perl6
12:49 gootle joined #perl6
12:50 tokuhiro_ joined #perl6
12:52 tokuhiro_ joined #perl6
12:56 PacoAir joined #perl6
12:57 skids joined #perl6
12:58 leprevost joined #perl6
12:58 hash_table joined #perl6
13:03 MayDaniel joined #perl6
13:03 dalek Perlito: 27eaafa | (Flavio S. Glock)++ | / (5 files):
13:03 dalek Perlito: Perlito5 - js - fix local(); use hash and array through accessors
13:03 dalek Perlito: review: https://github.com/fglock/​Perlito/commit/27eaafafd7
13:05 PacoAir joined #perl6
13:06 sftp joined #perl6
13:07 SamuraiJack_ joined #perl6
13:07 daniel-s_ joined #perl6
13:12 hoelzro joined #perl6
13:12 sjn joined #perl6
13:12 changedNicks joined #perl6
13:26 grondilu joined #perl6
13:27 grondilu ==> Testing MongoDB
13:27 grondilu t/find.t .... 3/9 No such method 'id' for invocant of type 'Any'
13:35 [Coke] sorear++ for the my/our sub note. now my little sample works, but partcl is still complaining that it can't find the sub in the module. hurm.
13:40 [Coke] ah. the module is being defined /inside/ a class.
13:41 [Coke] nqp: class One { module Two { our sub Three() {say(3)} } ; method Four() {Two::Three()} };  One.new().Four() # can Four be written in a way that invokes Three?
13:41 p6eval nqp: OUTPUT«3␤»
13:41 [Coke] ... locally that doesn't work. hurm.
13:41 [Coke] can we get nqp to tell us which version it's running?
13:43 [Coke] Bother. wonder if I hadn't run "make install" on my nqp build in a few days.
13:43 moritz it wouldn't hurt to add the NQP revision to the evalbot output
13:43 moritz just needs doing
13:45 [Coke] argh. now /that/ sample works, but partcl still doesn't. ;)
13:48 mucker joined #perl6
13:48 PacoAir joined #perl6
13:49 changedNicks joined #perl6
13:49 integral joined #perl6
13:49 integral joined #perl6
13:50 daniel-s__ joined #perl6
13:53 user_2239 joined #perl6
13:53 user_2239 left #perl6
13:53 changedNicks joined #perl6
13:53 hoelzro joined #perl6
13:55 grondilu what's the equivalent of perl 5's -X File ?
13:55 rindolf joined #perl6
13:56 grondilu I mean "file test", like -f, -r, -x and so on.
13:57 flussence star: say '.'.IO.d
13:57 p6eval star 2012.07: OUTPUT«True␤»
13:57 moritz r: say '.'.path.d
13:57 p6eval rakudo fb11f1: OUTPUT«True␤»
13:57 moritz .IO will be deprecated eventually
13:57 moritz (or will open the path)
13:58 jnthn Oh?
13:58 * jnthn didn't know that :)
13:58 flussence on everything? or just dirs?
13:58 grondilu ok, thanks.  But once it's deprecated, what will be used?
13:58 moritz .path
13:59 grondilu even for a file?
13:59 moritz the idea is that if you want to deal with paths, you use .path
13:59 moritz and if you want to deal with file or dir *HANDLES*, you use .io or .IO or some such
13:59 moritz or maybe .open
14:00 grondilu ok
14:00 * moritz wonders if anybody ever read his huge refactorings to S32::IO
14:01 grondilu moritz: I will.  I swear :)
14:01 grondilu yet I kind of liked Perl5's syntax for this.
14:02 stopbit joined #perl6
14:03 moritz in p6 you can say    if $p.path ~~ :d { say "$p is a directory" }
14:03 moritz if you like that better
14:04 grondilu not bad indeed
14:05 flightrecorder joined #perl6
14:07 jnthn sleep &
14:10 grondilu how do I negate a smart match in a 'when'?
14:10 grondilu r: given "foo" { when not /z/ { say "no match" } }
14:10 p6eval rakudo fb11f1: OUTPUT«No such method 'match' for invocant of type 'Any'␤  in method Bool at src/gen/CORE.setting:10182␤  in sub prefix:<not> at src/gen/CORE.setting:2312␤  in block  at /tmp/D4H9u_ayrW:1␤␤»
14:11 grondilu see what I mean?
14:11 timotimo yeah, when takes an object to match against, not takes a thing that can Bool and returns the other Bool
14:11 colomon moritz: where are your refactorings?
14:11 moritz in the specs repo
14:11 grondilu r: given "foo" { when not $_ ~~ /z/ { say "no match" } }
14:11 p6eval rakudo fb11f1: OUTPUT«no match␤»
14:11 moritz done about 2 months ago or so
14:12 grondilu r: given "foo" { when not $_ ~~ /z/ { say "not very elegant" } }
14:12 p6eval rakudo fb11f1: OUTPUT«not very elegant␤»
14:12 [Coke] nqp: class Builtins { method concat() { say(String::trim()) }; module String { our sub trim() { say("ALIVE") } } }; say(Builtins.new().concat());
14:12 p6eval nqp: OUTPUT«invoke() not implemented in class 'NQPMu'␤current instr.: 'concat' pc 195 ((file unknown):95) (/tmp/aWEIm6KA__:1)␤»
14:12 [Coke] there we go.
14:13 moritz r: given 'foo' { when !/z/ { say "oh hai" } }
14:13 [Coke] Should that work?
14:13 p6eval rakudo fb11f1: OUTPUT«No such method 'match' for invocant of type 'Any'␤  in method Bool at src/gen/CORE.setting:10182␤  in sub prefix:<!> at src/gen/CORE.setting:2308␤  in block  at /tmp/PwjtiOuuyV:1␤␤»
14:13 * grondilu would like to write:  given "foo" { not when /z/ { say "no match" } }
14:14 jlaire joined #perl6
14:15 grondilu r: given "foo" { unless /z/ { say "no match" } }
14:15 p6eval rakudo fb11f1: OUTPUT«no match␤»
14:15 kaare__ joined #perl6
14:15 grondilu ^ is that the same?
14:16 colomon grondilu: no
14:17 colomon grondilu: I agree that not when would be handy.  or when not?
14:17 colomon moritz: is it S32 or S16?
14:18 grondilu maybe a whennot or notwhen keyword?
14:18 moritz colomon: I've changes some stuff in S16 too, but mostly S32::io
14:18 [Coke] jnthn: any ideas on nqp#59?
14:18 [Coke] r: class Builtins { method concat() { say(String::trim()) }; module String { our sub trim() { say("ALIVE") } } }; say(Builtins.new().concat());
14:19 p6eval rakudo fb11f1: OUTPUT«Could not find symbol '&trim'␤  in method <anon> at src/gen/CORE.setting:9934␤  in  at src/gen/Metamodel.pm:2380␤  in any find_method_fallback at src/gen/Metamodel.pm:2368␤  in any find_method at src/gen/Metamodel.pm:922␤  in  at src/gen/BOOTSTRAP.pm:827␤  in any  …
14:22 grondilu n: given "foo" { when not /z/ { say "no match" } }
14:22 p6eval niecza v22-6-g9e5350d: OUTPUT«Use of uninitialized value in string context␤  at /home/p6eval/niecza/lib/CORE.setting line 1289 (warn @ 5) ␤  at /home/p6eval/niecza/lib/CORE.setting line 266 (Mu.Str @ 15) ␤  at <unknown> line 0 (ExitRunloop @ 0) ␤  at /home/p6eval/niecza/lib/CORE.setting…
14:23 colomon moritz: actually, S32 IO looks pretty good to me now.  The only thing that gives me any hesitation is IO as a role which does nothing... should it just be a module?  (p6 doesn't have namespaces, right?)
14:24 colomon moritz: how much of that works in rakudo now?
14:24 dalek Perlito: bd0dff3 | (Flavio S. Glock)++ | / (5 files):
14:24 dalek Perlito: Perlito5 - js - tie() placeholder
14:24 dalek Perlito: review: https://github.com/fglock/​Perlito/commit/bd0dff3c2b
14:24 colomon should have said moritz++ moritz++ and apologized for negative comments on the state of S32 IO -- I hadn't seen the new stuff.  (Or at least, I hadn't remembered seeing the new stuff.)
14:29 moritz colomon: (re IO being a role that does nothing) that's called a "tag role", ie it's used to identify stuff as being IO related
14:30 moritz colomon: and if it were just a module, we would have to check the name of classes, instead of doing a typecheck (if we want to know if they are related to IO)
14:30 colomon moritz: but when would you want to know if something was "related" to IO?
14:31 Kim_Breitwieser joined #perl6
14:31 moritz colomon: when you write something that tries to DWIM
14:32 colomon example?
14:32 moritz colomon: or maybe filter out any potentially dangerous object from a list, or so
14:32 moritz colomon: for example a template system that has a "source" parameter
14:32 moritz and if it's IO, it tries to read from it (or open it, and then read, or whatever)
14:32 moritz and otherwise it treats it as a string
14:33 moritz not saying it's a great use case, just saying it doesn't hurt to have such a thing
14:33 colomon but wouldn't that be more clearly handled as "If it's IO::Handle, it reads from it; if it's IO::Path, it tries to open it; otherwise it treats it as a string"?
14:35 moritz that doesn sound cleaner
14:40 hash_table joined #perl6
14:41 grondilu rn: constant x = "foo" ~~ /bar/;
14:41 p6eval niecza v22-6-g9e5350d:  ( no output )
14:41 p6eval ..rakudo fb11f1: OUTPUT«===SORRY!===␤Cannot assign to a non-container␤»
14:41 colomon moritz: actually, this is a pretty good mental exercise.
14:42 colomon because how do you open an IO::Path?
14:42 flightrecorder joined #perl6
14:43 colomon moritz: right now the only way I'm seeing is open($path.Str, ... blah) which seems like it would work but is less than awesome
14:43 moritz IO::Path.open
14:43 moritz r: say "README".path.open.get
14:43 p6eval rakudo fb11f1: OUTPUT«Unable to open filehandle from path 'README'␤  in method open at src/gen/CORE.setting:7338␤  in sub open at src/gen/CORE.setting:7585␤  in method open at src/gen/CORE.setting:7524␤  in block  at /tmp/hK64ZcELEO:1␤␤»
14:44 moritz is that missing from S32::IO?
14:44 moritz r: say "nom/README".path.open.get
14:44 p6eval rakudo fb11f1: OUTPUT«Rakudo Perl 6␤»
14:44 colomon yes
14:45 colomon at least, it's not in S32 IO on perlcabal
14:45 moritz I don't have a secrect copy with extra stuff :-)
14:45 colomon but sometimes perlcabal is slow to match spec changes
14:46 colomon but in this case, it's not there either.
14:46 colomon hey, with git it's easy enough to have secret copies with extra stuff.
14:47 * colomon has had entire months where his version of niecza had special, not quite working functions in it...
14:54 Psyche^ joined #perl6
14:57 FROGGS joined #perl6
14:57 sirrobert joined #perl6
14:58 skids joined #perl6
14:59 dalek Perlito: bc4bbb3 | (Flavio S. Glock)++ | / (3 files):
14:59 dalek Perlito: Perlito5 - js - tie() placeholder; more
14:59 dalek Perlito: review: https://github.com/fglock/​Perlito/commit/bc4bbb3f79
15:03 mars__ joined #perl6
15:04 mucker joined #perl6
15:09 sirrobert joined #perl6
15:13 * colomon just got a "Malformed UTF-8 string" error from Rakudo
15:18 kresike bye folks
15:24 GlitchMr joined #perl6
15:31 dalek Perlito: 9a2d51f | (Flavio S. Glock)++ | / (5 files):
15:31 dalek Perlito: Perlito5 - js - tie() emitter
15:31 dalek Perlito: review: https://github.com/fglock/​Perlito/commit/9a2d51f46e
15:55 fgomez joined #perl6
15:58 bluescreen10 joined #perl6
16:10 spider-mario joined #perl6
16:13 bbobby joined #perl6
16:19 jerome_ joined #perl6
16:34 benabik joined #perl6
16:38 mjreed joined #perl6
16:43 cognominal joined #perl6
16:43 Vlavv` joined #perl6
16:47 sirrobert joined #perl6
16:51 SamuraiJack_ joined #perl6
16:51 cognominal joined #perl6
16:58 _edwin joined #perl6
16:58 _edwin hi perl6!
16:59 _edwin TimToady++, nice cleanups of my rosettacode contribution
16:59 sirrobert \o
17:00 _edwin I especially like the my $M = 1 + [+] (numers Z/ denoms) ... * < 1e-6; # wouldn't hace thought of this
17:01 _edwin have*
17:03 _edwin sorear, I think your gut feeling about the longest trail problem being NP-complete was right
17:04 _edwin because it is possible to transform the longest path problem into a longest trail problem by splitting each vertex into two vertices, one with all the incoming edges, one with all the outgoing edges, and a new edge inbetween
17:05 TimToady glad you liked it.  these days I tend to think of "shift" as a code smell, an imperative smell, if not exactly a bad smell
17:06 TimToady I'm also tending to use \foo declarations for SSA-style naming of temp results
17:07 sirrobert r: "abc:def".subst(/<-[ A..Z a..z 0..9 ]>/, *.ord.fmt("%%%02X"), :g);
17:07 p6eval rakudo fb11f1: OUTPUT«===SORRY!===␤Invalid hard reference syntax at line 2, near "%%02X\"), :"␤»
17:08 sirrobert That's the "url-encode" example from Rosetta Code
17:08 sirrobert http://rosettacode.org/wiki/URL_encoding#Perl_6
17:08 sirrobert Not sure what a "hard reference syntax" means
17:08 sirrobert any tips? =)
17:08 _edwin that lends itself particularly well to (sequences of) mathematical expressions, i think (resp. sigilless style)
17:09 TimToady especially when the original was specified using mathematical italics and such, since Unicode has those :)
17:09 TimToady sirrobert: it doesn't like the %%%
17:10 TimToady n: "abc:def".subst(/<-[ A..Z a..z 0..9 ]>/, *.ord.fmt("%%%02X"), :g);
17:10 p6eval niecza v22-6-g9e5350d: OUTPUT«[31m===[0mSORRY![31m===[0m��Invalid hard reference syntax at /tmp/1QjgREgqT7 line 1:�------> [32mst(/<-[ A..Z a..z 0..9 ]>/, *.ord.fmt("%[33m�[31m%%02X"), :g);[0m��Parse failed��»
17:10 TimToady try single quotes
17:10 sirrobert TimToady:  Ok, hm
17:10 sirrobert trying
17:10 sirrobert yeah, thanks
17:11 sirrobert might be worth fixing in Rosetta Code
17:11 TimToady it tests the %% before it realizes there's no {}, which might or might not be easy to fix
17:11 TimToady feel free to fix RC, it's a wiki :)
17:12 sirrobert =)
17:12 wk joined #perl6
17:12 pmurias joined #perl6
17:12 fhelmberger_ joined #perl6
17:13 kaleem joined #perl6
17:15 fhelmberger_ joined #perl6
17:15 TimToady http://rosettacode.org/wiki/Kapr​ekar_numbers#Casting_out_nines_.28fast.29_2
17:15 TimToady I had to write the loops using loop rather than for
17:16 TimToady using 'for' was very slow
17:16 sirrobert huh
17:16 TimToady slower than the non-casting-out-nines solution
17:16 TimToady (under niecza, but probably under rakudo as well, except it blew up my memory first)
17:17 TimToady we could probably use an optimizer that recognizes when a for can be rewritten into a loop
17:19 TimToady or find some way to expedite binding of simple loop variables
17:19 TimToady maybe we're getting bit by unnecessary closure cloning or some such
17:21 TimToady or maybe it's the "not realizing the loop is in sink context" problem again
17:23 TimToady (a gather is supposed to sink its innards)
17:25 TimToady propagating sink context to avoid storing stuff is going to be another important optimization
17:28 SamuraiJack joined #perl6
17:30 TimToady seems to leak badly in rakudo even if I explicitly sink the loops
17:31 TimToady here's the 'for' version if anyone wants to fiddle with it: http://wall.org/~larry/kap9for.p6
17:32 TimToady (doesn't leak in niecza, is just slowwww)
17:32 TimToady compared to the 'loop' version on RC, that is
17:34 cognominal joined #perl6
17:34 fhelmberger joined #perl6
17:38 diakopter explicitly sink?
17:40 TimToady putting a () after and/or putting sink before
17:41 diakopter how long does it take in rakudo and niecza
17:42 Chillance joined #perl6
17:55 snearch joined #perl6
17:56 mjreed joined #perl6
18:00 kaleem joined #perl6
18:10 _edwin is it possible to tell eval not to introduce a lexical scope?
18:11 integral joined #perl6
18:11 integral joined #perl6
18:13 benabik joined #perl6
18:14 _edwin I thought of doing something like 'file.pl'.path.open.slurp.eval; for http://rosettacode.org/wiki/Include_a_file
18:18 mjreed1 joined #perl6
18:19 _edwin but it does not "splice" into the current lexical scope. I see that it is cleaner this way, but is it possible to force an "unhygienic" eval?
18:20 GlitchMr42 joined #perl6
18:21 _edwin nr: BEGIN { eval 'say "foo"' }
18:21 p6eval rakudo fb11f1, niecza v22-6-g9e5350d: OUTPUT«foo␤»
18:22 _edwin hm, missing somthing, I got a "Confused" locally
18:24 cognominal joined #perl6
18:26 _edwin nr: BEGIN { eval 'say "foo"' }␤say "bar"
18:26 p6eval niecza v22-6-g9e5350d: OUTPUT«foo␤bar␤»
18:26 p6eval ..rakudo fb11f1: OUTPUT«foo␤===SORRY!===␤Confused␤at /tmp/q40bpgnGUA:1␤»
18:26 _edwin that's the one
18:27 fgomez joined #perl6
18:27 timotimo r: BEGIN { eval 'say "foo"' }; say "bar"
18:27 p6eval rakudo fb11f1: OUTPUT«foo␤bar␤»
18:27 timotimo go figure!
18:27 _edwin rakudobug?
18:28 _edwin std: BEGIN { eval 'say "foo"' }␤say "bar"
18:28 birdwindupbird joined #perl6
18:28 p6eval std 77327a4: OUTPUT«ok 00:00 43m␤»
18:31 GlitchMr42 joined #perl6
18:33 timotimo seems like a rakudobug indeed.
18:35 sorear good * #perl6
18:45 fhelmberger_ joined #perl6
18:52 broquaint joined #perl6
18:53 rindolf sorear: hello.
18:56 sudokode joined #perl6
18:59 sudokode joined #perl6
19:08 TimToady nr: proto infix:<of> (|) is equiv(&infix:<X>) {*}; multi infix:<of>(\slice, @a) { @a[slice] }; multi infix:<of>(\slice, %h) { %h{slice} }; say 'HOME','SHELL' of %*ENV;
19:08 p6eval niecza v22-6-g9e5350d: OUTPUT«/home/p6eval /bin/bash␤»
19:08 p6eval ..rakudo fb11f1: OUTPUT«===SORRY!===␤Cannot call 'trait_mod:<is>'; none of these signatures match:␤:(Mu:U $child, Mu:U $parent)␤:(Attribute:D $attr, :rw(:$rw)!)␤:(Attribute:D $attr, :readonly(:$readonly)!)␤:(Attribute:D $attr, :box_target(:$box_target)!)␤:(Routine:D $r, :rw(:$rw)!)␤:(Rout…
19:09 kurahaupo joined #perl6
19:09 TimToady interesting, my rakudo gives Null PMC access in get_string()
19:10 TimToady updating to see if that helps
19:11 _edwin hi sorear! I think your gut feeling about the longest trail problem being NP-complete was right
19:11 _edwin because it is possible to transform the longest path problem into a longest trail problem by splitting each vertex into two vertices, one with all the incoming edges, one with all the outgoing edges, and a new edge inbetween
19:11 dalek Perlito: 74e2045 | (Flavio S. Glock)++ | / (5 files):
19:11 dalek Perlito: Perlito5 - js - TIEARRAY, STORE, FETCH; add tie() example to html/perlito5.html
19:11 dalek Perlito: review: https://github.com/fglock/​Perlito/commit/74e2045453
19:13 Circlepuller joined #perl6
19:14 TimToady nr: proto infix:<of> (|) {*}; multi infix:<of>(\slice, @a) { @a[slice] }; multi infix:<of>(\slice, %h) { %h{slice} }; say 'HOME','SHELL' of %*ENV;
19:15 p6eval rakudo fb11f1, niecza v22-6-g9e5350d: OUTPUT«HOME/bin/bash␤»
19:15 dalek Perlito: 9536f4a | (Flavio S. Glock)++ | / (2 files):
19:15 dalek Perlito: Perlito5 - ChangeLog
19:15 dalek Perlito: review: https://github.com/fglock/​Perlito/commit/9536f4ac87
19:15 TimToady nr: proto infix:<of> (|) {*}; multi infix:<of>(\slice, @a) { @a[slice] }; multi infix:<of>(\slice, %h) { %h{slice} }; say *-1 of lines;
19:15 p6eval rakudo fb11f1: OUTPUT«WhateverCode.new()␤»
19:15 p6eval ..niecza v22-6-g9e5350d: OUTPUT«{ ... }␤»
19:16 Circlepuller_ joined #perl6
19:16 TimToady nr: proto infix:<of> (|) {*}; multi infix:<of>(\slice, @a) { @a[slice] }; multi infix:<of>(\slice, %h) { %h{slice} }; say *-1 of @(lines);
19:16 p6eval rakudo fb11f1: OUTPUT«WhateverCode.new()␤»
19:16 p6eval ..niecza v22-6-g9e5350d: OUTPUT«{ ... }␤»
19:17 TimToady nr: proto infix:<of> (|) {*}; multi infix:<of>(\slice, @a) { @a[slice] }; multi infix:<of>(\slice, %h) { %h{slice} }; say 0 of @(lines);
19:17 p6eval rakudo fb11f1: OUTPUT«Land der Berge, Land am Strome,␤Land der Äcker, Land der Dome,␤Land der Hämmer, zukunftsreich!␤Heimat bist du großer Söhne,␤Volk, begnadet für das Schöne,␤vielgerühmtes Österreich,␤vielgerühmtes Österreich!␤␤Heiß umfehdet, wild umstritten␤liegst dem Erdteil du inmi…
19:17 p6eval ..niecza v22-6-g9e5350d: OUTPUT«Land der Berge, Land am Strome,␤»
19:17 TimToady umm...
19:17 _edwin hm, how can I pass a Str argument to a macro (instead of an AST)?
19:18 TimToady still get the Null PMC locally
19:19 TimToady do you mean foo("string") or foo(string)?
19:19 TimToady the latter would be $ast.Str or some such
19:20 TimToady the former would require evaluating the $ast
19:20 TimToady but I believe that everything comes in as AST currently
19:21 _edwin I meant the former
19:22 TimToady might need an inside helper macro to evaluate an OUTER::<$ast>
19:22 TimToady though presumably there's some more direct way
19:22 TimToady that is probably non-portable
19:22 _edwin $ast.Str gives me something like AST<-993599824> in rakudo :/
19:23 tadzik _edwin: I don't think string macros are implemented
19:24 TimToady if $ast gives you positional info you could extract the string from the original text, I suppose
19:24 TimToady but a helper macro might be cleaner and more portable
19:25 TimToady you'd just have to call the helper macro from the body of the outer macro
19:25 TimToady assuming the helper macro can see your outer $ast somehow
19:26 _edwin tadzik: ah, that might be why I get "too few positional arguments: 2 passed, 3 (or more) expected" when trying to return a string
19:27 _edwin TimToady, you mean something like returning the AST from the inner macro so it is evaluated in the body of the outer macro?
19:27 TimToady nodnod
19:27 _edwin ok, thanks
19:28 TimToady we should probably spec something that just does that though
19:30 TimToady nr: proto infix:<of> (|) {*}; multi infix:<of>(\slice, @a) { @a[|slice] }; multi infix:<of>(\slice, %h) { %h{|slice} }; say 0 of lines;
19:30 p6eval niecza v22-6-g9e5350d: OUTPUT«Unhandled exception: Unable to resolve method Capture in type Int␤  at /home/p6eval/niecza/lib/CORE.setting line 3278 (prefix:<|> @ 4) ␤  at /tmp/Y3_BA0ynWR line 1 (infix:<of> @ 4) ␤  at /tmp/Y3_BA0ynWR line 1 (mainline @ 7) ␤  at /home/p6eval/niecza/lib/CO…
19:30 p6eval ..rakudo fb11f1: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&prefix:<|>' called (lines 1, 1)␤»
19:31 _edwin when I try to call the inner macro I always get "too few positional arguments: 2 passed, 3 (or more) expected"
19:31 _edwin regardless of the signature I declare for the inner macro
19:32 TimToady ENOKLOO
19:33 TimToady all our domain experts are vacating at the moment, I suspect
19:36 cognominal joined #perl6
19:36 cognominal joined #perl6
19:37 TimToady or prioritizing their family, as they should be
19:41 Circlepuller joined #perl6
19:42 TimToady nr: proto infix:<of> (|) {*}; multi infix:<of>(\slice, @a) { @a[|slice] }; multi infix:<of>(\slice, %h) { %h{|slice} }; my @lines = lines; say 0 of @lines;
19:42 p6eval niecza v22-6-g9e5350d: OUTPUT«Unhandled exception: Unable to resolve method Capture in type Int␤  at /home/p6eval/niecza/lib/CORE.setting line 3278 (prefix:<|> @ 4) ␤  at /tmp/SHKejJ6D38 line 1 (infix:<of> @ 4) ␤  at /tmp/SHKejJ6D38 line 1 (mainline @ 8) ␤  at /home/p6eval/niecza/lib/CO…
19:42 p6eval ..rakudo fb11f1: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&prefix:<|>' called (lines 1, 1)␤»
19:42 TimToady nr: proto infix:<of> (|) {*}; multi infix:<of>(\slice, @a) { @a[slice] }; multi infix:<of>(\slice, %h) { %h{slice} }; my @lines = lines; say 0 of @lines;
19:42 p6eval rakudo fb11f1: OUTPUT«Land der Berge, Land am Strome,␤Land der Äcker, Land der Dome,␤Land der Hämmer, zukunftsreich!␤Heimat bist du großer Söhne,␤Volk, begnadet für das Schöne,␤vielgerühmtes Österreich,␤vielgerühmtes Österreich!␤␤Heiß umfehdet, wild umstritten␤liegst dem Erdteil du inmi…
19:42 p6eval ..niecza v22-6-g9e5350d: OUTPUT«Land der Berge, Land am Strome,␤»
19:42 TimToady nr: proto infix:<of> (|) {*}; multi infix:<of>(\slice, @a) { @a[slice] }; multi infix:<of>(\slice, %h) { %h{slice} }; my @lines = lines; say *-1 of @lines;
19:42 p6eval rakudo fb11f1: OUTPUT«WhateverCode.new()␤»
19:42 p6eval ..niecza v22-6-g9e5350d: OUTPUT«{ ... }␤»
19:43 TimToady nr: proto infix:<of> (|) {*}; multi infix:<of>(\slice, @a) { @a[slice] }; multi infix:<of>(\slice, %h) { %h{slice} }; my @lines = lines; say (*-1) of @lines;
19:43 p6eval rakudo fb11f1: OUTPUT«WhateverCode.new()␤»
19:43 p6eval ..niecza v22-6-g9e5350d: OUTPUT«{ ... }␤»
19:43 TimToady nr: say lines[0]
19:43 p6eval rakudo fb11f1: OUTPUT«Land der Berge, Land am Strome,␤Land der Äcker, Land der Dome,␤Land der Hämmer, zukunftsreich!␤Heimat bist du großer Söhne,␤Volk, begnadet für das Schöne,␤vielgerühmtes Österreich,␤vielgerühmtes Österreich!␤␤Heiß umfehdet, wild umstritten␤liegst dem Erdteil du inmi…
19:43 p6eval ..niecza v22-6-g9e5350d: OUTPUT«Land der Berge, Land am Strome,␤»
19:44 TimToady sure looks like a rakudobug to me
19:44 TimToady b: say lines[0]
19:44 p6eval b 922500: OUTPUT«Land der Berge, Land am Strome,␤»
19:44 TimToady a regression, in fact
19:44 TimToady p: say lines[0]
19:44 p6eval pugs: OUTPUT«*** No such subroutine: "&lines"␤    at /tmp/cfZa6ba0ww line 1, column 5 - line 2, column 1␤»
19:46 cognominal joined #perl6
19:47 * _edwin submitted rakudobug about the BEGIN { eval } confusion: https://rt.perl.org/rt3/Publi​c/Bug/Display.html?id=115134
19:47 rindolf TimToady: did you see Shmuel's comment here: http://mail.perl.org.il/pipermail​/perl/2012-September/012838.html ?
19:51 _edwin is it worthwhile to also submit a spectest for a rakudobug (if I'm pretty sure it is a bug)?
19:51 TimToady spectests are a good thing
19:52 TimToady but if you don't, the fixer will presumably write one
19:52 flussence .oO( why would someone go to a perl conference then complain that people are talking about perl there all the time? )
19:53 rindolf flussence: are you referring to Shmuel's comment?
19:53 flussence yeah. it just comes off as needlessly bitter.
19:53 diakopter flussence: yes, if one doesn't include "Perl 6" in "Perl"
19:54 _edwin what is the preferred way to contribute to roast? pull request or something? I didn't find something about that in the README
19:55 flussence _edwin: usually you ask and then end up getting a commit bit anyway :)
19:55 _edwin ok, that would be nice :)
19:56 * TimToady is just amused by the slippage into the typical phraseology of old religion advocates vs new religion evangelists: "stuff it down our throats"
19:57 TimToady _edwin: do you have a github id?
19:57 * [Coke] gives up on modules in classes and re-refactors partcl
19:58 _edwin TimToady, hm I really have to check . o O (ETOOMANYWEBSITEACCOUNTS)
20:01 Targen joined #perl6
20:02 simcop2387 joined #perl6
20:03 _edwin no, I haven't. going to get myself one
20:06 TimToady not terribly hard, but you do have to have to privide an RSA public key
20:06 TimToady *provide
20:06 Circlepuller_ joined #perl6
20:08 bruges joined #perl6
20:10 sjohnson openssl -genrsa technology
20:10 sjohnson github has all the instructions though for you
20:14 sirrobert joined #perl6
20:16 spider-mario joined #perl6
20:19 mjreed joined #perl6
20:20 spider-mario joined #perl6
20:20 colomon http://www.johndcook.com/blog/​2012/10/02/sum-of-4th-powers/
20:22 _edwin TimToady, I think I made it. id "edwinst"
20:25 TimToady hugme: add edwinst
20:26 TimToady hugme: hug someone
20:26 * hugme hugs someone
20:27 sjohnson hugs
20:28 sjohnson i wonder if hugme has any STDs yet
20:28 colomon on the sum-of-4th-powers: https://gist.github.com/3836214 # not sure if I should be proud of this or ashamed
20:33 sorear comment on 5th powers: for all large w, below w^5, there are about w fifth powers and therefore about w^2 sums of two fifth powers.  making the (very unjustifiable) assumption that sums of two fifth powers are distributed randomly, by the birthday bounds there is about a w^-1 chance of finding a number which is a sum of two fifth powers, so there probably aren't any.
20:34 colomon interesting, niecza is nearly 10x faster than rakudo for that script.  I thought rakudo had pretty much caught up with niecza these days...
20:35 TimToady _edwin: okay, you should have commit access to the repos that the perl6 team can modify, including roast
20:35 TimToady dunno why hugme didn't work, offhand...
20:36 _edwin TimToady, thanks, that's awsome
20:37 sorear TimToady: I don't think hugme has worked since we converted perl6 to an org acct
20:38 kurahaupo joined #perl6
20:40 TimToady I seem to recall seeing moritz making it work, so maybe I'm just not on the right list...
20:42 grondilu nr: my @a = [ <a b> ], [ <d e> ]; say @a».[0]
20:42 p6eval rakudo fb11f1, niecza v22-6-g9e5350d: OUTPUT«a b d e␤»
20:42 * grondilu was expecting "a d"
20:42 * _edwin installing niecza to crosscheck potential spectests
20:43 sorear grondilu: that's how it's supposed to work but nobody implements the new spec yet
20:43 TimToady grondilu: that would be correct if either niecza or rakudo followed current spec
20:44 grondilu ok.  Good to know.
20:44 TimToady or even if either followed the previously specced duckmap semantics :)
20:44 TimToady but they both do deepmap currently
20:45 TimToady so follow .[] structure in preference to calling .[] on top level
20:48 mst Bedamned quack cartographers going round mapping our ducks ...
20:49 mjreed joined #perl6
20:50 grondilu r: say (<a b>)»[*]
20:50 p6eval rakudo fb11f1: OUTPUT«a b␤»
20:51 grondilu cool
20:51 grondilu So I don't actualy need to type the period between » and [ ?
20:51 raiph joined #perl6
20:51 sorear correct, you don't
20:51 grondilu nice
20:52 sorear r: say <a b>.».[*] # this works too
20:52 p6eval rakudo fb11f1: OUTPUT«===SORRY!===␤Confused␤at /tmp/ahPbN0oART:1␤»
20:52 sorear n: say <a b>.».[*] # this works too
20:52 p6eval niecza v22-6-g9e5350d: OUTPUT«a b␤»
20:52 sorear std: say <a b>.».[*] # this works too
20:52 p6eval std 77327a4: OUTPUT«ok 00:00 43m␤»
20:52 sorear rakudobug?
20:52 grondilu r: say <a b>»[*]
20:52 p6eval rakudo fb11f1: OUTPUT«a b␤»
20:52 sorear r: $_.++
20:52 p6eval rakudo fb11f1: OUTPUT«===SORRY!===␤CHECK FAILED:␤Undefined routine '&postfix:<.>' called (line 1)␤»
20:52 sorear std: $_.++
20:52 p6eval std 77327a4: OUTPUT«ok 00:00 41m␤»
20:53 sorear seems rakudo doesn't support dots before postfixes in general
20:53 sorear r: .++
20:53 p6eval rakudo fb11f1: OUTPUT«===SORRY!===␤Method 'unshift' not found for invocant of class 'NQPMu'␤»
20:54 hash_table joined #perl6
20:54 sorear std: .++
20:54 p6eval std 77327a4: OUTPUT«ok 00:00 41m␤»
20:54 sorear phenny: tell masak possible rakudobugs, "r: .++" and "r: $_.++"; STD is fine with both; are they known?
20:54 phenny sorear: I'll pass that on when masak is around.
20:55 sorear phenny: tell masak well, rakudobugs for sure, possibly *new*
20:55 phenny sorear: I'll pass that on when masak is around.
20:57 mjreed1 joined #perl6
20:58 cognominal joined #perl6
21:00 grondilu the same shortcut does not work with function, though:
21:01 grondilu r: say (&cos, &sin)»(pi)
21:01 p6eval rakudo fb11f1: OUTPUT«Too many positional parameters passed; got 3 but expected 2␤  in sub METAOP_HYPER_POSTFIX at src/gen/CORE.setting:12161␤  in block  at /tmp/fQtKotv0au:1␤␤»
21:01 grondilu n: say (&cos, &sin)»(pi)
21:01 p6eval niecza v22-6-g9e5350d: OUTPUT«-1 1.2246063538223773E-16␤»
21:01 grondilu r: say (&cos, &sin)».(pi)  # here the period is needed
21:01 p6eval rakudo fb11f1: OUTPUT«-1 -3.52688866664137e-10␤»
21:03 raiph n: https://gist.github.com/3836214 # don't understand why colomon wouldn't be proud of this and post it at the original blog
21:03 p6eval niecza v22-6-g9e5350d: OUTPUT«[31m===[0mSORRY![31m===[0mâ�¤â�¤Confused at /tmp/f0MznW5rjS line 1:â�¤------> [32mhttps[33mâ��[31m://gist.github.com/3836214 # don't under[0mâ�¤â�¤Undeclared routine:â�¤       'https' used at line 1â�¤â�¤Parse failedâ�¤â�¤Â»
21:04 raiph n: my @fourth-powers = (1..*).map(* ** 4) ... * >= 635318657; my %counts; for @fourth-powers X+ @fourth-powers -> $sum {     %counts{$sum}++; };  for %counts.keys.grep({ %counts{$_} > 2 }) -> $sum {     say "$sum has { %counts{$sum} } fourth power sums"; }
21:04 p6eval niecza v22-6-g9e5350d: OUTPUT«635318657 has 4 fourth power sums␤»
21:04 colomon raiph: its kind of excessively brute force even as it is kind of elegant
21:05 colomon it's
21:06 colomon also that version has a factor of two error in its reported output.  :)
21:08 raiph colomon: ah. My answer to the first concern is "You have to love brute force" (from the comments). But, yeah, I glossed over the factor of two error...
21:08 bbkr_ joined #perl6
21:09 colomon it's minor and unimportant as far as errors go.  :)
21:10 colomon the thing that impressed me was that our p6 implements are now fast enough that a brute force approach is fine.
21:11 colomon *implementations # typing sideways while hanging out with a 4yo
21:12 benabik joined #perl6
21:12 integral joined #perl6
21:12 integral joined #perl6
21:15 colomon n: https://gist.github.com/3836214
21:15 p6eval niecza v22-6-g9e5350d: OUTPUT«635318657 has 2 fourth power sums␤»
21:15 TimToady grondilu: I believe you're looking for "when none /z/"
21:16 raiph colomon: i'm impressed. gonna post it to the blog?
21:16 colomon maybe?
21:20 grondilu r: given "Foo" { when none /z/ { say "no match" } }
21:20 p6eval rakudo fb11f1: OUTPUT«no match␤»
21:20 grondilu TimToady: indeed.  Thanks.
21:21 colomon I love the first line and the X+.  It's the rest of it that seems slightly inelegant to me.
21:23 xubu joined #perl6
21:24 grondilu TimToady: yet I confess I don't understand how it works.  I thought 'none' was a junction, and /z/ is not a scalar.
21:25 sorear here's a question for the ages: how MANY numbers can be expressed as a sum of two squares of squares in two different ways?
21:25 sorear my heuristic argument from above suggests that the answer is not infinity, but does not prove any specific value
21:26 shachaf «I went to visit him while he was lying ill at the hospital. I had come in taxi cab number 14 and remarked that it was a rather dull number. "No" he replied, "it is a very interesting number. It's the smallest number expressible as the product of 7 and 2 in two different ways."»
21:26 sorear shachaf, what's your point here?
21:27 shachaf No mathematical point.
21:27 shachaf Hmm, squares of squares.
21:27 sorear is your point that you don't like our discussion?
21:28 TimToady sorear: you're taking it wrong, I think
21:28 TimToady 7*2 and 2*7 is a very uninteresting interesting way to make 14
21:28 shachaf Your discussion is great!
21:28 sorear I guess that's possible
21:28 grondilu I think shachaf for a second thought that "two different ways" meant "in a different order".
21:28 TimToady it's more of a linguistic point
21:29 shachaf Point? It's just a joke that I found very funny the first time I came across it.
21:29 * TimToady was amused by it
21:30 sorear ah, I did not see it as a joke, my apologies
21:30 sorear I see I too have a problem with seeing cloaked insults where there are none
21:31 diakopter hm, I wonder if there's a limit to the number of interesting comments on particular numbers
21:31 TimToady yes, well, most of us here are not at the neurotypical end of the spectrum :)
21:31 _edwin sorear, but if you find one such number, isn't it that you can generate an infinity of them? a^4+b^4 = c^4+d^4 --> (na)^4+(nb)^4 = (nc)^4+(nd)^4 for any n
21:33 colomon wait, classify!
21:35 sorear diakopter: have you encountered https://en.wikipedia.org/wik​i/Interesting_number_paradox ?
21:36 sorear _edwin: ooo
21:36 raiph colomon: re first line: I don't like seeing ^ used with > instead of just >=
21:36 sorear _edwin: integral points on a homogenous polynomial eh.  someday I need to properly learn algebraic geometry
21:39 colomon raiph: it's not the same thing.  ^ and > there means "up to and not including the first value > N" ; just >= would be "up to and including the first value >= N"
21:41 sorear _edwin: now you can interpret (a,b,c,d) as the homogenous coordinates of a point in projective 3-space, your polynomial describes an algebraic surface in 3-space, and we're talking about rational points *waves hands vigorously*
21:43 sorear the obvious question is then "what does this projective variety look like"
21:43 raiph colomon: d'oh
21:43 _edwin right, you could collapse these uninteresting multiples this way
21:44 _edwin hehe, i like this paradox
21:44 _edwin I'm afraid my mono build hangs :(
21:44 colomon n: say (^10).classify({ * %% 2 ?? "even" !! "odd" }).perl
21:44 p6eval niecza v22-6-g9e5350d: OUTPUT«Unhandled exception: Unable to resolve method classify in type Range␤  at /tmp/KQtr9CypON line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4198 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4199 (module-CORE @ 574) ␤  at /h…
21:44 sorear to which I say: let x^4 + y^4 = 1 + z^4 ; the constant-z cross sections are superellipses
21:45 diakopter sorear: no
21:45 colomon r: say (^10).classify({ * %% 2 ?? "even" !! "odd" }).perl
21:45 p6eval rakudo fb11f1: OUTPUT«("even" => [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]).hash␤»
21:45 benabik joined #perl6
21:45 colomon r: say (^10).classify({ $_ %% 2 ?? "even" !! "odd" }).perl
21:45 p6eval rakudo fb11f1: OUTPUT«("even" => [0, 2, 4, 6, 8], "odd" => [1, 3, 5, 7, 9]).hash␤»
21:45 colomon n: say (^10).classify({ $_ %% 2 ?? "even" !! "odd" }).perl
21:45 p6eval niecza v22-6-g9e5350d: OUTPUT«Unhandled exception: Unable to resolve method classify in type Range␤  at /tmp/fKVEyDHo38 line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4198 (ANON @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4199 (module-CORE @ 574) ␤  at /h…
21:46 _edwin r: say (^10).classify(* %% 2 ?? "even" !! "odd" ).perl
21:46 p6eval rakudo fb11f1: OUTPUT«Nominal type check failed for parameter '&t'; expected Callable but got Str instead␤  in method classify at src/gen/CORE.setting:1143␤  in block  at /tmp/02jL5p_sZj:1␤␤»
21:46 grondilu sorear: circles rather than ellipses, no?
21:47 sorear I'll just call this thing a squircular hyperboloid and leave it for someone who knows more about projective varieties to pick up
21:47 _edwin * does not thunk enough of the code for this to work, i think
21:47 grondilu they are not projective anymore since you reduced to 3 parameters.  You already projected.
21:49 TimToady jetlag nap attack &
21:49 colomon n: say (^10).list.classify({ $_ %% 2 ?? "even" !! "odd" }).perl
21:49 p6eval niecza v22-6-g9e5350d: OUTPUT«("even" => [0, 2, 4, 6, 8], "odd" => [1, 3, 5, 7, 9]).list␤»
21:50 _edwin rn: (* %% 2).WHAT
21:50 p6eval rakudo fb11f1, niecza v22-6-g9e5350d:  ( no output )
21:50 _edwin rn: (* %% 2).WHAT.say
21:50 p6eval rakudo fb11f1: OUTPUT«WhateverCode()␤»
21:50 p6eval ..niecza v22-6-g9e5350d:  ( no output )
21:51 _edwin rn: (* %% 2 ?? 1 !! 2).WHAT.say
21:51 p6eval rakudo fb11f1, niecza v22-6-g9e5350d: OUTPUT«Int()␤»
21:52 sorear .oO( hmm, I think this would be a great shape for a hat. maybe I'll bring one to austin )
21:52 _edwin * ?? ... !! ... does not autothunk at all. is that intentional?
21:57 grondilu sorear: actually you just reduced the search domain, but not all the points are solutions.  They are still tricky to find.
22:00 sorear grondilu: I think that all the rational points of the new affine variety are solutions, except for those lying on a finite number of trivial planes corresponding to non-solutions like x^4 + y^4 = x^4 + y^4
22:01 grondilu I very much doubt so.
22:01 sorear suppose (x/d), (y/d), (z/d) is a rational point
22:01 grondilu hang on
22:02 sorear that is (x/d)^4 + (y/d)^4 = (z/d)^4 + 1
22:02 sorear multiply through by d^4, x^4 + y^4 = z^4 + d^4
22:02 grondilu sorry, you were right.  It's just that finding such rationals is tricky.
22:03 fgomez joined #perl6
22:05 grondilu probably just as tricky as the problem in its initial formulation.
22:07 sorear I get the impression that if I knew more algebraic geometry, I'd have tools I could use to help solve rational point problems
22:09 grondilu That would help.  Indeed algebraic geometry is notoriously linked to number theory.
22:10 grondilu as far as I know anyway.
22:15 sorear Actually that variety has no nontrivial rational points at infinity.
22:15 sorear Fermat's last theorem.
22:15 dalek Perlito: 1ec6ea0 | (Flavio S. Glock)++ | / (6 files):
22:15 dalek Perlito: Perlito5 - js - add UNTIE
22:15 dalek Perlito: review: https://github.com/fglock/​Perlito/commit/1ec6ea07cc
22:19 sorear Oops I got a sign wrong, it's more corset-shaped than hat-shaped
22:19 grondilu btw, can a variety "cut through space" without enountering any rational?  That would be weird.
22:19 taggart joined #perl6
22:19 sorear sure, try the plane z = pi
22:20 grondilu sorear: indeed.
22:20 sorear or z^3 + z = 1 if you want it to be algebraic over Z
22:21 cognominal joined #perl6
22:22 taggart I am looking for documentation on the perl6 "form" built-in, pointers?
22:23 sorear a couple years back formats were kicked out of the perl 6 core and into a module, Perl6::Form, which I don't know if it's maintained
22:25 sizz joined #perl6
22:26 Circlepuller joined #perl6
22:28 taggart sorear: I found this one https://github.com/mathw/form/  and in perl5 there is Perl6::Form (pretty old now)
22:36 Khisanth joined #perl6
22:40 Circlepuller_ joined #perl6
22:43 Circlepuller joined #perl6
22:52 taggart left #perl6
23:00 cognominal joined #perl6
23:06 sizz joined #perl6
23:15 whiteknight joined #perl6
23:25 macae joined #perl6
23:30 cibs joined #perl6
23:31 Circlepuller_ joined #perl6
23:34 Circlepuller_ joined #perl6
23:38 Circlepuller joined #perl6
23:54 Circlepuller_ joined #perl6
23:56 Circlepuller__ joined #perl6

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

Perl 6 | Reference Documentation | Rakudo