--- Log opened Wed May 23 00:00:42 2007 |
01:34 | | Takyoji [~Takyoji@Nightstar-25812.dhcp.roch.mn.charter.com] has quit [Quit: Leaving] |
01:41 | | Derakon[AFK] is now known as Derakon |
01:52 | | Serah [~Z@87.72.36.ns-26407] has quit [Ping Timeout] |
01:55 | | Serah [~Z@87.72.36.ns-26407] has joined #Code |
01:55 | | mode/#code [+o Serah] by ChanServ |
01:58 | | Netsplit DeepThought.NY.US.Nightstar.Net <-> Troika.TX.US.Nightstar.Net quits: @Pi, ReivSLEP, Derakon, @AnnoDomini, @jerith, GeekSoldier_, @Chalain |
01:59 | | Netsplit over, joins: Chalain, Derakon |
01:59 | | mode/#code [+o Chalain] by ChanServ |
01:59 | | Netsplit over, joins: ReivSLEP |
01:59 | | Netsplit over, joins: Pi, GeekSoldier_ |
01:59 | | mode/#code [+o Derakon] by ChanServ |
01:59 | | Netsplit over, joins: jerith, AnnoDomini |
01:59 | | mode/#code [+o Pi] by ChanServ |
01:59 | | mode/#code [+o jerith] by ChanServ |
01:59 | | mode/#code [+o AnnoDomini] by ChanServ |
01:59 | | AnnoDomini [~farkoff@Nightstar-29660.neoplus.adsl.tpnet.pl] has quit [Ping Timeout] |
01:59 | | Pi [~sysop@Nightstar-6875.hsd1.wa.comcast.net] has quit [Ping Timeout] |
02:00 | | GeekSoldier_ [~Rob@Nightstar-6745.pools.arcor-ip.net] has quit [Ping Timeout] |
02:00 | | GeekSoldier_ [~Rob@Nightstar-6745.pools.arcor-ip.net] has joined #code |
02:01 | | AnnoDomini [~farkoff@Nightstar-29660.neoplus.adsl.tpnet.pl] has joined #Code |
02:01 | | mode/#code [+o AnnoDomini] by ChanServ |
02:01 | | Pi [~sysop@Nightstar-6875.hsd1.wa.comcast.net] has joined #code |
02:01 | | mode/#code [+o Pi] by ChanServ |
02:04 | | gnolam [lenin@Nightstar-13557.8.5.253.se.wasadata.net] has quit [Quit: Z?] |
02:15 | | ReivSLEP is now known as Reiver |
02:18 | | Derakon is now known as Derakon[coding] |
02:23 | <@Derakon[coding]> | See, I don't like collision detection work because it's just implementing a bunch of geometry. |
02:23 | <@Derakon[coding]> | I feel like I'm doing highschool geometry again. |
02:23 | <@Vornicus> | Heh |
02:24 | <@Derakon[coding]> | "Given two line segments A and B and a vector v, determine the constant c such that A + cv does not intersect B." |
02:24 | <@Derakon[coding]> | I mean, I can *do* it. I just don't enjoy it. |
02:24 | <@Derakon[coding]> | Er, minimal-magnitude constant c. ¬.¬ |
02:26 | <@Derakon[coding]> | My approach here is to determine how far A has to go along B and multiply that by the component of v in the direction of B. |
02:29 | | Vornicus is now known as IanMusgrave |
02:30 | <@Derakon[coding]> | Sound reasonable? |
02:30 | <@Derakon[coding]> | Or do you not want to do geometry either? |
02:33 | <@Derakon[coding]> | ...ergh, actually, this won't always work, since I'm assuming A exits B before B exits A (i.e. asymmetrical logic). |
02:38 | <@Derakon[coding]> | Okay, new plan - draw lines through A and B along vel. At least two of them will intersect the other line. The one with the shortest magnitude along v indicates the "exit point"; its length divided by v's magnitude gets us our answer. I think. |
02:56 | | Chalcedon is now known as ChalcyAFK |
03:01 | <@Derakon[coding]> | Argh...stupid Lua reflexes. I keep typing "then" after my if statements even though I'm writing C++. |
03:10 | <@ToxicFrog|W`rkn> | Heh. |
03:10 | <@ToxicFrog|W`rkn> | I keep trying to use dynamically generated classes. |
03:45 | <@Serah> | I keep trying to use Get.Pizza. |
03:47 | | * IanMusgrave keeps forgetting stuff like semicolons and braces. |
03:48 | | * IanMusgrave has been working too long in languages that don't need them. |
03:51 | | ToxicFrog|W`rkn is now known as ToxicFrog |
03:52 | <@ToxicFrog> | Joy: there is a JIT compiler (to machine code) for Lua that is v. fast. |
03:52 | <@ToxicFrog> | Sorrow: it's 80x86 only. |
04:21 | | * ChalcyAFK offers round various thwapping instruments and the opportunity to assist me in beating the hell out of C# |
04:23 | | * IanMusgrave accepts a thwapping instrument. |
04:24 | <@ChalcyAFK> | this assignment is needlessly complicated |
04:24 | <@ChalcyAFK> | in a rather extreme kind of way. |
04:24 | <@ChalcyAFK> | It's kinda like a dictionary, except I have to use a thing called an array list. With objects. |
04:25 | <@ChalcyAFK> | or maybe I'm confused again. You never know |
04:51 | | ChalcyAFK is now known as ChalcyAssignment |
05:00 | | Derakon[coding] is now known as Derakon |
05:02 | | S|DE-K|CK [~PScript@203.173.171.ns-11546] has joined #Code |
05:02 | < S|DE-K|CK> | hey room |
05:02 | | S|DE-K|CK [~PScript@203.173.171.ns-11546] has left #Code [] |
05:04 | | Derakon is now known as Derakon[ReBoot] |
05:13 | <@Derakon[ReBoot]> | I wish I knew why my SAT algorithm is claiming that two parallel lines are the ones intersecting. >.< |
05:19 | <@Derakon[ReBoot]> | ...ahh, right. That's because SAT doesn't actually tell you which lines are intersecting at all. >.< |
05:19 | <@Derakon[ReBoot]> | Bah. |
05:47 | <@Derakon[ReBoot]> | Ahh, the Nullzilla episode. So silly. |
05:59 | | IanMusgrave is now known as Vornicus |
06:41 | | GeekSoldier_ is now known as GeekSoldier |
06:46 | | Derakon[ReBoot] is now known as Derakon[AFK] |
08:05 | < MyCatVerbs> | Wow. Prolog feels... surprisingly natural, for looking up relations on hierarchial data. |
08:06 | | You're now known as TheWatcher |
08:53 | | KBot [~karma.bot@Nightstar-29123.neoplus.adsl.tpnet.pl] has joined #Code |
08:54 | | KarmaBot [~karma.bot@Nightstar-29660.neoplus.adsl.tpnet.pl] has quit [Ping Timeout] |
08:54 | | AnnoDomini [~farkoff@Nightstar-29660.neoplus.adsl.tpnet.pl] has quit [Ping Timeout] |
08:54 | | KBot is now known as KarmaBot |
08:59 | | gnolam [lenin@Nightstar-13557.8.5.253.se.wasadata.net] has joined #Code |
08:59 | | mode/#code [+o gnolam] by ChanServ |
09:00 | | AnnoDomini [~farkoff@Nightstar-29123.neoplus.adsl.tpnet.pl] has joined #Code |
09:00 | | mode/#code [+o AnnoDomini] by ChanServ |
09:03 | | MahalWork is now known as Mahal |
09:43 | <@AnnoDomini> | Does anyone have an idea of how to increase the frequency of a clock input using logic circuits? |
09:44 | <@Vornicus> | ...I don't know if that's actually possible without some Scary Delay Tricks. |
09:44 | <@AnnoDomini> | I know it's possible to make a clock of my own with a few capacitors, but that's a bit meh. |
09:45 | <@Vornicus> | I really don't know if it can be done with raw logic. |
09:45 | <@Vornicus> | I don't think so. |
09:45 | <@AnnoDomini> | Hrm. |
09:57 | < Reiver> | What are you doing? |
10:00 | <@AnnoDomini> | An automatic watering system in case of drought. |
10:06 | <@gnolam> | Aren't there multiplier chips for this specific purpose? |
10:06 | <@Vornicus> | ...I wonder how those do it. |
10:08 | <@AnnoDomini> | Could you point me at such chips? I see only frequency dividers on the 7400 series list. |
10:09 | <@AnnoDomini> | Vornicus: I gather it has something to do with upward and downward inclines. Instead of one specific, maybe the flip-flops in there change on both? |
10:10 | <@gnolam> | I can see if I can Google up something. |
10:11 | <@gnolam> | I'm positive they exist, since we /did/ use one in our digcon project. :) |
10:12 | <@gnolam> | AnnoDomini: http://en.wikipedia.org/wiki/Phase-locked_loop#Clock_generation |
10:13 | <@AnnoDomini> | Thanks. I'll look into it. |
10:14 | <@AnnoDomini> | Though I could just go with a multivibrator. |
10:16 | <@gnolam> | Or just use a higher clock frequency? :) |
10:17 | <@AnnoDomini> | Can't. It's user-made... you push a button on and off. |
10:20 | <@Vornicus> | You can't do much without a consistent clock in that case |
10:30 | <@gnolam> | Well... you could use, say, two 555s to generate a series of pulses with each button press. |
10:31 | <@Vornicus> | True |
11:06 | | Vornicus is now known as Vornicus-Latens |
11:26 | | ChalcyAssignment is now known as Chalcedon |
11:40 | | Chalcedon [~Chalcedon@Nightstar-1216.ue.woosh.co.nz] has quit [Quit: Gone] |
13:32 | | ToxicFrog is now known as ToxicFrog|W`rkn |
13:43 | | Reiver is now known as ReivZzz |
14:39 | | Vornicus-Latens is now known as Vornicus |
15:00 | | * ToxicFrog|W`rkn huggles his function closures |
16:09 | | GeekSoldier [~Rob@Nightstar-6745.pools.arcor-ip.net] has quit [Quit: IceChat - Its what Cool People use] |
16:18 | | GeekSoldier [~Rob@Nightstar-6745.pools.arcor-ip.net] has joined #code |
16:28 | | You're now known as TheWatcher[afk] |
17:12 | | ReivZzz [~reaverta@IRCop.Nightstar.Net] has quit [Nick collision (older nick overruled)] |
17:13 | | ReivZzz [~reaverta@IRCop.Nightstar.Net] has joined #Code |
17:16 | | Vornicus is now known as Vornicus-Latens |
17:16 | | ReivZzz is now known as ReivSLEP |
17:18 | | ReivSLEP is now known as rEIVslep |
17:21 | | rEIVslep is now known as ReivSLEP |
18:30 | | You're now known as TheWatcher |
18:41 | | GeekSoldier_ [~Rob@Nightstar-4144.pools.arcor-ip.net] has joined #code |
18:42 | | GeekSoldier [~Rob@Nightstar-6745.pools.arcor-ip.net] has quit [Ping Timeout] |
18:44 | | GeekSoldier_ is now known as GeekSoldier |
19:18 | <@ToxicFrog|W`rkn> | ... |
19:18 | <@ToxicFrog|W`rkn> | Ok, metalua? |
19:18 | <@ToxicFrog|W`rkn> | Awesome. |
19:19 | < GeekSoldier> | meta-lua? as in a metascripting lua engine? |
19:19 | < GeekSoldier> | or, metal-ua, as in a metal UA? |
19:19 | <@ToxicFrog|W`rkn> | Metalua is lua + macros, and by "macros" I mean "the ability to examine and alter the lexer, parser, and abstract syntax tree programatically" |
19:20 | < GeekSoldier> | sounds indeed awesome. |
19:21 | <@ToxicFrog|W`rkn> | The worked examples include things like ML-style argument pattern matching and multiple dispatch, or implementing "let foo = bar in expr" in three lines of code. |
19:29 | <@ToxicFrog|W`rkn> | It also adds some nice sugars out of the box, like |args| expr as an equivalent of function(args) return expr end |
19:30 | <@ToxicFrog|W`rkn> | Oooo, and ` for new infixes. |
19:30 | <@ToxicFrog|W`rkn> | a `op` b -> op(a,b) |
19:36 | <@ToxicFrog|W`rkn> | Although given that you can alter the lexer directly I can't actually see that getting much use. |
20:28 | | GeekSoldier is now known as GeekSoldier|Sleep |
20:30 | <@ToxicFrog|W`rkn> | Hmm. |
20:30 | <@ToxicFrog|W`rkn> | Yes, I can do classes with this. |
20:30 | | * ToxicFrog|W`rkn heartbubbles |
20:53 | | Chalcedon [~Chalcedon@Nightstar-1216.ue.woosh.co.nz] has joined #code |
20:53 | | mode/#code [+o Chalcedon] by ChanServ |
21:38 | <@ToxicFrog|W`rkn> | adfjklajgkdhkajsdh |
21:39 | <@ToxicFrog|W`rkn> | I need some way of tracking what includes Make is performing |
21:44 | | * Chalcedon give TF a cookie |
21:48 | | Mahal is now known as MahalAway |
21:49 | <@ToxicFrog|W`rkn> | Cookie! |
21:49 | | * ToxicFrog|W`rkn nibbles |
21:49 | <@ToxicFrog|W`rkn> | Did you get your C# evilness sorted, Chalcy? |
21:50 | <@Chalcedon> | I did |
21:50 | <@Chalcedon> | I was going to ask about something though |
21:50 | <@Chalcedon> | because I didn't understand it and our notes don't have a good explaination. |
21:52 | <@ToxicFrog|W`rkn> | Go ahead! |
21:52 | <@Chalcedon> | please excuse the code spam |
21:52 | <@Chalcedon> | class Car |
21:52 | <@Chalcedon> | { |
21:52 | <@Chalcedon> | private string myMake, myRegNumber; |
21:52 | <@Chalcedon> | public Car(string make, string regNumber) |
21:52 | <@Chalcedon> | { |
21:52 | <@Chalcedon> | myMake = make; |
21:52 | <@Chalcedon> | myRegNumber = regNumber; |
21:52 | <@Chalcedon> | } |
21:52 | <@Chalcedon> | public string Make |
21:52 | <@Chalcedon> | { |
21:52 | <@Chalcedon> | get |
21:52 | <@Chalcedon> | { |
21:52 | <@Chalcedon> | return myMake; |
21:52 | <@Chalcedon> | } |
21:52 | <@Chalcedon> | } |
21:53 | <@Chalcedon> | public string RegNumber |
21:53 | <@Chalcedon> | { |
21:53 | <@Chalcedon> | get |
21:53 | <@Chalcedon> | { |
21:53 | <@Chalcedon> | return myRegNumber; |
21:53 | <@Chalcedon> | } |
21:53 | <@Chalcedon> | } |
21:53 | <@Chalcedon> | } |
21:53 | <@Chalcedon> | That defines the class Car. |
21:53 | <@Chalcedon> | What is confusing me is it seems to be very circular. |
21:53 | <@ToxicFrog|W`rkn> | (I see "Car" and my first thought is Contents of Address Register) |
21:53 | <@Chalcedon> | Yet, if you remove anything, it doesn't work properly. |
21:53 | <@ToxicFrog|W`rkn> | ...circular how? |
21:54 | | * ToxicFrog|W`rkn could go over the definition statement by statement if you like? |
21:54 | <@Chalcedon> | no, wait. I solved the circular issue, but I still don't get it. |
21:54 | <@Chalcedon> | yes please. |
21:55 | <@Chalcedon> | (make != Make) |
21:55 | <@ToxicFrog|W`rkn> | Ok. |
21:55 | <@ToxicFrog|W`rkn> | 1-2: this is a class, a new type, named Car. |
21:55 | | * Chalcedon nods. |
21:55 | < MyCatVerbs> | Anyone know offhand what the predicate for equality is in Prolog? |
21:56 | <@ToxicFrog|W`rkn> | 3: It has the following properties associated with it: myMake and myRegNumber. Both are strings and are accessible only to the Car itself. |
21:56 | <@jerith> | =:= perhaps? |
21:56 | <@jerith> | Or just ==? |
21:57 | | * Chalcedon nods. |
21:57 | <@ToxicFrog|W`rkn> | 4-8: this is the constructor. It takes two arguments, and stores them in the abovementioned properties, so that [[ Car foo = new Car("89 Mustang", "123456"); ]] works as expected. |
21:57 | | * Chalcedon nods |
21:58 | <@ToxicFrog|W`rkn> | 9-15: this is a property accessor. From the outside, make it appear that Car has a string property called "Make". If something attempts to read this property, use the value of myMake instead (that's the get{} block); attempts to write to this property (from outside) are an error (that's the total lack of a set{} block). |
21:58 | <@ToxicFrog|W`rkn> | 16-22: same as above, except for (my)RegNumber instead of (my)Make. |
21:59 | | * Chalcedon reads this bit very carefully several times. |
21:59 | <@ToxicFrog|W`rkn> | This seperates the class's internal storage of make and regNumber from the way other things interact with it. |
22:00 | <@ToxicFrog|W`rkn> | So if, say, regNumber had to change to an int for some reason, you could change the get{} block for it to convert it to a string and return that, and from the point of view of the rest of the program everything works just as it always has before. |
22:01 | <@ToxicFrog|W`rkn> | More generally, this lets you seperate "how other things see your class" and "how your class really works inside", and this mechanism for doing so is one of the few things I like about C#. |
22:01 | <@ToxicFrog|W`rkn> | (the C++ or Java way is to write GetFoo and SetFoo methods for each property.) |
22:01 | <@ToxicFrog|W`rkn> | (Lua, and I think Python, Do It Better though~) |
22:01 | <@Chalcedon> | I don't think I've met anything like it in Python. |
22:01 | <@ToxicFrog|W`rkn> | Make sense? |
22:01 | <@Chalcedon> | I think so. |
22:02 | <@Chalcedon> | Let me check if my head is on right :) |
22:02 | <@ToxicFrog|W`rkn> | I'm not sure that Python has it out of the box, but I'm fairly sure you can implement it. |
22:02 | | * Chalcedon nods |
22:02 | <@ToxicFrog|W`rkn> | I know you can implement it in Lua in like three different ways, and if you're using the Metalua compiler it gets even more awesome. |
22:04 | <@Chalcedon> | The type Car has the properties myMake and myRegNumber . However the public string Make (and RegNumber) get{} portions of code allow you to access the Car using Make, as if Car actually had a property Make, without interfering the the actual properties of the Car object. |
22:04 | <@Chalcedon> | ? |
22:04 | <@ToxicFrog|W`rkn> | Right. |
22:04 | <@ToxicFrog|W`rkn> | Or, well, "without exposing the actual properties to the rest of the program" |
22:05 | <@ToxicFrog|W`rkn> | So, from the outside, you can do: print(aCar.Make) |
22:05 | <@Chalcedon> | where you couldn't do print(aCar.myMake) because the myMake property is private? |
22:06 | <@ToxicFrog|W`rkn> | Without needing to worry about whether Make is an actual property, or a get{} block that aliases it to an actual property (as in this example), or a get{} block that looks up the car number in a database and figures out the make without ever storing it in the car object itself. |
22:06 | <@ToxicFrog|W`rkn> | Exactly. |
22:06 | <@Chalcedon> | Additionally, it's not possible to alter the Car object once it's created (because it doesn't have a set{}), so if you wanted to change something, you'd have to delete the object and create a new one? |
22:06 | <@ToxicFrog|W`rkn> | Right. |
22:06 | <@ToxicFrog|W`rkn> | I note that the Car itself can change its properties. |
22:07 | <@ToxicFrog|W`rkn> | So if you had, say, a ChangeRegNumber() method, that could adjust it. |
22:07 | | * Chalcedon nods |
22:07 | <@ToxicFrog|W`rkn> | The distinction here is that -only- the Car can do this. |
22:07 | <@ToxicFrog|W`rkn> | If it were const, nothing could. If it were public, -everything- could. |
22:07 | <@ToxicFrog|W`rkn> | Declaring it private and then giving it a get{} block both hides the implementation, and gives the rest of the world read-only access. |
22:08 | <@Chalcedon> | ok. |
22:09 | <@Chalcedon> | one other thing. The Car method has no return value (not even void). Why is that? |
22:12 | <@ToxicFrog|W`rkn> | That's the constructors, and constructors have no return signature. |
22:12 | <@ToxicFrog|W`rkn> | In a sense, the allocator/initializer (new) creates and returns the new object; the constructor just gets a chance to modify it along the way. |
22:13 | <@ToxicFrog|W`rkn> | Personally, I find it useful to be able to have a ctor return false to indicate that construction failed in some manner, but neither C++ nor C# follow this philosophy~ |
22:14 | <@jerith> | I prefer to throw an exception. |
22:15 | <@jerith> | Then again, Ruby's initialisers annoy me. |
22:15 | <@ToxicFrog|W`rkn> | Which you can't do in C++ (yes, I know the spec says you can, but it lies) and is kind of a pain in Lua. |
22:15 | <@ToxicFrog|W`rkn> | Unless you're using Metalua. I seem to be thinking that a lot recently. |
22:15 | | * ToxicFrog|W`rkn can't wait for it to ripen |
22:16 | <@jerith> | You create an object with MyClass.new(), but the constructor is called MyClass::initialize(). |
22:16 | <@ToxicFrog|W`rkn> | Gnar. |
22:16 | <@ToxicFrog|W`rkn> | My most recent implementation creates with MyClass(...) and calls the ctor __init. |
22:16 | <@jerith> | Not only do they use a different name, they give it a regional bloody spelling quirk. |
22:16 | <@jerith> | That's what Python does. |
22:16 | <@jerith> | Well, __init__(). |
22:16 | <@ToxicFrog|W`rkn> | Yeah, I shamelessly stole that. |
22:17 | <@ToxicFrog|W`rkn> | Previous ones were MyClass.new() and __new, but I found that ugly. |
22:17 | <@jerith> | Which is cool. |
22:17 | <@ToxicFrog|W`rkn> | (the Lua idiom is two leading underscores for metamethods, hence __init rather than init or __init__) |
22:17 | <@jerith> | I like that creation looks the same as a factory function. |
22:18 | <@ToxicFrog|W`rkn> | That's what it is, underneath; it hits the __call overload on Class objects, which invokes the object creator and then (if present) the constructor. |
22:19 | <@ToxicFrog|W`rkn> | This also means that class definitions use the same syntax: SubClass = Class(SuperClass) |
22:19 | <@ToxicFrog|W`rkn> | Since Class is_a Object and vice versa. |
22:19 | <@jerith> | Cool. |
22:20 | <@ToxicFrog|W`rkn> | That was kind of a pain in the ass to set up. |
22:21 | <@Chalcedon> | sorry, got distracted by the budget. |
22:21 | | * ToxicFrog|W`rkn still isn't 100% Class is actually internally consistent. |
22:21 | <@ToxicFrog|W`rkn> | *100% sure. |
22:22 | <@Chalcedon> | that is one thing that confuses me. Sometimes classes |
22:22 | <@Chalcedon> | bah |
22:23 | <@Chalcedon> | Sometimes classes make new objects like the Car object. Sometimes they seem to simply act as a collection of similar methods (which are accessed via an object, yes, but it seems different). |
22:23 | <@ToxicFrog|W`rkn> | IOW, sometimes classes serve as templates from which to create objects, and sometimes a class basically is a single object? |
22:24 | <@Chalcedon> | iow? |
22:24 | <@jerith> | In Other Words |
22:24 | <@ToxicFrog|W`rkn> | In Other Words. |
22:24 | <@Chalcedon> | yes. |
22:24 | <@ToxicFrog|W`rkn> | (this is where prototype-based OO is nice. There are no classes - all is objects.) |
22:24 | <@Chalcedon> | thats a much better way of putting it. |
22:25 | <@Chalcedon> | what languages use prototype based OO? |
22:25 | <@ToxicFrog|W`rkn> | This tends to happen, I think, when you have some collection of related functions and properties with the nature such that you're program-global - ie, you only have the one set for the entire program - but you don't, for whatever reason, want to use namespaces. |
22:25 | <@ToxicFrog|W`rkn> | Self, I think, and a few others (Javascript?) |
22:26 | <@ToxicFrog|W`rkn> | And you can implement it in most HLLs. Lua again. ?? |
22:26 | <@jerith> | Chalcedon: Classes that just collect assorted static methods (like String in Java) would probably be modules or something in languages that have them. |
22:26 | <@ToxicFrog|W`rkn> | jerith: well, I thought C# had namespaces? |
22:26 | <@Chalcedon> | it does |
22:26 | <@jerith> | Dunno. |
22:26 | <@ToxicFrog|W`rkn> | But, yeah, mostly I see this when you want a namespace but can't have one. |
22:26 | <@Chalcedon> | yes, I seem to recall doing that in Python |
22:26 | <@ToxicFrog|W`rkn> | So instead you create a static class and bung all the stuff into that./ |
22:26 | <@jerith> | And Ruby has explicit modules. |
22:26 | <@Chalcedon> | or are like me and don't know how to fiddle with them yet? |
22:26 | <@jerith> | Which double as mixins. |
22:27 | <@ToxicFrog|W`rkn> | Chalcedon: also a possibility. |
22:27 | <@ToxicFrog|W`rkn> | Although namespaces are fairly easy to grok. |
22:27 | <@ToxicFrog|W`rkn> | As for prototype-based OO - the basic idea is twofold: |
22:27 | <@ToxicFrog|W`rkn> | (1) Objects can be modifed, including with the addition and removal of members |
22:28 | <@ToxicFrog|W`rkn> | (2) Objects can create perfect copies of themselves |
22:28 | <@ToxicFrog|W`rkn> | So, "subclassing" becomes a matter of copying the superclass and adding/removing from it. |
22:28 | <@ToxicFrog|W`rkn> | "instancing" means copying the class and then /not/ adding/removing. |
22:28 | <@ToxicFrog|W`rkn> | A "static class" is just an object that you never copy but instead use directly. |
22:29 | <@Chalcedon> | aaaahhhh |
22:29 | <@Chalcedon> | I think I'm seeing some light in here :) |
22:30 | | * Chalcedon supply TF and jerith with cookies for their help :) |
22:30 | <@ToxicFrog|W`rkn> | Yaycookies |
22:30 | | * ToxicFrog|W`rkn nibbles |
22:31 | <@ToxicFrog|W`rkn> | Anyways, I played around with PBOO some, but it never really grabbed me; I find classical OO + modules easier to work in. |
22:32 | | * Chalcedon nods. |
22:35 | <@Chalcedon> | I am assuming that it is possible to create a class as a template for objects (as opposed to a static one) without using get{} etc? |
22:36 | <@ToxicFrog|W`rkn> | Well, get{} and set{} are just C#isms that define how other things should use the object; you can also use members directly, or write accessor functions. |
22:36 | <@ToxicFrog|W`rkn> | Eg: |
22:37 | <@ToxicFrog|W`rkn> | class Car { public string myMake; public string MyRegNumber; } // now other things can access them directly |
22:37 | | * Chalcedon nods |
22:37 | <@Chalcedon> | Thats what I thought. |
22:38 | <@Chalcedon> | so that would now be accessed by aCar.myMake? |
22:38 | <@ToxicFrog|W`rkn> | Or: |
22:38 | | * jerith nods. |
22:38 | <@ToxicFrog|W`rkn> | Exactly. |
22:38 | <@ToxicFrog|W`rkn> | Or you could keep them private and use GetMake and SetMake methods instead. |
22:39 | <@Chalcedon> | ok. |
22:39 | <@ToxicFrog|W`rkn> | Which is basically what get{} and set{} are shortcuts for; get{} becomes a GetFoo() method, set{} becomes a SetFoo() method, and obj.foo becomes obj.GetFoo() and obj.foo = bar becomes obj.SetFoo(bar) |
22:39 | <@ToxicFrog|W`rkn> | And now I head home, so, bbiab. |
22:39 | <@Chalcedon> | bye! |
22:40 | <@jerith> | And I'm off to hallucinate wildly for several hours and then go to work. |
22:40 | <@Chalcedon> | so in choosing which method to use you'd consider what you wanted to store in the object, how you as a programmer wanted to access it and what you wanted the user to be able to see (or not). |
22:40 | <@Chalcedon> | have fun jerith |
23:21 | | Vornicus-Latens is now known as Vornicus |
23:25 | | You're now known as TheWatcher[T-2] |
23:27 | | You're now known as TheWatcher[zZzZ] |
23:33 | <@ToxicFrog|W`rkn> | Chalcedon: well, generally none of this stuff is exposed to the user |
23:33 | <@ToxicFrog|W`rkn> | Unless you're writing a library, in which case the "user" is in fact another programmer. |
23:34 | <@ToxicFrog|W`rkn> | Unless you meant "the code that uses it", in which case yes, that's accurate. |
23:36 | | ToxicFrog|W`rkn is now known as ToxicFrog |
23:43 | | * Chalcedon nods |
23:48 | | MahalAway is now known as Mahal |
--- Log closed Thu May 24 00:00:54 2007 |