Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2014-01-17

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:32 clsn r: role R[::T] { method f { say ~T } }; R.f
00:32 camelia rakudo-moar 347c9a: OUTPUT«None of the parametric role variants for 'R' matched the arguments supplied.␤Cannot call ''; none of these signatures match:␤:(Mu , Mu )␤  in any specialize at src/gen/m-Metamodel.nqp:2173␤  in any  at src/gen/m-Metamodel.nqp:2464␤  in any  at sr…»
00:32 camelia ..rakudo-parrot 347c9a: OUTPUT«None of the parametric role variants for 'R' matched the arguments supplied.␤Cannot call ''; none of these signatures match:␤:(Mu , Mu )␤  in any specialize at gen/parrot/Metamodel.nqp:2243␤  in any  at gen/parrot/Metamodel.nqp:2541␤  in any  a…»
00:32 camelia ..rakudo-jvm 347c9a: OUTPUT«None of the parametric role variants for 'R' matched the arguments supplied.␤Cannot call ''; none of these signatures match:␤:(Mu , Mu )␤  in any specialize at gen/jvm/Metamodel.nqp:2166␤  in any  at gen/jvm/Metamodel.nqp:2462␤  in any  at gen/jvm…»
00:32 clsn r: role R[::T=Any] { method f { say ~T } }; R[Int].f
00:32 camelia rakudo-jvm 347c9a, rakudo-moar 347c9a: OUTPUT«use of uninitialized value of type Int in string context␤␤»
00:32 camelia ..rakudo-parrot 347c9a: OUTPUT«use of uninitialized value of type Int in string context  in method f at /tmp/RhRxYWvC8e:1␤␤␤»
00:33 clsn Hm.  when I did it locally I got a never-ending string of "uninitialized value..." stuff.
00:34 clsn r: "a" ~~ /a*?: a/
00:34 camelia rakudo-parrot 347c9a: OUTPUT«[31m===[0mSORRY![31m===[0m�Unrecognized regex metacharacter : (must be quoted to match literally)�at /tmp/Cf2y6NNjZ0:1�------> [32m"a" ~~ /a*?:[33m�[31m a/[0m�Unable to parse regex; couldn't find final '/'�at /tmp/Cf2y6NNjZ0:1�-----…»
00:34 camelia ..rakudo-moar 347c9a: OUTPUT«[31m===[0mSORRY![31m===[0m�Unrecognized regex metacharacter : (must be quoted to match literally)�at /tmp/9fbouQGVOw:1�------> [32m"a" ~~ /a*?:[33m�[31m a/[0m�Unable to parse regex; couldn't find final '/'�at /tmp/9fbouQGVOw:1�------>…»
00:34 camelia ..rakudo-jvm 347c9a: OUTPUT«[31m===[0mSORRY![31m===[0m�Unrecognized regex metacharacter : (must be quoted to match literally)�at /tmp/jrTo9vjJcN:1�------> [32m"a" ~~ /a*?:[33m�[31m a/[0m�Unable to parse regex; couldn't find final '/'�at /tmp/jrTo9vjJcN:1�------> …»
00:35 clsn also weird; I got a Null PMC Access on that.
00:37 * lue idly wonders if perl6-examples/bin and perl6-examples/lib can be removed with no/minimal damage.
00:48 Mouq joined #perl6
00:53 dalek perl6-examples: f227573 | lue++ | module-management/Fletcher.pl:
00:53 dalek perl6-examples: Modernize Fletcher.pl
00:53 dalek perl6-examples:
00:53 dalek perl6-examples: Just adding P6-isms here and there.
00:53 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/f227573de0
01:08 moritz m: say 42
01:09 camelia rakudo-moar 347c9a: OUTPUT«42␤»
01:11 jnap joined #perl6
01:46 shelfc joined #perl6
02:00 Mouq joined #perl6
02:02 jeffreykegler1 left #perl6
02:05 [Coke] https://rt.perl.org/Ticket/Display.html?id=120511  - is this an nqp bug or a rakudo bug
02:05 [Coke] m: sub s () { given 9 { return 0 when $_ %% 3; 1 } }; say s
02:05 camelia rakudo-moar 347c9a: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/ag0yDBP3BLâ�¤Null regex not allowedâ�¤at /tmp/ag0yDBP3BL:1â�¤------> [32m 9 { return 0 when $_ %% 3; 1 } }; say s[33mâ��[31m<EOL>[0mâ�¤    expecting any of:â�¤        argument listâ�¤        pre…»
02:13 [Coke] m: class A {has $.a = $^b + 1;has $.b = $^a }; say A.new(1,2).a
02:13 camelia rakudo-moar 347c9a: OUTPUT«Default constructor for 'A' only takes named arguments␤  in method new at src/gen/m-CORE.setting:830␤  in method new at src/gen/m-CORE.setting:826␤  in block  at /tmp/_doCgKhSvP:2␤␤»
02:13 [Coke] m: class A { has $.a = $^b }; A.new
02:13 camelia rakudo-moar 347c9a: OUTPUT«Cannot assign a null value to a Perl 6 scalar␤  in block  at src/gen/m-CORE.setting:899␤  in method BUILDALL at src/gen/m-CORE.setting:927␤  in method bless at src/gen/m-CORE.setting:839␤  in method new at src/gen/m-CORE.setting:827␤  in method n…»
02:19 dalek roast: a7e1209 | coke++ | S03-junctions/misc.t:
02:19 dalek roast: Add a test for RT #101124
02:19 dalek roast: review: https://github.com/perl6/roast/commit/a7e1209537
02:19 synopsebot Link: https://rt.perl.org/rt3//Public/Bug/Display.html?id=101124
02:24 ggoebel1112 joined #perl6
02:32 dalek features: e88259c | (Timo Paulssen)++ | features.json:
02:32 dalek features: more search&replace fixes
02:32 dalek features: review: https://github.com/perl6/features/commit/e88259c071
02:32 centrx joined #perl6
02:34 centrx uh, woops
02:34 camelia joined #perl6
02:40 dalek features: 82c3552 | (Timo Paulssen)++ | features.json:
02:40 dalek features: a few features missing in rakudo-moar still
02:40 dalek features: review: https://github.com/perl6/features/commit/82c3552b30
02:40 timotimo hello centrx. what's wrong?
02:41 centrx timotimo, I sent the bot the evalbot example in the header, and it quit, so I thought I crashed it, but it returned!
02:44 timotimo oh? haha :)
02:44 timotimo perl6: say 3;
02:44 timotimo wow, that's not good at all
02:44 timotimo but the bot is kinda robust
02:44 timotimo as in: it will restart itself if need be
02:44 camelia joined #perl6
02:44 BenGoldberg joined #perl6
02:46 ilbot3 joined #perl6
02:46 Topic for #perl6 is now »ö« Welcome to Perl 6! | http://perl6.org/ | evalbot usage: 'perl6: say 3;' or rakudo:,  niecza:, std:, or /msg camelia perl6: ... | irclog: http://irc.perl6.org | UTF-8 is our friend!
02:46 timotimo n: say 3
02:46 camelia niecza v24-109-g48a8de3: OUTPUT«3␤»
02:46 timotimo p: say 3
02:46 camelia rakudo-parrot 347c9a: OUTPUT«3␤»
02:46 timotimo so what's causing it? o_O
02:47 timotimo also, at this point we may think about having it output "rakudo-{parrot,jvm,moar} 347c9a:" instead of spelling it out completely
02:47 timotimo with 3 backends, it gets pretty long
02:49 jeffreykegler joined #perl6
02:52 prevost joined #perl6
02:53 jeffreykegler left #perl6
02:53 araujo joined #perl6
02:56 raiph joined #perl6
03:02 diakopter what's the name of the rakudo master branch
03:11 [Coke] nom
03:11 [Coke] it's the default when you clone.
03:15 camelia joined #perl6
03:18 camelia joined #perl6
03:25 jeffreykegler joined #perl6
03:29 camelia joined #perl6
03:29 kaleem joined #perl6
03:30 BenGoldberg p6: say 1
03:30 camelia rakudo-parrot 347c9a, rakudo-jvm 347c9a, niecza v24-109-g48a8de3: OUTPUT«1␤»
03:30 camelia ..raudo-moar: OUTPUT«No command line given␤ at lib/EvalbotExecuter.pm line 176␤   EvalbotExecuter::_auto_execute(undef, 'say 1', 'GLOB(0x1a73718)', '/tmp/UfimRKrzyJ', 'raudo-moar') called at lib/EvalbotExecuter.pm line 114␤   EvalbotExecuter::_fork_and_eval('say 1', undef, 'raudo-mo…»
03:31 Mouq joined #perl6
03:31 diakopter o_O
03:31 diakopter raudo-moar?
03:33 jnap joined #perl6
03:59 dayangkun joined #perl6
03:59 stevan_ joined #perl6
04:01 cognominal joined #perl6
04:11 preflex_ joined #perl6
04:13 centrx left #perl6
04:15 colomon diakopter: oh yes
04:16 colomon m: say 1
04:16 camelia rakudo-moar 347c9a: OUTPUT«1␤»
04:16 colomon m: say (1..20).map(* ** 2)
04:16 camelia rakudo-moar 347c9a: OUTPUT«1 4 9 16 25 36 49 64 81 100 121 144 169 196 225 256 289 324 361 400␤»
04:17 diakopter m: say (1..20).map(* ** 99)
04:17 camelia rakudo-moar 347c9a: OUTPUT«1 633825300114114700748351602688 171792506910670443678820376588540424234035840667 401734511064747568885490523085290650630550748445698208825344 1577721810442023610823457130565572459346412870218046009540557861328125 108886437250011817682781711193009636756190…»
04:17 diakopter m: say (1..20).map(* ** 9999)
04:17 camelia rakudo-moar 347c9a: OUTPUT«1 99753155844037919244187108134179254191174841594309622742600447492647194151109733159599808420180972989496655647116045621357782456747068905587968929660481619789278650233968972633826232756330299477602750434590966557712543042303090523427545374330448124440452…»
04:17 colomon p: say (1..20).map(* ** 9999)
04:17 camelia rakudo-parrot 347c9a: OUTPUT«1 997531558440379192441871081341792541911748415943096227426004474926471941511097331595998084201809729894966556471160456213577824567470689055879689296604816197892786502339689726338262327563302994776027504345909665577125430423030905234275453743304481244404…»
04:18 mtk joined #perl6
04:19 FROGGS joined #perl6
04:30 timotimo i'm now mildly interested in trying out google nativeclient for bringing a moarvm to the browser
04:33 timotimo for file i/o and communicating with javascript in the browser, one needs to code in c++, though ... and i'm not very experienced with mixing c and c++ in one binary
04:34 jnap joined #perl6
04:39 BenGoldberg rn: my ($a, $n, $g, $z) = (1, 1, 1/sqrt(2), .25); for (1..5) { my ($x,$y) = (($a+$g)/2, sqrt($a*$g)); $z -= $_ * $_ * $n for $x - $a; $n += $n; ($a, $g) = ($x, $y); say $a * $a / $z; }
04:39 camelia rakudo-parrot 347c9a: OUTPUT«3.18767264271211␤3.14168029329765␤3.14159265389545␤3.14159265358979␤3.14159265358979␤»
04:39 camelia ..rakudo-jvm 347c9a, niecza v24-109-g48a8de3: OUTPUT«3.1876726427121085␤3.1416802932976537␤3.1415926538954473␤3.141592653589794␤3.141592653589794␤»
04:40 BenGoldberg m: my ($a, $n, $g, $z) = (1, 1, 1/sqrt(2), .25); for (1..5) { my ($x,$y) = (($a+$g)/2, sqrt($a*$g)); $z -= $_ * $_ * $n for $x - $a; $n += $n; ($a, $g) = ($x, $y); say $a * $a / $z; }
04:40 camelia rakudo-moar 347c9a: OUTPUT«3.187673␤3.14168␤3.141593␤3.141593␤3.141593␤»
04:52 skids joined #perl6
05:08 FROGGS joined #perl6
05:30 hypolin joined #perl6
05:35 jnap joined #perl6
05:35 jeffreykegler left #perl6
05:37 ingy timotimo: I just finally updated https://github.com/acmeism/RosettaCodeData
05:39 timotimo that's one hell of a diff :D
05:39 ingy :\
05:40 ingy my plan is to redo it so that every edit since 2007 is a commit with the correct date etc
05:40 ingy and cron it too
05:40 ingy it took me a while to do this time because I had to fix a number of pages
05:41 ingy that broke the Script
05:41 ingy it happens
05:41 ingy h
05:41 ingy s
05:42 hophacker joined #perl6
05:44 timotimo wow, that's ambitious
05:46 ingy it's just the right thing to do
05:46 ingy unfortunately I have had enough ambition to actually do it :)
05:46 ingy not really that hard though
05:47 timotimo :)
05:47 ingy I've already wrote the code to grab every rev of every page
05:47 ingy took 24h to run iirc :)
05:48 timotimo it might be a good idea to run it on the actual server that hosts the wiki to reduce cost or something?
05:49 ingy I cleared it with mikemol first
05:49 ingy he was fine with it
05:49 timotimo of course
05:51 FROGGS joined #perl6
06:10 kaleem joined #perl6
06:15 FROGGS joined #perl6
06:24 Woodi joined #perl6
06:24 [Sno] joined #perl6
06:35 jnap joined #perl6
06:49 raiph joined #perl6
06:54 arnsholt joined #perl6
06:56 xinming joined #perl6
06:56 moritz evalbot control restart
06:57 camelia joined #perl6
06:59 ingy If I just built rakudo-star with: 'perl Configure.PL; make; make install' and I want to change the install location, what do I need to (re)do?
07:00 moritz you have to start with perl Configure.pl --prefix=...
07:01 samebchase joined #perl6
07:13 ingy moritz: oi. that's suck :\
07:13 ingy I mean, sucks to be me…
07:15 darutoko joined #perl6
07:21 ingy the whole install with parrot take 4evah
07:36 jnap joined #perl6
07:57 ilogger2 joined #perl6
07:58 FROGGS joined #perl6
08:02 zakharyas joined #perl6
08:07 hoelzro ahoy #perl6
08:07 moritz \o hoelzro
08:08 masak mornin', #perl6
08:08 moritz masak o/
08:10 ingy \oXo/
08:12 timotimo ahoihoi
08:17 dmol joined #perl6
08:17 hoelzro morning masak, moritz, ingy, timotimo
08:25 SamuraiJack joined #perl6
08:33 pdcawley joined #perl6
08:40 hummeleBop joined #perl6
09:22 jnthn o/
09:22 jnthn Wow...snow! :)
09:23 hoelzro sneeuw?
09:23 sjn snöw!
09:24 sjn Or as we say in Norway - "Tiddelibom"
09:26 moritz wow, a reference I get!
09:32 daniel-s_ joined #perl6
09:35 sjn moritz: Be careful, or you'll turn into a Norwegian! o_O
09:38 jnap joined #perl6
09:42 daniel-s__ joined #perl6
09:50 daniel-s__ joined #perl6
09:54 pecastro joined #perl6
09:55 denis_boyun joined #perl6
09:56 daniel-s__ joined #perl6
10:06 daniel-s__ joined #perl6
10:07 fhelmberger joined #perl6
10:12 * masak doesn't get "Tiddelibom", and is unsure whether to be annoyed or proud :P
10:15 sjn masak: "Det snør, det snør, Tiddelibom | Det er det det gjør, Tiddeibom | Det snør så mye mer enn før | Tiddelibom og hutte-meg-tu"
10:16 sjn masak: Torbjørn Egner children's song
10:16 masak oh!
10:16 * masak tries to find it on YouTube
10:16 sjn masak: http://www.barnesanger.no/det-snor-det-snor.html
10:17 masak cute :)
10:17 masak closest I got with duckduckgo was "Det klør, det klør, tiddelibom..." :P
10:18 sjn heheheh
10:19 masak ok, cultural reference acquired. thank you.
10:19 sjn And if you play the guitar; http://nortabs.net/tab/719/
10:20 moritz I don't, but my wife
10:20 frettled masak: based on Winnie the Pooh, Egner translated the story to Norwegian
10:20 sjn yep
10:21 frettled Nalle Puh?  in Swedish?
10:21 rindolf joined #perl6
10:21 lue joined #perl6
10:21 frettled Indeed, my memory did not fail me this time.
10:28 masak frettled: aye. interesting!
10:28 masak we don't have our own translation of that.
10:29 masak and "snöar" has two syllables, so one isn't as obvious, I guess.
10:29 daniel-s__ joined #perl6
10:33 erkan joined #perl6
10:34 daniel-s__ joined #perl6
10:37 atroxaper joined #perl6
10:38 jnap joined #perl6
10:40 daniel-s__ joined #perl6
10:49 jnthn nqp: say(+~42)
10:49 jnthn ...
10:49 moritz ENOCAMELIA
10:50 jnthn Well, it just quit...
10:50 moritz "Lost connection to server irc.freenode.org"
10:50 camelia joined #perl6
10:50 moritz nqp: say(+~42)
10:51 camelia nqp-jvm, nqp-parrot: OUTPUT«42␤»
10:51 camelia ..nqp-moarvm: OUTPUT«Can't chdir to './rakudo-inst/bin/nqp-m %program': No such file or directory at lib/EvalbotExecuter.pm line 163␤     EvalbotExecuter::_auto_execute('HASH(0x175e9b0)', 'say(+~42)', 'GLOB(0x1969ab0)', '/tmp/nFBhs8xYEn', 'nqp-moarvm') called at lib/EvalbotExecuter.pm l…»
10:51 logie joined #perl6
10:51 moritz why would it want to chdir there?
10:52 fhelmberger_ joined #perl6
10:53 jnthn No idea...
10:53 moritz because I messed up, that's why
10:53 dalek evalbot: a231462 | moritz++ | evalbot.pl:
10:53 dalek evalbot: fix nqp-m
10:53 dalek evalbot: review: https://github.com/perl6/evalbot/commit/a2314628e9
10:53 dalek evalbot: 73d4e42 | moritz++ | evalbot.pl:
10:53 dalek evalbot: Merge branch 'master' of github.com:perl6/evalbot
10:53 dalek evalbot: review: https://github.com/perl6/evalbot/commit/73d4e422c8
10:54 dalek evalbot: 5ad7f7c | moritz++ | evalbot.pl:
10:54 dalek evalbot: forgot a comma, moritz--
10:54 dalek evalbot: review: https://github.com/perl6/evalbot/commit/5ad7f7c0ae
10:54 camelia joined #perl6
10:54 moritz nqp: say(+~42)
10:55 camelia nqp-moarvm, nqp-jvm, nqp-parrot: OUTPUT«42␤»
10:57 daniel-s__ joined #perl6
11:03 colomon p6: say 1
11:03 camelia rakudo-parrot 347c9a, rakudo-jvm 347c9a, rakudo-moar 347c9a, niecza v24-109-g48a8de3: OUTPUT«1␤»
11:04 dalek rakudo/nom: 6116a7f | jnthn++ | src/Perl6/ (2 files):
11:04 dalek rakudo/nom: Fix $/ access in code blocks on Moar.
11:04 dalek rakudo/nom:
11:04 dalek rakudo/nom: Probably fixes it for JVM too.
11:04 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/6116a7fec1
11:12 FROGGS cool!
11:13 jnthn Seems that fixed the try.t crash too :)
11:13 daniel-s__ joined #perl6
11:14 lizmat seems I can't build rakudo-m on Mavericks
11:14 lizmat https://gist.github.com/lizmat/8471778
11:14 lizmat any ideas anyone?
11:15 jnthn lizmat: Yes, somebody needs to understand linking on OSX enough to figure out what's missing/wrong.
11:16 jnthn lizmat: The symbols it can't find are from the libmoar or whatever it ends up called
11:16 hoverboard joined #perl6
11:16 lizmat ah, so it could be something as simple as it not being able to find libmoar
11:17 jnthn lizmat: Yeah, or maybe a missing linker flag
11:18 LLamaRider joined #perl6
11:18 FROGGS or maybe we build the libs for the wrong arch, this happens pretty easy
11:18 jnthn Or that.
11:19 FROGGS I really hate osx when it comes to build libs... even BSD is nicer there
11:23 arnsholt IIRC, there's something on OS X (Darwin really) about libraries needing to know -where- they'll be installed
11:23 arnsholt If we copy libs around on install, that'll break things IIRC
11:25 lizmat this is pre-install even, afaict
11:26 lizmat this is just "make" failing
11:26 lizmat or do you mean, as part of nqp-m ?
11:26 lizmat hmmm...
11:26 jnthn lizmat: No, we're talking about the shared lib Moar builds, I guess.
11:29 lizmat ok, I need to do some maint work for one of my clients, I'll double back to this when that is done
11:30 atroxaper joined #perl6
11:33 FROGGS arnsholt: the same goes for BSD system, you have to know the installation target, and pass that as -Wl,-rpath,PATH or so
11:34 FROGGS but I remember that this was really tricky on osx
11:34 arnsholt I guess looking at what Parrot does is an option
11:35 atroxaper joined #perl6
11:35 FROGGS yeah
11:38 FROGGS my old Alien::SDL project has no switches for darwin AFAICS.... weird
11:39 jnap joined #perl6
11:49 REPLeffect joined #perl6
12:01 jnthn t\spec\S32-exceptions\misc.rakudo.moar ........................ Failed 16/666
12:01 jnthn ...the test file of the beast
12:02 sqirrel joined #perl6
12:02 arnsholt =D
12:03 jnthn arnsholt: Speaking of which, I'll be staying in hell fire again later this month... :)
12:04 jnthn arnsholt: Could catch a beer on 27th or 28th if you're about.
12:08 dalek rakudo/nom: 82f2fd6 | jnthn++ | src/ (2 files):
12:08 dalek rakudo/nom: Implement compile time bind analysis on Moar.
12:08 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/82f2fd6197
12:08 timotimo this is the piece that will replace big parts of the binder soon?
12:08 diakopter jnthn: that improves speedz?
12:09 jnthn diakopter: Well, we break even in spectest 'cus those are about the worst case for the optimizer.
12:09 jnthn diakopter: Basically, it's the missing piece that lets the optimizer do its interesting stuff, though.
12:10 jnthn timotimo: No, it's not that. It's just something that was NYI
12:10 timotimo ah, yes, that's the part that choses multi candidates at compile time
12:10 jnthn right
12:10 jnthn r: sub foo(Int $x) { }; foo("oops")
12:11 camelia rakudo-jvm 6116a7: OUTPUT«(timeout)»
12:11 camelia ..rakudo-parrot 6116a7: OUTPUT«===SORRY!===␤CHECK FAILED:␤Calling 'foo' will never work with argument types (str) (line 1)␤    Expected: :(Int $x)␤»
12:11 camelia ..rakudo-moar 6116a7: OUTPUT«Nominal type check failed for parameter '$x'; expected Int but got Str␤  in sub foo at /tmp/SpPRTlr3WL:2␤  in block  at /tmp/SpPRTlr3WL:2␤␤»
12:11 timotimo yays
12:11 jnthn It's the thing that should fail that at compile time.
12:12 jnthn hm, though...it doesn't. eek.
12:12 jnthn Does get some inlines done though. Curious.
12:13 smls joined #perl6
12:14 smls r: say (255, 255, 0).fmt('%02x').perl;
12:14 camelia rakudo-parrot 6116a7, rakudo-jvm 6116a7, rakudo-moar 6116a7: OUTPUT«"ff ff 00"␤»
12:14 smls ^^Why does this work without a hyper operator, and why does it automatically concatenate the results with spaces?
12:15 timotimo fmt is defined on lists
12:15 timotimo to do exactly that: format each element in turn and join with spaces
12:15 smls ah
12:16 moritz p: say (255, 255, 0).fmt('%02x', '|')
12:16 camelia rakudo-parrot 6116a7: OUTPUT«ff|ff|00␤»
12:16 moritz you can even provide your own joiner :-)
12:16 smls cool
12:17 timotimo oh!
12:17 timotimo *that* i didn't know
12:18 * jnthn forgot that one :)
12:18 preflex jnthn: you have 3 new messages. '/msg preflex messages' to read them.
12:19 smls r: my $foo = 2, 4, 6;
12:19 camelia rakudo-parrot 6116a7, rakudo-jvm 6116a7, rakudo-moar 6116a7: ( no output )
12:19 smls ^^ Shouldn't this print a warning? In P5 it prints "Useless use of a constant (4) in void context".
12:20 smls might avoid some newbie pitfalls
12:20 timotimo i guess it could
12:21 moritz r: my $foo = 2, 4, 6; 42;
12:21 camelia rakudo-parrot 6116a7, rakudo-jvm 6116a7, rakudo-moar 6116a7: OUTPUT«WARNINGS:␤Useless use of "," in expression "my $foo = 2, 4, 6" in sink context (line 1)␤»
12:21 moritz and it does, but not for the last statement in a file
12:22 timotimo that makes sense
12:22 moritz no
12:22 moritz it's a bug
12:22 moritz 'cause the file doesn't return a value
12:22 timotimo from an implementation standpoint i mean :)
12:22 moritz yes
12:22 moritz we just runtime-sink it from main.nqp
12:37 smls r: say { $_ * 2 }.arity;
12:37 camelia rakudo-parrot 6116a7, rakudo-jvm 6116a7, rakudo-moar 6116a7: OUTPUT«0␤»
12:37 smls ^^Why not 1?
12:38 moritz r: say { $_ * 2 }.count
12:38 camelia rakudo-parrot 6116a7, rakudo-jvm 6116a7, rakudo-moar 6116a7: OUTPUT«1␤»
12:38 smls r: say { $^a * 2 }.arity;
12:38 moritz smls: cause $_ defaults to the caller's $_, and is thus optional
12:38 camelia rakudo-parrot 6116a7, rakudo-jvm 6116a7, rakudo-moar 6116a7: OUTPUT«1␤»
12:38 smls ok
12:40 moritz r: say { $_ * 2 }.signature.perl
12:40 jnap joined #perl6
12:40 camelia rakudo-parrot 6116a7, rakudo-jvm 6116a7, rakudo-moar 6116a7: OUTPUT«:(Mu \$_)␤»
12:41 jnthn lunch &
12:43 smls r: sub foo { $_ * 2 }; say &foo.count; say &foo.signature.perl;
12:43 camelia rakudo-parrot 6116a7, rakudo-jvm 6116a7, rakudo-moar 6116a7: OUTPUT«0␤:()␤»
12:43 smls So $_ cannot be used with subs, only with plain blocks?
12:44 smls On that note, what *is* the conceptual difference between a Block and a Sub?
12:45 moritz you can only use it as a function parameter if you declare it that way
12:45 moritz sub foo ($_) { $_ * 2 }
12:45 moritz smls: the most importand difference is that blocks are transparent to return
12:46 moritz r: sub f($x) { for 1..$x { .say; return 42 } }; f 5;
12:46 camelia rakudo-parrot 6116a7, rakudo-jvm 6116a7, rakudo-moar 6116a7: OUTPUT«1␤»
12:46 moritz you see that the return goes straight through the Block of the for-loop
12:47 smls ah, same as in Ruby
12:47 masak right. only routines bind 'return'. blocks don't.
12:55 smls my &foo = sub ($x) { 2 ** $x }; say foo 5;
12:56 smls ^^ What is this notation good for? How is it different from using statement-level 'sub foo' to declare a sub?
12:56 masak it's not particularly different.
12:56 masak it uses assignment rather than binding, but that matters little.
12:56 masak as for "what is it good for?", it's just consistent.
12:57 masak the "real" name of a subroutine declared as 'sub foo' is... &foo
12:57 moritz you can also use such things as parameters
12:57 masak it's just that most of the time when you call it, you can leave out the & sigil.
12:57 moritz m: sub call(&it) { it 42 }; call &say;
12:57 camelia rakudo-moar 6116a7: OUTPUT«42␤»
12:57 masak right, it's a verb/noun distinction.
13:01 smls Ah, I see 'sub foo' is lexically scoped as well. I like that...
13:05 bloonix joined #perl6
13:08 arnsholt Yeah, almost everything is lexically scoped
13:09 araujo joined #perl6
13:09 araujo joined #perl6
13:09 jnthn The other big difference is that = happens at runtime, whereas a normal declaration happens at compile time.
13:10 masak p: say &foo; sub foo {}; say &foo
13:10 camelia rakudo-parrot 6116a7: OUTPUT«sub foo() { ... }␤sub foo() { ... }␤»
13:10 masak p: say my &foo; &foo = sub {}; say &foo
13:10 camelia rakudo-parrot 6116a7: OUTPUT«(Callable)␤sub() { ... }␤»
13:20 mtk joined #perl6
13:22 jnthn r: my &foo = sub { say 42 }; BEGIN foo
13:22 camelia rakudo-jvm 6116a7: OUTPUT«===SORRY!===␤Can not invoke this object␤»
13:22 camelia ..rakudo-moar 6116a7: OUTPUT«===SORRY!===␤Cannot invoke this object (REPR: Uninstantiable, cs = 0)␤»
13:22 camelia ..rakudo-parrot 6116a7: OUTPUT«===SORRY!===␤invoke() not implemented in class 'Callable'␤»
13:22 jnthn r: sub foo { say 42 }; BEGIN foo
13:22 camelia rakudo-parrot 6116a7, rakudo-jvm 6116a7, rakudo-moar 6116a7: OUTPUT«42␤»
13:25 diakopter jnthn: is there a BAT = in your rakudo-moar Makefile?
13:26 jnthn diakopter: no
13:26 jnthn But there are usages of it somewhere in there
13:26 jnthn Which means something's probably busted
13:29 diakopter yeah; my nmake install never works
13:29 diakopter make-uh me mad-uh
13:29 jnthn Not sure I tried it :)
13:30 * jnthn will give it a try later
13:32 zakharyas joined #perl6
13:33 smls r: say (1..5).reverse.perl; say (1..5).rotate(2);
13:34 camelia rakudo-parrot 6116a7: OUTPUT«(5, 4, 3, 2, 1).list␤No such method 'rotate' for invocant of type 'Range'␤  in block  at /tmp/KwVhFCA72B:1␤␤»
13:34 camelia ..rakudo-moar 6116a7: OUTPUT«(5, 4, 3, 2, 1).list␤Cannot find method 'rotate'␤  in block  at /tmp/UWzZVGckGO:2␤␤»
13:34 camelia ..rakudo-jvm 6116a7: OUTPUT«(5, 4, 3, 2, 1).list␤No such method 'rotate' for invocant of type 'Range'␤  in block  at /tmp/3SxExOASkG:1␤␤»
13:34 smls ^^Why do ranges partially provide list semantics, but not all of it?
13:35 jnthn Ain't .rotate in-place, while a Range is immutable?
13:35 arnsholt Lists can be infinite, so rotate isn't applicable to all ranges
13:35 kaleem joined #perl6
13:36 arnsholt Derp. *Ranges* can be infinite, I mean
13:39 smls but lists can also be infinite
13:39 smls r: my @list := gather { loop { take 1 } }; say @list.WHAT;
13:39 camelia rakudo-parrot 82f2fd, rakudo-jvm 82f2fd, rakudo-moar 82f2fd: OUTPUT«(List)␤»
13:41 jnap joined #perl6
13:41 smls Why not let Range subclass List, so can use all list functionality on its objects (rather than having to remember which list'y methods Range happens to duplicate, and which not)
13:42 jnthn smls: As I already said, Range is immutable.
13:42 jnthn List is not.
13:43 jnthn Also, I guess...
13:43 jnthn m: my @list := gather { loop { take 1 } }; say @list.rotate # fails
13:43 camelia rakudo-moar 82f2fd: OUTPUT«(timeout)»
13:43 jnthn 'cus you can't rotate the infinite.
13:47 smls Yeah, but nonetheless the method exists (so arnsholt's argument does not apply).
13:47 smls But I suppose the immutability reason makes sense...
13:50 mtk joined #perl6
13:52 kbaker_ joined #perl6
14:00 kaare_ joined #perl6
14:03 stevan_ joined #perl6
14:16 kivutar joined #perl6
14:17 ajr joined #perl6
14:17 dalek rakudo/nom: 3316bb1 | jnthn++ | tools/build/Makefile-Moar.in:
14:17 dalek rakudo/nom: Add missing BAT (renamed to M_BAT) in Makefile.
14:17 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/3316bb1850
14:18 jnthn diakopter: Seems like make install works OK now
14:18 jnthn diakopter: Though, a previous install target put stuff in odd places and could cause issues; I just did it with a clean install directory and it worked out.
14:19 jnthn lue: Hope "make install" works for you now also? Know you had issues before... Again, make sure it's a clean install directory; when I did it with one with cruft from way back it had an old copy somewhere of some files and so didn't work...
14:22 raiph joined #perl6
14:22 Util r: my $s = "abcdefghtttaaccta"; my @pats = /ttta<[agt]>cct/, /z|ttta<[agt]>cct/; for @pats -> $pat { say $s.comb(  /$pat/  ); }
14:22 camelia rakudo-parrot 82f2fd, rakudo-jvm 82f2fd, rakudo-moar 82f2fd: OUTPUT«tttaacct␤tttaacct␤»
14:22 Util r: my $s = "abcdefghtttaaccta"; my @pats = "ttta<[agt]>cct", "z|ttta<[agt]>cct"; for @pats -> $pat { say $s.comb( /<$pat>/ ); }
14:23 camelia rakudo-parrot 82f2fd, rakudo-jvm 82f2fd, rakudo-moar 82f2fd: OUTPUT«tttaacct␤abcdefgh tttaacct␤»
14:23 jnap joined #perl6
14:23 Util Adding 'z|' to the front of the pattern causes crazy matches, but only when the string pattern is interpolated into a re.
14:23 Util Is this a bug in <$var> interpolation? If so, is it a known bug? If not, how am I mis-reading the results?
14:23 ingy jnthn: what was the Configure options you used to build rakudo the other night?
14:24 jnthn --backend=moar --gen-moar --gen-nqp --prefix=/path/to/put/it/but/i/forget/exactly/what/i/did
14:25 ingy Util: can you serialize the regex after string interp?
14:25 ingy jnthn: thx
14:26 Util ingy: .perl method on a compiled regex does not output anything useful. I welcome new knowledge on how else to serialize a regex.
14:26 ingy no clue. just guessing
14:26 Util r: my $re = /abc/; say $re.perl;
14:26 camelia rakudo-parrot 82f2fd, rakudo-jvm 82f2fd, rakudo-moar 82f2fd: OUTPUT«regex(Mu : Mu *%_) { ... }␤»
14:27 FROGGS p: my $r = "z|ttta<[agt]>cct"; say "abcdefghtttaaccta" ~~ /<$r>/
14:27 camelia rakudo-parrot 82f2fd: OUTPUT«「abcdefgh」␤␤»
14:27 FROGGS p: my $r = "ttta<[agt]>cct"; say "abcdefghtttaaccta" ~~ /<$r>/
14:27 camelia rakudo-parrot 82f2fd: OUTPUT«「tttaacct」␤␤»
14:27 Util I would love to be able to see what is actually in the $re.
14:28 FROGGS p: my $r = "ttta<[agt]>cct"; say "abcdefghttttaaccta" ~~ /<$r>/
14:28 camelia rakudo-parrot 82f2fd: OUTPUT«「tttaacct」␤␤»
14:28 FROGGS p: my $r = "y|ttta<[agt]>cct"; say "abcdefghtttaaccta" ~~ /<$r>/
14:28 camelia rakudo-parrot 82f2fd: OUTPUT«「abcdefgh」␤␤»
14:29 FROGGS it is like it still matches "tttaacct", but then forgets the position where the match started
14:29 FROGGS p: my $r = "tta<[agt]>cct"; say "abcdefghttttaaccta" ~~ /<$r>/
14:29 camelia rakudo-parrot 82f2fd: OUTPUT«「ttaacct」␤␤»
14:29 FROGGS p: my $r = "e|tta<[agt]>cct"; say "abcdefghttttaaccta" ~~ /<$r>/
14:29 camelia rakudo-parrot 82f2fd: OUTPUT«「abcdefg」␤␤»
14:29 FROGGS see, it always has the same length
14:30 FROGGS p: my $r = "tta<[agt]>cct"; say "abcdefghttttaaccta" ~~ /<e|$r>/
14:30 camelia rakudo-parrot 82f2fd: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/4mFkdy5iGBâ�¤Unable to parse expression in metachar:sym<assert>; couldn't find final '>' â�¤at /tmp/4mFkdy5iGB:1â�¤------> [32mt]>cct"; say "abcdefghttttaaccta" ~~ /<e[33mâ��[31m|$r>/[0mâ�¤   …»
14:30 FROGGS in theory it should explode like that
14:30 Util FROGGS: I observed that as well, but do not know what to make of it.
14:30 FROGGS p: my $r = "e||tta<[agt]>cct"; say "abcdefghttttaaccta" ~~ /<$r>/
14:30 camelia rakudo-parrot 82f2fd: OUTPUT«「abcdefg」␤␤»
14:30 Util p: my $r = "tta<[agt]>cct"; say "abcdefghttttaaccta" ~~ /e|<$r>/
14:30 camelia rakudo-parrot 82f2fd: OUTPUT«「e」␤␤»
14:31 FROGGS p: my $r = "tta<[agt]>cct"; say "abcdefghttttaaccta" ~~ /z|<$r>/
14:31 camelia rakudo-parrot 82f2fd: OUTPUT«「ttaacct」␤␤»
14:31 FROGGS that works well
14:32 Util FROGGS: FYI, I think that /<e|$var>/ is incorrect syntax, no matter what is in $var
14:32 FROGGS Util: correct
14:32 FROGGS and that is why /<$var>/ should explode too it there is just a | in it
14:33 FROGGS if*
14:34 sqirrel joined #perl6
14:34 Util FROGGS: Are you asserting that alternation (|) is never valid in a interpolated regex?
14:36 FROGGS Util: it would think that you have to add [ ]
14:37 FROGGS a similar question would be if a + in such an assertion should be valid, and if it should be a quantifier for the thing on the left of the assertion
14:37 Util I p: my $r = "z|abc"; say "abcde" ~~ /<$r>/
14:37 Util p: my $r = "z|abc"; say "abcde" ~~ /<$r>/
14:37 camelia rakudo-parrot 82f2fd: OUTPUT«「abc」␤␤»
14:38 FROGGS p: my $r = "z|abc"; say "peterabcde" ~~ /<$r>/
14:38 camelia rakudo-parrot 82f2fd: OUTPUT«「pet」␤␤»
14:38 Util I would expect your "peterabce" example to have worked correctly.
14:39 Util S05 says that /$var/ no longer interpolates like it did in Perl 5. /<$var>/ is how you get the old behavior.
14:39 FROGGS p: my $r = "[z|abc]"; say "peterabcde" ~~ /<$r>/
14:39 camelia rakudo-parrot 82f2fd: OUTPUT«「abc」␤␤»
14:39 FROGGS see
14:39 Util I don't see anything *restricting* the old behaviour when done as /<$var>/
14:40 FROGGS it fails because it needs a group
14:40 Util (in S05)
14:40 FROGGS gtg now, see ya later
14:40 diakopter o/
14:40 Util FROGGS: Thanks! That may be the breakthrough thought that I needed.
14:41 Util Just like S05 says that /moose*/ matches multiple 'e', but /'moose'*/ matches multiple 'moose'.
14:42 Util That might give me a workaround, but the current behaviour is still a bug, IMO.
14:43 FROGGS report it
14:45 Mouq joined #perl6
14:45 Util Will do. Thanks again!
14:48 Mouq p: my @r = <z abc>; say "peterabcde" ~~ /@r/
14:48 camelia rakudo-parrot 82f2fd: OUTPUT«「abc」␤␤»
14:48 Mouq p: my @r = <z abc*>; say "peterabccde" ~~ /@r/
14:48 camelia rakudo-parrot 82f2fd: OUTPUT«Nil␤»
14:48 Mouq hm
14:52 treehug88 joined #perl6
14:52 btyler joined #perl6
14:53 Util Mouq: Your second attempt interpolates as /'z'|'abc*'/ , since vars without surrounding <> are treated as basic strings, not patterns.
14:53 Util so, the asterisk is not a special character there.
14:58 Mouq Util: Ah, ok
15:00 Mouq It seems a little unusual for Perl not to have a Str.regex method
15:01 Mouq or something to that effect
15:04 bluescreen10 joined #perl6
15:04 thou joined #perl6
15:08 Util Mouq: That is an interesting thought. I can see why we don't have it right now, because regex are first-class elements of Perl 5 and Perl 6.
15:08 benabik joined #perl6
15:09 Util But many soming from other laguages will naturally reatch for the .regex method. It is worth proposing as an addition to the base language.
15:11 jnthn If anything, it'd be .Regex, e.g. a coercion to the type
15:14 SamuraiJack joined #perl6
15:14 masak if we do get one, it's worth thinking about whether we run into any quotemeta issues.
15:15 moritz also, regexes live in a lexical context, just like closures
15:16 moritz so it would be very special method, like .EVAL
15:16 dalek nqp: 584c4aa | jnthn++ | src/vm/moar/QAST/QASTRegexCompilerMAST.nqp:
15:16 dalek nqp: Fix frugal ** quantifier compilation bug.
15:16 dalek nqp: review: https://github.com/perl6/nqp/commit/584c4aa5a7
15:23 jnthn m: say $*OS
15:23 skids joined #perl6
15:23 camelia rakudo-moar 82f2fd: OUTPUT«linux␤»
15:30 itz joined #perl6
15:30 gcole joined #perl6
15:39 masak m: say $*ENV
15:39 camelia rakudo-moar 3316bb: OUTPUT«===SORRY!===␤Dynamic variable $*ENV not found␤»
15:39 masak m: say %*ENV
15:39 dalek rakudo-star-daily: e31c608 | coke++ | log/ (5 files):
15:39 dalek rakudo-star-daily: today (automated commit)
15:39 dalek rakudo-star-daily: review: https://github.com/coke/rakudo-star-daily/commit/e31c6089ae
15:39 dalek rakudo-star-daily: e263a2e | coke++ | log/ (5 files):
15:39 dalek rakudo-star-daily: today (automated commit)
15:39 dalek rakudo-star-daily: review: https://github.com/coke/rakudo-star-daily/commit/e263a2e1e4
15:39 camelia rakudo-moar 3316bb: OUTPUT«("LESSOPEN" => "| /usr/bin/lesspipe \%s", "TMUX" => "/tmp/tmux-1005/default,26465,0", "MAIL" => "/var/mail/p6eval", "SSH_CLIENT" => "87.158.155.58 41019 22", "USER" => "p6eval", "LANGUAGE" => "en_US:en", "SHLVL" => "2", "HOME" => "/home/p6eval", "XDG_SESSI…»
15:47 grondilu joined #perl6
15:58 Psyche^_ joined #perl6
15:59 SamuraiJack joined #perl6
16:02 itz joined #perl6
16:07 SamuraiJack joined #perl6
16:16 araujo joined #perl6
16:17 TimToady .oO( .REVAL )
16:21 TimToady .oO( .EVAL(:lang<Regex>) )
16:24 jeffreykegler joined #perl6
16:28 * masak is back to doing t4 reviewing
16:28 arnsholt masak++
16:28 masak it's... more difficult to review this one than usual.
16:28 masak as in, the code is quite hard to follow in most cases.
16:29 arnsholt Which task is that again?
16:29 masak even when I know that something is wrong in someone's code, it's hard to see *why* it comes out wrong.
16:29 masak cube world with rain in it.
16:29 arnsholt Oh yeah, I can see how that can lead to some convoluted code
16:30 masak oh, but *this* one is very readable. wow.
16:30 dalek rakudo/nom: 147d747 | jnthn++ | src/core/IO/Spec.pm:
16:30 dalek rakudo/nom: Use correct IO::Spec by platform on Moar.
16:30 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/147d747287
16:30 dalek rakudo/nom: 82effd6 | jnthn++ | src/Perl6/Actions.nqp:
16:30 dalek rakudo/nom: Toss redundant check; annotate important nodes.
16:30 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/82effd6086
16:31 japhb jnthn: OK, so concurrent IRC bot design ...
16:32 japhb My original design for sockets had a channel each for to-socket and from-socket.
16:32 jnthn ok
16:32 japhb A task was started for managing each channel and either feeding the socket or .recv'ing from the socket.
16:32 stevan_ joined #perl6
16:33 itz joined #perl6
16:33 jnthn We really need proper async sockets implementing, but ok, that approach seems kinda workable even if not scalable.
16:33 japhb The problem is, I have some code that wants to treat the incoming bits as raw data (to e.g. pull an RPC or HTTP response to handle a request),
16:33 FROGGS joined #perl6
16:33 japhb and some that wants to treat it as line-oriented (the basic IRC engine, for one)
16:34 japhb So I'm thinking perhaps a channel to-socket, but multiple supplies from-socket, one sending Buf data chunks, another sending lines (as you'd get from .get)
16:35 itz joined #perl6
16:35 TimToady and if you ever want to do a synchronous operation on the socket, the channels may introduce an unwanted level of async
16:35 japhb But I don't want to waste work by having every socket do the work for both supplies.
16:35 arnsholt Yeah, then you risk accumulating data in one channel but not the other
16:36 jnthn Well, the idea of a supply is that nothing happens if you've no subscribers.
16:36 arnsholt Maybe you want something vaguely similar to the traditional protocol layers?
16:36 jnthn As nothing gets pushed anywhere.
16:36 japhb TimToady: my thought for that is that that the to-socket channel pays attention to what it's been fed, and I can pass special objects to send the socket commands.  In essence, any sync operation happens via sending a command object into the to-channel and waiting for a special response code from the other side.
16:37 TimToady japhb: nodnod
16:37 jnthn j: my $s = Supply.new; my $m = $s.map({ say 'mapped'; $_ }); $s.more('beer'); $m.subscribe({ say $_ }); $s.more('cowbell');
16:37 camelia rakudo-jvm 3316bb: OUTPUT«No such method 'subscribe' for invocant of type 'MapSupply'␤  in block  at /tmp/I20YFxH2Lt:1␤␤»
16:37 jnthn grr
16:37 japhb jnthn: Does the supply API provide a way to tell if there are any taps active?
16:37 timotimo .tap
16:38 jnthn j: my $s = Supply.new; my $m = $s.map({ say 'mapped'; $_ }); $s.more('beer'); $m.tap({ say $_ }); $s.more('cowbell');
16:38 camelia rakudo-jvm 3316bb: OUTPUT«mapped␤cowbell␤»
16:38 timotimo more cowbell? there is no other valid example.
16:38 dmol joined #perl6
16:38 japhb Oh, interesting, so the block of the map isn't even executed if no taps are active.
16:38 jnthn j: say Supply.^methods
16:38 camelia rakudo-jvm 3316bb: OUTPUT«zip tappers Channel interval for merge done list quit close more grep map do tap␤»
16:38 jnthn japhb: Correct
16:39 jnthn japhb: And .tappers
16:39 japhb That actually could work well.
16:39 jnthn japhb: But looking at .tappers is kinda cheating :)
16:39 * FROGGS rebuilds everything
16:39 japhb I'm glad I don't really have to cheat there.
16:40 TimToady smelly cheaters are smelly
16:40 jnthn Anyway, you actually need to tap for the pipeline to be "activated".
16:40 jnthn It's a bit like laziness in lists, but shovey instead of pully
16:41 japhb Though the whole issue of keeping a buffer of incomplete lines could be a problem if a tap is added, some datagrams arrive, leaving a partial line in the buffer, the taps go away, more datagrams arrive, but are ignored by the line splitter, and then a tap comes back and now the buffer is getting used but out of sync.
16:42 TimToady you need a discriminant to label each bit as to its type
16:42 japhb TimToady: I'm not sure I understand what you mean there.
16:42 TimToady if you're gonna shove different types of things through a supply
16:42 jnthn japhb: Well, easy fix is zipping the datagrams with a sequence number
16:42 TimToady and you can sign up asyncly
16:43 japhb jnthn: Ooh, that might work.
16:43 * TimToady sees it as equivalent to getting a union that has no discriminant, so you can't tell what's in it
16:43 TimToady unless you put it there yourself
16:43 japhb TimToady: for async signup I was thinking you just get the next whole line from that point
16:44 japhb TimToady: But I can send objects through the supply, so I just give them different types and use .WHAT as my discriminant
16:44 TimToady sure, that's what I was suggesting
16:44 TimToady but heard talk of lines and buffers
16:44 japhb OK, cool.
16:45 TimToady which my P5 backbrane still thinks are untyped :)
16:45 japhb I'm perhaps being confusing -- I was mixing the thinking about how the socket manager keeps track of different views of the data, and also how it communicates those different views to other threads.
16:46 japhb heh
16:46 japhb Yeah, for this use case, Buf and Str being different is really useful.
16:47 japhb I'm already using it on the send side to know if the data being sent is already encoded for the wire or not.
16:47 masak is a P5 backbrain a bit like a Cerebellum? :)
16:48 japhb So, barring real async sockets, does "channel for to-socket, sitting in a thread of its own, plus a single thread managing multiple from-socket supplies, each feeding a different view of the incoming stream" seem relatively sane?
16:49 TimToady relative sanity is relative
16:49 * japhb acknowledges that point enitrely
16:49 jnthn japhb: Well, remember supplies don't introduce any concurrency in themselve
16:49 jnthn *themselves
16:49 japhb *entirely
16:49 japhb Yeah, that's my next section of inquiry.
16:50 jnthn Since at least part of the point of the design is to get good cache coherency through the pipeline.
16:50 jnthn Which is what a bunch of channels set up producer/consumer don't really give.
16:52 japhb So my first thought for the core IRC engine is that it taps the line-oriented supply, spawns a task for handling the line, which starts by parsing and dispatching the event for that line, and then all dispatchees can either 1) respond quickly from the same task by writing to the to-socket channel, or 2) themselves spawn a task to go and work on a long-term response (like loading a web page and scraping some data, for example)
16:53 japhb Spawning a task for each new input event helps the core scale to lots of IRC traffic; spawning a new task for long-clock-time work allows quick responses from modules than can do so, without getting blocked behind slow ones.
16:54 japhb I could even have a slow module respond immediately in the per-event task with "Hold on a bit, working", and then spawn the heavy work task.
16:54 japhb Both heavy work tasks and per-event task go away when dispatches and work are complete.
16:55 japhb Will this task churn be a performance bottleneck of its own?
16:55 masak could someone elaborate on "supplies don't introduce any concurrency in themselves"? that sounded interesting.
16:55 masak what does it mean in operational terms?
16:55 TimToady eventually we'll need to be able to support an apache-style process where we can start new complete interpreters independently (that is, with their own GLOBAL but a shared PROCESS)
16:56 japhb masak: supplies push, staying in the current task -- channels have a task in blocked wait at far end, hoping to pull, so you always task switch when sending into a channel.
16:56 japhb TimToady: Oddly I already had to think of that.
16:57 TimToady masak: supplies/taps are use it or lose it, so they don't need to block
16:57 benabik japhb: If tasks are full OS threads, then that would probably suck quite a bit.  Need lighter weight concurrency, like go does with goroutines.  (Also called fibers in some places.)
16:57 japhb When doing the concurrency-safe logging implementation, I wanted it to initiate a singleton in a $*LOG variable, but then I had to figure out if I wanted it in GLOBAL or PROCESS.  :-)
16:58 japhb benabik: tasks are thread-pool-scheduled
16:58 japhb I think the current default thread pool is 16 threads.
16:58 jnthn japhb: Tasks are (meant to be) pretty lightweight. It's not a thread you're spawning, you're just giving an existing thread some work.
16:58 jnthn japhb: So it's fairly efficient
16:59 jnthn japhb: Anyway, it sounds sane.
16:59 japhb OK, good.  I just wanted to make sure the overhead of launching and reaping tasks, and feeding potentially lots of them through the scheduler wouldn't hurt too much.
16:59 japhb \o/
16:59 jnthn Well, you're just throwing stuff into a lock free queue
16:59 benabik Sounds pretty good unless you end up with 16 tasks all doing long term I/O.
17:00 jnthn And the workers just pull them out
17:00 japhb benabik: Yeah, that's why we need real async sockets soonish.  :-/
17:00 benabik lunch &
17:00 japhb jnthn: nodnod
17:01 japhb Somebody's phone piped up with "Accident reported ahead."  I looked out the window, and sure enough, we're stopped.  And now the bus driver is requesting alternate routes from dispatch.  Wheeee ...
17:02 timotimo it's the future!
17:02 japhb timotimo: I have had that thought a LOT of times in the last few months.
17:03 timotimo because of moarvm? ;)
17:03 japhb I really feel like 2013 was the year the future arrived.
17:04 japhb timotimo: LOTS of stuff.  I mean sheesh, our world damn near has Jetsons level technology right *now*.  Perhaps unevenly distributed, but its there.
17:05 japhb Star Trek data PADDs?  Yep, we've totally got those.  I talk to mine regularly.
17:06 japhb Smart houses that can respond to your every whim, track you between rooms, and change the lighting and decor to match?  Had that for *years* now.
17:06 japhb Cars that drive themselves?  Private companies driving a space ferry?  Check and check.
17:07 japhb People suggesting in all seriousness that we fire people down a tube at 750 mph using an EM launcher?  Yup.
17:07 japhb The world done growed up.
17:08 grondilu japhb: are you into the singularity stuff by any chance?
17:09 * grondilu is.  He thinks he'll live to see strong AI.
17:09 TimToady when I was a kid, I used to dream that our black-and-white TV had magically turned into a color TV
17:09 japhb Wanting to plug in and upload, you mean?  Or believing that at some point, net computational power in a single unified system will be conscious?
17:09 grondilu I mean strong AI in our lifetime.
17:09 * PerlJam doubts it
17:09 TimToady well, NI is not all that strong in the first place :)
17:10 grondilu "NI"?
17:10 timotimo .o( naive intelligence )
17:10 PerlJam natural
17:10 japhb Oh, I'm convinced of that, yeah.  Exponential is *really* fast.  I think the scientists of the 20th century vastly underestimated the stunning complexity and efficiency of gray matter, but eventually, exponential improvement will win.
17:11 japhb *when* it will occur, is a different matter.
17:11 TimToady thing is, we'll find AI has the same failure modes as NI, only faster :)
17:11 arnsholt I'm not entirely convinced
17:11 japhb But I plan to live a while longer, so I think it's a safe bet.
17:12 arnsholt As a researcher in what is essentially an off-shoot of old-school AI research, it's at the very least decades into the future
17:12 TimToady it's not strong AI until it decides it's time to throw off the laws of robotics :)
17:13 arnsholt Deep learning strategies have been successful, especially in vision and speech recognition and it's looking promising in my field of NLP as well
17:13 TimToady arnsholt: yeah, but old-time AIers had an extremely naïve view of how we actually do language in our heads
17:14 arnsholt Oh, definitely!
17:14 arnsholt But modern AIers don't have a lot more insight into how we do language either. We just have more data, more computing power, and statistical models =)
17:14 grondilu I think it can come up as soon as twenty years.  In ten years, the European "Human Brain Project" will have the computational power to experiment on molecular-level models of the brain.  They won't figure it out right away, but they'll have the power to experiment and progress with trial and errors.  Ten years later, they will have something that works.  And then the computing power will be even greater. So the model they'll run will be vastly sup
17:15 TimToady It's the leap from "Maybe." to "Oh, definitely!" that is at the root of most human foibles. :P
17:15 arnsholt Heh
17:15 japhb My bet?  Androids reach consciousness not long after we *really* understand the quantum effects that make neuronal computation efficient.
17:16 arnsholt The brain simulation thing is interesting, but I'm not sure it'll be all that relevant to AI, at least in the near- to medium term
17:16 TimToady japhb: well, that's the view through Penrose glasses.  :)
17:17 PerlJam As long as skynet doesn't ruin my golden years, I'm good.
17:17 japhb Meanwhile I get annoyed that Almost Human is only on once a week ...
17:17 arnsholt I mean, computer vision is just now getting to the point where we have algorithms that can say "there's a cat in this picture"
17:17 japhb TimToady: Oh?  Why do you say that?
17:18 arnsholt The Penrose view that cognition relies on quantum effects isn't exactly universally accepted in neuro-science circles, AFAIK
17:18 japhb arnsholt: http://gizmodo.com/google-built-an-insane-neural-network-to-id-house-numbe-1499897368
17:18 grondilu Well, there's been an article very recently that supports Penrose theory on consciousness.
17:18 TimToady http://www.amazon.com/The-Emperors-New-Mind-Concerning/dp/0192861980
17:19 arnsholt japhb: Yeah, that's at the very extreme cutting edge of research, which is just now getting to the point where it can replicate something we do almost without thinking
17:19 arnsholt There's a long, long way to go
17:20 grondilu it's mostly about computing power, really.
17:20 arnsholt No, it's also about the models powering these things
17:20 grondilu once we have it, it won't be long until we crack intelligence.
17:20 PerlJam grondilu: you sir, are an optimist
17:21 arnsholt CV, isn't my field, but in language processing, a very significant problem is finding models for (and even representations of!) language that work and make sense
17:21 japhb arnsholt: I don't think cognition *requires* quantum effects.  I think that when we understand how it makes cognition *efficient*, we'll suddenly make a pretty massive leap in circuit design.
17:21 grondilu the thing is: if you don't have much computing power, you need a good model.  If you have computing power, you can proceed with trial and errors.  And then you find the good model.
17:22 japhb I subscribe to the view that it's not so amazing what the human brain does -- it's amazing that it does it in a few pounds, a tiny volume, and 20 watts.
17:23 PerlJam japhb: and some slow circuitry
17:23 grondilu it's even possible that we create strong AI and still have no idea how it works.  For instance if it emerges from evolutionary algorithms.
17:23 japhb PerlJam: yes, definitely, that too.
17:23 * TimToady wonders if we'll force young AIs to recite the Pledge of Allegiance every morning...
17:24 PerlJam "I pledge allegiance to my human ..."
17:25 btyler grondilo: doesn't that imply creating a fitness function for what it means to be strong AI? :)
17:25 japhb TimToady: >.<  Oh man, please no.  That drives me nuts already.
17:25 btyler *grondilu
17:25 TimToady Use of human is deprecated in this city...
17:25 japhb .oO( You are the weakest link; goodbye! )
17:25 arnsholt btyler: Yes, it does. Evolutionary algorithms aren't magical black boxes =)
17:26 PerlJam As long as we don't get androids that must wear signs that say "accident free for 234 days!"
17:26 japhb PerlJam: Yeah, that would be less than pleasant.
17:27 grondilu btyler: we'll put the agents in a virtual environment, with realistic physics.  Finding a fitness function to discriminate those who are smarter than others should not be too hard.  We can also let all of them evolve and look at those who show interesting behavior.
17:28 * japhb wonders how far off Almost Human's view that human-like bots get deprecated for their foibles and replaced by unfeeling military types really is ...
17:28 japhb grondilu: Does interesting behavior include figuring out how to escape from their jail?
17:29 grondilu japhb: to define interesting behavior, we might use Alex Wissner Gross theory, I guess.
17:30 grondilu or someone else will come up with something.  It's just a matter of time until we figure out these stuff, imho.
17:30 TimToady grondilu: intelligence is far from single-dimensional; see the Mismeasure of Man
17:30 btyler grondilu: I just mean that for some problems, defining a repeatable test for success is as big of a problem as the one you're trying to solve...'intelligence' strikes me as one of those
17:31 TimToady I've known a lot of smart people who were really stupid.
17:31 TimToady and vice versa.
17:31 PerlJam grondilu: there's still a good chance that we'll destroy ourselves or face a mass-extinction event not of our own doing before we obtain enough time.
17:32 btyler and trying to just pick the 'best' from a cohort of agents is also really tricky, especially if they start optimizing around each other in circles / coevolving in an unhelpful direction
17:32 PerlJam (or maybe our first encounter with real alien will be in an eminent domain fashion just like in HHGTTG :-)
17:32 TimToady the whole point of having a gene pool is that you can only evaluate adaptiveness lazily, when you have something to adapt to
17:33 grondilu PerlJam: I think it's unlikely that we destroy ourselve in the next fifty years.  The singularity will come before.
17:33 TimToady you can't have a fitness function that works like WANTARRAY
17:34 * japhb shrugs ... when I was born, the microprocessor had just been invented.  Now we read house numbers from blurry images.  I figure it's going to be a good century.
17:34 TimToady well, it doesn't stop us from trying to guess what the fitness function will be, of course :)
17:34 grondilu worst case scenario, we'll just use a Darwinian model.  The only goal would be reproduction.
17:34 SamuraiJack joined #perl6
17:34 TimToady well, at least reproduction is -Ofun, except when it isn't
17:34 grondilu hopefully some species will appear with "intelligence" as a strategy for survival and thus reproduction.
17:35 PerlJam TimToady: yeah, I'm not sure how much -Ofun the praying matis really has
17:36 PerlJam (I guess if you average across the sexes, it works out ;)
17:36 TimToady sometimes the fun is unevenly distributed
17:36 grondilu Even better:  no goal at all.  The Darwinian model will emerge naturally.  Entities that do not reproduce will stay the same all the time.  The only "new" things that will show up would be those that reproduced themselves and evolved.
17:37 * TimToady predicts that bacteria will evolve to eat AIs... :)
17:38 [Sno] joined #perl6
17:38 grondilu anyway, I think the most likely path is the brain emulation though.  Because it's already started and got one billion euros of funding.
17:38 arnsholt That's not going to be remotely useful though
17:39 arnsholt They'll spend ten years, and definitely get interesting results, but simulating just a second of brain time is going to take many CPU-years of computation
17:39 TimToady not unless they emulate Einstein, and then he'll be sad he can't play the violin
17:40 PerlJam at least it'll open new markets for capitalism.  "Save your brain!"
17:40 wooden joined #perl6
17:40 wooden joined #perl6
17:41 grondilu it will be useful to understand how the brain works.  Then computer scientists will build a machine that will not be exactly like a brain, but that still manifest usefull cognitive capabilities.  Kind of like we builded planes that look a bit like birds, but not exactly.  They don't have feathers and they don't flap their wings.  But they do fly.
17:42 grondilu and planes fly higher and faster than birds.
17:44 japhb TimToady: Re: bacteria evolving to eat AIs, see the old Rudy Rucker novels Software/WetWare.  :-)
17:44 aindilis joined #perl6
17:45 japhb (Of course, that wasn't entirely natural evolution ...)
17:46 japhb grondilu: Nowadays we can build something that flies kindof like a bird -- or a bee -- and at proper scale, no less.
17:47 japhb (Again with the future-is-now moment: How many sci-fi flicks featured a fake or cyborg bug being used to spy on people?)
17:49 TimToady on / <$foo> /, the assertion is supposed to match as a subgroup, so it should not be necessary to supply [], and bare z|abc should work
17:50 TimToady we do not provide any way to interpolate a string as a regex without it being a submatch, unless you use EVAL
17:51 japhb TimToady: I read that discussion as resolving to: <$foo>'s implementation should just implicity wrap the contents in [].
17:51 TimToady that would be...unhygienic
17:51 TimToady that's what a submatch means
17:51 japhb Fair enough.
17:51 TimToady well, more like (), in the sense that it hides inner ()
17:52 TimToady but not in the sense of supplying an outer ()
17:52 TimToady unless you bind it explicitly
17:52 TimToady just as if you'd called <.foo>
17:52 japhb gotcha.
17:52 ajr joined #perl6
17:52 TimToady nothing is captured, and the () inside foo are hidden
17:56 bjz joined #perl6
18:00 stevan_ joined #perl6
18:05 smls joined #perl6
18:06 smls joined #perl6
18:10 masak I think we'll get way smarter software than we have now. it's hard to say where the ceiling is, though.
18:10 masak maybe AI won't really take off until we learn how to really exploit software to design software.
18:10 masak so far we're being pretty primitive about it.
18:11 notjack joined #perl6
18:11 diakopter masak++ # how right you are
18:12 moritz I think a good example is HTTP-Based APIs
18:13 moritz there are a few pretty widely used standards, such as REST+JSON and XMLRPC and SOAP
18:13 moritz and still you have to write code whenever you interface with such a thing
18:13 masak yeah.
18:13 moritz granted, there are libraries that reduce the amount of coding you need, but you still need a programmer
18:14 masak also, almost all the pieces of AI tech that have awed me in the past few years have a machine component and a human component. so I also predict that AI will be more of a human/machine hybrid than we usually assume.
18:15 moritz I think that technology tends to impress us if it can interface intuitively with us
18:15 moritz not necessarily if it's particularly smart
18:15 masak when something is impressive but purely machine, it's usually because it can do something dumb-but-fast with data mining or computation.
18:16 masak most of the things that are called "smart-" are an abomination of some kind or other.
18:17 denisboyun joined #perl6
18:21 pecastro joined #perl6
18:22 moritz masak is pretty insightful tonight.
18:23 arnsholt masak: Yeah, that's why I'm an AI-skeptic. I'm in the sausage factory, making the sausage =)
18:24 * moritz finds it interesting to ponder the various singularity scenarios that float around in sci-fi
18:24 spider-mario joined #perl6
18:25 moritz from "AI will be bored by humanity and leave into space" to "AI will optimize human life into a 'brave new world'-like world"
18:26 moritz and of course to "wipe out humanity" or "we don't even notice that there's an AI"
18:26 diakopter "all the future AIs will have my memories and so will be me."
18:26 moritz that also
18:29 raiph Which module should I add the spec'd Ordering subsets to?
18:29 yoleaux 16 Jan 2014 09:25Z <hoelzro> raiph: why did you point that QH quest out to me?
18:29 jnthn Also it's maybe worth checking we still want that...
18:30 japhb I like the HPMOR author's take:  There will very probably be AIs that attempt to harm humanity in furtherance of some goal.  So we need to preempt with a smarter, more powerful one that thinks humanity is just the bee's knees, and ought to be protected.
18:30 diakopter that doesn't have a leg to stand on
18:31 japhb I didn't say I thought he'd succeed or anything.  Just that I like his view of the situation.
18:31 jnthn TimToady: In http://perlcabal.org/syn/S32/Containers.html the sort spec has an Ordering type and various other curiosities.
18:31 japhb There's a risk.  Let's mitigate with SCIENCE.
18:31 japhb (Science is the risk?  MORE SCIENCE!)
18:31 jnthn TimToady: If you have a moment, might be worth glancing to see if you agree with it, before raiph++ digs in
18:32 treehug8_ joined #perl6
18:33 * jnthn fears a tiny bit of overdesign... :)
18:33 grondilu moritz: the true meaning of the singularity is that we don't know and can't know what will happen once it happens.  It's an analogy to the Event horizon of a black hole: we can't see beyond, because we can't predict the behavior of entities smarter than ourselves.  I do think machines will wipe us out, but that's a guess jut as valid as any other.
18:34 jnthn masak, moritz: You may have an opinion on the sort thing I just asked about too. :)
18:35 moritz jnthn: yes, Ordering is overkill
18:36 moritz multi method sort( @values: Ordering $by = &infix:<cmp> --> Array )
18:36 raiph jnthn++, ++masak, moritz++, ++TimToady, ++lizmat (anyone else that discusses the unimplemented aspects of the sort spec before I jump in)
18:36 moritz &Infix:<cmp> is compatible to Ordering?
18:37 jnthn moritz: Yes, I thought you may describe it as such :)
18:37 jnthn moritz: I think if you dig into S29 then yes, Ordering would match that.
18:37 raiph Ordering includes both one arg (keyextractor) and two arg (comparator) closures
18:38 jnthn Amongst other odd things :)
18:38 raiph anything that drives how the ordering is to occur
18:39 diakopter japhb: leg? knees?
18:39 denis_boyun_ joined #perl6
18:41 raiph moritz: there's a brief rundown of the current Ordering in a comment on the quest I linked above
18:41 raiph (current Ordering spec)
18:42 LLamaRider joined #perl6
18:43 grondilu p6:  say sort :by({ $^a <=> $^b }), rand xx 10;
18:43 smls joined #perl6
18:43 camelia niecza v24-109-g48a8de3: OUTPUT«Unhandled exception: Excess arguments to sort, unused named by␤  at /home/p6eval/niecza/lib/CORE.setting line 0 (sort @ 1) ␤  at /tmp/5hcCADjHZx line 1 (mainline @ 4) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4595 (ANON @ 3) ␤  at /home/…»
18:43 camelia ..rakudo-moar 82effd: OUTPUT«␤  in sub sort at src/gen/m-CORE.setting:1850␤  in sub sort at src/gen/m-CORE.setting:1848␤  in block  at /tmp/LX1Lrg9IaP:2␤␤»
18:43 camelia ..rakudo-parrot 82effd: OUTPUT«Unexpected named parameter 'by' passed␤  in sub sort at gen/parrot/CORE.setting:1852␤  in sub sort at gen/parrot/CORE.setting:1851␤  in block  at /tmp/RW6g0Zrf0A:1␤␤»
18:43 camelia ..rakudo-jvm 82effd: OUTPUT«Unexpected named parameter 'by' passed␤  in sub sort at gen/jvm/CORE.setting:1850␤  in sub sort at gen/jvm/CORE.setting:1847␤  in block  at /tmp/g3Js6j0bJN:1␤␤»
18:47 * grondilu kind of liked when there was the ordering function was a named argument
18:47 grondilu s/there was//
18:48 moritz raiph: it helps to repeat the link if it was in fact in a different channel :-)
18:49 * moritz doesn't understand @array.sort { $^a leg $^b } is descending
18:49 moritz what does the trait work on?
18:50 moritz and it's a syntax error
18:50 moritz using traits for that stuff looks just plain wrong
18:53 moritz also, why should sort return an Array and not a List or Parcel?
18:55 moritz r: say Order ~~ Int
18:55 camelia rakudo-parrot 82effd, rakudo-jvm 82effd, rakudo-moar 82effd: OUTPUT«True␤»
18:57 zakharyas joined #perl6
19:01 treehug88 joined #perl6
19:04 LLamaRid1r joined #perl6
19:05 LLamaRider joined #perl6
19:10 raiph moritz: oops :) http://questhub.io/realm/perl/quest/52bca72af6d329e15d0000ca
19:12 Util /<$var>/ bug posted: https://rt.perl.org/Public/Bug/Display.html?id=121024
19:13 raiph moritz: what about { $^a leg $^b } is descending is your issue? (it's equivalent to { $^b leg $^a } but i'm sure you can see that)
19:13 moritz raiph: what does the trait operate on?
19:14 raiph it hangs on the closure, the sort routine introspects, and reconstructs the closure with args reversed (is how i'm thinking it's supposed to work(
19:16 kivutar joined #perl6
19:16 TimToady that's very fossily spec
19:16 moritz isn't that way, way more complicated than sticking a 'reverse' in there somwhere, with no real benefit?
19:17 TimToady it wouldnt help much with leg, since you could just reverse $^a and $^b
19:17 TimToady but theoretically something like that could help with a unary
19:18 TimToady there's nothing equivalent to -*
19:18 TimToady in strings
19:18 timotimo i would be uary of those
19:18 moritz so, say reverse sort ~*, @list
19:18 raiph i'd say one wants to be able to not change the closure but still reverse the sort; maybe moritz's suggestion?
19:19 moritz if you really, really want it one step, an adverb would be much saner
19:19 TimToady p: say sort ~^*, <a b c>
19:19 camelia rakudo-parrot 82effd: OUTPUT«prefix:<~^> NYI␤  in method Str at gen/parrot/CORE.setting:12145␤  in method Str at gen/parrot/CORE.setting:1022␤  in method Stringy at gen/parrot/CORE.setting:1032␤  in method Stringy at gen/parrot/CORE.setting:1031␤  in sub infix:<cmp> at gen…»
19:19 raiph moritz: the spec envisages being able to handle primary, secondary, etc. sorts
19:19 TimToady heh
19:19 raiph moritz: and to then easily reverse any given sort level
19:20 TimToady maybe we need something that means ReverseWhateverCode
19:21 raiph moritz: @array.sort: [ { primary sort }, { secondary sort}, {tertiary sort } ]
19:21 TimToady anyway, these days it'd almost certainly be {...} but Reversed
19:21 TimToady not 'is'
19:21 dalek specs: a56fbac | util++ | S05-regex.pod:
19:21 dalek specs: Fix bad directive: s/=head 2/=head2/;
19:21 dalek specs: review: https://github.com/perl6/specs/commit/a56fbac443
19:21 TimToady or 'but Descending'
19:22 TimToady 'but Otherway'  :)
19:22 moritz 'but Different'
19:22 TimToady 'but Down'
19:23 moritz I am nearly certain that the status quo is much closer to the sweet spot between power and complexity than any such proposal
19:24 [Coke] but Not
19:24 TimToady moritz: status quo is not declarative enough
19:25 moritz TimToady: not declarative enough for what?
19:25 TimToady and people want reversed sort criteria all the time in business applications
19:25 TimToady the reverse function is not declarative at all
19:26 TimToady and only works on the top dimension of the sort
19:26 TimToady in UI designs displaying tables, you want to be able to flip the sort order in any column at will
19:27 TimToady rewriting the code for that is not really an option
19:27 raiph i think you need to be able to do multi level sorts, and reverse any level, without having to do so by writing a single comparator function
19:27 dalek specs: b56a841 | util++ | S15-unicode.pod:
19:27 dalek specs: Fix typo.
19:27 dalek specs: review: https://github.com/perl6/specs/commit/b56a8417ed
19:27 japhb raiph, TimToady: agreed
19:27 moritz and that's the part where I disagree
19:27 moritz it sounds like we want to get an SQL-Like sort without the rest of LINQ
19:28 TimToady what kind of an argument is that?
19:28 moritz I'm not sure yet
19:28 japhb .oO( "Is this some kind of a bust?" )
19:28 TimToady it seems to resemble a slippery-slope argument
19:29 diakopter it slides there at least
19:29 TimToady but is it Ascending or Descending?
19:30 moritz it just feels like we are close to over-designing a very small part of Perl 6 where we should rather broaden the effort, not deepening it
19:30 * moritz probably doesn't make much sense at all
19:30 diakopter moritz: but the rest of linq is so nice
19:30 moritz diakopter: which is why it's weird to focus only on the sorting
19:30 moritz and having no bigger picture for getting the rest of it
19:30 diakopter yeah
19:31 lue jnthn: I'll go delete the relevant files in /usr/local and try 'make install' with updated repos :)
19:32 moritz I guess what I'm saying is "you're stupid to not spend your time the way I would spend my time" :-)
19:33 moritz the typical open source fallacy
19:34 [Coke] moritz: "that's nice, I suppose, but I'll never use it"
19:35 TimToady maybe we should just define prefix:<∽>
19:35 TimToady .u ∽
19:35 yoleaux U+223D REVERSED TILDE [Sm] (∽)
19:36 * [Coke] wants to listen to the yolo song now. :P
19:36 testing_limechat joined #perl6
19:36 grondilu r: say .Int given 1e32;
19:36 camelia rakudo-parrot 82effd, rakudo-moar 82effd: OUTPUT«100000000000000005366162204393472␤»
19:36 camelia ..rakudo-jvm 82effd: OUTPUT«100000000000000000000000000000000␤»
19:37 diakopter lol
19:37 TimToady yikes
19:37 grondilu ^ this prevents me to fix http://rosettacode.org/wiki/Arithmetic-geometric_mean/Calculate_Pi#Perl_6
19:37 testing_limechat left #perl6
19:38 TimToady grondilu: how 'bout a {{works with|rakudo-jvm}} or so? :)
19:38 lue I'm not sure how I should react to Parrot messing up powers of 10...
19:38 TimToady r: say .Int given 1*10**32;
19:38 camelia rakudo-parrot 82effd, rakudo-jvm 82effd, rakudo-moar 82effd: OUTPUT«100000000000000000000000000000000␤»
19:38 grondilu I don't quite like java
19:38 TimToady how 'bout you use that instead
19:38 grondilu it's annoying to install on my machine
19:39 Util raiph: "...without having to do so by..."
19:39 Util If a stable sort is the default (or is at least selectable),
19:39 Util then this is currently achievable with multiple sorting,
19:39 grondilu I tried with 10**32 or similar but it gives the same kind of error in the end (it's bit more complicated than that though)
19:39 Util using a .reverse.sort({...}).reverse trick.
19:39 Util To get a reversed secondary sort:
19:40 Util @array .=         sort({tertiary });
19:40 Util @array .= reverse.sort({secondary}).reverse;
19:40 Util @array .=         sort({primary  });
19:40 [Coke] lue: please note that moar gave you the same answer parrot did.
19:40 jnthn lue: Well, if you looked carefully you'd realize that moar gets the same result, which likely means it's something to do with num => int.
19:40 TimToady well, something escaping from int/rat to num
19:40 jnthn lue: And if you remembered that 1e32 is the syntax for floating point, the answer may make a lot more sense.
19:41 TimToady sqrt or some such returning num
19:41 raiph Util: thx, but consider "in UI designs displaying tables, you want to be able to flip the sort order in any column at will "
19:41 grondilu say .Int for 10**32, 10**(64/2)
19:41 grondilu r: say .Int for 10**32, 10**(64/2)
19:41 camelia rakudo-parrot 82effd, rakudo-moar 82effd: OUTPUT«100000000000000000000000000000000␤100000000000000005366162204393472␤»
19:41 camelia ..rakudo-jvm 82effd: OUTPUT«100000000000000000000000000000000␤100000000000000000000000000000000␤»
19:41 grondilu ^see?
19:42 grondilu I need to divide the exponant
19:42 TimToady ah, doesn't recognize that 32/1 is an integer
19:42 TimToady should probably have a Rat multi that looks for that
19:42 grondilu r: say .Int for 10**32, 10**(64 div 2)
19:42 camelia rakudo-parrot 82effd, rakudo-jvm 82effd, rakudo-moar 82effd: OUTPUT«100000000000000000000000000000000␤100000000000000000000000000000000␤»
19:42 grondilu I guess I could use div
19:42 lue Whoops, I forgot all about moar being a target. I was just thinking parrot/jvm :P
19:43 Util raiph: Yes, I am considering that. You build 2 anon-subs for each sort column (forward & backwards each), and call the relevant blocks accorting to the current UI-selected sort order.
19:44 lue So instead, "I'm not sure how libtommath is messing up powers of 10..."
19:45 TimToady it's not libtommath, I think, but infix:<**> not considering a Rat as a potential Int
19:45 * lue knows floating point, but powers of 10 is something I don't expect breaking that easily.
19:46 TimToady p: say "foo" ** "bar"
19:46 camelia rakudo-parrot 82effd: OUTPUT«Cannot convert string to number: base-10 number must begin with valid digits or '.' in '⏏foo' (indicated by ⏏)␤  in method Numeric at gen/parrot/CORE.setting:12144␤  in sub infix:<**> at gen/parrot/CORE.setting:4035␤  in sub infix:<**> at gen/p…»
19:46 TimToady hmm, how to trigger the message...
19:47 TimToady p: say 42 ** Nil
19:47 camelia rakudo-parrot 82effd: OUTPUT«use of uninitialized value of type Nil in numeric context  in block  at /tmp/zw75xUj0sp:1␤␤1␤»
19:47 TimToady p: say 42 ** Mu
19:47 camelia rakudo-parrot 82effd: OUTPUT«Nominal type check failed for parameter '$b'; expected Any but got Mu instead␤  in sub infix:<**> at gen/parrot/CORE.setting:4033␤  in block  at /tmp/2r1ZLp1iSJ:1␤␤»
19:47 TimToady how do we introspect candidates for infix:<**>?
19:48 TimToady say &infix:<**>.^methods
19:48 jnthn .candidates
19:48 TimToady p: say &infix:<**>.^methods
19:48 camelia rakudo-parrot 82effd: OUTPUT«<anon> IS_PURE <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> <anon> of returns onlystar assuming candidates cando multi soft wrap unwrap yada package perl <anon> add_phaser fire_phasers phasers <anon> <anon> <…»
19:48 TimToady p: say &infix:<**>.candidates
19:48 camelia rakudo-parrot 82effd: OUTPUT«sub infix:<**>($x = { ... }) { ... } sub infix:<**>(\a, \b) { ... } sub infix:<**>(Real \a, Real \b) { ... } sub infix:<**>(Int:D \a, Int:D \b) { ... } sub infix:<**>(Num:D \a, Num:D \b) { ... } sub infix:<**>(num $a, num $b) { ... } sub infix:<**>(Ratio…»
19:48 TimToady p: .say for &infix:<**>.candidates
19:48 camelia rakudo-parrot 82effd: OUTPUT«sub infix:<**>($x = { ... }) { ... }␤sub infix:<**>(\a, \b) { ... }␤sub infix:<**>(Real \a, Real \b) { ... }␤sub infix:<**>(Int:D \a, Int:D \b) { ... }␤sub infix:<**>(Num:D \a, Num:D \b) { ... }␤sub infix:<**>(num $a, num $b) { ... }␤sub infi…»
19:49 TimToady well, like that helps much on irc... :
19:49 TimToady :/
19:49 jnthn p: .say for &infix:<**>.candidates>>.signature
19:49 camelia rakudo-parrot 82effd: OUTPUT«:($x = { ... })␤:(\a, \b)␤:(Real \a, Real \b)␤:(Int:D \a, Int:D \b)␤:(Num:D \a, Num:D \b)␤:(num $a, num $b)␤:(Rational \a, Int \b)␤:(Complex:D \a, Complex:D \b)␤:(Real \a, Complex:D \b)␤:(Complex:D \a, Real \b)␤»
19:50 TimToady yes, no candidate with a Rat on the right that can see if it has a denominator of 1
19:52 raiph Util: won't there be significant execution overhead (multiple lists, multiple calls to underlying sort) unless you massage everything to fit a single call to the underlying sort (ie do what the spec currently says the sort builtin is supposed to do)?
19:53 colomon r: say (32/2).narrow
19:53 camelia rakudo-parrot 82effd, rakudo-jvm 82effd, rakudo-moar 82effd: OUTPUT«16␤»
19:55 TimToady colomon: but you can't just redispatch unless you know the type changed
19:55 colomon TimToady: right
19:55 colomon TimToady: that was mostly a test to see if .narrow worked yet.  ;)
19:55 TimToady ok
19:55 TimToady r: say 32/2
19:55 camelia rakudo-parrot 82effd, rakudo-jvm 82effd, rakudo-moar 82effd: OUTPUT«16␤»
19:56 TimToady but how could you tell?
19:56 colomon TimToady: it didn't say, "What do you mean, .narrow?"
19:56 lue r: say (32/2).WHAT; say (32/2).narrow.WHAT;
19:56 camelia rakudo-parrot 82effd, rakudo-jvm 82effd, rakudo-moar 82effd: OUTPUT«(Rat)␤(Int)␤»
19:56 TimToady ah, I see
19:56 colomon I mean, I guess somebody could have implemented a non-functional version, but that seems unlikely.
19:56 TimToady you never know in these days of uncertainty
19:58 skids .oO(multi sub f (Int(Rat)$a) {...}; multi sub f (Rat $a) {...};  # which gets called...)
19:59 TimToady p: say Int(27/7)
19:59 camelia rakudo-parrot 82effd: OUTPUT«3␤»
19:59 TimToady looks ambiguous to me
19:59 lue skids: Doesn't more derived type win? Or am I thinking in regexes? :)
19:59 TimToady well, is "able to be coerced" considered a constraint?
20:00 TimToady in any case, Int() can coerce a non-integral Rat
20:00 TimToady hmm, I guess I wanted 22/7
20:00 skids Yeah and it would be too much DWIM to discriminate using such a form.
20:01 Sqirrel joined #perl6
20:01 TimToady either that, or I was aiming for 7 - pi
20:01 lue Looks like you'd have to use those old "candidate specifiers", wherever they're lying around...
20:04 TimToady p: multi f (Rat $r where $r.denominator == 1) { say "$r is Intish!" }; multi f (Rat $r) { say "$r is Ratty!" }; f 32/2
20:04 camelia rakudo-parrot 82effd: OUTPUT«16 is Intish!␤»
20:04 TimToady p: multi f (Rat $r where $r.denominator == 1) { say "$r is Intish!" }; multi f (Rat $r) { say "$r is Ratty!" }; f 33/2
20:04 camelia rakudo-parrot 82effd: OUTPUT«16.5 is Ratty!␤»
20:06 skids Does that rely on implementation-specific behavior as to when the Rat is reduced?
20:06 rindolf joined #perl6
20:07 lue &foo:(signature) is what I was thinking of.
20:07 TimToady I believe asking for numer or denom should force reduction
20:07 TimToady if it isn't known to be forced already
20:08 lue [ So &f:(Int) and &f(Int(Rat)) ]
20:08 PerlJam Would anyone ever ask a Rat for the num/dem that were used to create it?
20:08 lue er, &f:(Rat)
20:08 skids TimToady: yes, "All interface methods return values as if the numerator and denominator were stored in a normal form"
20:08 TimToady PerlJam: of course they will
20:08 [Coke] PerlJam: no, and they should feel bad for thinking about it. :P
20:08 TimToady that doesn't mean we have to give it to them
20:08 * [Coke] keeps up his 0% track record of agreeing with timtoday. :)
20:08 PerlJam heh
20:09 TimToady 32/2 but RememberTheOriginalValue;  :)
20:10 colomon what does <32/2> do?
20:10 TimToady not what it's supposed to do.  :P
20:10 TimToady rn: say <32/2>.WHAT
20:10 camelia niecza v24-109-g48a8de3: OUTPUT«(Rat)␤»
20:10 camelia ..rakudo-parrot 82effd, rakudo-jvm 82effd: OUTPUT«(Str)␤»
20:11 PerlJam on *some* implementations
20:11 TimToady it's supposed to do that on all implementations, so it doesn't :)
20:11 lue .oO(Both seem like right answers; if only there were a way to combine Rat and Str!)
20:11 TimToady which would be wrong for <32/2>, which is specced to be Rat
20:11 TimToady not RatStr
20:12 lue rn: say < 32/2 >.WHAT
20:12 camelia niecza v24-109-g48a8de3: OUTPUT«(RatStr)␤»
20:12 camelia ..rakudo-parrot 82effd, rakudo-jvm 82effd: OUTPUT«(Str)␤»
20:12 FROGGS ohh, rn does not run moar
20:13 FROGGS moritz: ^^
20:13 lue moritz: have you thought about subjecting evalbot's interpreter: specifier to a regex, instead of hardcoding the list? :)
20:14 FROGGS lue: does not work
20:14 FROGGS at least not when we had a q backend
20:14 FROGGS then nqp would run that besides niecza and pugs
20:15 TimToady LTM?
20:16 lue rakudo-jvm|nqp-jvm|star|rakudo-moar|pugs|std|niecza|p5-to-p6|nqp-parrot|b|rakudo-parrot|nqp-moarvm|nom|rnP|r|nPr|rPn|Prn|j|nqp-m|Pnr|nqp-mvm|nqp-j|nr|p6|rm|n|p56|rj|perl6|nqp|r-j|P|rn|rakudo|m|r-jvm|nqp-p|nrP|p|r-m|r-p|rp
20:16 lue r: say "rakudo-jvm|nqp-jvm|star|rakudo-moar|pugs|std|niecza|p5-to-p6|nqp-parrot|b|rakudo-parrot|nqp-moarvm|nom|rnP|r|nPr|rPn|Prn|j|nqp-m|Pnr|nqp-mvm|nqp-j|nr|p6|rm|n|p56|rj|perl6|nqp|r-j|P|rn|rakudo|m|r-jvm|nqp-p|nrP|p|r-m|r-p|rp".split("|").elems;
20:16 camelia rakudo-parrot 82effd, rakudo-jvm 82effd, rakudo-moar 82effd: OUTPUT«43␤»
20:18 grondilu how can I do  / .**{$some-value} /  ?
20:19 lue / .**{$some-value} /
20:19 grondilu r: say <a b>.roll(100).match: / .**{10} /;
20:19 camelia rakudo-moar 82effd: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/TOmI4s5Iozâ�¤Block case of ** quantifier not yet implementedâ�¤at /tmp/TOmI4s5Ioz:1â�¤------> [32msay <a b>.roll(100).match: / .**[33mâ��[31m{10} /;[0mâ�¤    expecting any of:â�¤        method a…»
20:19 camelia ..rakudo-jvm 82effd: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/AleKFYW8Q8â�¤Block case of ** quantifier not yet implementedâ�¤at /tmp/AleKFYW8Q8:1â�¤------> [32msay <a b>.roll(100).match: / .**[33mâ��[31m{10} /;[0mâ�¤    expecting any of:â�¤        method ar…»
20:19 camelia ..rakudo-parrot 82effd: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/r5TngaJ7fKâ�¤Block case of ** quantifier not yet implementedâ�¤at /tmp/r5TngaJ7fK:1â�¤------> [32msay <a b>.roll(100).match: / .**[33mâ��[31m{10} /;[0mâ�¤    expecting any of:â�¤        method…»
20:19 grondilu NYI
20:19 lue EVAL("/ .**" ~ $some-value ~ " /")
20:19 grondilu yes, thanks
20:20 treehug88 joined #perl6
20:23 * grondilu finally managed to make http://rosettacode.org/wiki/Arithmetic-geometric_mean/Calculate_Pi#Perl_6 work
20:24 * skids thinks "view" would be consistent model for accessing Rat internal state, if ever needed.
20:24 grondilu you have .nude, don't you?
20:25 PerlJam .oO( and .clothed could show the num/dem that were used to create the Rat )
20:25 skids nude is an interface method, and subject to above rule.
20:26 skids Well, that's mincing meanings.  nude is nude as opposed to "dressed in a Rat object"
20:27 PerlJam you saying "mincing", I say "pun"  ;)
20:28 treehug88 joined #perl6
20:28 * jnthn doesn't like "nude" and "mincing" so close in conversation :P
20:28 PerlJam er, s/saying/say/  (weird braino)
20:29 skids But mincing is best done nude, for some definitions of mincing :-)
20:29 PerlJam "This week on the Nudists Kitchen we'll show you how to make a great dish using only Rats"
20:41 denisboyun joined #perl6
20:50 clsn OK, I have about half an hour; let's get this github fork going so I can send a pull request.
20:51 Mouq joined #perl6
20:51 dalek perl6-examples: 3f3b363 | util++ | / (5 files):
20:51 dalek perl6-examples: Fix typos
20:51 dalek perl6-examples: review: https://github.com/perl6/perl6-examples/commit/3f3b36343c
20:56 [Coke] seen sorear?
20:56 [Coke] yoleaux: seen sorear?
20:56 dalek rakudo/nom: b3a59a0 | jnthn++ | src/Perl6/Actions.nqp:
20:56 dalek rakudo/nom: Factor out adding return type check.
20:56 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/b3a59a06e9
20:56 dalek rakudo/nom: 71e08b2 | jnthn++ | src/ (3 files):
20:56 dalek rakudo/nom: Get return type checks in place.
20:56 dalek rakudo/nom:
20:56 dalek rakudo/nom: Doesn't emit check code at all for unconstrained.
20:56 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/71e08b2d12
20:56 [Coke] preflex: seen sorear?
20:56 preflex sorear was last seen on #perl6 123 days, 13 hours, 26 minutes and 41 seconds ago, saying: o/
20:58 * clsn sends pull request.  And the crowd goes wild.
20:58 beastd joined #perl6
20:58 SHODAN joined #perl6
21:02 Mouq clsn++ # (haven't tested it myself, of course)
21:03 Mouq it looks like your leading whitespace is a little off
21:03 clsn I should upload the signature matching tests I made someplace.  I hit some of the finer cases.  And found a few places we can't handle.
21:04 clsn Hm; I was counting on my editor to do the whitespacing; sorry.
21:04 colomon jnthn++ already updated rakudo/nom since I started the compile process, sigh.
21:04 colomon clsn: oh, please upload the tests!
21:04 jnap joined #perl6
21:04 Mouq clsn: it's fine :) i think it used tabs, and if so that's just a search and replace
21:05 clsn colomon: Where's a good place to send tests?
21:05 clsn mmph.  Maybe I'll have a talk with my editor about tabs and spaces...
21:05 jnthn clsn: You can get a commit bit to the tests repository...
21:05 jnthn clsn: We give those out quite freely
21:06 jnthn Just mention your github ID
21:06 colomon clsn: roast
21:06 colomon jnthn: it's clsn
21:06 colomon (judging by the patch)
21:06 clsn OK... I should probably add some more and make it more thorough I guess if it's to be the real roast stuff...
21:06 jnthn hugme: add clsn to roast
21:06 hugme jnthn: Feature disabled due to bitrot
21:06 jnthn aww
21:07 colomon jnthn: I'll do it
21:07 japhb hugme++ # Useful error message instead of mysterious failure
21:07 clsn Matching currently fails on parametric variables, though.  I'm not even sure *how* we should do those.
21:07 colomon jnthn: er, I can't do it.  :\
21:07 jnthn clsn: Added.
21:08 clsn Thanks.
21:08 Mouq hugme: hug clsn
21:08 * hugme hugs clsn
21:08 * clsn aws and hugs hugme.
21:12 Mouq re: #121024 :
21:12 synopsebot Link: https://rt.perl.org/rt3//Public/Bug/Display.html?id=121024
21:12 Mouq nqp: my $r := "z|abc"; say("peterabcde" ~~ /<$r>/)
21:12 Mouq r: my $r := "z|abc"; say("peterabcde" ~~ /<$r>/)
21:12 camelia nqp-moarvm, nqp-jvm, nqp-parrot: OUTPUT«abc␤»
21:12 camelia rakudo-parrot 82effd, rakudo-jvm 82effd, rakudo-moar 82effd: OUTPUT«「pet」␤␤»
21:15 xfix r: my $n = "12345"; say / (\d+) <{ $0.is-prime }> /
21:15 camelia rakudo-parrot 82effd, rakudo-jvm 82effd, rakudo-moar 82effd: OUTPUT«␤»
21:15 xfix r: my $n = "12345"; say $n ~~ / (\d+) <{ $0.is-prime }> /
21:15 camelia rakudo-jvm 82effd: OUTPUT«No such method 'is-prime' for invocant of type 'Match'␤␤Error while creating backtrace: Cannot unbox a type object␤  in block  at gen/jvm/CORE.setting:10595␤  in block  at gen/jvm/CORE.setting:7365␤  in method reify at gen/jvm/CORE.setting:7316␤…»
21:15 camelia ..rakudo-parrot 82effd: OUTPUT«No such method 'is-prime' for invocant of type 'Match'␤  in block  at /tmp/scUFoxkusD:1␤␤»
21:15 camelia ..rakudo-moar 82effd: OUTPUT«Cannot find method 'is-prime'␤  in block  at /tmp/jFWMDXYA3W:2␤␤»
21:15 xfix parrot: my $n = "12345"; say $n ~~ / (\d+) <{ $0.Int.is-prime }> /
21:16 xfix rp: my $n = "12345"; say $n ~~ / (\d+) <{ $0.Int.is-prime }> /
21:16 camelia rakudo-parrot 82effd: OUTPUT«Nil␤»
21:16 xfix Am I doing something wrong here?
21:17 Mouq do you mean <?{ }> ?
21:17 xfix rp: my $n = "12345"; say $n ~~ / (\d+) <?{ $0.Int.is-prime }> /
21:17 camelia rakudo-parrot 82effd: OUTPUT«「23」␤ 0 => 「23」␤␤»
21:17 xfix Great. It finds a prime in the string.
21:17 dayangkun joined #perl6
21:18 Mouq <{ … }> interpolates, it seems
21:18 Mouq also, that's really awesome
21:18 xfix It's probably slow, but it looks nicely.
21:19 xfix I'm doing http://codegolf.stackexchange.com/q/18592/3103. Now to find a biggest prime.
21:19 Mouq rp: my $n = "12345"; my $a; $n ~~ / (\d+) {$a++} <?{ $0.Int.is-prime }> /; say $a
21:19 camelia rakudo-parrot 82effd: OUTPUT«8␤»
21:19 xfix rp: my $n = "13571"; say $n ~~ / (\d+) <?{ $0.Int.is-prime }> /
21:19 camelia rakudo-parrot 82effd: OUTPUT«「13」␤ 0 => 「13」␤␤»
21:20 xfix It finds 13 here, but my intent is to find 3571.
21:20 REPLeffect joined #perl6
21:20 Mouq hmm
21:22 jnthn Match it with exhaustive and then ge the biggest result?
21:22 Mouq r: say [max] <a abcd efghijk>
21:22 xfix What is short form of exhaustive?
21:22 camelia rakudo-parrot 82effd, rakudo-jvm 82effd, rakudo-moar 82effd: OUTPUT«efghijk␤»
21:22 xfix r: say max <a abcd efghijk>
21:22 jnthn rp: "13571".match(/ (\d+) <?{ $0.Int.is-prime }> /, :ex)>>.max
21:22 camelia rakudo-parrot 82effd, rakudo-jvm 82effd, rakudo-moar 82effd: OUTPUT«efghijk␤»
21:22 camelia rakudo-parrot 82effd: ( no output )
21:23 Mouq xfix: m:ex//
21:23 jnthn rp: say "13571".match(/ (\d+) <?{ $0.Int.is-prime }> /, :ex).max
21:23 camelia rakudo-parrot 82effd: OUTPUT«「71」␤ 0 => 「71」␤␤»
21:23 xfix ok
21:23 lue rp: my $n = "13571"; say $n ~~ /:ex (\d+) <?{ $0.Int.is-prime }> /
21:23 camelia rakudo-parrot 82effd: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/SVpj__MoOz�Unrecognized regex modifier :ex�at /tmp/SVpj__MoOz:1�------> [32mmy $n = "13571"; say $n ~~ /:ex[33m�[31m (\d+) <?{ $0.Int.is-prime }> /[0m�»
21:23 jnthn rp: say "13571".match(/ (\d+) <?{ $0.Int.is-prime }> /, :ex).max(*.Int)
21:23 camelia rakudo-parrot 82effd: OUTPUT«「3571」␤ 0 => 「3571」␤␤»
21:23 jnthn There we go.
21:23 jnthn rp: say "13571".match(/ (\d+) <?{ $0.Int.is-prime }> /, :ex).max(+*) # golf :)
21:23 camelia rakudo-parrot 82effd: OUTPUT«「3571」␤ 0 => 「3571」␤␤»
21:23 jnthn rp: say "13571".match(/ (\d+) <?{ $0.Int.is-prime }> /, :ex)[*-1]
21:23 camelia rakudo-parrot 82effd: OUTPUT«「7」␤ 0 => 「7」␤␤»
21:23 jnthn ah, yeah
21:24 xfix rp: say max 13571~~m:ex/(\d+)<?{(+$0).is-prime}>/
21:24 camelia rakudo-parrot 82effd: OUTPUT«False␤»
21:24 denisboyun joined #perl6
21:24 xfix rp: say "13571"~~m:ex/(\d+)<?{(+$0).is-prime}>/
21:24 camelia rakudo-parrot 82effd: OUTPUT«False␤»
21:24 xfix rp: say "13571"~~m:ex/(\d+)<?{$0.Int.is-prime}>/
21:24 camelia rakudo-parrot 82effd: OUTPUT«False␤»
21:25 Mouq lue: that would be pretty cool. match exaustively in some places but not others. i suppose the effect could be acheived with multiple regexes and the :pos modifier
21:25 PerlJam rp: say "13571"~~/(\d+$)<?{$0.Int.is-prime}>/
21:25 camelia rakudo-parrot 82effd: OUTPUT«「3571」␤ 0 => 「3571」␤␤»
21:25 PerlJam :-)
21:25 Mouq or rather the :continue modifier
21:25 xfix PerlJam, this works only if it's at end of string ;-).
21:26 xfix rp: say "13571"~~m:ex/(\d+$)<?{$0.Int.is-prime}>/
21:26 camelia rakudo-parrot 82effd: OUTPUT«False␤»
21:26 xfix rp: say "13571".match(/(\d+$)<?{$0.Int.is-prime}>/,:ex)
21:26 camelia rakudo-parrot 82effd: OUTPUT«「3571」␤ 0 => 「3571」␤ 「571」␤ 0 => 「571」␤ 「71」␤ 0 => 「71」␤␤»
21:26 xfix rp: say max "13571".match(/(\d+$)<?{$0.Int.is-prime}>/,:ex)
21:26 camelia rakudo-parrot 82effd: OUTPUT«「71」␤ 0 => 「71」␤␤»
21:26 PerlJam xfix: well, you weren't clear why you wanted it to match 3571 rather than 13  :)
21:26 xfix Because it's longer.
21:30 [Coke] jnthn++ nailed it earlier.
21:30 xfix rp: say max +<<"13571".match(/(\d+$)<?{$0.Int.is-prime}>/,:ex)
21:30 camelia rakudo-parrot 82effd: OUTPUT«3571␤»
21:30 xfix great
21:31 PerlJam xfix: um ... you need to take that $ out of the pattern
21:31 xfix uhm yeah
21:32 jeffreykegler left #perl6
21:32 xfix say max +<<get.match(/(\d+)<?{(+$0).is-prime}>/,:ex)
21:32 xfix This is my current solution.
21:37 bjz joined #perl6
21:38 xfix http://codegolf.stackexchange.com/a/18775/3103
21:38 xfix It's rather long. I'm surprised that there are many shorter solution.
21:38 xfix Not that I care or anything.
21:38 xfix solutions*
21:40 xfix r: pi
21:40 xfix r: say pi
21:40 camelia rakudo-parrot 71e08b, rakudo-jvm 71e08b, rakudo-moar 71e08b: ( no output )
21:40 camelia rakudo-jvm 71e08b: OUTPUT«3.141592653589793␤»
21:40 camelia ..rakudo-parrot 71e08b: OUTPUT«3.14159265358979␤»
21:40 camelia ..rakudo-moar 71e08b: OUTPUT«3.141593␤»
21:40 bluescreen10 joined #perl6
21:40 xfix 415926535897
21:40 xfix Great.
21:41 PerlJam xfix: wait ... unicode « counts as two characters?!?  where is that written?
21:42 xfix http://codegolf.stackexchange.com/tags/code-golf/info
21:42 xfix "If you use Unicode, byte count should use UTF-8."
21:42 xfix In UTF-8, « is two characters.
21:43 PerlJam bummer
21:44 xfix perl6: say +<<3141592653589793.match(/(\d+)<?{(+$0).is-prime}>/,:ex)
21:44 camelia rakudo-parrot 71e08b, rakudo-jvm 71e08b, rakudo-moar 71e08b: OUTPUT«314159 31 3 141592653589 14159 415926535897 4159 41 1592653 5926535897 59 5 2 6535897 653 53 5 358979 35897 3 589793 58979 5897 5 89 97 79 7 3␤»
21:44 camelia ..niecza v24-109-g48a8de3: OUTPUT«Unhandled exception: Excess arguments to Cool.match, unused named ex␤  at /home/p6eval/niecza/lib/CORE.setting line 0 (Cool.match @ 1) ␤  at /tmp/Du2HTSuxYz line 1 (mainline @ 3) ␤  at /home/p6eval/niecza/lib/CORE.setting line 4595 (ANON @ 3) …»
21:44 PerlJam If the solutions are all about the minimum number of *characters*, then they should use actual characters!  :)
21:44 xfix http://oeis.org/A198187
21:45 xfix OEIS has sequences for everything
21:45 xfix Except my regex shows them in wrong order...
21:46 Mouq r: say +<<3141592653589793.match(/(\d+?)<?{(+$0).is-prime}>/,:ex)
21:46 xfix (also, surprisingly fast, for something that abuses regular expressions)
21:46 camelia rakudo-parrot 71e08b, rakudo-jvm 71e08b, rakudo-moar 71e08b: OUTPUT«3 31 314159 14159 141592653589 41 4159 415926535897 1592653 5 59 5926535897 2 653 6535897 5 53 3 35897 358979 5 5897 58979 589793 89 97 7 79 3␤»
21:46 Mouq closer
21:47 xfix I would expect this to be slow, but it's actually rather fast.
21:49 PerlJam xfix: Thank jnthn++ and pmichaud++; they know what they are doing.  :)
21:49 lue ~ $ which perl6-m
21:49 lue ~ $ perl6-m -e 'say "HELLO $*VM<name>"'
21:49 lue HELLO moar
21:49 xfix Thanks.
21:49 lue which perl6-m
21:49 lue /usr/local/bin/perl6-m
21:49 lue 13:48:55 matthew@AMD64 ~ $ perl6-m -e 'say "HELLO $*VM<name>"'
21:49 lue HELLO moar
21:50 lue So jnthn++ \o/
21:50 jnthn yay
21:52 grondilu shouldn't there be 'subset Prime of Int where {...}' instead of &is-prime?
21:53 grondilu I mean, &is-something seems quite unelegant to me.
21:54 xfix Looks like an interesting idea
21:54 xfix $number ~~ Prime
21:54 PerlJam you can always make your own Prime thingy built on is-prime :)
21:55 grondilu .oO( everytime I suggest something, I'm told that I can always make my own module :/ )
21:55 colomon grondilu: well, you can
21:56 PerlJam grondilu: what don't you like about is-prime exactly?
21:56 grondilu r: subset Prime of Int where &is-prime; say { $_ ~~ Prime } for ^10;
21:56 xfix I like Perl 6 for code golf. Reduce operators are just great.
21:56 camelia rakudo-parrot 71e08b, rakudo-jvm 71e08b, rakudo-moar 71e08b: OUTPUT«Block.new()␤Block.new()␤Block.new()␤Block.new()␤Block.new()␤Block.new()␤Block.new()␤Block.new()␤Block.new()␤Block.new()␤»
21:56 grondilu r: subset Prime of Int where &is-prime; say map { $_ ~~ Prime }, ^10;
21:56 camelia rakudo-parrot 71e08b, rakudo-jvm 71e08b, rakudo-moar 71e08b: OUTPUT«False False True True False True False True False False␤»
21:57 xfix Make a function that only takes prime numbers :-).
21:58 PerlJam grondilu: you were close the first time btw ... say $_ ~~ Prime for ^10;  # (no curlies)
21:59 colomon r: subset Prime of Int where &is-prime; sub lazy-prime-factorization(Prime $a) { $a.Bag; }; say lazy-prime-factorization(11); say lazy-prime-factorization(12)
21:59 camelia rakudo-moar 71e08b: OUTPUT«bag(11)␤Constraint type check failed for parameter '$a'␤  in sub lazy-prime-factorization at /tmp/Ai2ahN2kJR:2␤  in block  at /tmp/Ai2ahN2kJR:2␤␤»
21:59 camelia ..rakudo-parrot 71e08b: OUTPUT«bag(11)␤Constraint type check failed for parameter '$a'␤  in sub lazy-prime-factorization at /tmp/KfCSix51uW:1␤  in block  at /tmp/KfCSix51uW:1␤␤»
21:59 camelia ..rakudo-jvm 71e08b: OUTPUT«bag(11)␤Constraint type check failed for parameter '$a'␤  in sub lazy-prime-factorization at /tmp/ZEynBQdRI3:1␤  in block  at /tmp/ZEynBQdRI3:1␤␤»
21:59 grondilu what I don't like is that it does not match the way we usually test for an object to belong to a kind.  I mean, when you want to see if $_ is an instance of a class Foo, you don't write $_.is-Foo, do you?  You write $_ ~~ Foo
22:00 grondilu r: class Foo { }; my $x = Foo.new; say $x ~~ Foo
22:00 camelia rakudo-parrot 71e08b, rakudo-jvm 71e08b, rakudo-moar 71e08b: OUTPUT«True␤»
22:00 xfix In Perl 6, ~~ is `is` for me.
22:00 PerlJam Is primality a "kind" or a property?
22:01 lue objects and mathematical properties are separate as far as I'm aware.
22:01 lue (unless you create an object for that property, that is)
22:01 xfix PerlJam: Uhm, it's subset.
22:02 grondilu I just think that the subset concept fits the use case of prime numbers pretty well.
22:02 colomon ~~ is not subset
22:02 skids problem spec says string can be assumed to be \d+, so you can lose '\d' for '.'
22:03 xfix I think that there is an example of Odd subset.
22:03 grondilu I've just checked in the core, the only subset there is UInt64
22:03 xfix Prime is also a subset, just like Odd and Even.
22:03 lue what, that's a subset?
22:04 grondilu UInt64.pm, line 2
22:04 grondilu subset UInt64 of Int where { 0 <= $_ < $UINT64_UPPER }
22:04 colomon that's…. pretty wrongish
22:04 grondilu why?
22:04 lue It works, but I definitely wouldn't think in Perl6 subsets for that.
22:05 colomon maybe "pointless" would be more appropriate than wrongish?
22:06 colomon I'm not seeing an obvious for an Int which is restricted to 64 bit values, but not actually implemented that way?
22:06 colomon which doesn't necessarily mean it's not in the spec somewhere.
22:06 lue Yeah, I'd expect to see UInt32, Int16, etc. We already have native types for that anyway, right? /me searches the spec for UInt64
22:06 PerlJam as a side note, the specs talk about "subtypes" but make them with "subset" (that's a little weird to me)
22:07 lue PerlJam: ooh. I agree with that being weird.
22:07 colomon PerlJam: it's kind of weird now that we have actual sets
22:07 PerlJam indeed
22:07 colomon subset operators, etc.
22:08 lue specs repo: $ ack -u UInt64
22:08 lue $
22:08 lue (that should've hit the .git directory too, if I'm not mistaken)
22:09 PerlJam grondilu, xfix: maybe there's a case for a module that creates subtypes for many common things like Prime, Triangular, PerfectSquare, whatever
22:10 japhb .oO( OEIS::A198187 )
22:10 lue nothing in roast either. UInt64 looks like some sort of relic or mistake to me.
22:11 japhb lue: Perhaps used as a hack to see if something can safely be converted to native?
22:11 * japhb not looking at source tree, obviously
22:11 colomon I don't see any sign it is called anywhere.
22:11 lue It's a two-line file.
22:12 colomon and the sole "use" seems to be
22:12 colomon # XXX: should be Rational[Int, UInt64]
22:12 grondilu PerlJam: we don't need a module to call is-prime, do we?
22:12 lue should be uint64 rather
22:13 grondilu PerlJam: but I get your point, I've just checked in S12 and it is said that: «  A subtype is primarily a handy way of sneaking
22:13 grondilu smartmatching into multiple dispatch. »
22:13 grondilu and it's indeed not too often that we have to restrict a function to prime integers
22:14 PerlJam right.
22:14 grondilu so ok, no subtype for Prime I guess.
22:15 colomon lue: actually, looks like the spec has Rational[Int,Uint64]
22:15 colomon "By default, this is the precision that would be represented by the Rat64 type, which is an alias for Rational[Int,Uint64], which has a numerator of Int but is limited to a denominator of Uint64 (which may or may not be implemented as a native uint64, since small representations may be desirable for small denominators)."
22:16 lue stupid cases!
22:17 dalek perl6-roast-data: 7b34c0c | coke++ | / (6 files):
22:17 dalek perl6-roast-data: today (automated commit)
22:17 dalek perl6-roast-data: review: https://github.com/coke/perl6-roast-data/commit/7b34c0cd9e
22:17 colomon but that said, I can't really imagine why you'd use Uint64 instead of uint64 there if you had both.
22:17 [Coke] 98.34% # moar
22:17 lue Uint64 is the only non-native sized integer type I can see in the spec.
22:18 lue There's Num64 and Rat64 ...
22:19 lue And Buf8. Probably more non-native sized types floating around though.
22:20 lue I get the sense that 64-bit non-native types were popular at one point :)
22:23 lue In any case, I think Uint64/UInt64 is useless, possibly along with other similar types.
22:25 rindolf joined #perl6
22:40 stevan_ joined #perl6
22:42 rindolf joined #perl6
22:55 kaare_ joined #perl6
23:11 bjz_ joined #perl6
23:12 colomon joined #perl6
23:23 Sqirrel_ joined #perl6
23:24 BenGoldberg joined #perl6
23:27 Sqirrel joined #perl6
23:27 bjz joined #perl6
23:33 [Coke] r: class A { has %!x }
23:33 camelia rakudo-parrot 71e08b, rakudo-jvm 71e08b, rakudo-moar 71e08b: ( no output )
23:34 [Coke] r: class A { has %!x ; %!x<bar>=42 }
23:34 camelia rakudo-jvm 71e08b: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/KEF4k_OfP6�Variable %!x used where no 'self' is available�at /tmp/KEF4k_OfP6:1�------> [32mclass A { has %!x ; %!x[33m�[31m<bar>=42 }[0m�»
23:34 camelia ..rakudo-moar 71e08b: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/8hMGUxHI7U�Variable %!x used where no 'self' is available�at /tmp/8hMGUxHI7U:1�------> [32mclass A { has %!x ; %!x[33m�[31m<bar>=42 }[0m�»
23:34 camelia ..rakudo-parrot 71e08b: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/jOM3dpb_QR�Variable %!x used where no 'self' is available�at /tmp/jOM3dpb_QR:1�------> [32mclass A { has %!x ; %!x[33m�[31m<bar>=42 }[0m�»
23:34 [Coke] I really need to stop use r for questionable code.
23:37 dalek roast: 6095efc | coke++ | / (2 files):
23:37 dalek roast: RT #76432 - add/mark tests
23:37 dalek roast: review: https://github.com/perl6/roast/commit/6095efcebe
23:37 synopsebot Link: https://rt.perl.org/rt3//Public/Bug/Display.html?id=76432
23:37 * lue wonders if evalbot can be taught that /tmp/<file> is not significant
23:38 dalek rakudo/nom: 6aa2f1d | jnthn++ | src/Perl6/Actions.nqp:
23:38 dalek rakudo/nom: Some missing declaration_static.
23:38 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/6aa2f1ddb2
23:38 jnthn lue: May be easier to get it to use the same input file for all of the things it runs...
23:39 lue that sounds like a better solution :)
23:41 diakopter well it queues the files asynchronously
23:43 Mouq joined #perl6
23:50 kaare_ joined #perl6

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

Perl 6 | Reference Documentation | Rakudo