Perl 6 - the future is here, just unevenly distributed

IRC log for #perl6book, 2009-10-19

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

All times shown according to UTC.

Time Nick Message
02:00 p6eval joined #perl6book
02:00 p6eval joined #perl6book
03:20 pmichaud joined #perl6book
04:43 dalek joined #perl6book
08:44 dalek book: 4fe7f7b | moritz++ | src/multi-dispatch.pod:
08:44 dalek book: [MMD] give the proto the right arity
08:44 dalek book: review: http://github.com/perl6/book/commit/4fe7f7bd9c6f3f33f32c4f9d88e9f30a0997ddc8
08:47 masak joined #perl6book
11:53 dalek book: 507c553 | masak++ | src/classes-and-objects.pod:
11:53 dalek book: [OO] dot is a twigil, not a sigil
11:53 dalek book: review: http://github.com/perl6/book/commit/507c553f7c3d9361dddfdf00fd108d4c51036057
11:56 pmurias joined #perl6book
12:00 jnthn masak: ooh, nice catch.
12:00 masak the dot is a cute sigil, but in this context I think we'll stick with 'twigil' :P
12:00 jnthn :-)
12:01 moritz_ actually it's even misleading to call the dot a twigil here
12:01 moritz_ in some sense
12:01 moritz_ but I guess we can get away with it
12:01 masak the dot has that ambiguity over it.
12:01 moritz_ oh, and (peer review)++
12:02 jnthn It's fair enough in the declaration, which is what this is.
12:02 masak I think it's a lie worth risking.
12:02 jnthn In a usage, I agree it's a tougher call.
12:02 jnthn But in a declaration, it really isn't anything much deeper.
12:02 moritz_ s/tougher/method/ :-)
12:02 pmurias should the book describe writing a custom constructor?
12:02 jnthn :-P
12:02 masak I think calling it a twigil across the board helps understanding.
12:02 jnthn pmurias: It does.
12:02 pmurias it's an advanced and not very usefull topic
12:02 pmurias jnthn: i'm proposing it shouldn't
12:02 jnthn ...not very useful?
12:03 pmurias yes
12:03 jnthn Not sure I'd agree with that.
12:03 masak let me respectfully disagree too.
12:03 moritz_ it is something you might want to do in about half or a third of your classes
12:03 pmurias writing a BUILD method is the thing you should do
12:03 jnthn No, they fill different niches.
12:04 jnthn BUILD methods are for doing initialization tasks.
12:04 moritz_ and since masak++ has probably written the most real-world Perl 6 code out there, I tend to agree with him
12:04 jnthn A custom constructor is for providing an alternative interface to object instantiation.
12:05 jnthn I'd say it'd be nice to have an example of a BUILD method too, to show this.
12:06 jnthn And try and show when to use which one of them.
12:06 moritz_ but probably not in the same class
12:06 jnthn No
12:06 jnthn I don't think it'd fit well into this example.
12:06 jnthn masak: I'm a little bothered about the typed slurpy param.
12:07 moritz_ if we dwell deeply in object construction we could use something like http://perlgeek.de/images/creation.png
12:07 jnthn I think pmichaud speculated that those maybe could not work.
12:07 masak jnthn: ok. I meant to discuss that with you.
12:07 jnthn The thing is that your life then gets awkward if you want a typed array.
12:07 jnthn I'm still trying to decide what I think about typed slurpies.
12:07 moritz_ I agree, it's safer to leave out the type check
12:08 jnthn My current feeling is, let's get laziness in first, and see how that plays with slurpies, and then try and make a call on this one.
12:08 masak jnthn: nod.
12:08 moritz_ because typed arrays don't just require all elements to be of the declared type, but they need to be actually declared with that type
12:08 pmurias moritz_: when have you last seen a custom new in a Moose using program?
12:08 moritz_ and you don't do that in the example
12:08 masak jnthn: I also saw that you preferred a scalar as an argument to Task.push rather than an array.
12:08 jnthn The problem is that if something untyped and infinite is passed in that, in list context, will expand, then we run into issues.
12:09 moritz_ pmurias: I haven't really seen any moose programs at all
12:09 jnthn masak: I thought having to make an array to call the method was a tad odd.
12:09 jnthn masak: But my plan was actually to make it a multi-method later on.
12:09 masak jnthn: I meant to have a slurpy array there too.
12:09 jnthn masak: Not in the top example.
12:10 jnthn But to show how you could provide different ways of adding a new task through some multis.
12:10 jnthn As a kind of way we could extend the example.
12:10 masak jnthn: but right now we don't call that .push method anywhere, so I can argue either way about it. :)
12:10 * moritz_ would reallly love to see 'has Task @!dependencies handles (push => 'add-dependency')
12:10 jnthn :-)
12:10 masak moritz_: aye. that'd be really nice.
12:10 jnthn Yeah, we need to, erm, get a chunk of the spec ripped out first.
12:11 masak moritz_: feels like one of those things one could show as 'variants'.
12:11 moritz_ masak: aye
12:11 moritz_ let's convince TimToady when he shows up next :-)
12:11 masak I haven't said it yet, but showing how Task could be made to do threading would be a great variant.
12:11 jnthn I was going to do number-of-dependencies forwarding to elems.
12:11 jnthn masak: I was considering doing a subclass Task::ParalellDependencies
12:11 jnthn To show inheritance and then >>.
12:12 masak jnthn: the naming is a bit enterprisey, but otherwise ACK. :)
12:14 jnthn well, ParallelTask felt wrong
12:15 jnthn Because it's not the task itself that's done in a parallel way, but its dependencies.
12:15 jnthn I don't like Task::ParalellDependencies much either, fwiw.
12:15 jnthn I just didn't think of a better one yet that captures what I think the functionality is.
12:17 masak Task::Parallel?
12:17 moritz_ the task isn't parallel
12:20 masak that is right, but the naming scheme doesn't necessarily indicate that it is.
12:20 masak in Pod::Parser, it is not indicated that Pod is a parser.
12:21 masak in Test::Harness, it is not indicated that the Test is a harness.
12:21 masak etc.
12:23 jnthn True.
12:24 jnthn I tend to suck at naming things anyway. :-)
12:27 moritz_ "When he awoke, Taborlin the Great found himself locked in a high tower. They had taken his sword and stripped him of his tools: key, coin, and candle were all gone. [...] But Taborlin knew the names of all things, and so all things were his to command. He said to the stone: 'Break!' and the stone broke. The wall tore like a piece of paper, and through that hole Taborlin could see the sky and breathe the sweet spring air. He stepped to the edge, looked dow
12:27 moritz_ oh, that was probably too long
12:28 moritz_ looked down, and without a second  thought he stepped out into the open air. So Taborlin fell,  but he did not despair. For he knew the name of the wind, and  so the wind obeyed him. He spoke to the wind and it cradled  and caressed him. It bore him to the ground as gently as a  puff of thistledown and set him on his feet softly as a  mother's kiss."
12:28 moritz_ from "The Name of the Wind"
12:28 moritz_ somehow that came to my mind when I thought about naming things :-)
12:29 masak very nice.
12:29 jnthn d00d he has 1337 skillz!
12:30 masak why does he even have a sword and tools in the first place? :P
12:30 jnthn A coin is a tool? :-)
12:30 moritz_ masak: because he's a learned man, and knows about style :-)
12:31 masak :)
12:31 jnthn .oO( next time airport security ask why the sword, say I know about style )
12:31 moritz_ and reference "Kill Bill Vol. 1"
12:31 jnthn ;-)
12:31 masak yeah, airport security are notoriously touchy about swords.
12:32 moritz_ did you try it?
12:32 masak not as such, no.
12:32 carlin http://idle.slashdot.org/article.pl?sid=09/07/30/0435250
12:32 jnthn yeah, I did once...they actually didn't care much about the sword though.
12:32 jnthn But man were they pissed about the bottle of water!
12:32 masak :D
12:33 jnthn oh gee...what on _earth_ is going on in .wrap :-/
12:33 moritz_ heh, didn't we have an xkcd about that one? :-)
12:33 moritz_ erm, today?
12:33 jnthn moritz_: orly?
12:33 jnthn oh, wow!
12:33 jnthn timely!
12:34 moritz_ anyway, "The Name of the Wind" is a rather nice read if you like fantasy books
12:34 moritz_ too bad the sequel isn't out yet
17:27 dalek joined #perl6book
21:45 jnthn aww. poor dalek
21:46 moritz_ jnthn: was that you? ;-)
21:46 jnthn No!
21:46 jnthn I feel bad 'cus I'm about to cause the same to happen again though!
21:47 moritz_ well, it's going to restart and autorejoin
21:49 dalek joined #perl6book

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