Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6, 2014-07-01

Perl 6 | Reference Documentation | Rakudo

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

All times shown according to UTC.

Time Nick Message
00:00 chenryn__ joined #perl6
00:06 chenryn__ joined #perl6
00:30 erkan joined #perl6
00:33 jnap joined #perl6
00:42 chenryn__ joined #perl6
00:57 vendethiel joined #perl6
00:58 BenGoldberg joined #perl6
01:02 klapperl_ joined #perl6
01:09 Su-Shee joined #perl6
01:20 thou joined #perl6
01:27 [Sno] joined #perl6
01:39 thou joined #perl6
01:46 chenryn__ joined #perl6
01:48 colomon joined #perl6
01:54 tempire joined #perl6
01:59 camelia joined #perl6
02:01 xiaomiao joined #perl6
02:07 dayangkun joined #perl6
02:08 xiaomiao joined #perl6
02:18 Sqirrel joined #perl6
02:20 vendethiel-- joined #perl6
02:24 noganex joined #perl6
02:39 silug joined #perl6
02:47 chenryn joined #perl6
02:47 chenryn__ joined #perl6
02:52 teodozjan joined #perl6
03:04 chenryn__ joined #perl6
03:10 davercc joined #perl6
03:14 [Coke] . o O (Colorado)
03:22 kaare__ joined #perl6
03:22 mr-foobar joined #perl6
03:23 xragnar_ joined #perl6
03:26 davercc joined #perl6
03:50 James-YeJ3TE48lO joined #perl6
03:52 James-YeJ3TE48lO utf8 ทำงานดีไหมครับ
03:58 Sqirrel joined #perl6
03:59 Sqirrel_ joined #perl6
04:02 Sqirrel joined #perl6
04:02 Sqirrel_ joined #perl6
04:06 ivanshma` joined #perl6
04:19 xenoterracide__ joined #perl6
04:22 cognominal joined #perl6
04:22 lyda_ joined #perl6
04:22 Khisanth joined #perl6
04:22 MilkmanDan joined #perl6
04:22 Exodist joined #perl6
04:22 japhb_ joined #perl6
04:22 TimToady joined #perl6
04:22 Possum joined #perl6
04:22 sjohnson joined #perl6
04:22 apejens joined #perl6
04:22 matija joined #perl6
04:22 bloonix joined #perl6
04:22 ggoebel111116 joined #perl6
04:22 cosimo joined #perl6
04:22 frettled joined #perl6
04:22 thilp joined #perl6
04:22 robinsmidsrod joined #perl6
04:22 ChoHag joined #perl6
04:22 mtj_ joined #perl6
04:22 raydiak joined #perl6
04:22 ccverg joined #perl6
04:22 mhasch joined #perl6
04:22 djanatyn joined #perl6
04:22 perigrin joined #perl6
04:24 kaleem_ joined #perl6
04:27 lyda joined #perl6
04:42 chenryn joined #perl6
04:48 moritz p6: say 'ทำงานดีไหมครับ'.chars
04:48 kaare__ joined #perl6
04:48 camelia rakudo-{parrot,jvm,moar} 77024f, niecza v24-109-g48a8de3: OUTPUT«14␤»
04:53 gfldex joined #perl6
05:01 James-YeJ3TE48lO joined #perl6
05:02 rurban1 joined #perl6
05:05 chenryn__ joined #perl6
05:06 hoverboard joined #perl6
05:12 [Sno] joined #perl6
05:15 xenoterracide__ joined #perl6
05:21 pdcawley joined #perl6
05:22 James-YeJ3TE48lO joined #perl6
05:32 rurban1 joined #perl6
05:36 rindolf joined #perl6
06:02 ivanshmakov joined #perl6
06:05 mutani joined #perl6
06:06 chenryn__ joined #perl6
06:14 lizmat joined #perl6
06:16 * lizmat finally made it to Brussels
06:20 davercc left #perl6
06:35 lizmat .tell vendethiel-- please look at http://blog.timbunce.org/2010/07/16/java2perl6api-java-to-perl-6-api-tranalation-what-why-and-whereto/
06:35 yoleaux lizmat: I'll pass your message to vendethiel--.
06:43 SamuraiJack joined #perl6
07:01 ingy joined #perl6
07:03 FROGGS joined #perl6
07:06 FROGGS o/
07:07 chenryn__ joined #perl6
07:07 tadzik o/
07:08 * FROGGS reads http://blog.timbunce.org/2010/07/16/java2perl6api-java-to-perl-6-api-tranalation-what-why-and-whereto/
07:10 atroxaper joined #perl6
07:11 zakharyas joined #perl6
07:14 sqirrel__ joined #perl6
07:14 sergot morning o/
07:16 virtualsue joined #perl6
07:17 teodozjan joined #perl6
07:22 darutoko joined #perl6
07:22 Isp-sec joined #perl6
07:24 anaeem1 joined #perl6
07:30 virtualsue joined #perl6
07:35 rurban1 joined #perl6
07:36 masak a morn', a morn'! \o/
07:36 masak <James-YeJ3TE48lO> utf8 ทำงานดีไหมครับ
07:36 masak why yes, James, it does.
07:37 masak it's our friend :)
07:37 James-YeJ3TE48lO Hehe, thanks. Do you read Thai?
07:37 FROGGS sort of... .chars is still wrong :o)
07:39 anaeem1 joined #perl6
07:43 igorsutton joined #perl6
07:50 masak James-YeJ3TE48lO: Google Translate is also my friend ;)
07:50 ivanshmakov joined #perl6
07:50 James-YeJ3TE48lO Haha, thought as much. :)
07:51 masak "[...] we should note that the proverb about not putting all your eggs in one basket is *not* necessarily a sound engineering principle. The right answer depends on the margin of error and on the per-basket failure rate. It also greatly depends on the chance of correlated, uncorrelated, and anti-correlated basket failures. Sometimes the best way to get your eggs from point A to point B is to put them all in one basket and take really good care of that basket.
07:51 masak ^ a really nice quote I just found at http://www.av8n.com/computer/htm/secure-random.htm
07:51 James-YeJ3TE48lO Yes, it's certainly true of security and crypto primitives.
07:52 dmol joined #perl6
07:54 anaeem1 joined #perl6
08:00 [Sno] joined #perl6
08:01 masak James-YeJ3TE48lO: so you're calling in from .th?
08:04 lelf joined #perl6
08:04 James-YeJ3TE48lO Yes ใช่ครับ
08:09 Alina-malina joined #perl6
08:10 masak :)
08:19 ivanshmakov joined #perl6
08:21 brrt joined #perl6
08:22 donaldh joined #perl6
08:24 anaeem1_ joined #perl6
08:27 FROGGS jnthn: say we have a C struct that has a void * in it which will be represented as an OpaquePointer - how can we unpack that pointer later using a class?
08:29 FROGGS it seems we'd need parts of nqp::nativecall($!rettype, self, nqp::getattr(nqp::decont($args), Capture, '$!list'))
08:31 FROGGS so this could become its own op: result = MVM_nativecall_make_cstruct(tc, res_type, dcCallPointer(vm, body->entry_point));
08:32 jnthn FROGGS: I think it'll need some kind of nqp::nativecast or so
08:32 fhelmberger joined #perl6
08:33 FROGGS (or the entirem switch statement, including int/Int/wahtever)
08:33 FROGGS yes
08:33 sergot jnthn: what should we do if we have an function inside the struct?
08:33 * FROGGS .oO( cry? )
08:33 sergot :)
08:33 jnthn sergot: Not immediately sure how we express that.
08:34 FROGGS jnthn: also, I'd like to see that OpaquePointer gistifies to: OpaquePointer<24982734>, so you see its mem address for debugging
08:35 rurban1 joined #perl6
08:35 FROGGS okay, who wants to implement nqp::nativecast(OpaquePointer, <Type>) ? :o)
08:37 anaeem1_ joined #perl6
08:40 dakkar joined #perl6
08:40 dalek joined #perl6
08:43 anaeem1 joined #perl6
08:44 arnsholt FROGGS: I don't really have the time to implement that ATM, but it should be pretty straightforward I think
08:44 arnsholt Mostly a matter of hooking already existing functionality into a new op
08:46 FROGGS arnsholt: pssst, I wanna trick sergot in doing it :P
08:47 FROGGS or I do it, should be a fairly small amount of work for one who has already implemented ops
08:49 arnsholt sergot: If your struct contains a function pointer, you'll have to implement support for function pointers first =)
08:50 FROGGS perhaps something can be stolen from how callbacks work?
08:50 sergot hmmm, I can try :)
08:50 arnsholt The existing callback stuff should have a fair amount of what's needed, yeah
08:51 arnsholt But storable function pointers are a bit fiddly, 'cause it's not obvious (to me anyways) what kind of type they should have
08:51 sergot challenge accepted ;))
08:52 arnsholt The pointer type fiddling should be pretty straightforward though
08:52 arnsholt (That's zavolaj #13, BTW =)
09:00 teodozjan hi, I would like to ask whether I'm the only person who has error while trying to compile parrot backend :)
09:01 xiaomiao teodozjan: I have encountered an error too
09:01 xiaomiao teodozjan: tried with 6.2-6.5 parrot, they all don't want to cooperate
09:02 pecastro joined #perl6
09:03 anaeem1 joined #perl6
09:03 teodozjan i've bisected it but i'm not sure it is real cause https://github.com/rakudo/rakudo/commit/f12ff543046221a28ffb6cd7c948d396b8965429#commitcomment-6843467
09:04 anaeem1 joined #perl6
09:06 jnthn That would be a very strange patch to casue such a failure, given it's mostly just adding an extra condition on whether to apply an optimization (and means we apply it *less*)
09:08 chenryn__ joined #perl6
09:09 chenryn joined #perl6
09:09 teodozjan maybe it triggered something faulty
09:10 smls joined #perl6
09:10 Su-Shee left #perl6
09:13 masak ++sergot # function pointers
09:13 masak a function pointer has type Func[Param1, Param2, RetVal], no?
09:13 masak at least conceptually.
09:13 masak the same should hold for C.
09:16 smls "<FROGGS> sort of... .chars is still wrong :o)"  -- I don't think it is
09:17 smls ดี   and  รั   are two alphabet characters each: the bottom ones consonants, the top ones the vowels following them.
09:17 smls (If I remember correctly)
09:18 smls They just happen to be written on top of each other... :)
09:20 smls ทำ  is different: The bottom left part is the consonant, and the right+top parts together are the vowel character.
09:20 FROGGS smls: I just selected the text using firefox, and it looked like as if there where two codepoint pairs that were combined
09:20 FROGGS I counted 12 grapheme clusters by selecting the text
09:21 smls Well I don't know how Unicode defined chars, but that's how the Thai alphabet (as taught in Thai kindergarten) separates them
09:21 FROGGS and .chars should tell you the amount of grapheme clusters, which should be identical to the *visible* characters
09:26 spider-mario joined #perl6
09:36 rurban1 joined #perl6
09:37 silug joined #perl6
09:40 vendethiel-- thanks lizmat
09:40 yoleaux 06:35Z <lizmat> vendethiel--: please look at http://blog.timbunce.org/2010/07/16/java2perl6api-java-to-perl-6-api-tranalation-what-why-and-whereto/
09:47 teodozjan joined #perl6
09:53 denis_boyun joined #perl6
09:55 vendethiel-- not related though :(
09:57 brrt left #perl6
10:03 tadzik joined #perl6
10:03 pecastro joined #perl6
10:18 * masak likes that today's topic seems to involve the Thai alphabet
10:26 sqirrel joined #perl6
10:29 masak a good friend of mine turns 32 today.
10:29 masak I went to Wikipedia and discovered that 32 is a happy number.
10:29 masak naturally, I had to implement a way to show this in Perl 6Ö
10:29 masak naturally, I had to implement a way to show this in Perl 6:
10:29 masak m: sub happy($n is copy) { $n = [+] $n.comb X** 2 until $n == 1 || (my %){$n}++; $n == 1 }; say happy 32
10:29 camelia rakudo-moar 77024f: OUTPUT«True␤»
10:29 masak it was easier than I thought.
10:30 jnthn eww, look at that state :D
10:31 masak note especially that it is *not in a .map* :P
10:31 jnthn :P
10:32 masak yes, that's just a matter of taste.
10:37 rurban1 joined #perl6
10:38 kaleem_ joined #perl6
10:45 psch joined #perl6
10:45 psch hi #perl6 o/
10:48 psch vendethiel: did you see day 03 from the 2013 advent calender? it has an example for calling java.util.zip.CRC32
10:49 vendethiel psch: yeah, I saw it
10:50 zengargo1le joined #perl6
10:50 colomon m: https://gist.github.com/colomon/fea0ec14fbf3ad02c5ed
10:50 camelia rakudo-moar 77024f: OUTPUT«gist not found»
10:50 psch vendethiel: but it didn't help? FWIW, the example doesn't even actually work for me.
10:51 vendethiel well, I don't even know how to link a jar for example
10:52 colomon masak: https://gist.github.com/colomon/fea0ec14fbf3ad02c5ed
10:54 vendethiel psch: also, I'm on p62014.03-parrot, sooo... :)
10:55 masak colomon: nice.
10:55 masak colomon: would 'is cached' work as well, instead of %memory ?
10:55 colomon masak: no, because of the %memory{$n} = False line
10:55 masak just saw that one.
10:56 masak well, it *feels* like an eminently memoizable problem, except for the fact that it sometimes loops infinitely.
10:56 * colomon desperately wanted to make it is cached, mind you.
10:56 pdcawley joined #perl6
10:57 anaeem1__ joined #perl6
10:57 psch vendethiel: clog says you asked about "jvm libs from perl6-jvm" yesterday, that's what I was refering to... :)
10:57 vendethiel I mean, I can't test
10:58 pdcawley joined #perl6
10:59 pdcawley_ joined #perl6
11:00 pdcawley joined #perl6
11:03 colomon masak: https://gist.github.com/colomon/adf4d949d1835730ba65
11:03 colomon masak: solutions keep getting longer and slower.  time to stop and make breakfast
11:08 psch vendethiel: https://gist.github.com/peschwa/0158083bc4e5613a6390 # as an example; as it says, it doesn't quite work as-is
11:08 psch so it's probably not something that should be showed around
11:09 psch I don't understand the jvm compilation process (in general and for rakudo) enough to say why it's not enough to add the correct CLASSPATH
11:11 erkan joined #perl6
11:11 erkan joined #perl6
11:14 amkrankruleuen joined #perl6
11:14 amkrankruleuen joined #perl6
11:18 vendethiel m: say 'FOO1;2;3' ~~ / :r ^ 'FOO' $<id>=(\d) ** 3 % ';' $ /
11:18 camelia rakudo-moar 77024f: OUTPUT«「FOO1;2;3」␤ id => 「1」␤ id => 「2」␤ id => 「3」␤␤»
11:19 vendethiel m: 'FOO1;2;3' ~~ / :r ^ 'FOO' $<id>=(\d) ** 3 % ';' $ /; say $/<id>.list>>.ast;
11:19 camelia rakudo-moar 77024f: OUTPUT«(Any) (Any) (Any)␤»
11:23 vendethiel >>.Num it is then.
11:23 FROGGS right, there is nothing in the .ast (called .made now), as long as you don't 'make' anything
11:27 vendethiel joined #perl6
11:30 brrt joined #perl6
11:31 chenryn joined #perl6
11:37 rurban1 joined #perl6
11:38 vendethiel m: my ($a, $b, *) = 1..*; say $a
11:38 camelia rakudo-moar 77024f: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/bUXHGDClquâ�¤Malformed parameterâ�¤at /tmp/bUXHGDClqu:1â�¤------> [32mmy ($a, $b, [33mâ��[31m*) = 1..*; say $a[0mâ�¤    expecting any of:â�¤        scoped declaratorâ�¤        formal parameter…»
11:40 vendethiel m: for ({a => 1}, {a => 50}, {a => 60}) -> $a { say $a }
11:40 camelia rakudo-moar 77024f: OUTPUT«{"a" => 1}␤{"a" => 50}␤{"a" => 60}␤»
11:40 vendethiel m: for ({a => 1}, {a => 50}, {a => 60}) -> $a { say $a<a> }
11:40 camelia rakudo-moar 77024f: OUTPUT«1␤50␤60␤»
11:40 ChoHag Does calling callsame twice do Bad Things?
11:43 moritz I sure hope not
11:44 ChoHag Just checking.
11:44 * jnthn really can't remember how stateful iterating the candidate list is...
11:50 lelf joined #perl6
11:54 moritz m: class A { method x() { 42 } }; class B is A { method x() { say callsame; say callsame; } }; B.new.x
11:54 camelia rakudo-moar 77024f: OUTPUT«42␤Nil␤»
11:54 moritz bug (IMHO)
11:54 LLamaRider joined #perl6
11:55 jnthn Not sure.
11:55 jnthn Can we change that without breaking lastcall?
11:55 moritz I have no idea
11:57 jnthn Hm, perhaps can
11:57 jnthn It'll involve more copying stuff, I guess...
11:57 Alina-malina joined #perl6
12:00 ChoHag If I wanted to create a magic Int, how would I do it? Class MagicInt is Int { ... }? Then how can I create a MagicInt attribute which coerces an Int to a MagicInt?
12:02 * masak submits rakudobug
12:04 awwaiid How does one choose between "my $x = {a => 1}" and "my %x = {a => 1}" ?
12:04 igorsutton joined #perl6
12:04 awwaiid and is that decision any different for a &x vs $x for storing a lambda?
12:04 moritz awwaiid: there are two answers (for the % case)
12:04 moritz the first is that % does a type check, so if you want type checks, go with %
12:05 moritz the second is that % flattens, and $ doesn't
12:05 awwaiid right, type check is a clear answer
12:05 awwaiid ok, flatten, right
12:05 moritz the type check applies also to & variables (which don't flatten)
12:06 awwaiid what is a simple example of that type check happening?
12:06 moritz m: my %h := 42;
12:06 camelia rakudo-moar 77024f: OUTPUT«Type check failed in binding; expected 'Associative' but got 'Int'␤  in any bind_error at src/vm/moar/Perl6/Ops.nqp:217␤  in block  at /tmp/XKGM0otdkw:1␤␤»
12:06 moritz oh, third point
12:07 moritz assignment to % variables is coercing
12:07 awwaiid oh yes, I always forget about :=
12:07 moritz m: my %h = a => 1, b => 2; say %h.perl; # the RHS is a Parcel, the LHS an array
12:07 camelia rakudo-moar 77024f: OUTPUT«("a" => 1, "b" => 2).hash␤»
12:07 moritz s/array/hash/
12:08 awwaiid ok, that helps. I'm giving my talk on Rakudo tonight, and during prep keep imagining some of these sorts of questions :)
12:14 virtualsue joined #perl6
12:15 chenryn joined #perl6
12:19 jnap joined #perl6
12:21 prevost joined #perl6
12:31 masak awwaiid++
12:36 guru joined #perl6
12:40 ClarusCogitatio joined #perl6
12:41 vendethiel joined #perl6
12:47 kurahaupo joined #perl6
12:49 xenoterracide__ joined #perl6
12:54 xenoterracide__ joined #perl6
12:59 fhelmberger_ joined #perl6
13:00 zengargo1le left #perl6
13:04 brrt joined #perl6
13:05 raiph joined #perl6
13:06 bluescreen10 joined #perl6
13:07 rurban1 joined #perl6
13:08 zengargoyle joined #perl6
13:16 molaf joined #perl6
13:19 * vendethiel is trying to help his friend play w/ Java interop
13:19 vendethiel It Works (TM) (but it's a bit ugly :P)
13:21 virtualsue joined #perl6
13:30 anaeem1 joined #perl6
13:33 lelf joined #perl6
13:36 virtualsue joined #perl6
13:38 chenryn joined #perl6
13:39 FROGGS vendethiel: coat it with sugar
13:39 vendethiel well, that's not easy
13:41 ChoHag Sugar makes you fat.
13:44 FROGGS ChoHag: there is nothing wrong with being fat
13:44 ChoHag Apart from heart disease.
13:44 ChoHag And never stairs.
13:44 ChoHag s/never//
13:45 kaare_ joined #perl6
13:45 ChoHag And summer insulation.
13:46 ChoHag I tried being fat. Not doing that again.
13:47 btyler joined #perl6
13:48 FROGGS :o)
13:50 James-YeJ3TE48lO joined #perl6
13:53 treehug88 joined #perl6
14:01 woolfy joined #perl6
14:04 SamuraiJack joined #perl6
14:06 vendethiel joined #perl6
14:06 kaleem_ joined #perl6
14:12 * brrt wonders, and has decided not too, discuss the evidence on sugar-making-you-fat
14:12 FROGGS *g*
14:13 FROGGS No! it is not the sugar that is making you fat! You eating it makes you fat!
14:13 FROGGS :P
14:15 tadzik well, the law of energy conservation surely has something to do with getting fat
14:16 masak tadzik: and then there's that group that say "you can't apply *physics* to a biological organism like that!"
14:17 tadzik :)
14:17 masak tadzik: as if physics somehow ceased to apply inside bodies.
14:17 carlin joined #perl6
14:17 rurban1 joined #perl6
14:19 tadzik don't forget, there's the spiritual part that science can't explain
14:19 tadzik https://www.youtube.com/watch?v=HhGuXCuDb1U explained here
14:21 kaleem_ joined #perl6
14:28 hoverboard joined #perl6
14:33 dylanwh joined #perl6
14:33 zengargoyle biology is on a sliding scale.  if it were physics E=mc^2 and 1g of food would sustain many lifetimes. :P
14:34 moritz as long as you don't want to build muscles with that energy alone :-)
14:34 moritz then you'd be limited to 1g of new body tissue :-)
14:34 zengargoyle if it were calories in vs out it would be easy.  but it's also non-energy processes like all that non-calorie water you drink.
14:35 zengargoyle so like 1g of calorie food + 1kg of non-calorie water = ~.5kg fat
14:35 zengargoyle *bogus numbers*
14:37 thou joined #perl6
14:39 brrt tadzik - and i'm with those people
14:39 Ulti plus plenty of stuff is energy dense but humans can't process it, plant fibre we burn it for fuel to heat a home but it does nothing going through you
14:39 chenryn joined #perl6
14:39 ChoHag Are return signature types implemented?
14:40 moritz m: sub f(--> Int) { "str" }; f()
14:40 camelia rakudo-moar 77024f: OUTPUT«Type check failed for return value; expected 'Int' but got 'Str'␤  in any return_error at src/vm/moar/Perl6/Ops.nqp:598␤  in block  at /tmp/HFhuHAVYBJ:1␤␤»
14:40 zengargoyle yeah, think it might be along the lines of we can only get energy from low total energy processes
14:40 moritz and that's good for us
14:40 zengargoyle otherwise we'd be prone to accidental explosion or something. :)
14:40 moritz aye
14:41 brrt zengargoyle - don't forget that drinking water at 15deg celsius needs to be 'heated' to 37 degrees celsius and thus actually costs energy
14:41 * moritz thinks of a rod of burning Magnesia
14:41 James-YeJ3TE48lO joined #perl6
14:41 zengargoyle maybe that's how vampires work.
14:41 ChoHag Where does the --> go wrt the rest of the signature?
14:41 moritz ChoHag: after them
14:41 ChoHag No comma?
14:41 moritz m: sub f(Int --> Int) { "str" }; f(52)
14:41 camelia rakudo-moar 77024f: OUTPUT«Type check failed for return value; expected 'Int' but got 'Str'␤  in any return_error at src/vm/moar/Perl6/Ops.nqp:598␤  in block  at /tmp/NSk9TrUs8z:1␤␤»
14:41 moritz m: sub f(Int $x --> Int) { say $x; "str" }; f(52)
14:42 camelia rakudo-moar 77024f: OUTPUT«52␤Type check failed for return value; expected 'Int' but got 'Str'␤  in any return_error at src/vm/moar/Perl6/Ops.nqp:598␤  in sub f at /tmp/TqsVTPPQHY:1␤  in block  at /tmp/TqsVTPPQHY:1␤␤»
14:45 mr-foobar hey all, want to try perl6 on the jvm on mac. any star release for it ?
14:46 moritz not yet
14:46 moritz well, the last one contains the code for the JVM, but some of the modules don't work
14:47 mr-foobar anything I can do to test ?
14:48 mr-foobar i am interested in calling java from pl6
14:50 moritz I have no idea; I hope somebody else ( FROGGS? [Coke]? ) knows the current state and where to start
14:51 FROGGS there are issues as seen in the daily star build/test reports
14:51 mr-foobar oh, how about moarvm ?
14:51 mr-foobar star release ?
14:51 FROGGS moarvm is clean and can be released easily
14:52 * mr-foobar one liner installers ftw !
15:00 dylanwh joined #perl6
15:01 dylanwh joined #perl6
15:06 dylanwh joined #perl6
15:11 chenryn joined #perl6
15:16 ChoHag How do I set up a coercion from one type to another? So that my Foo $bar = Baz.new can be made to work?
15:17 dylanwh joined #perl6
15:18 dylanwh joined #perl6
15:20 dylanwh joined #perl6
15:26 dylanwh joined #perl6
15:26 jnthn ChoHag: The Foo is a type *constraint*. The thing you assign has to match. It's not a coercion request. my Foo() $bar = ...; is the proposed syntax for a type that coerces to Foo.
15:27 brrt left #perl6
15:30 raiph joined #perl6
15:31 * sjn reminds that YAPC::EU talk submission deadline is July 1st (today)
15:32 jnthn :)
15:32 * jnthn submat two talks :)
15:33 jnthn Only once in the last 9 YAPC::EUs did all my submissions get rejected, so I'm fairly hopeful one will make the cut. :)
15:36 * masak submat one, ponders whether to do a second
15:37 colomon what will you guys' talks be on?  (assuming you are allowed to make them)
15:39 ChoHag So if Baz is an existing class, can I create a role Foo which is automatically mixed into any Baz put into $bar?
15:40 ChoHag Or do I just have to wait for my Foo() $bar to work?
15:42 psch m: class Baz { method baz { "baz" } }; my $bar = Baz.new does role { method foo { "foo" } }; $bar.foo.say # not quite the same
15:42 camelia rakudo-moar 77024f: OUTPUT«foo␤»
15:43 psch i don't think you can stick the (in this case anon) role onto the container itself
15:44 mr-foobar "legal issues as per freenode"
15:46 sjn colomon: mine is called "Creative Perlmongership" :)
15:46 colomon sjn++
15:47 * sjn wonders if he should rather call it "Baeudacious Perlmongitude" or something like that
15:54 kaare_ joined #perl6
16:01 FROGGS joined #perl6
16:05 sqirrel joined #perl6
16:10 masak colomon: mine is called "GOTO considered awesome", and is about more or less insane applications of userland CPS transforms.
16:12 chenryn joined #perl6
16:15 jnthn ChoHag: Have to wait, I suspect...though I'd also consider whether there's not a more elegant approach to whatever you're trying to achieve...
16:15 ChoHag Well in the immediate case I'm just trying to find new ways of breaking perl so that I can examine the pieces.
16:18 colomon masak++ # awesome
16:18 * colomon remembers the bad old days of programming with goto….
16:19 jnthn oh, and talks... I submitted one about the performance work in Rakudo and MoarVM (including spesh), and another about the primitives Perl 6 provides for asynchronous programming.
16:20 colomon jnthn++
16:21 * colomon imagines the "jnthn surprise" for performance work could be disturbingly awesome...
16:24 carlin m: use MONKEY_TYPING; augment class Rat { method cieling { die "'i' before 'e' except after 'c', except where the sound is 'ee' and except where it's just plain weird" } }; say 4.2.cieling;
16:24 camelia rakudo-moar 77024f: OUTPUT«'i' before 'e' except after 'c', except where the sound is 'ee' and except where it's just plain weird␤  in method cieling at /tmp/NZpTbe6xYT:1␤  in block  at /tmp/NZpTbe6xYT:1␤␤»
16:24 carlin that should be in core
16:24 carlin or maybe I should remember how to spell ceiling
16:24 erdic joined #perl6
16:25 flussence m: say cieling 4.2
16:25 camelia rakudo-moar 77024f: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/AX0X_fzxRfâ�¤Undeclared routine:â�¤    cieling used at line 1. Did you mean 'ceiling'?â�¤â�¤Â»
16:25 flussence it should probably do that for methods...
16:25 jnthn m: say 4.2.cieling
16:25 camelia rakudo-moar 77024f: OUTPUT«No such method 'cieling' for invocant of type 'Rat'␤  in block  at /tmp/FBQC56Hl21:1␤␤»
16:25 jnthn Yeah, should be possible
16:37 silug joined #perl6
16:39 jlaire joined #perl6
16:40 brrt joined #perl6
16:46 ren1us joined #perl6
16:46 ren1us out of pure curiosity, is there a particularly reason why lists don't seem to support deleting an element other than at the ends?
16:47 masak ren1us: .splice
16:48 ren1us I'll go back to my cave of being an idiot. Thank you.
16:48 spider-mario joined #perl6
16:50 carlin an idiot is someone who doesn't know something you learned yesterday :)
16:52 jnthn carlin: Do you know what I learned yesterday?
16:55 jnthn .oO( darn, didn't fall for it :) )
16:55 carlin jnthn: I'll bite, what did you learn yesterday?
16:55 virtualsue joined #perl6
16:56 jnthn See, you don't know. :P
16:56 moritz => idiot :-)
16:56 jnthn :D
16:56 carlin heh
16:56 jnthn Sorry, was too good to resist. :)
16:57 carlin :)
16:59 carlin my point was ren1us++ now knows about .splice and is therefore no longer an idiot
17:00 carlin see also: xkcd 1053
17:00 brrt left #perl6
17:00 Possum joined #perl6
17:12 kaleem_ joined #perl6
17:13 chenryn joined #perl6
17:14 telex joined #perl6
17:17 [Sno] joined #perl6
17:20 vendethiel joined #perl6
17:21 jnap left #perl6
17:21 rindolf joined #perl6
17:28 jnap joined #perl6
17:30 pdcawley joined #perl6
17:36 erdic joined #perl6
17:55 masak it's the people who never ask probing questions and never get interesting answers we should feel sorry for ;)
17:55 itz_ joined #perl6
18:00 FROGGS jnthn: there?
18:01 xinming_ joined #perl6
18:02 FROGGS jnthn: the nativecast thingy works for some things now and I wonder... should that be available as a method on OpaquePointer?
18:02 FROGGS like .cast-to(MyClass) ?
18:05 brrt joined #perl6
18:06 Sqirrel joined #perl6
18:11 masak m: sub happy($n is copy) { $n = [+] $n.comb X** 2 until $n == 1 || (my %){$n}++; $n == 1 }; say happy 32
18:11 camelia rakudo-moar 77024f: OUTPUT«True␤»
18:12 masak m: say (sort gather for 2..8 -> $x { for $x..8 -> $y { take $x ** $y + $y ** $x } })[^10]
18:12 camelia rakudo-moar 77024f: OUTPUT«8 17 32 54 57 100 145 177 320 368␤»
18:12 masak ...I'm a little bothered by the two 8s in that code.
18:12 masak they're the lowest constant I can put there to get the right first 10 terms, but I found that through trial and error.
18:13 masak maybe someone can think of some code that doesn't involve them? :)
18:14 chenryn joined #perl6
18:14 jnthn .oO( 2..^9 )
18:14 masak actually, this reminds me of http://strangelyconsistent.org/blog/t2-sums-of-cubes
18:15 masak also, this could probably find quite an elegant (if longer) solution using Supplies.
18:15 lizmat joined #perl6
18:25 virtualsue joined #perl6
18:40 denis_boyun joined #perl6
18:42 dalek rakudo/nom: e371c34 | (Elizabeth Mattijsen)++ | src/core/Method.pm:
18:42 dalek rakudo/nom: Implement "is cached" on methods properly
18:42 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/e371c34206
18:42 * lizmat is sorta back, but at the NLPM meeting
18:44 masak lizmat++ # 'is cached' on methods
18:45 colomon I dunno if I agree that's a proper fix or not.
18:46 colomon was there more discussion on it on IRC after the initial disucssion yesterday?
18:47 masak oh, I didn't check the patch.
18:47 * masak does so
18:47 masak using $self.WHICH is what I'd do, too.
18:47 masak so +1 on that.
18:48 masak the question I *didn't* ask yesterday -- but do now -- is: why are we not using .WHICH for all the parameters?
18:48 colomon If I understand it correctly, now it caches on WHICH instead of the value of the attributes of self
18:48 masak we should be using .WHICH for all kinds of hashing, right? and caching does hashing.
18:48 masak I don't think .gist is up to the task in general.
18:50 Isp-sec joined #perl6
18:51 colomon masak: it seems to me (re self) there are two cases:
18:52 colomon 1) The object is immutable.  In this case using .WHICH means we don't get possible caching when two different objects of the type have the same attribute values.
18:53 colomon 2) The object is mutable.  In this case, using only .WHICH means we don't even notice when the values of the attributres have changed.
18:55 colomon …. errrr ....
18:55 colomon but wait, immutable objects with the same attributes are supposed to have the same WHICH, aren't they?
18:56 teodozjan joined #perl6
18:56 colomon So my objection #1 goes away
18:57 lizmat I was actually thinking about .WHICH as well, but that would have meant a recursive .WHICH implementation
19:01 * lizmat is not completely clear yet: sleep depravation does that to you
19:03 * lizmat also wonders whether she missed TimToady's ruling on the behaviour of:
19:03 lizmat my %hash = { a => 1 };
19:03 lizmat being the same as:
19:03 lizmat my %hash = ( a => 1 );
19:03 lizmat (which I think is wrong)
19:06 masak colomon: IMO, people shouldn't do 'is cached' on functions which take mutable arguments.
19:06 colomon masak: including classes which are mutable?
19:08 masak well, 'self' may be the exception here. haven't thought about it.
19:08 colomon self is what I'm talking about.
19:08 masak but I really don't think so.
19:08 masak if 'self' is an object which mutates, then we're in the same kind of trouble as if other params mutate.
19:09 lizmat ah, that would be the reason I used .gist  :-)
19:09 masak IMO it's a case of "things *may* come out right, but really all bets are off if you have mutability"
19:09 lizmat supposedly, the .gist should reflect any changes to self
19:09 colomon right, if you don't care about mutable things, then .gist is maybe better than .WHiCH
19:10 masak so I vote for using .WHICH throughout and then conditioning users to dislike combining 'is cached' (or really any kind of hashing) with mutability.
19:10 colomon er,, or am I thinking about that backwards
19:10 masak that's really the only long-term sane option.
19:10 masak using .gist is going down the wrong road, trying to compensate for insanity which can't really be compensated for.
19:12 lizmat S06:2121: A given C<Capture> would always calculate the same return value.  That is, there is no state hidden within the dynamic scope of the call.
19:12 synopsebot Link: http://perlcabal.org/syn/S06.html#line_2121
19:13 rurban src/gen/p-CORE.setting.pir:147823 fails with parrot (handler.'handle_types'(.CONTROL_LOOP_LAST) since some time.
19:14 rurban looks like the .CONTROL_LOOP_LAST nqp-p constants are gone on
19:14 lizmat actually, the spec indicates that we don't need special handling for "is cached" for methods
19:15 lizmat anyway, that's how I read it
19:15 FROGGS rurban: the constants were removed?
19:15 denis_boyun__ joined #perl6
19:15 rurban I see them in nqp, but rakudo doesn't see them.
19:16 rurban nqp/install/bin/parrot  -o CORE.setting.pbc src/gen/p-CORE.setting.pir
19:16 rurban error:imcc:syntax error, unexpected DOT, expecting '(' ('.')
19:16 rurban in file 'src/gen/p-CORE.setting.pir' line 147823
19:16 FROGGS that sounds more like there is something bogus before that line
19:16 rurban It worked a week before YAPC
19:18 colomon masak: I think the biggest problem I'm having with your logic is I see .WHICH as a way of tracking mutable objects, whereas here you want to switch to using it while culturally banning using it in this context with mutable objects.
19:20 lizmat well, maybe we need a clearer spec, then  :-)
19:20 colomon lizmat: I'd argue the specs there say we *have* to pay attention to mutable state.
19:21 colomon or maybe not.
19:21 colomon clearer spec++
19:21 * lizmat is too tired to think straight about this right now
19:28 lizmat m: class A { has $.foo }; A.new(:foo<bar>).gist.say  # makes me think a separate "is cached" for methods is wrong
19:28 camelia rakudo-moar 77024f: OUTPUT«A.new(foo => "bar")␤»
19:29 * lizmat is going to revert
19:30 dalek rakudo/nom: 71eab81 | (Elizabeth Mattijsen)++ | src/core/Method.pm:
19:30 dalek rakudo/nom: Only implement things  when sufficiently awake
19:30 dalek rakudo/nom:
19:30 dalek rakudo/nom: This reverts commit e371c34206800c777fb7e06e11427acbd492a0f5.
19:30 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/71eab815da
19:30 * colomon is not sure he understands lizmat++'s reasoning there
19:30 lizmat masak used the example with class A {} and two A.new's
19:31 TimToady .WHICH should never change on a mutable container, because it's container identity, not contents
19:31 lizmat if there are no attributes, the class A is in fact value based, as you the two objects have identical behaviour
19:31 rurban FROGGS: It's a problem in your 196b4ff55e "implement labeled loops and throwing of labels as payload"
19:32 lizmat TimToady: agree
19:33 kolbe joined #perl6
19:33 colomon it seems to me that "is cached" should indeed be for logically non-mutable things. but … it's not clear me that set of things is the same as the set of things with stable WHICH
19:33 kolbe left #perl6
19:33 TimToady possibly 'is cached' should decontainerize, then it can base itself off of value identities
19:34 FROGGS rurban: ohh... but that was applied way earlier...
19:34 * FROGGS looks
19:34 TimToady much like we can test a value for boolean without losing the object: if $x -> $obj { ... }
19:35 lizmat TimToady: do you mean on methods?  or on subs?  or both?
19:35 TimToady on any parameter that gets a mutable container rather than an imutable object
19:36 TimToady that is, 'is cached' should perhaps try for 'eqv' semantics, snapshotting the current value of containers
19:36 FROGGS rurban: is that a problem? handler.'handle_types'(.CONTROL_LOOP_LAST, .CONTROL_LOOP_NEXT, .CONTROL_LOOP_REDO, 512, 513, 514)
19:36 TimToady to put it another way, 'is cached' should probably pretend everything is passed by value rather than by reference
19:37 lizmat which is in a way what .gist in practice usually does ?
19:37 TimToady .gist should be considered completely unreliable for identity
19:37 TimToady "gist" means a summary
19:38 xenowoolfy joined #perl6
19:38 FROGGS but in a way .gist is also more about values
19:38 TimToady gist is designed to allow information loss, unlike .Str
19:38 lizmat so, more like .perl then :-)
19:38 lizmat assuming .perl can roundtrip with EVAL
19:39 TimToady well, currently .perl loses a heck of a lot of info as well
19:39 lizmat which breaks the roundtripping
19:39 lizmat but if roundtripping would work, would .perl be a good candidate for the cache key ?
19:40 rurban FROGGS: Yes. the problem is the seperation of Q:PIRT blocks for !$labels in MapIter.pm
19:40 rurban I moved the handler to the local block, and now it works
19:40 * moritz still thinks that .WHICH would make the best cache key
19:40 TimToady lizmat: it wouldn't be bad, though I tend to think of eqv semantics as dealing in serializations of a more dense nature
19:41 lizmat then perhaps the serialization of the structure should be the key ?
19:42 TimToady I believe I said something to that effect when it was first being worked on...but maybe I'm confabulating...
19:42 * lizmat will need serialization before long for CURL::Installation anyway...
19:42 TimToady there is the possibility that someone would want to cache based on container identity rather than contents, but it feels like a marginal use case to me
19:43 FROGGS rurban: still weird that it breaks now
19:44 TimToady except for 'self', it should generally be clear from the parameter declaration whether reference or value semantics are intended
19:45 prevost joined #perl6
19:45 rurban FROGGS: Well, it has to bind the used .local pmc handler from the previous block for no good reason
19:45 TimToady so 'is cached' on a method would need either to declare the invocant explicitly as non-mutable, or we just force deep value semantics all the time, and let the people who want object identity write their own caches
19:46 FROGGS rurban: I'll rework that code then
19:46 FROGGS rurban: thanks for hunting it down
19:46 * lizmat tries to grok TimToady's words
19:46 TimToady or, another idea, 'is cached' keeps a separate cache in each object...
19:47 TimToady trouble is that self is naturally mutable
19:47 TimToady we assume it's declared 'is rw' basically
19:47 lizmat which is basically forcing self.WHICH, which I just removed  :-)
19:48 TimToady so either we snapshot the object for eqv semantics (could be very expensive), or we assume they want shallow identity semantics, and each object basically keeps its own cache without considering its own attribute values
19:49 TimToady or we just say 'is cached' only makes sense on functions, not methods
19:49 lizmat unless the class has its own .WHICH (like Bag/Set/Mix)
19:49 lizmat that depends on the values of the attributes
19:49 TimToady yes, those are value types, not object types
19:50 TimToady (the immutable ones)
19:50 rurban FROGGS: https://gist.github.com/rurban/b64f609fdd3c78aeb79c
19:51 rurban FROGGS: But it's still not working
19:52 kurahaupo joined #perl6
19:52 TimToady lizmat: I'd be inclined to agree with you on my %hash = { a => 1 }; except that it's obviously an odd number of values, so it should either dwim or carp.
19:53 lizmat what would be DWIM?
19:53 lizmat flatten ?
19:53 TimToady assuming |
19:54 TimToady if you really want to put a hash in a hash, you can always say key => { a => 1 } explicitly
19:54 lizmat my %h{Any} = ( $%a, $%b )  # would that flatten ?
19:54 TimToady well, a list assigment will erase parens, so it's just like = $%a, $%b
19:55 TimToady but why would you write that if you meant: = $%a => $%b
19:55 lizmat m: my %a = a=>1; my %b = b=>2; my %h = ($%a, $%b); say %h.perl  # so this is wrong?
19:55 camelia rakudo-moar 77024f: OUTPUT«("a" => 1, "b" => 2).hash␤»
19:56 FROGGS seems correct
19:56 TimToady looks correct by the dwim interpretation
19:57 TimToady m: my %a = a=>1; my %b = b=>2; my %h{Any} = %a => %b; say %h.perl
19:57 camelia rakudo-moar 77024f: OUTPUT«Hash[Any,Any].new({"a" => 1} => {"b" => 2})␤»
19:57 lizmat fwiw, that has always been a WAT to me
19:57 TimToady that looks correct too
19:58 TimToady and what you'd write if you really mean to map one hash to another
19:58 lizmat there is no ambiguity there because of the Pair
19:58 FROGGS is that Any,Any for k and v?
19:58 lizmat v is by default Any
19:58 TimToady indeed, so why would anyone write $ ever?
19:59 TimToady unless they were hoping a , would turn into a => magically?
19:59 lizmat m: my %h = <a 1 b 2>; say %h.perl  # magic =>
19:59 camelia rakudo-moar 77024f: OUTPUT«("b" => "2", "a" => "1").hash␤»
19:59 virtualsue joined #perl6
20:00 lizmat so, yes,   :-)
20:01 TimToady I don't think requiring => in the case of %h{Any} is terrible.
20:02 lizmat well, it feels like too much DWIM to me, and a big WAT
20:02 lizmat but if that's the way we're going to do this, then I can undo / change a bunch of tests that are waiting on a decision on this
20:02 TimToady m: my $a = set <a b>; my $b = set <c d>; my %h{Any} = $a, $b; say %h.perl
20:02 camelia rakudo-moar 77024f: OUTPUT«Hash[Any,Any].new(set("a","b") => set("c","d"))␤»
20:03 TimToady okay, sets behave like items, and don't autoflatted, which I think is good
20:04 lizmat m: my $a = bag <a b b>; my $b = bag <c d d>; my %h{Any} = $a, $b; say %h.perl
20:04 camelia rakudo-moar 77024f: OUTPUT«Hash[Any,Any].new(("a"=>1,"b"=>2).Bag => ("c"=>1,"d"=>2).Bag)␤»
20:04 lizmat and for Bags?
20:04 TimToady that also looks correct
20:04 lizmat so why would that not work for hashes like that ?
20:05 lizmat m: my $a = { a => 1 }; my $b = { b => 2 }; my %h{Any} = $a, $b; say %h.perl
20:05 camelia rakudo-moar 77024f: OUTPUT«Hash[Any,Any].new("a" => 1, "b" => 2)␤»
20:05 TimToady because people want to say my %a = %b; and have it work
20:05 lizmat but that would work...
20:06 lizmat because %b would flatten
20:06 jnthn Wow...lot of backlog...
20:06 TimToady well, as I said, we could also warn them on odd number of elements
20:06 lizmat my %a = $b;
20:06 lizmat it does, actually failes
20:06 lizmat *fails
20:07 lizmat m: my %h = 1
20:07 camelia rakudo-moar 77024f: OUTPUT«Odd number of elements found where hash expected␤  in method STORE at src/gen/m-CORE.setting:9423␤  in block  at /tmp/VpApgRDoWF:1␤␤»
20:07 TimToady hmm, is a hash really expected there?
20:07 TimToady seems LTA
20:08 TimToady s/hash/hash initializer/
20:08 anaeem1 joined #perl6
20:08 jnthn Taht'd be better
20:09 dalek rakudo/nom: 5613bea | (Elizabeth Mattijsen)++ | src/core/Exception.pm:
20:09 dalek rakudo/nom: s/hash/hash initializer/
20:09 dalek rakudo/nom: review: https://github.com/rakudo/rakudo/commit/5613bea2c2
20:09 lizmat done
20:10 brrt left #perl6
20:14 steve____ joined #perl6
20:15 xenowoolfy joined #perl6
20:18 itz_ joined #perl6
20:18 lizmat I think the current %c = $%a, $%b is inconsistent with:
20:18 lizmat m: my @a = <a b c>; my @b = <d e f>; my @c = $@a, $@b; say @c.perl
20:18 camelia rakudo-moar 77024f: OUTPUT«Array.new(["a", "b", "c"], ["d", "e", "f"])␤»
20:19 lizmat feels to me $%a, $%b is going to be a WAT that is going to be hard to explain to Perl6 newbies
20:19 lizmat like changing sigils
20:19 lizmat in p5
20:25 FROGGS so you say a $%a should not "flatten" into a pair?
20:25 lizmat indeed...  $ itemizes
20:26 lizmat like with arrays
20:26 lizmat also visually:
20:26 lizmat m: my $a = { a => 1 }; my $b = { b => 2 }; my %h{Any} = $a, $b; say %h.perl
20:26 camelia rakudo-moar 77024f: OUTPUT«Hash[Any,Any].new("b" => 2, "a" => 1)␤»
20:26 lizmat seeing 2 scalars would lead you to expect automatic pairing
20:26 lizmat just because they happen to contain hashes, they flatten
20:27 lizmat m: my $a = [<a b>]; my $b = [<b c>]; my @a = $a, $b; say @a.perl
20:27 camelia rakudo-moar 77024f: OUTPUT«Array.new(["a", "b"], ["b", "c"])␤»
20:27 lizmat it does not flatten in this case
20:28 lizmat m: my $a = [<a 1 b>]; my $b = [<2>]; my %a = $a, $b; say %a.perl
20:28 camelia rakudo-moar 77024f: OUTPUT«("a 1 b" => ["2"]).hash␤»
20:30 lizmat I would argue that itemized hashes shouldn't flatten, just like itemized arrays don't
20:32 jnthn Yes, I'm surprised to see a { ... } or a $a flatten there too
20:33 jnthn I'd lean towards the my %h = { a => 1 }; whining
20:34 lizmat in case this wasn't clear, my stance is +1
20:34 jnthn Yes, I noticed we seem to be agreeing :)
20:34 lizmat decommute from NLPM meeting&
20:35 flussence m: sub infix:<÷>(\a, \b where * != 0) is pure { a / b }; say "whoops"; say 5 ÷ 0; # Is there any way to make things like this explode at compile time?
20:35 camelia rakudo-moar 77024f: OUTPUT«whoops␤Constraint type check failed for parameter 'b'␤  in sub infix:<÷> at /tmp/gM2I3dmYQz:1␤  in block  at /tmp/gM2I3dmYQz:1␤␤»
20:37 FROGGS m: multi infix:<÷>(\a, \b) is pure { a / b }; multi infix:<÷>(\a, 0) is pure { die "ohh my gosh! }; say "whoops"; say 5 ÷ 0;
20:37 camelia rakudo-moar 77024f: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/czsTxVTth7â�¤Two terms in a rowâ�¤at /tmp/czsTxVTth7:1â�¤------> [32m 0) is pure { die "ohh my gosh! }; say "[33mâ��[31mwhoops"; say 5 ÷ 0;[0mâ�¤    expecting any of:â�¤        postfixâ�¤      â€¦Â»
20:37 FROGGS m: multi infix:<÷>(\a, \b) is pure { a / b }; multi infix:<÷>(\a, 0) is pure { die "ohh my gosh!" }; say "whoops"; say 5 ÷ 0;
20:37 camelia rakudo-moar 77024f: OUTPUT«whoops␤ohh my gosh!␤  in sub infix:<÷> at /tmp/CtyEGCJPw0:1␤  in sub infix:<÷> at /tmp/CtyEGCJPw0:1␤  in block  at /tmp/CtyEGCJPw0:1␤␤»
20:38 FROGGS hmmm, no, that won't work as of now
20:39 FROGGS I guess we will know that there is no candidate in near future
20:39 flussence (I'm not crazy for thinking it would work though, right?)
20:39 FROGGS maybe that just falls out of more inlining work?
20:41 jnthn http://cdn.memegenerator.net/instances/500x/51979488.jpg # lizmat++ :)
20:42 jnthn flussence: We don't attmept "where" constraints during compile-time type checking
20:42 jnthn They might do...well...anything
20:42 flussence ahh, ok
20:43 flussence I had this vague idea of wanting code to fail early before any unwanted side effects, never thought about the possibility of that *causing* them...
20:44 vendethiel jnthn: they might, but you might know they won't :-)
20:44 vendethiel that's probably something left for another tool, though
20:46 jnthn vendethiel: Yeah, if we can know they won't... :)
20:46 vendethiel jnthn: well, maybe with said is pure :)
20:50 jeffreykegler joined #perl6
20:51 FROGGS jnthn: https://github.com/jnthn/zavolaj/pull/44
20:54 jnthn FROGGS: Does this only work on Moar so far?
20:54 FROGGS uhh, yes, I forgot
20:54 FROGGS there are others? *cough*
20:55 jnthn Well, my worry is "will it break the NativeCall build on others"...
20:55 jnthn Looking at the patch, I don't think it will
20:55 FROGGS maybe... I'll implement it for the others this night
20:58 dalek nqp/typevaropt: 78f5a7b | jnthn++ | src/vm/moar/QAST/QASTCompilerMAST.nqp:
20:58 dalek nqp/typevaropt: Add typevar scope handling for MoarVM.
20:58 dalek nqp/typevaropt:
20:58 dalek nqp/typevaropt: Uses op that indicates that the value is invariant with regards to the
20:58 dalek nqp/typevaropt: invocant type.
20:58 dalek nqp/typevaropt: review: https://github.com/perl6/nqp/commit/78f5a7b818
20:58 dalek nqp/typevaropt: 39f25d9 | jnthn++ | src/vm/ (2 files):
20:58 dalek nqp/typevaropt: On Parrot and JVM, for now typevar means lexical.
20:58 dalek nqp/typevaropt: review: https://github.com/perl6/nqp/commit/39f25d9831
20:58 dalek nqp/typevaropt: b4b2d6b | jnthn++ | src/NQP/Actions.nqp:
20:58 dalek nqp/typevaropt: Start marking $?CLASS lookup with typevar scope.
20:58 dalek nqp/typevaropt: review: https://github.com/perl6/nqp/commit/b4b2d6b661
20:58 dalek nqp/typevaropt: 04bbf8c | jnthn++ | src/NQP/Actions.nqp:
20:58 dalek nqp/typevaropt: One more place we can use typevar, not lexical.
20:58 dalek nqp/typevaropt:
20:58 dalek nqp/typevaropt: This benefits !cursor_start, meaning that all the attribute accesses
20:58 dalek nqp/typevaropt: in it are now lowered to pointer operations. Le JIT will like this -
20:58 dalek nqp/typevaropt: once it can handle other things inside !cursor_start, anyway.
20:58 dalek nqp/typevaropt: review: https://github.com/perl6/nqp/commit/04bbf8c5d9
21:04 virtualsue joined #perl6
21:16 chenryn joined #perl6
21:17 lichtkind joined #perl6
21:19 lichtkind jnthn: looks like START phaser doesnt work
21:19 masak lichtkind: extraordinary claims require extraordinary evidence. how do you know the START phaser doesn't work? :)
21:20 masak are you observing a failing test, for example?
21:20 FROGGS m: for ^5 { .say; START { say "WAT" } }
21:20 camelia rakudo-moar 77024f: OUTPUT«[31m===[0mSORRY![31m===[0m Error while compiling /tmp/Cms7syirsRâ�¤Undeclared name:â�¤    START used at line 1â�¤â�¤Â»
21:20 lichtkind masak because i tested it
21:20 jnthn Isn't that spelt "once" these days?
21:20 FROGGS m: for ^5 { .say; once { say "WAT" } }
21:20 camelia rakudo-moar 77024f: OUTPUT«0␤WAT␤1␤2␤3␤4␤»
21:20 masak 'git grep START' on the spec turns up nothing.
21:21 lichtkind oh so its removed
21:21 masak ah, because fca7f5a90384693468e8df4698fedb5e5995c78e renamed it to 'once'.
21:21 lichtkind not ONCE ?
21:21 masak lichtkind: renamed, and made into a statement prefix.
21:21 masak no, 'once'.
21:21 masak because it's not a phaser, for some reason.
21:21 jnthn It's not really a phaser like the others
21:21 masak I think I see why.
21:21 jnthn Because it executes in the normal flow of control
21:21 masak it's not about moving the execution in time.
21:21 masak right.
21:21 masak makes sense.
21:22 masak and "START" for that was a really bad name, in retrospect :)
21:22 lichtkind allright so i have to update tablets
21:27 masak lichtkind: sorry to inconvenience your tables :P
21:27 masak tablets*
21:28 masak lichtkind: if you're interested in running updates to Perl 6 features, they can be found here: https://github.com/perl6/specs/commits/master
21:31 jeffreykegler left #perl6
21:35 lichtkind i know just was away a bit
21:39 dalek tablets: 95f94bc | (Herbert Breunung)++ | docs/appendix- (3 files):
21:39 dalek tablets: phaser START gone and addedspurt to highlights
21:39 dalek tablets: review: https://github.com/perl6/tablets/commit/95f94bca2c
21:39 guru joined #perl6
21:40 jnthn spurting is a highlight? :)
21:40 lichtkind jnthn: yes ther is a section of this 2 way io, there was prompt and slurp now added spurt
21:40 lichtkind sound gay i know
21:41 lichtkind jnthn: are modules now running on jvm port?
21:45 FROGGS lichtkind: many of them yes, but there are a few that do not and that are deps for others, so jvm-star is not there yet
21:52 lichtkind FROGGS: and not in july either?
21:52 FROGGS lichtkind: I can't tell because I don't know how hard these problems are
21:52 FROGGS these might be just a bit too hard for me
21:53 psch FROGGS: is there a list somewhere?
21:54 psch (not that i think that FROGGS++ not being smart enough gives me high chances... :)
21:55 FROGGS psch: https://github.com/coke/rakudo-star-daily/blob/master/log/jvm-test-modules.log
21:55 FROGGS psch: you have to keep in mind that I'm not even a good dev :o)
21:55 FROGGS I just spend a lot of time here
22:10 ivanshmakov joined #perl6
22:17 chenryn joined #perl6
22:20 donaldh joined #perl6
22:22 masak 'night, #perl6
22:23 FROGGS night masak
22:27 zengargoyle is there a way to call whatever would have happened if you didn't have a BUILD submethod from within a BUILD submethod?
22:27 FROGGS zengargoyle: callsame?
22:28 zengargoyle if i read things right, bless only assigns new arguments to their public accessors if there is no BUILD
22:29 zengargoyle if you provide a BUILD, it reads like you have to handle *all* of your intitializaion
22:30 FROGGS correct
22:30 FROGGS or you do your extra stutt and then call callsame, or was it nextsame?
22:30 zengargoyle i though callsame/nextsame looked for a method of the same name...
22:31 FROGGS well, yes
22:31 FROGGS there is a method BUILD in Mu
22:31 zengargoyle Mu BUILD would already have been called.
22:31 zengargoyle BUILDALL goes from Mu down to your class.
22:32 FROGGS not if you provide your own BUILD method
22:32 FROGGS err yes
22:32 FROGGS well, no, what I said
22:32 zengargoyle BUILDALL walks all subclasses in reverse method resolution order (i.e. from Mu to most derived classes)
22:33 zengargoyle it seems bless() does like: if BUILD call BUILD else do magic auto assignment stuff
22:34 jnthn Well, it's BUILDALL that executes those things, not bless
22:34 zengargoyle it's bless that calls BUILDALL
22:35 zengargoyle oh, maybe not.  maybe it's Mu.new that does bless then BUILDALL
22:36 zengargoyle Mu.new calls method bless on its invocant, passing along all the named arguments. bless creates the new object, and then calls method BUILDALL on it. BUILDALL walks all subclasses in reverse method resolution order (i.e. from Mu to most derived classes), and in each class checks for existence of a method named BUILD. If it exists, it is called, again passing all named arguments from method new to it. If not, the public attri
22:36 cooper_ joined #perl6
22:37 zengargoyle i wish i could just fiddle with one or two arguments in a BUILD and let something else handle the rest that i don'n need to fiddle with.
22:37 zengargoyle if i have a BUILD, i have to change it if i add another attribute
22:39 rurban1 joined #perl6
22:39 lichtkind thanks FROGGS and all here
22:39 lichtkind good night
22:40 FROGGS gnight lichtkind
22:40 lichtkind :)
22:44 psch m: class A { has $.foo; has $.bar; submethod BUILD(:$!foo, :$bar is copy) { $!bar = $bar + 2; } }; my A $a .= new(:foo(1), :bar(2)); $a.foo.say; $a.bar.say
22:44 camelia rakudo-moar 77024f: OUTPUT«1␤4␤»
22:44 psch zengargoyle: maybe i misunderstood what you want to do, but that seems to do it? i.e. bar can be changed in BUILD, foo doesn't have to
22:45 psch of course you have to update the signature; maybe that's what you meant
22:46 lizmat joined #perl6
22:47 zengargoyle yes, you have to update in two places. :)
22:49 FROGGS rurban: I have a patch that builds: https://gist.github.com/FROGGS/7cf3c95f8c566a6aa545
22:50 FROGGS rurban: I'll need for spectests though to be sure, so I'll probably apply right after $sleep
22:51 FROGGS wow, a lot of fails already /o\
22:53 FROGGS I'll bisect this tomorrow... that makes no sense this way
23:10 jnap1 joined #perl6
23:14 rurban1 joined #perl6
23:17 chenryn joined #perl6
23:20 rurban1 left #perl6
23:32 ren1us joined #perl6

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

Perl 6 | Reference Documentation | Rakudo