Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6book, 2009-11-27

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

All times shown according to UTC.

Time Nick Message
00:26 eternaleye joined #perl6book
03:36 moritz__ joined #perl6book
03:47 TimToady joined #perl6book
04:47 eternaleye joined #perl6book
04:53 snarkyboojum joined #perl6book
05:42 eternaleye Hey, I have a question. In the multis section, there's multi to-json($d where undef) - should I change that to match the spec? If so, 'where Mu' or 'where *.notdef' ?
08:21 japhb joined #perl6book
10:13 japhb joined #perl6book
10:19 masak joined #perl6book
14:20 japhb joined #perl6book
15:33 dalek joined #perl6book
15:33 TimToady joined #perl6book
15:33 japhb joined #perl6book
15:33 moritz_ joined #perl6book
15:33 hicx174 joined #perl6book
15:33 pmichaud joined #perl6book
15:33 carlin joined #perl6book
15:34 snarkyboojum joined #perl6book
15:37 TimToady joined #perl6book
16:36 snearch joined #perl6book
16:46 snearch_ joined #perl6book
19:25 masak joined #perl6book
19:52 eternaleye joined #perl6book
20:03 eternaleye jnthn: Did you see my question about the multis section?
20:04 masak oh, oh! have we written anything about subtypes yet?
20:05 masak because I have some (loose) ideas.
20:20 * jnthn back from teh noms
20:20 jnthn eternaleye: where *.notdef
20:20 jnthn masak: Let 'em loose!
20:20 eternaleye Cool
20:24 masak jnthn: well, I have one actual use case for subtypes: an upcoming refactor of Druid.
20:24 masak jnthn: istead of checking for move validity inside the routine that makes the move, I'll just define subtypes of valid moves, and then dispatch on those.
20:25 masak jnthn: I think it's a brilliant use case, but I somehow want to factor Druid out of it for the book. :)
20:26 jnthn masak: That is just the kinda thing subtypes were designed for, yeah.
20:27 masak jnthn: yeah. for some reason, the full power only struck me a few days ago.
20:27 jnthn masak: Challenge is just finding a way to use it in a much smaller example.
20:27 masak exactly.
20:27 jnthn I want to write up a first cut of my ideas for the roles thingy too.
20:27 masak maybe subtypes of poker hands could work...
20:27 jnthn I've been a bit take up today by being asked to jump in and do some urgent code review at $other-job though
20:28 jnthn ooh, yes.
20:28 jnthn If you understand poker enough.
20:28 jnthn Or somebody does.
20:28 * jnthn totally doesn't.
20:28 masak there's always Wikipedia. :)
20:28 jnthn :-)
20:28 masak and knowledgeable people all around us.
20:29 jnthn Aye.
20:29 jnthn I don't know enough about poker to really know quite how well it'd work. :-)
20:30 jnthn But it's worth asking around, for sure.
20:30 jnthn .oO( use Perl 6 to aid your gambling! )
20:33 masak I'll try and write a poker hand analyzer and see what falls out of it.
20:33 jnthn Cool!
20:33 jnthn masak++
20:33 jnthn Let us know if you win any money with it. ;-)
20:34 masak one step at a time :)
20:36 * jnthn bets on masak coming up with something cool
20:37 eternaleye joined #perl6book
20:37 masak jnthn: if by 'something cool', you mean rakudobugs, then sure. :P
20:37 jnthn oh buggar
20:37 jnthn ;-)
20:42 masak is there a method on enum types which says 'give me all the values'?
20:42 masak I don't mind it being a metaclass method, if that helps.
20:42 jnthn .pick(*)
20:42 jnthn maybe?
20:43 masak but that gives me the values out of order...
20:43 masak and it gives me the integer values, not the names.
20:43 masak hm, maybe I'll take this to #perl6...
20:43 jnthn I thought it gave you the enum values?
20:43 jnthn So you could .pick(*)>>.name?
20:43 * masak cheks
20:44 masak oh, it does.
20:44 masak but it still botches the order.
20:44 jnthn Yeah
20:44 jnthn I don't know of an answer to that.
20:45 masak .pick(*, :nonrandom) # :)
20:45 jnthn lol
21:21 vamped joined #perl6book
21:23 vamped In the November release of book, chapter 2, exercise 1 states:
21:23 vamped my @sorted = B<%sets.keys>.sort({ %sets{$_} }).sort({ %games{$_} }).reverse;
21:24 vamped I think something is not being translated correctly: the B<...>
21:24 vamped anyone know what it should say?
21:24 jnthn I'm not sure the B<...> should appear in the output for one...
21:24 masak probably without the B<>
21:25 vamped if I remove it, I get errors
21:25 vamped Multiple Dispatch: No suitable candidate found for 'cmp', with signature 'PP->I'
21:25 vamped in Main (file <unknown>, line <unknown>)
21:26 vamped %set.keys should turn into an array, to be sorted. I think it needs to be offset somehow from the .sort
21:29 jnthn Hmm...I suspect that may be a bug somewhere in Rakudo rather than a problem with the code.
21:33 vamped ... you were both right at first. just remove the B<> and it works.
21:33 masak that error shows up when the things being sorted are not all of the same kind.
21:33 vamped initial error message came from error in input file. my bad.
21:34 vamped problem solved. and by the way -- thanks all for an awesome book -- those who are contributing.
21:34 masak vamped: which includes you, now! :) vamped++
21:44 hicx174 joined #perl6book

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