Camelia, the Perl 6 bug

IRC log for #moe, 2013-04-10

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

All times shown according to UTC.

Time Nick Message
00:46 jnap joined #moe
01:00 gizmomathboy joined #moe
05:44 hiratara joined #moe
05:51 melo joined #moe
06:42 tobyink joined #moe
12:57 isBEKaml joined #moe
13:10 bluescreen joined #moe
13:17 jnap joined #moe
14:23 bluescreen_ joined #moe
14:40 PerlJam joined #moe
14:49 moe [moe] prakashk created prakashk/array-methods (+2 new commits): http://git.io/32xIJw
14:49 moe moe/prakashk/array-methods 947252c Prakash Kailasa: array flatten method and repeat operator ("x")
14:49 moe moe/prakashk/array-methods f2f920d Prakash Kailasa: first few of the 99 Problems list (from http://aperiodic.net/phil/scala/s-99/)
14:59 moe [moe] stevan pushed 1 new commit to master: http://git.io/FuuP7g
14:59 moe moe/master e794125 Stevan Little: Merge pull request #81 from MoeOrganization/prakashk/array-methods...
15:03 tobyink joined #moe
15:27 isBEKaml joined #moe
15:47 gizmomathboy joined #moe
16:00 jasonmay mmm github issue spring cleaning
16:01 stevan yup
16:02 stevan just added submethods
16:02 moe [moe] stevan pushed 5 new commits to master: http://git.io/utiQYA
16:02 moe moe/master 3510829 Stevan Little: add in sub methods
16:02 moe moe/master 9154548 Stevan Little: I love it when things line up
16:02 moe moe/master ac57d92 Stevan Little: simple Tree module (testing sub methods)
16:02 stevan will convert the BUILD and DEMOLISH over to them sometime soon
16:56 leedo oh neat, so arrays won't auto-flatten when passed as an argument?
17:27 stevan leedo: no, they are references, ala Perl 6
17:27 jnap joined #moe
17:27 stevan though I kind of want a way for an array to say "flatten me" when it is passed in
17:28 stevan but I am not worrying about it yet
17:28 moe [moe] stevan pushed 1 new commit to master: http://git.io/oOX_cQ
17:28 moe moe/master 43b732f Stevan Little: adding in a simple sleep()
18:06 leedo javascript has .apply which takes an args array and flattens
18:45 stevan leedo: so do we -> https://github.com/MoeOrganization/m​oe/blob/master/src/main/scala/org/mo​e/runtime/builtins/CodeClass.scala
18:45 stevan actually I think we might have it backwards
18:46 stevan nope, we have it the same as JS -> https://github.com/MoeOrganization/​moe/blob/master/src/test/scala/org/​moe/parser/AnonCodeTestSuite.scala
18:47 leedo ah cool :)
19:08 tobyink joined #moe
19:09 sahadev stevan: .apply doesn't work on named subs?
19:09 sahadev moe> sub add($x, $y) { $x + $y } add.apply([1, 2])
19:09 sahadev org.moe.runtime.MoeErrors$ParserInputError: [1.32] error: `=>' expected but `.' found
19:10 * sartak is impressed with moe's progres
19:10 jasonmay stevan++
19:10 jasonmay are subs first-class?
19:12 mattp sartak: a lot can be accomplished when you forget decades of backcompat it seems :)
19:13 stevan sahadev: yeah, so I was thinking about that
19:13 stevan I would thing that should be
19:13 stevan sub add($x, $y) { $x + $y }; &add.apply([1, 2])
19:13 stevan instead
19:14 stevan and we can use the & sigil to lazily attach the Code class to any sub
19:14 sahadev tried that too
19:14 stevan yeah it doesnt work yet :)
19:14 sahadev different error
19:14 * stevan is working on my ($x, $y) = (1, 2) right now
19:14 jasonmay is that the subref sigil?
19:14 stevan jasonmay: its the code sigil
19:14 stevan same as p5
19:14 jasonmay gotcha
19:17 leedo stevan: any thoughts on if/how ($x, $y) = @a could work?
19:17 leedo ($x, $y) = *@a ?
19:18 doy |@a would be more perl6-ish
19:18 stevan leedo: yes, it would throw an error ;)
19:18 stevan yeah I dont like the | prefix
19:18 stevan I would sooner support
19:18 jasonmay I like *@a
19:18 stevan my [$x, $y] = @a;
19:19 jasonmay and that
19:19 stevan which is the destructuring syntax that p6 has
19:19 phaylon destruct++
19:19 doy are you just not planning on having flattening at all?
19:19 jasonmay semi off topic, scala has some good destructuring features
19:20 stevan doy: i dont think so, if I can avoid it
19:20 stevan I mean, I really like it too, but I can't see how it would work if everything is a ref
19:21 stevan jasonmay: yes it does
19:21 stevan https://gist.github.com/st​evan/15aebbbb36ffc014d952
19:21 doy yeah, it is incredibly complicated in perl 6
19:21 stevan multi var declare works
19:21 stevan now to do multi-assignment
19:21 stevan doy: yeah, I want to avoid complexity :)
19:21 doy i don't think that having an explicit flatten operator would be bad though
19:23 doy it's implicit flattening that is complicated, when combined with making everything into a reference
19:24 stevan yeah, but what would it flatten into?
19:24 stevan I dont expose a List type
19:25 doy it doesn't need to be exposed
19:25 stevan yeah perhaps
19:25 * stevan will ponder it
19:25 stevan doy: also, patches welcome ;)
19:28 masak fwiw, I don't think 'my [$x, $y] = @a' would work in Perl 6.
19:28 masak you need for the lhs to be a signature, and you need binding, for it to be destructuring.
19:29 hobbs list($x, $y) = array($y, $z);
19:29 masak but this maybe just adds to the heap of indicications that it's complicated in Perl 6 ;)
19:29 leedo i read this channel to escape PHP, please :P
19:29 jasonmay hah
19:32 jasonmay my [$w, {$x: [$y, undef, $z]}] = @data;
19:32 jasonmay would moe's destructuring support that?
19:33 doy don't see why not
19:34 leedo coffeescript supports similar http://coffeescript.org/#destructuring
19:44 moe [moe] stevan pushed 1 new commit to master: http://git.io/VXSFFg
19:44 moe moe/master 18c8f04 Stevan Little: multi-assignment
19:54 stevan sahadev: sub add($x, $y) { $x + $y }; &add.apply([1, 2]) now works
19:54 stevan as does sub add($x, $y) { $x + $y }; &add.(1, 2)
19:55 moe [moe] stevan pushed 1 new commit to master: http://git.io/caFnbg
19:55 moe moe/master 30ce065 Stevan Little: getting a reference to a named sub now works
19:55 sahadev cool. stevan++
19:56 sahadev stevan: in multi-assignment, is the rhs list completely evaluated first before assigning to the lhs list? or, is each individual element evaluated just before it is assigned to the correspoinding var on the lhs?
19:57 sahadev moe> my ($x, $y) = (1, 2); ($x, $y) = ($y, $x); [$x, $y]
19:57 stevan it is just zipped together as multiple assignment nodes and the result wrapped in a StatementsNode
19:57 sahadev [2, 2]
19:57 stevan hmm, interesting
19:58 stevan whoops
19:58 * stevan forgot about the swap case
19:59 stevan I thought I was clever for unrolling it like I did
20:00 stevan I guess we actually need some AST nodes for this then
20:00 stevan sahadev++ # good catch
20:00 doy you should be able to still use that unrolling for the case where there's no overlap
20:00 stevan right
20:00 stevan but why bother if we still have to support overlap
20:01 stevan we can likely be more efficient if we dont unroll
20:01 doy well, not needing temporaries is faster, and it will be the overwhelmingly more common case
20:01 stevan actually, just assignment needs this, declaration won't encounter it
20:01 stevan my ($x, $y) = ($y, $x); is never gonna work anyway
20:02 doy sure
20:19 gizmomathboy joined #moe
20:28 stevan sahadev: my ($x, $y) = (1, 2); ($x, $y) = ($y, $x); [$x, $y] is fixed now
20:28 moe [moe] stevan pushed 1 new commit to master: http://git.io/7bdZwg
20:28 moe moe/master 1911507 Stevan Little: multi-assignment swaps now work
20:36 sahadev excellent. stevan++
21:32 jnap joined #moe

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