Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2014-05-23

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:05 timotimo damn, i lost the link to the tutorial i was following :(
00:05 timotimo nope, found it again
00:05 colomon timotimo++
00:15 timotimo not exactly sure how to map things like on_delete_event where you can return true or false to signal to gtk that the window should or should not be destroyed when the user clicks close or hits alt-f4 or equivalent
00:18 guru joined #perl6
00:21 autark joined #perl6
00:35 timotimo i wonder if it should be a method you could just override (or, you know, add with an anonymous role)
00:43 dalek gtk-simple: 3eaba06 | (Timo Paulssen)++ | lib/GTK/Simple.pm6:
00:43 dalek gtk-simple: nitpick some final spaces away
00:43 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/3eaba06eda
00:43 dalek gtk-simple: 16c6da1 | (Timo Paulssen)++ | lib/GTK/Simple.pm6:
00:43 dalek gtk-simple: when closing the main window, the program shall exit the main loop.
00:43 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/16c6da1f37
00:43 dalek gtk-simple: f5ee9ee | (Timo Paulssen)++ | examples/01_hello_world.pm6:
00:43 dalek gtk-simple: the hello/goodbye example is now somewhat proper.
00:43 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/f5ee9eef86
00:43 dalek gtk-simple: 8b7475e | (Timo Paulssen)++ | lib/GTK/Simple.pm6:
00:43 dalek gtk-simple: vim fold markers for categories of native subs
00:43 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/8b7475e667
00:43 dalek gtk-simple: af88ff8 | (Timo Paulssen)++ | / (2 files):
00:43 dalek gtk-simple: bind get_ and set_border_width for containers
00:43 dalek gtk-simple:
00:43 dalek gtk-simple: and use it in the example
00:43 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/af88ff8a45
00:43 rurban joined #perl6
00:48 rurban joined #perl6
01:05 klapperl_ joined #perl6
01:07 dalek gtk-simple: f61d580 | (Timo Paulssen)++ | examples/01_hello_world.pm6:
01:07 dalek gtk-simple: lots of documentations and clarifications
01:07 dalek gtk-simple: review: https://github.com/perl6/gtk-simple/commit/f61d580a5f
01:18 Khisanth joined #perl6
01:48 Su-Shee_ joined #perl6
01:48 FROGGS_ joined #perl6
01:49 rurban joined #perl6
01:50 Ben_Goldberg joined #perl6
01:51 thou joined #perl6
01:51 donaldh_ joined #perl6
01:53 breinbaa1 joined #perl6
01:53 huf_ joined #perl6
01:59 FROGGS[mobile] joined #perl6
02:06 btyler joined #perl6
02:19 Sqirrel joined #perl6
02:41 rurban joined #perl6
02:45 rurban1 joined #perl6
03:26 xragnar joined #perl6
03:36 Alula joined #perl6
04:03 kaare_ joined #perl6
04:20 woosley left #perl6
04:26 REPLeffect joined #perl6
04:35 Sqirrel joined #perl6
04:41 volodin661 joined #perl6
04:42 volodin661 perl6: say [+] 1,2
04:42 camelia rakudo-{parrot,jvm,moar} 85bcd7, niecza v24-109-g48a8de3: OUTPUT«3␤»
04:43 volodin661 left #perl6
04:45 volodin661 joined #perl6
04:50 volodin661 rakudo: map {.say} <== grep { /^zhoppa/ ^fff^ /^zhoppa/ } <== lines;
04:50 camelia rakudo-{parrot,jvm,moar} 85bcd7: ( no output )
04:50 volodin661 1
04:50 volodin661 2
04:50 volodin661 3
04:50 volodin661 4
04:51 volodin661 ^D
04:56 volodin661 joined #perl6
04:56 volodin661 perl6: say .value given max :by(*.key), classify *.chars, grep { [le] .comb }, ( 'aa', 'dsasd', 'gg','dd')
04:57 camelia niecza v24-109-g48a8de3: OUTPUT«Unhandled exception: Unable to resolve method key in type Hash␤  at /tmp/tmpfile line 1 (ANON @ 2) ␤  at /home/p6eval/niecza/lib/CORE.setting line 1808 (ANON @ 4) ␤  at /home/p6eval/niecza/lib/CORE.setting line 1812 (List.max @ 14) ␤  at /home…»
04:57 camelia ..rakudo-{parrot,jvm,moar} 85bcd7: OUTPUT«aa gg dd␤»
05:04 volodin661 index of the minimum element of the array in PYTHON is: a=[9,10,6,0,5,7]; min_idx = a.index(min(a));    and In Perl6 ?
05:07 rurban joined #perl6
05:08 Sqirrel joined #perl6
05:09 skids r: my @a = (0,1,5,2,9,4,-1); @a.first-index(@a.min).say
05:09 camelia rakudo-{parrot,jvm,moar} 85bcd7: OUTPUT«6␤»
05:11 skids r: my @a = (0,1,5,2,9,4,-1); @a.first(* > 4).say
05:11 camelia rakudo-{parrot,jvm,moar} 85bcd7: OUTPUT«5␤»
05:14 dayangkun joined #perl6
05:23 kaare_ joined #perl6
05:35 moritz \o
05:35 moritz http://blogs.perl.org/users/peter_martini/2014/05/spelunking-why-while-is-my-new-favorite-perl-ism.html
05:38 rurban joined #perl6
05:39 rurban1 joined #perl6
05:56 spintronic joined #perl6
05:59 spintronic Does STD.pm implement all of Perl 6 into Perl 5?
06:08 rindolf joined #perl6
06:13 TimToady only the parser
06:14 TimToady and it cheats, for instance by using localized globals rather than true dynamic vars
06:14 TimToady and by using the subset of Perl 6 that is easy to translate to Perl 5 :)
06:15 TimToady for some subset of "easy" that does not include the parser itself :)
06:18 woolfy joined #perl6
06:27 spintronic ah ok thanks TimToady
06:49 FROGGS joined #perl6
06:51 lizmat m: say $*OUT.WHAT
06:51 camelia rakudo-moar 85bcd7: OUTPUT«(IO::Handle)␤»
06:51 lizmat m: $*OUT = class is IO::Handle {}
06:51 camelia rakudo-moar 85bcd7: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/m9LlshWozmâ�¤Unable to parse class definitionâ�¤at /tmp/m9LlshWozm:1â�¤------> [32m$*OUT = class is [33mâ��[31mIO::Handle {}[0mâ�¤    expecting any of:â�¤        postfixâ�¤        infix stopper…»
06:51 lizmat m: $*OUT = class {}
06:51 camelia rakudo-moar 85bcd7: ( no output )
06:51 FROGGS m: $*OUT = class { } but IO::Handle {}
06:51 camelia rakudo-moar 85bcd7: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/PKRX_7FkdT�Unexpected block in infix position (two terms in a row, or previous statement missing semicolon?)�at /tmp/PKRX_7FkdT:1�------> [32m$*OUT = class { } but IO::Handle [33m�[31m{}…»
06:51 lizmat shouldn't the "class is IO::Handle" case work ?
06:51 FROGGS m: $*OUT = class { } but IO::Handle;
06:51 camelia rakudo-moar 85bcd7: OUTPUT«Cannot mix in non-composable type IO::Handle into object of type <anon>␤  in sub infix:<but> at src/gen/m-CORE.setting:16948␤  in block  at /tmp/Ie3iPHRFJh:1␤␤»
06:52 FROGGS lizmat: it looks weird
06:52 lizmat FROGGS o/
06:52 FROGGS hi :o)
06:52 lizmat it's one of the tests failing with jnthn's "say" patches
06:52 jnthn lizmat: You need to give the class a name, no?
06:52 jnthn r: class Foo is IO::Handle { }
06:52 camelia rakudo-{parrot,jvm,moar} 85bcd7: ( no output )
06:53 FROGGS m: $*OUT = anon class is IO::Handle {} # it perhaps parses 'is' as the class name?
06:53 camelia rakudo-moar 85bcd7: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/aCoDluSCtLâ�¤Unable to parse class definitionâ�¤at /tmp/aCoDluSCtL:1â�¤------> [32m$*OUT = anon class is [33mâ��[31mIO::Handle {} # it perhaps parses 'is' a[0mâ�¤    expecting any of:â�¤        â€¦Â»
06:53 jnthn Or use :: for anonymous class
06:53 FROGGS m: $*OUT = anon class is is IO::Handle {} # it perhaps parses 'is' as the class name?
06:53 camelia rakudo-moar 85bcd7: ( no output )
06:53 jnthn FROGGS: Yes, correctly
06:53 lizmat t/spec/rosettacode/sierpinski_triangle.t
06:53 jnthn r: my $c = anon class :: is IO::Handle { } # if you really, really don't want a name
06:53 camelia rakudo-{parrot,jvm,moar} 85bcd7: ( no output )
06:54 jnthn lizmat: My patch I think is problematic 'cus it assumes that things pretending to be handles now also provide a say method.
06:54 jnthn Whereas before we only needed a print one.
06:54 FROGGS m: my $foo = anon regex { \d+ } # but I guess that only works because wo do not apply traits
06:54 camelia rakudo-moar 85bcd7: ( no output )
06:54 jnthn FROGGS: correct
06:55 jnthn lizmat: I suspect that means my patch ain't smart enough or something :)
06:55 FROGGS jnthn: that is a good start into the day *g*
06:55 FROGGS twice correct already :D
06:55 lizmat jnthn: ok
06:57 masak morning, #perl6
06:57 lizmat morning masak
06:57 masak m: say "morning #perl{$_}" for 5..7
06:57 camelia rakudo-moar 85bcd7: OUTPUT«morning #perl␤morning #perl␤morning #perl␤»
06:57 lizmat morning jnthn
06:57 masak oh, right.
06:57 masak m: say "morning #$_" for "perl5" .. "perl7"
06:57 camelia rakudo-moar 85bcd7: OUTPUT«morning #perl5␤morning #perl6␤morning #perl7␤»
06:57 SamuraiJack joined #perl6
06:57 jnthn o/ lizmat
06:58 lizmat m: say "morning #$_" for "perl5" .. ^"perl7"
06:58 camelia rakudo-moar 85bcd7: OUTPUT«Cannot call 'Real'; none of these signatures match:␤:(Mu:U \v: *%_)␤  in method new at src/gen/m-CORE.setting:7399␤  in sub prefix:<^> at src/gen/m-CORE.setting:7574␤  in block  at /tmp/HYUAuKhyD5:1␤␤»
06:58 anaeem1 joined #perl6
06:58 darutoko joined #perl6
06:58 lizmat m: say "morning #$_" for "perl5" ..^ "perl7"
06:58 camelia rakudo-moar 85bcd7: OUTPUT«morning #perl5␤morning #perl6␤»
06:58 lizmat :-)
06:59 lizmat so, do we have the equivalent of open \$scalar in perl 6?
06:59 jnthn no :D
07:00 jnthn Wait, what does that actually do?
07:00 jnthn The backslash?
07:00 jnthn But open returns a file handle in Perl 6.
07:02 kurahaupo joined #perl6
07:03 dalek panda: 35c2b63 | (Steve Mynott)++ | lib/Panda/Ecosystem.pm:
07:03 dalek panda: support web proxy via http_proxy env var
07:03 dalek panda: review: https://github.com/tadzik/panda/commit/35c2b63d2c
07:03 dalek panda: 30357d3 | tadzik++ | lib/Panda/Ecosystem.pm:
07:03 dalek panda: Merge pull request #83 from stmuk/master
07:03 dalek panda:
07:03 dalek panda: support web proxy via http_proxy env var
07:03 dalek panda: review: https://github.com/tadzik/panda/commit/30357d3f71
07:04 jnthn FROGGS: Is https://github.com/jnthn/zavolaj/pull/39 covered by changes you already did?
07:05 lizmat jnthn: it gives file semantics to a in memory scalar
07:05 FROGGS jnthn: nah, I tried but failed...
07:05 lizmat so, you can slurp from / spurt it
07:05 lizmat do .lines on it, etc
07:05 lizmat but all in memory
07:05 zakharyas joined #perl6
07:06 lizmat the sierpinski example is just doing that, in a strange way: it is "say"ing to a variable
07:07 lizmat http://rosettacode.org/wiki/Sierpinski_triangle#Perl_6
07:11 lizmat well, actually, only the test is doing that
07:11 lizmat it's not part of the example
07:11 lizmat hmmm...
07:13 lizmat breakfast&
07:14 Ven joined #perl6
07:30 kaleem joined #perl6
07:42 rurban joined #perl6
07:46 dmol joined #perl6
07:46 snarkyboojum joined #perl6
07:52 virtualsue joined #perl6
07:56 sergot morning! o/
07:57 FROGGS morning sergot
07:57 FROGGS sergot: had no chance to review your work, release took until 1am :(
08:00 sergot ok, no worries! :)
08:04 Ven joined #perl6
08:05 masak FROGGS++ # release
08:06 sergot FROGGS++
08:07 masak Vendethiel-: I would do everything in one pass, I think.
08:13 woolfy FROGGS++ # release
08:14 dalek star: 08dd7b4 | moritz++ | tools/star/Makefile:
08:14 dalek star: bump rakudo,nqp,moar versions to 2014.05
08:14 dalek star: review: https://github.com/rakudo/star/commit/08dd7b49cb
08:14 dalek star: 9917fe9 | moritz++ | modules/ (6 files):
08:14 dalek star: Update module versions
08:14 dalek star: review: https://github.com/rakudo/star/commit/9917fe9430
08:14 lizmat joined #perl6
08:14 zakharyas joined #perl6
08:14 dalek star: c9969dd | moritz++ | / (2 files):
08:14 dalek star: bump version in README and Makefile.in
08:14 dalek star: review: https://github.com/rakudo/star/commit/c9969dd0d8
08:15 lizmat joined #perl6
08:17 lizmat so I was thinking something like this idiom:
08:17 lizmat open my IO::File $scalar
08:17 lizmat giving you an IO::Handle::File
08:18 lizmat and then implement the necessary logic in IO::File and IO::Handle::File to make it look like a file
08:18 lizmat would that make sense?
08:19 zakharyas joined #perl6
08:19 woolfy left #perl6
08:20 jnthn Not to me
08:20 jnthn There's nothing to open
08:21 jnthn my $file = IO::InMemory.new; # or so would make more sense
08:21 jnthn Needs better naming
08:21 moritz +1 to using the OO approach
08:21 jnthn I think putting that behavior on open is a bit of a hack.
08:22 moritz p5's open() is a huge hack that we don't need to duplicate
08:22 jnthn An excusable one in Perl 5 where handles are not objects.
08:22 lizmat well, the thing is that if you have a module that accepts a path
08:22 lizmat and you want it to work in memory, you wouldn't have to change that routine
08:23 moritz ... assuming the argument isn't type to Str or IO::Path in the first place
08:23 lizmat so open() would need at least an MMD candidate to handle that case
08:24 lizmat internally, it would do the IO::InMemory of course
08:24 moritz lizmat: a possible compromise is to make open() a no-op on IO::Handle (or whatever we call it) objects
08:24 moritz lizmat: then you can pass in an IO::InMemory where people expect a path, as long as they only open() it
08:25 lizmat moritz: I assume you meant IO::Handle::File ?
08:25 fhelmberger joined #perl6
08:25 lizmat then yes
08:25 lizmat that would essentially be happening, yes
08:26 lizmat another thing before starting our part 1 of decommute:
08:26 lizmat TimToady: if Pair.key is rw, would this be expected behaviour:
08:26 lizmat liz$ perl6 -e 'my %h = (a=>1); .key = "b" for %h.pairs; say %h'
08:26 lizmat ("a" => 1).hash
08:26 * moritz hopes .key isn't rw
08:26 lizmat aka, silently allow changes to the pair, *without* affecting the hash
08:27 lizmat TimToady seems to be in two minds about that, see discussion yesterday
08:27 jnthn lizmat: I think the problem there is that the iterator implementation somehow ends up introducing its internal container to the hash
08:27 jnthn uh, to the Pair
08:27 jnthn It probably does like
08:27 moritz on a totally unrelated note, I thought about a horrible hack to work around Unicode problems with file systems: use punicode to encode module names!
08:27 jnthn my $foo = <obtain the key somehow>;
08:27 jnthn And so we accidentally build the pair with an rw thing
08:27 lizmat HashIter.new(self, :keystore($!keys), :pairs).list
08:28 lizmat is what Hash.pairs does
08:28 jnthn Yeah...so maybe it's inside HashIter :)
08:29 lizmat but Pairs are pretty much everywhere in Perl 6
08:29 lizmat and it seems a bit late to be changing that to something lake "Named"  now
08:31 lizmat *like
08:31 lizmat anyways, need to pack and decommute
08:31 lizmat later&
08:38 thou joined #perl6
08:42 rurban joined #perl6
08:43 FROGGS moritz: punicode would at least be a nice thing for the distribution's tarball file name
08:58 dayangkun joined #perl6
09:01 dayangkun joined #perl6
09:02 volodin661 perl6:my @a=1,3,4,0,8; @a.first-index(@a.min).say;
09:10 dayangkun joined #perl6
09:16 Ulti m: my @a=1,3,4,0,8; @a.first-index(@a.min).say;
09:16 camelia rakudo-moar 85bcd7: OUTPUT«3␤»
09:17 FROGGS volodin661: put a space after the first colon
09:20 * masak finds he doesn't use $obj.say at all, just .say -- and he's a bit confused as to why others like $obj.say so much
09:25 dalek Perlito: 666a73d | (Flavio S. Glock)++ | / (2 files):
09:25 dalek Perlito: Perlito5 - js - add test for "last from inside sub"
09:25 dalek Perlito: review: https://github.com/fglock/Perlito/commit/666a73dab0
09:26 dalek Perlito: 493e35f | (Flavio S. Glock)++ | TODO-perlito5:
09:26 dalek Perlito: Perlito5 - perl6 - un-deprecate
09:26 dalek Perlito: review: https://github.com/fglock/Perlito/commit/493e35fdc8
09:26 FROGGS I don't like it either
09:27 FROGGS fglock++
09:29 jnthn Yeah, I suaully use $handle.say(...) of course.
09:34 FROGGS yeah
09:37 dalek Perlito: 1c44abc | (Flavio S. Glock)++ | / (2 files):
09:37 dalek Perlito: Perlito5 - TODO - update
09:37 dalek Perlito: review: https://github.com/fglock/Perlito/commit/1c44abca0b
09:43 rurban joined #perl6
09:51 denis_boyun joined #perl6
10:06 xinming_ joined #perl6
10:13 FROGGS[mobile] joined #perl6
10:21 * virtualsue tries to work out why panda won't build
10:34 dalek Perlito: d5fe7f7 | (Flavio S. Glock)++ | / (2 files):
10:34 dalek Perlito: Perlito5 - js - add test for "alternate array deref syntax"
10:34 dalek Perlito: review: https://github.com/fglock/Perlito/commit/d5fe7f7dc5
10:36 sqirrel_ joined #perl6
10:40 virtualsue it complains that there is no supported backend but i built perl6 with moar support
10:44 rurban joined #perl6
11:01 [Sno]_ joined #perl6
11:01 moritz eeks
11:02 moritz precomping LWP::Simple during the star build (moarvm) hangs
11:02 moritz /home/mlenz/p6/star/rakudo-star-2014.05/install/bin/moar --execname=/home/mlenz/p6/star/rakudo-star-2014.05/install/bin/perl6-m --libpath=/home/mlenz/p6/star/rakudo-star-2014.05/install/languages/nqp/lib --libpath=/home/mlenz/p6/star/rakudo-star-2014.05/install/languages/perl6/lib --libpath=/home/mlenz/p6/star/rakudo-star-2014.05/install/languages/perl6/runtime /home/mlenz/p6/star/rakudo-star-2014.05/install/languages/perl6/runtime/perl6.moarvm --target=m
11:02 moritz http://perlpunks.de/paste/show/537f2ac1.569e.232 has been running for two hours now
11:05 moritz same for JSON::RPC::Client
11:05 moritz stuff looks really borked :(
11:06 kurahaupo joined #perl6
11:07 dalek Perlito: d4d6772 | (Flavio S. Glock)++ | / (4 files):
11:07 dalek Perlito: Perlito5 - perl5 - fix 2 TODO bugs
11:07 dalek Perlito: review: https://github.com/fglock/Perlito/commit/d4d6772d3f
11:11 FROGGS I was able to build star without problems yesterday
11:18 dalek Perlito: f2b435f | (Flavio S. Glock)++ | / (3 files):
11:18 dalek Perlito: Perlito5 - perl5 - fix "say" in Test.pm
11:18 dalek Perlito: review: https://github.com/fglock/Perlito/commit/f2b435f6d4
11:32 Psyche^_ joined #perl6
11:35 dalek Perlito: 173897c | (Flavio S. Glock)++ | TODO-perlito5:
11:35 dalek Perlito: Perlito5 - js - TODO - phase order
11:35 dalek Perlito: review: https://github.com/fglock/Perlito/commit/173897c2e7
11:41 virtualsue i've just been told that panda doesn't build with rakudo star. i'm not sure what to do with this information.
11:45 cognominal In Mixy.pm  :       method default(--> Real) { 0 }
11:45 cognominal Why Real?
11:45 jnthn Rakudo Star already includes Panda, so there's no need to build one.
11:47 cognominal https://github.com/rakudo/rakudo/blob/nom/src/core/Mixy.pm#L2
11:48 virtualsue jnthn: ha. so it does.
11:51 virtualsue still, i would have thought it should be buildable
11:55 tadzik timotimo: no eye deer
11:55 tadzik but it might just be starting a new panda :)
11:55 jnthn Panda as it was at the time of the Rakudo Star release in question, perhaps. Note that a lot of the versioned modules and CPAN integration stuff is coming together, and as part of that some backend-specific knowledge Panda currently has is, as I understand it, moving into Rakudo itself (which is where such things really belong).
11:55 jnthn Upshot being that latest Panda implementation is tracking latest Rakudo fairly tightly right now.
11:59 dalek specs: 9230300 | (Stéphane Payrard)++ | S32-setting-library/Basics.pod:
11:59 dalek specs: Correct insconsistency
11:59 dalek specs: review: https://github.com/perl6/specs/commit/9230300c48
12:00 colomon there should be a tag in the panda repo for the last version which works with older Rakudos.
12:02 * colomon releases he has no idea how to find tags under github.
12:06 tadzik it's there under "releases"
12:06 tadzik https://github.com/tadzik/panda/releases
12:06 tadzik I make those when I introduce changes that don't work on older rakudos
12:08 colomon tadzik++
12:10 berekuk joined #perl6
12:10 Ulti how do you cast in Perl6?
12:10 colomon Ulti: what sense of cast?
12:11 Ulti so I have an object of a parent class to the one I want to cast to
12:11 Ulti so imagine I got an Int but I wanted to assign to an Even or Odd or something
12:12 colomon I believe that should Just Work
12:13 Ulti yeah its more I dont think I know the syntax
12:13 tadzik I think so
12:13 tadzik just assign it
12:13 tadzik it'll work out
12:13 colomon m: subset Odd of Int where { $_ % 2 }; my Int $i = 37; my Odd $o = $i; say $o;
12:13 camelia rakudo-moar 85bcd7: OUTPUT«37␤»
12:13 Ulti I get this as a message  Type check failed in assignment to '$seq'; expected 'BioInfo::Seq::DNA' but got 'BioInfo::Seq'
12:14 tadzik is Seq a subclass of Seq::DNA? :o
12:14 Ulti no its a role
12:14 Ulti that BioInfo::Seq::DNA does
12:14 tadzik well, is that objectyou assign indeed a Seq::DNA?
12:14 jnthn m: role Foo { }; class Bar does Foo { }; my Foo $x = Bar.new;
12:14 camelia rakudo-moar 85bcd7: ( no output )
12:15 tadzik Ulti: I think you're doing it the other way around
12:15 tadzik if A is B, you can't assign B to something that wants A
12:15 tadzik "I want a dog!" "here, have a generic mammal"
12:16 Ulti sure you can :P though yeah I should just make a constructor that takes the generic role and makes a new object
12:17 * Ulti checks to see if Java interfaces do act this way
12:18 Ulti maybe roles are just very different to what I was thinking
12:18 tadzik I still think you're doing this the wrong way
12:18 tadzik Seq is the generic, Seq::DNA is the specific
12:18 tadzik if something expects a type Seq::DNA, you can't give it Seq
12:18 tadzik see the dog example
12:18 tadzik can you show us the code?
12:19 Ven agreed with tadzik. Upcasting is safe, dwncasting is down
12:19 Ven .oO( May the spirit of Liskov be with you ! )
12:19 tadzik :)
12:19 colomon .oO(And also with you.)
12:20 Ulti well its a role so its not up or down its sideways, I would imagine you get a new one of the thing that does the role and the roles attributes patched over
12:20 Ulti so defaults of the class and the specific things from the role
12:21 colomon Ulti: which is the role?
12:21 Ulti Seq is the role and Seq::Dna the class that is the top level that does Seq
12:22 Ulti I guess Seqyness would have been a better name
12:22 tadzik it doesn't matter really
12:22 tadzik Seq is less specific than Seq::DNA
12:22 Ulti also its a bit weird you can create an instance of a role
12:22 tadzik you're expecting Seq::DNA
12:22 Ulti yeah
12:23 tadzik so you say "I don't accept just any Seq, I want a Seq::DNA"
12:23 tadzik that's why something that does Seq doesn't work here
12:23 Ulti its more I want a new Seq::DNA with the Seq attributes which are part of the Seq role copied over
12:23 tadzik perhaps Seq::DNA should have a method new-from-seq()?
12:24 Ulti yeah sure I can make a constructor
12:27 * skids wondered the other day if the bioinfo folks have ever had a reason to map GATC to △▫○X and what they decided on.
12:29 breinbaas joined #perl6
12:30 SamuraiJack joined #perl6
12:30 virtualsue ah, i now see the panda change which causes the issue
12:32 jnthn Ulti: You may also want to consider if a role is the right thing, or you just want a has-a relationship. I don't know your domain well enough to say. :)
12:33 jnthn Ulti: Note that Perl 6 has really nice delegation support through handles...
12:36 kaare_ joined #perl6
12:38 kaleem joined #perl6
12:39 vendethiel joined #perl6
12:41 moritz it does, because Even and Odd aren't subclasses, but rather subsets
12:41 moritz uhm, /me replied to stale chat :(
12:51 dalek Perlito: 2f3e1d2 | (Flavio S. Glock)++ | / (2 files):
12:51 dalek Perlito: Perlito5 - perl6 - eval-string
12:51 dalek Perlito: review: https://github.com/fglock/Perlito/commit/2f3e1d247c
12:56 rurban joined #perl6
12:59 Ulti well you can say the same thing of strings of characters too
13:00 Ulti Seq is the language of all strings, DNA is the ones made of only G C A T
13:00 Ulti I'd still probably implement them as two classes because DNA also implies a load of specific behaviour
13:01 Ulti though the liklihood of another biopolymer suddenly becoming biologically relevant is fairly slim at this point
13:13 timotimo Ulti: assigning to a container with a different type restriction doesn't change the object
13:13 timotimo all methods and stuff are still virtual, late-bound
13:13 timotimo and the type restriction on the container the object is in does not inform the method resolution logic etc
13:17 sqirrel_ joined #perl6
13:21 fglock joined #perl6
13:21 fglock hi
13:22 FROGGS hi fglock
13:22 timotimo hello :)
13:22 fglock I'm trying to translate this from perl5 to perl6 - ' sub x { return 7, 8 }; my $v = x(); print $v,"\n" '  # 8
13:23 fglock perl6 answer is  7 8
13:23 timotimo fglock: is there a way to get the 7, 8 in perl5 without modifying sub x?
13:23 fglock is there a signature/context I can set to get the perl5 behaviour?
13:23 FROGGS hmmmm
13:23 fglock timotimo: yes, using list context
13:23 jnthn my ($v) = x(); # should do it
13:24 timotimo jnthn: that doesn't bomb? o_O
13:24 fglock jnthn: that gives 7
13:24 guru joined #perl6
13:24 FROGGS timotimo: my should it?
13:24 jnthn wait, Perl 5 gives *8*?!
13:24 jnthn wtf.
13:24 timotimo yeah, the , operator evaluates to the last thing
13:24 jnthn Well. How silly.
13:24 fglock yes - the comma operator returns the last element
13:24 fglock :)
13:25 timotimo except if it's list context
13:25 FROGGS m: sub x { return { 7, 8 } }; my ($v) = x(); print $v,"\n"
13:25 camelia rakudo-moar 85bcd7: OUTPUT«␤»
13:25 jnthn Well, there's always my $v = x()[*-1] :P
13:25 jnthn FROGGS: Did you really want a block there?
13:25 fglock maybe my (*, $v) = x()
13:26 FROGGS jnthn: no, a statementlist :P
13:26 timotimo then put a do in front?
13:26 FROGGS fglock: the * one gobbles one then
13:26 jnthn fglock: $ not *, but it will only nom one thing
13:27 FROGGS perl -E 'sub x { return 7, 8 }; say x(); my $v = x(); print $v,"\n"'
13:27 FROGGS 78
13:27 FROGGS 8
13:27 FROGGS sooo..... do we want wantarray now?
13:27 timotimo jnthn: off-topic (somewhat), how should gtk-simple model things like on_destroy_event where the thing we connect to can return a value to decide, for example, if a click on the X should result in a window closing or not?
13:28 FROGGS fglock: you need something for your p5->p6 compiler, right?
13:28 fglock yes
13:29 FROGGS gimme a few minutes
13:31 jnthn timotimo: Supply an object with a method on it that can change a non-default decision.
13:31 BenGoldberg joined #perl6
13:31 fglock the compiler could generate something like:  return wantarray ?? (7,8) !! 8
13:31 jnthn timotimo: And then the C call-in inspects that.
13:32 jnthn timotimo: Of course, relies on the programmer to not try to tweak that asynchronously, but that'd be a slightly odd thing to do.
13:33 jnthn timotimo: So basically a bit like e.preventDefault() thingy that happens in jQuery...
13:34 kaare_ joined #perl6
13:35 jnthn fglock: Yeah, then you'd need to have a wantarray implementation...somehow...
13:36 vendethiel joined #perl6
13:36 fglock or a lazy-comma...
13:38 [Coke] https://twitter.com/marktimemedia/status/469462640314421248
13:40 FROGGS fglock: I have no idea how to do that, without reimplementing p6store in Perl 6 code...
13:40 FROGGS (to fake wantarray)
13:40 [Coke] oh, there's moar: http://www.mynameismichelle.com/git-frost/
13:41 fglock FROGGS: no problem - thanks for looking!
13:41 FROGGS fglock: I'll drop you a note once v5 has wantarray .o)
13:41 FROGGS :o)
13:45 fglock well, p5-in-js uses an "out-of-band" parameter to set the context - I could do the same in p5-in-p6
13:45 fglock something like   x( :scalar )  I think
13:46 FROGGS this should work, since you basically only have positional arguments
13:47 rindolf left #perl6
13:47 BenGoldberg You could do the same thing to implement lvalue context, too.
13:48 FROGGS for lvalue you just apply the 'is rw' trait
13:48 BenGoldberg Good point
13:49 Ven we can't wantarray anyway
13:50 Ven m: sub x { return 7, 8 }; say x(); my (@*, $v) = x(); say $v;
13:50 camelia rakudo-moar 85bcd7: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/2LsCwLvC0Fâ�¤Unable to parse expression in declarator; couldn't find final ')' â�¤at /tmp/2LsCwLvC0F:1â�¤------> [32msub x { return 7, 8 }; say x(); my (@[33mâ��[31m*, $v) = x(); say $v;[0mâ�¤  â€¦Â»
13:50 Ven m: sub x { return 7, 8 }; say x(); my (*, $v) = x(); say $v;
13:50 camelia rakudo-moar 85bcd7: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/uIVkldWqusâ�¤Malformed parameterâ�¤at /tmp/uIVkldWqus:1â�¤------> [32msub x { return 7, 8 }; say x(); my ([33mâ��[31m*, $v) = x(); say $v;[0mâ�¤    expecting any of:â�¤        scoped declaratorâ�¤Â»
13:50 jnthn m: sub x { return 7, 8 }; say x(); my ($, $v) = x(); say $v;
13:50 camelia rakudo-moar 85bcd7: OUTPUT«7 8␤8␤»
13:51 Ven oh, right, perl 6 doesn't accept positional parameters after slurpy ones for a reason I don't agree with :P
13:51 perltricks joined #perl6
13:53 perltricks Does anybody know why: "say 'hello'.reverse;" does not raise a method not found exception?
13:53 timotimo m: say 'hello'.flip; say (1, 2, 3).reverse;
13:53 camelia rakudo-moar 85bcd7: OUTPUT«olleh␤3 2 1␤»
13:53 timotimo that's why :)
13:53 dmol joined #perl6
13:53 timotimo in perl6, many methods that make sense on lists will turn single items into a single-item-list and do the list thing on it
13:54 timotimo reverse is "turn a list around", flip is "turn a string around"
13:54 perltricks but it returns 'hello'
13:54 timotimo that's why reverse doesn't raise an error; it does what it's supposed to do, but the effect is no-op
13:54 timotimo m: say ("hello".reverse).WHAT
13:54 camelia rakudo-moar 85bcd7: OUTPUT«(List)␤»
13:54 FROGGS perltricks: it is a one element list for .reverse
13:54 jnthn perltricks: Yes, because it's really doing "hello".list.reverse
13:54 perltricks aha ok it converts to a single element array and reverses it
13:54 FROGGS yeah
13:55 jnthn BTW, same if you .flip an array. It'll .Stringy it first
13:55 perltricks got it thanks guys
13:55 perltricks Am making progress with the exercism Perl 6 exercises.... https://github.com/sillymoose/xperl6
13:56 perltricks Need 10 before exercism will add it to the app
13:58 telex joined #perl6
13:58 FROGGS perltricks: 10 what?
13:59 FROGGS ten examples?
13:59 timotimo oh! that's you, perltricks
13:59 timotimo cool
13:59 perltricks 10 exercises completed. exercism is a programming exercises app. Provides a readme and a test file and you have to make the tests pass
13:59 timotimo did you see my comments?
13:59 dalek Perlito: 52a4c4c | (Flavio S. Glock)++ | TODO-perlito5:
13:59 dalek Perlito: Perlito5 - perl6 - wantarray discussion
13:59 dalek Perlito: review: https://github.com/fglock/Perlito/commit/52a4c4c2e2
14:00 timotimo i'll be away most of the day, but maybe i'll throw a few tips your way from my smartphone
14:00 FROGGS nice
14:00 timotimo like using $_ (or $^a) instead of @_[0]
14:00 perltricks comments on reddit?
14:00 timotimo yes
14:01 timotimo gotta run now
14:02 perltricks just saw them, thanks will make those changes
14:03 thou joined #perl6
14:04 btyler joined #perl6
14:14 thou joined #perl6
14:19 rurban joined #perl6
14:20 bluescreen10 joined #perl6
14:31 Ven OH: (in a conference) nevermind me,I'm just looking for snippets to translate to perl 6
14:35 flussence m: my @a=1,3,4,0,8; @a.first-index(@a.min).say; @a.pairs.min(*.value).say;
14:35 camelia rakudo-moar 85bcd7: OUTPUT«3␤3 => 0␤»
14:39 xenoterracide_ joined #perl6
14:40 treehug88 joined #perl6
14:40 * PerlJam still wishes for a way to say @a.first(@a.min :gimme-the-index)
14:41 PerlJam the -index functions seem like they should be composable from the pieces we already have.
14:41 timotimo why does nobody want to try .kv.min and map?
14:41 timotimo or pairs.min.map?
14:41 timotimo that way you only have to go through the list once
14:44 PerlJam yeah, that works.
14:45 PerlJam I just have a bother from the proliferation of -index functions.
14:47 kaleem joined #perl6
14:53 moritz it sounds like we really need some kind of combinators
15:08 thou joined #perl6
15:13 raiph joined #perl6
15:20 Alula joined #perl6
15:21 john3213 joined #perl6
15:25 guru joined #perl6
15:26 john3213 left #perl6
15:27 markov joined #perl6
15:38 kivutar joined #perl6
15:44 Ulti if you had to show someone a single line of Perl6 to entice someone who has never even seen Perl 5 or 6 what would it be?
15:49 thou joined #perl6
15:51 molaf joined #perl6
15:51 PerlJam Depends on the person I was showing it to :)
15:53 timotimo p6 is many things to many people
15:53 anaeem1 joined #perl6
15:56 PerlJam It's like ... how do you show someone some magic to entice them to become a magician?  The magic you show them can't be so complicated that they lose all hope of learning it.  But if you show them a card trick, they think "I can learn to do card tricks"  and then you show them a disappearing apple or something and they think "I can do card tricks, maybe i can make apples disappear too"
15:57 PerlJam But, if they already know card tricks and that's where you start, then they're likely to go "What's the big deal?" and not go deeper.
16:00 FROGGS joined #perl6
16:08 btyler Ulti: personally I really like jnthn's prime-grepping example as a short "extremely cool but still pretty clear" demo.
16:08 btyler eg: my @promises; for (1000 .. 1010) -> $prime-index { push @promises, start { (1..Inf).grep(*.is-prime)[$prime-index] }}
16:08 btyler pretty fun to start that off and see all available cores maxing out :)
16:10 btyler -and- it works on r-m these days, so you don't have to wait for the JVM to boot to see the coolness
16:11 BenGoldberg There's got to be a more efficient, but still multi-threaded way of doing that...
16:12 BenGoldberg Is there a perl6 variable which says how many cores the cpu has?
16:15 BenGoldberg eg: my @primes; my @promises; for my $core ( 1 .. $*PROCESSOR<cores> ) { push @promises, start { $primes[$_] = .is_prime } for $core, $core+$*PROCESSOR<cores> ... 1010 } }
16:16 jnthn BenGoldberg: We should put such load-balancing/scaling smarts into the scheduler rather than have everybody re-implement them, I think :)
16:16 jnthn But yeah, it will need that data.
16:16 jnthn And no, we don't expose it in Perl 6 yet.
16:16 PerlJam BenGoldberg: IF you spec it, someone may build it :)
16:17 BenGoldberg It's kinda silly to recompute .is_prime eleven times for the first thousand integers.
16:17 BenGoldberg Err, for the first thousand primes.
16:19 btyler I always assumed the point of that demo was to spent enough time crunching that you could open up a system monitor and see that, indeed, all available cores are doing stuff
16:19 BenGoldberg Well in that case, I'm sure it'll work just fine.
16:20 Rotwang joined #perl6
16:21 BenGoldberg But if I knew the computer had two cores, I'd have one looking for primes that were 1 mod for, and the other looking for primes 3 mod 4... or some such.
16:21 BenGoldberg s/1 mod for/1 mod 4/
16:21 PerlJam And I'd want my execution environment using those cores without me having to tell it to.  :)
16:25 BenGoldberg Load balancing across all cores only will work if you've got at least as many tasks as you've got cores.
16:26 BenGoldberg So if you make eleven tasks, and you've got one or two or four cores, no problem.
16:26 BenGoldberg But if you had twelve cores, then one of those cores would be idle.
16:26 flussence .oO( that thing I mentioned ~18h ago would be an impressive one-line demo if it worked... )
16:39 * [Coke] wonders if the name of this month's compiler release comes from star trek.
16:50 vendethiel masak: WRT parsing ?
16:51 vendethiel the problem is that I can have "block headlines" on multiple lines
16:52 vendethiel Ulti: say so 1 == 3 | 4 when .lines given open('file', :rw) :-°
16:54 masak vendethiel: is that because of some kind of line continuations?
16:54 vendethiel masak: no, not even
16:55 vendethiel masak: https://gist.github.com/Nami-Doc/dc3f6126140f0094f31b something like thgat
16:55 * masak looks
16:55 vendethiel so I basically need to parse <line> differently depending on whether I'm on the same indent as the previous or not, if ...
16:56 masak vendethiel: I don't think my solution is for your kind of indented text :)
16:56 vendethiel yep
16:56 masak vendethiel: guessing best you can do is steal the test suite and then add cases until it does what you want.
16:56 vendethiel I've actually something a bit ATM, I can get a correct AST from your stuff
16:56 vendethiel but it isnt parsed at all
16:57 vendethiel I'm not sure how I want to do that. Perl 6's grammars are not made to deal with this kind of stuff
16:58 vendethiel i'm actually thinking about generating indent and outdent token ...
17:00 masak still need to preprocess that to get the right kind of recursive structure.
17:00 masak er, post-process.
17:01 vendethiel but it's actually far easier
17:02 vendethiel I know that a block is `<declarations> + % <nl> <block>`
17:03 vendethiel and recursively parse it
17:05 vendethiel that does seem easier to me
17:07 masak yes.
17:12 thundergnat joined #perl6
17:19 thundergnat Every time I work with perl 6 grammars I am amazed at how much I can do with so little code.
17:19 thundergnat I have a little free time this week so I messed around with a cardinal to numeric parser. http://rosettacode.org/wiki/Cardinal_to_numeric
17:20 thundergnat I'm not really thrilled with how I've got every thing shoved into TOP, but it works ok.
17:20 masak shove things into TOP until you see a way to not shove things into TOP :)
17:21 thundergnat masak: Heh, yep, thats pretty much how I've been operating.
17:22 guru joined #perl6
17:23 denis_boyun_ joined #perl6
17:24 vendethiel masak: do you think I could get Text::Indented::(?) to take something, generate tokens somehow and return stuff in that state ?
17:25 vendethiel not sure what token I should use to mean indent and outdent
17:25 masak vendethiel: I don't really see why you have to have an intermediate token step. but maybe that's just me.
17:25 vendethiel masak: I don't see how I can generate correct blocks
17:25 masak entia non sunt, etc.
17:26 * vendethiel really, really dislakes putting random latin sentences
17:27 vendethiel masak: how can I process block levels then ? While I'm parsing everything else
17:33 itz joined #perl6
17:44 masak vendethiel: sorry to trigger your inexplicable latin dislike ;)
17:44 masak vendethiel: seems to me the logic for parsing block levels is the only thing you want to keep from my original algorithm.
17:44 vendethiel pretty irrelevant :P
17:49 vendethiel (i mean the latin stuff, I don't even know why I mentioned that)
17:50 vendethiel masak: seems to me too, yeah
17:51 masak the point I wanted to convey just happened to be expressed in Latin... :P
17:51 jnthn .oO( "what happens in vegas..." )
17:51 masak lol
17:53 vendethiel masak: I'm open to suggestions :-)
17:54 masak "steal the logic for parsing block levels" was my suggestion.
17:54 masak um, "steal the tests and add more" was my other suggestion.
17:54 masak I don't have more right now.
17:55 vendethiel yeah, tests were rightfully stolen
18:01 masak \o/
18:01 vendethiel and I already stole the block parsing
18:01 vendethiel I'm just inheriting the grammar atm
18:04 masak that may or may not lead to total and utter happiness.
18:05 treehug8_ joined #perl6
18:05 vendethiel oh, that's not gonna be enough
18:07 masak happiness is not enough!?
18:09 vendethiel masak: :)
18:09 vendethiel I mean inheritance
18:10 masak I'm not gonna rule it out completely, but instinct tells me that inheritance won't be enough for you, no.
18:12 anaeem1 joined #perl6
18:12 kivutar joined #perl6
18:13 anaeem1 joined #perl6
18:14 treehug88 joined #perl6
18:15 vendethiel masak: well, the interesting part is the stuff in line, and I can't inherit that
18:15 anaeem1 joined #perl6
18:16 timotimo do note that grammarsbare supposed to be able to match againstbstreams of objects, too
18:17 vendethiel (?)
18:17 vendethiel oh, s/b/ /
18:18 jnthn timotimo: That's fairly hypothetical and not likely to make 6.0, unless somebody suddenly gets the urge to do it, though...
18:24 [Coke] "hey, when are we hitting 6.0" ?
18:24 [Coke] Do we have a list of big ticket items remaining?
18:24 vendethiel Coke: be wary of Mus
18:25 vendethiel [Coke]: matrix :P ?
18:26 jnthn [Coke]: No, but it's probably about time to make one.
18:28 vendethiel you think so ?
18:28 vendethiel that's a good news
18:28 masak we're so full of good news
18:28 vendethiel masak: I'm still waiting for my total and utter happiness !
18:30 masak then don't use inheritance!
18:30 [Coke] didn't perl6.com used to redirect to perl6.org?
18:31 vendethiel masak: I'm not !
18:31 nwc10 mojibake! https://www.flickr.com/photos/34063820@N00/14249625331/
18:32 [Coke] jnthn: where to keep the list? Perl6.org? perl6/mu ?
18:32 [Coke] -1 on the old perlfoundation wiki.
18:32 anaeem1_ joined #perl6
18:33 jnthn [Coke]: I was pondering more of a tri-color making of the spec
18:34 [Coke] hokay.
18:34 jnthn [Coke]: Implemented in Rakudo, not implemented but we agree we really should for 6.0, deferred to 6.* (unless somebody really doesn't want to contribute to anything else, and just happens to implement it anyway)
18:35 jnthn nwc10: Fail!
18:37 jnthn [Coke]: Git repo is probably best. I'm open to suggestions of how we do the marking.
18:38 nwc10 jnthn: yes. I wasn't there last night and forgot to look this morning. Was fixed this evening
18:38 vendethiel one file, checkboxes :p ?
18:38 nwc10 This error dialogue on a lift display is also fail: https://www.flickr.com/photos/34063820@N00/14249625351/
18:39 itz does v5 still need a patched rakudo?
18:39 nwc10 Unicode is hard. Let's go ASCII! :-)
18:39 jnthn itz: Not since a few days ago
18:40 jnthn Epic fehl
18:40 * nwc10 groans
18:40 vendethiel (I mean, one file per syn, then checkboxing for each headline)
18:41 jnthn I don't think headline level is going to be enough...
18:41 vendethiel jnthn: really ? That's gonna be one long list to do
18:41 jnthn Yup.
18:45 [Coke] line? character?
18:46 [Coke] (which would painfully hard)
18:52 FROGGS itz: I am working on making v5 cope with panda
18:53 FROGGS right now it creates a Makefile, which will be replaced now be Build.pm
18:53 FROGGS jnthn: I think that the biggest missing thing for Perl 6 1.0 might be NFG and shaped Arrays... though I am not 100% sure about what really needs to go in
18:54 FROGGS and yeah, such a tricolore would be awesome
18:54 jnthn FROGGS: Yes, and native arrays.
18:54 FROGGS yeah
18:54 FROGGS that might be it...
18:55 FROGGS ahh, S11 of course, but that seems rather doable
18:56 FROGGS parallelized hypers are also on the features list, but that is just an implementation detail
18:59 anaeem1_ joined #perl6
19:01 FROGGS I have to say again how awesome fast perl6@MoarVM is... when I test the modules in star, it has almost finished in the time I open the test output file in my editor...
19:01 FROGGS sure, I have to click through some directories, but still :o)
19:02 colomon I think it might be important to have complex vs Complex straightened out, but that should be a pretty easy change, I'd expect.
19:03 FROGGS since Complex does what complex should do, right?
19:04 FROGGS colomon: btw, it is not really about the implementation, but about the spec
19:04 FROGGS when we do Complex wrong, it is just a bug
19:04 colomon FROGGS: right
19:04 FROGGS we can still have a Perl 6 1.0 spec by then
19:04 jeffreykegler joined #perl6
19:04 jnthn Yeah, but it means the "complex" (lower-case) type probably wants to a "will do" for example
19:04 FROGGS therefore we need a NFG implementation to see how it works out
19:05 jeffreykegler left #perl6
19:07 colomon jnthn: "will do"?
19:07 jnthn colomon: As in, probably should include in 6.0
19:07 colomon oh, yes, that's what I was trying to say.  :)
19:07 jnthn Especially as the current Complex basically is complex :)
19:08 colomon right
19:08 masak so complex!
19:08 colomon and Rakudo's version of Complex from a few years back is probably a good first approximation to the real Complex.
19:08 colomon :)
19:09 jnthn masak: *such :P
19:10 masak :P
19:10 BenGoldberg Is there any convenient way to force integer arithmatic to happen?  Let's say I want to divide 5/2, and get two instead of two-and-a-half.  And I don't mean rounding afterwards.
19:11 colomon BenGoldberg: div instead of /
19:11 BenGoldberg Thanks :)
19:11 colomon m: say 5 div 2
19:11 camelia rakudo-moar 85bcd7: OUTPUT«2␤»
19:14 masak fun trivium: the semantics of `div` isn't really "integer division", but "divide according to the type".
19:14 moritz but is it defined for anything except integers?
19:14 masak it should me.
19:14 masak be*
19:14 moritz for what?
19:15 FROGGS DateTimes?
19:15 * FROGGS runs
19:15 masak heh.
19:15 moritz could be defined for Duration though
19:16 masak reading S03 made me a bit more confused.
19:17 dalek features: d672c50 | thundergnat++ | features.json:
19:17 dalek features: Fixed borken link.
19:17 dalek features: review: https://github.com/perl6/features/commit/d672c50759
19:17 colomon according to S03, infix:<div>, integer division
19:17 colomon it is supposed to work for all different kinds of integers
19:18 treehug8_ joined #perl6
19:22 FROGGS wow, IO::Path.contents is so sloooow :(
19:26 darutoko joined #perl6
19:28 guru joined #perl6
19:29 timotimo which part of it is so slow?
19:30 timotimo canonpath?
19:30 timotimo gisting the result?
19:30 timotimo surely not iterating the files on the low level
19:34 treehug88 joined #perl6
19:34 eternaleye joined #perl6
19:45 anaeem1 joined #perl6
19:50 anaeem1 joined #perl6
20:11 timotimo can haz good news?
20:12 [Coke] timotimo: sure: tonight is opening night!
20:14 timotimo opening of what?
20:15 masak gifts!
20:15 timotimo froggs, we should include v5 versions of our benchmarks in timing runs, dont you think? :)
20:15 timotimo well, once it works well enough
20:20 * PerlJam made a naïve Lingua::ENG::Word2Num today (and sent it to the PetaMem folks)
20:21 PerlJam It's at https://github.com/perlpilot/p6-Lingua-ENG-Word2Num if anyone wants to improve on it ;)
20:22 [Coke] timotimo: http://ghentplayhouse.org/Season05Page.html
20:25 masak PerlJam: looking.
20:26 BenGoldberg Is there a way to get the evalbot to execute perl6 code from a url?
20:27 [Coke] give it a public gist url
20:27 [Coke] camelia: http://ghentplayhouse.org/Season05Page.html
20:28 masak PerlJam: that's beautiful.
20:28 [Coke] r: https://gist.github.com/coke/0cdeeb0363d0fd2464d6
20:28 camelia rakudo-{parrot,jvm,moar} 85bcd7: OUTPUT«gist not found»
20:28 treehug88 joined #perl6
20:28 [Coke] Oh. recent github gist changes have probably broken this feature.
20:28 PerlJam masak: I don't think I'd use that word, but it is somewhat functional.  I didn't really test it hard though, so I'm sure there are bugs
20:31 anaeem1 joined #perl6
20:32 masak PerlJam: I might be positively surprised by Github's color coding for Perl 6 code, which seems to have improved quite a lot lately.
20:37 anaeem1 joined #perl6
20:40 jnthn PerlJam++
20:43 timotimo masak, that was hoelzro
20:44 timotimo hoelzro++ for good measure and syntax highlighting
20:45 masak indeed, hoelzro++
20:51 BenGoldberg r: constant primes = 2, 3, do { my $i = 1; my $p = primes[$i]; my $q = $p * $p; my %s; grep -> $n { if ( %s{$n}:delete ) -> @c {         push %s{ $n + $_ } for @c;         False;      } elsif ( $n < $q ) {         True;      } else {         my \twop = $p * $p; push %s{ $q + twop }, twop; $p = primes[ ++$i ]; $q = $p * $p; False; } }, 5, 7 .. Inf;}; say primes[999 .. 1009];
20:51 camelia rakudo-moar 85bcd7: OUTPUT«===SORRY!===␤Cannot invoke null object␤»
20:51 camelia ..rakudo-jvm 85bcd7: OUTPUT«===SORRY!===␤java.lang.NullPointerException␤»
20:51 camelia ..rakudo-parrot 85bcd7: OUTPUT«===SORRY!===␤Could not find sub &primes␤»
20:53 masak huh.
20:53 masak maybe try with binding rather than assignment?
20:53 BenGoldberg You mean := instead of = ?
20:53 masak yes.
20:54 masak (but clearly something is wrong with the above output already.)
20:54 BenGoldberg Same error
21:05 sorear joined #perl6
21:08 colomon sorear!  \o/
21:09 masak sorear! \o/
21:09 masak BenGoldberg: think you could golf that?
21:10 BenGoldberg It was a pita to type it in the first place, I don't have perl6 installed; I wrote it using codepad.org, then had to remove the newlines
21:11 BenGoldberg Now, if I could give the eval bot a url, I'd be fine.  I can use git... but apparently that's down.
21:12 BenGoldberg Or, the bot doesn't see git pastes right, at present...
21:12 moritz r: constant primes = 1, 2 , { primes[0]; 3 } ... 3; say primes
21:12 camelia rakudo-{parrot,jvm,moar} 85bcd7: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/tmpfile�Variable '&primes' is not declared�at /tmp/tmpfile:1�------> [32mconstant primes = 1, 2 , { [33m�[31mprimes[0]; 3 } ... 3; say primes[0m�»
21:12 moritz that seems to be the essence
21:13 moritz except that the example above somehow manages to circumvent the compile-time error message
21:15 sorear joined #perl6
21:15 BenGoldberg r: constant primes := 2 , 3, do { my $p = primes[1]; grep { rand < .5 }, 5, 7 ... 99 }; say primes[10]
21:16 camelia rakudo-moar 85bcd7: OUTPUT«===SORRY!===␤Cannot invoke null object␤»
21:16 camelia ..rakudo-jvm 85bcd7: OUTPUT«===SORRY!===␤java.lang.NullPointerException␤»
21:16 camelia ..rakudo-parrot 85bcd7: OUTPUT«===SORRY!===␤Could not find sub &primes␤»
21:16 BenGoldberg golfed, I think. :)
21:17 xinming joined #perl6
21:17 BenGoldberg r: constant primes := 2 , 3, do { my $p = primes[1]; 2 }; say primes[10]
21:17 camelia rakudo-moar 85bcd7: OUTPUT«===SORRY!===␤Cannot invoke null object␤»
21:17 camelia ..rakudo-jvm 85bcd7: OUTPUT«===SORRY!===␤java.lang.NullPointerException␤»
21:17 camelia ..rakudo-parrot 85bcd7: OUTPUT«===SORRY!===␤Could not find sub &primes␤»
21:18 vendethiel BenGoldberg are you looking for ... :P ?
21:20 BenGoldberg Well, I might need ... instead of .. but the important thing at present is that I'd like to be able to define a constant lazy list in terms of itself.
21:22 SevenWolf joined #perl6
21:32 retupmoca r: my @foo = 1, 2, { @foo[0] } ... *; say @foo[1]; say @foo[75];
21:32 camelia rakudo-{parrot,jvm,moar} 85bcd7: OUTPUT«2␤1␤»
21:32 retupmoca r: my \foo = 1, 2, { foo[0] } ... *; say foo[1]; say foo[75];
21:32 camelia rakudo-{parrot,jvm,moar} 85bcd7: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/tmpfile�Variable '&foo' is not declared�at /tmp/tmpfile:1�------> [32mmy \foo = 1, 2, { [33m�[31mfoo[0] } ... *; say foo[1]; say foo[75];[0m�»
22:01 lizmat joined #perl6
22:26 timotimo i have a use case for a combine_latest supply op
22:26 timotimo does that mean i should implement it? :)
22:27 tadzik tag, you're it!
22:30 jnthn timotimo: Perhaps, but...did you try seeing if you can write it with "on" first?
22:32 timotimo oh, i may be able to.
22:32 vendethiel blog, you're it :P !
22:32 timotimo is that in the specss
22:32 timotimo ?
22:33 jnthn should be
22:33 jnthn We implement loads of other things in terms of it too
22:33 timotimo i'm now experiencing what happens when we throw an exception in a callback :)
22:33 timotimo i didn't find it in the synopsis 17 yet
22:41 timotimo bleh. i'm trying to connect the toggled event of a toggle_button or a check_button and they don't seem to fire :\
22:41 timotimo oh
22:41 timotimo i was wrong. never mind me :)
22:42 * jnthn doesn't mind timo
22:49 timotimo huh.
22:49 timotimo how do i ...
22:50 timotimo m: class T is rw { has $.status }; " and ".join: (T.new(:status), T.new(:!status)).map: { $_ ?? "on" !! "off" }
22:50 camelia rakudo-moar 85bcd7: ( no output )
22:50 timotimo m: class T is rw { has $.status }; say " and ".join: (T.new(:status), T.new(:!status)).map: { $_ ?? "on" !! "off" }
22:50 camelia rakudo-moar 85bcd7: OUTPUT« and ␤»
22:50 timotimo i don't understand this.
22:50 timotimo m: class T is rw { has $.status }; say ((T.new(:status), T.new(:!status)).map: { $_ ?? "on" !! "off" }).perl
22:50 camelia rakudo-moar 85bcd7: OUTPUT«("on", "on").list␤»
22:50 timotimo oh!
22:50 timotimo silly me :)
22:51 * colomon is watching jnthn give a talk and eating mapo doufu.  life is good.
22:51 vendethiel (what talk ?)
22:52 vendethiel (or "which"*)
22:56 timotimo what's the most readable way to get the .status of two objects (Boolean objects) and turn a boolean into "on" or "off" and join it with "and"
22:56 timotimo ?
22:57 timotimo <off on filenotfound>[($foo, $bar)>>.status].join(" and ") is not too pretty, IMO.
22:59 colomon vendethiel: invokedynamic
22:59 timotimo $status_label.text = "the toggles are " ~
22:59 timotimo (($check_button, $toggle_button) ==> map { <off on>[$_.status] } ==> join " and ");
23:03 flussence hm, we can't do a Qt::Simple because it's C++, right? I'm tempted to mess around with EFL...
23:05 colomon m: enum Result <off on filenotfound>; my Result $r = Result::on; say "$r";
23:05 camelia rakudo-moar 85bcd7: OUTPUT«on␤»
23:09 colomon m: enum Result <off on filenotfound>; my Result $r = 1; say "$r";
23:09 camelia rakudo-moar 85bcd7: OUTPUT«Type check failed in assignment to '$r'; expected 'Result' but got 'Int'␤  in block  at /tmp/KSEpOHVvt5:1␤␤»
23:10 colomon m: Int enum Result <off on filenotfound>; my Result $r = 1; say "$r";
23:10 camelia rakudo-moar 85bcd7: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/oLAFAZ_opVâ�¤Two terms in a rowâ�¤at /tmp/oLAFAZ_opV:1â�¤------> [32mInt [33mâ��[31menum Result <off on filenotfound>; my Re[0mâ�¤    expecting any of:â�¤        postfixâ�¤        infix stopper…»
23:10 colomon m: my Int enum Result <off on filenotfound>; my Result $r = 1; say "$r";
23:11 camelia rakudo-moar 85bcd7: OUTPUT«Type check failed in assignment to '$r'; expected 'Result' but got 'Int'␤  in block  at /tmp/F6j0pLB7sn:1␤␤»
23:11 colomon m: enum Result <off on filenotfound>; my Result $r = Result(1); say "$r";
23:11 camelia rakudo-moar 85bcd7: OUTPUT«on␤»
23:12 Mouq joined #perl6
23:13 Mouq o/
23:13 yoleaux 5 May 2014 07:26Z <lizmat> Mouq: should List.rotor(1,0) not be just { self } ?
23:13 yoleaux 5 May 2014 07:26Z <lizmat> Mouq: and could you also transmogrify the S17-supply/rotor.t tests to handle List.rotor ?
23:13 Mouq Oh geez :(
23:13 Mouq I've been busy with school and my laptop stopped working two weeks ago
23:14 Mouq .ask lizmat I really kind of can't add tests for List.rotor at the moment :( And yes, List.rotor(1,0) should be { self }
23:15 yoleaux Mouq: I'll pass your message to lizmat.
23:15 Mouq Well, .tell, I suppose
23:19 Mouq I suppose I can edit on github...
23:19 dalek rakudo/nom: b05edf7 | (Alexander Moquin)++ | src/core/List.pm:
23:19 dalek rakudo/nom: List.rotor(1,0) should be { self }
23:19 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/b05edf75be
23:19 timotimo flussence: i think efl is pretty cool, though i have never used it myself
23:20 * Mouq cringes just a little, is glad that commit came out like he wanted it\
23:20 timotimo hey Mouq
23:20 timotimo sorry to hear about your tech trouble :(
23:20 Mouq hey timotimo!
23:21 timotimo colomon: i like the enum trick, thanks!
23:21 Mouq It's alright, I shouldn't be on much anyway; have to start tying things up before graduation :)
23:21 Mouq Some thoughts, though:
23:22 Mouq Could we add a warning for `say :named`?
23:22 timotimo i wonder how i could >>. that enum coercion :\
23:22 timotimo probably can't. bummer!
23:22 Mouq "Named parameter "named" passed to &say. Please use parens if you meant to pass a Pair
23:22 Mouq "
23:23 Mouq Just because `say :$var` happens so often
23:23 timotimo mhh, probably could
23:23 Mouq Also, not a new thought, but the error for
23:23 Mouq m: ~Any
23:23 camelia rakudo-moar 85bcd7: OUTPUT«use of uninitialized value of type Any in string context␤»
23:23 Mouq Really should have a backtrace
23:24 flussence agreed, that was giving me a headache this week :(
23:24 colomon +1
23:24 Mouq And, IMO, a full backtrace, because perl5's use of only one line # causes headaches when using someone else's lib(s)
23:25 colomon Mouq: I'm happy to say I just rebuilt rakudo and it appears to be working fine after your patch.  :)
23:25 colomon (still be working fine, I mean)
23:26 Mouq And finally, method EXPR in HLL.nqp could use some loop labels; someone should see if that makes it run any faster. Obviously if it doesn't, we should probably leave it be, although FROGGS+++ anyway :)
23:26 timotimo it has a backtrace on our other backends and i agree it should have one on moar, too
23:26 Mouq Yay! colomon++
23:26 Mouq timotimo: oh?
23:26 Mouq p: ~Any
23:26 camelia rakudo-parrot 85bcd7: OUTPUT«use of uninitialized value of type Any in string context  in block  at /tmp/jLTJmKaR9Y:1␤␤»
23:27 * colomon has done the commit in github without compiling thing before, and even when very safe it is scary.
23:27 timotimo are we so used to moar being the awesomest back-end that we assume everything missing in moar is missing everywhere else, too? :)
23:27 Mouq p: sub blabla ($_) { ~$_ }; blabla Any
23:27 camelia rakudo-parrot 85bcd7: OUTPUT«use of uninitialized value of type Any in string context  in sub blabla at /tmp/6D1rehTi6l:1␤␤»
23:27 Mouq timotimo: Mayhaps :)
23:28 Mouq timotimo++ for keeping up with p6weekly :)
23:28 Mouq FROGGS++ for the release
23:28 timotimo thanks :)
23:29 timotimo i've even gotten back into doing helpful things
23:29 timotimo i've taken care of gtk-simple for a bit
23:29 timotimo and improved nativecall callback handling on moarvm
23:29 Mouq timotimo++ for gtk-simple too, can't wait to try it out :)
23:29 Mouq *gtk-simple love
23:29 timotimo yeah, jnthn is responsible for most of the awesome there
23:30 Mouq lizmat++ for continuing to be a commit ninja
23:30 timotimo yes!
23:33 Mouq jnthn++, nwc10++, and (all the awesome people I missed)++
23:35 Mouq That's it for tonight, nice work guys! \o #perl6
23:35 Mouq left #perl6

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

Perl 6 | Reference Documentation | Rakudo