Awesome Object Oriented System.
I decided to learn Common Lisp a couple of weeks ago, and I’ve been making my way through Practical Common Lisp. Over the weekend I read the section on the Common Lisp Object System. It blew my mind. First of all, common lisp isn’t a “message passing system”; this makes it different from every other major (imperative) object-oriented programming language I know. That whole, “you define methods as part of the class definition” thing? Yeah, no.
Common lisp defines generic functions (defgeneric), which you then implement with specific methods. The method definition (done in defmethod) specifies the types that the implementation is specific to. It also defines how it should combine with other methods (by default, it is a primary method, but you can have it run before, after, or around the other methods that implement the same function). When you call a generic function on an object, the lisp system takes all of the methods that apply to the type of the object, and sorts them by specificity. Primary methods are sorted in order of increasing generality, and they should deal with the full implementation of a generic function because the expectation is that they will be the primary place for work being done (though they can just call (call-next-method) to pass the buck). before methods are sorted in the same direction, and do not have to call (call-next-method). It can do whatever it wants to the object, and the object will be passed down the chain to whatever other auxiliary methods go before the calling of the primary methods and into the primary methods themselves. And, there are auxiliary methods that are called AFTER the primary methods! These get sorted from most general to most specific. And that’s only the standard method combination! There are others! There’s one that adds the returns from all of the methods, one that shoves them into a list, ones that find max or min, and there are others. If that’s not enough, apparently you can even define your own!
Common Lisp also has, sensibly enough, multiple inheritance. Basically, it deals with specificity of multiple direct superclasses by using the order they appeared in the class definition.
All of this leaves classes to mainly define the slots of objects; there are also some syntactic shortcuts to define default accessors for a slot, and the language provides several ways of setting the values of slots when an object is instantiated. Of course, all I’ve written about so far is a semantic abstraction provided by common lisp. I have to mention that, as a lisp, common lisp provides syntactic abstraction. You can define macros, which are based around the manipulation of lists instead of text because lists are not only the basic data type in lisp, but also the way that code is structured. With this blurring between data and code, lisp code can easily manipulate itself! Awesome!
Anyway, that’s enough about this for tonight. Go learn common lisp! It’s fun!
Computers. Why do they cause such angst?
This essay, over at American Digest humorously catalogs the issues with today’s operating systems and software packages. The conclusion is that what consumers really want is an appliance, not this crazy monstrosity that is a modern computer. In the comments, I mentioned Stephenson’s essay In the Beginning Was the Command Line Interface, but this was meant more to poke the various Mac fanboys in the comments.
But coming back later, I noticed that someone said that the history of computers is not really relevant, and someone else complained that computers act like jack-of-all-trades. That woke me up like a slap in the face. I did not even flinch at the comment saying that Linux should provide a warranty (which only goes to show that people don’t understand what the open-source development model is; Eric S. Raymond’s essay, The Cathedral and the Bazaar explains this idea better than I could). I think that the history of computers is fundamental to understanding the problem with the personal computer. Of course a computer does so much! Remember that the digital computer was designed, to borrow a metaphor from Neal Stephenson’s Cryptonomicon, along the lines of a pipe-organ, which can be reconfigured to make many types of sounds. Think of the incredible capacity for logic bound up in the theories behind computer science! The history of computers reveals that many false assumptions are made about how these things work, and I think that we would be foolish to ignore at least 40 years (not twenty) of computer history (not just of personal computers).
For the orignal poster’s problem, I think that some compromise between a modern cellphone interface and the power of a personal computer will emerge, that will deal with all the distractions and cruft of the current PC. Maybe I will design this, if I ever stop fooling around blogging, finish my college applications, and get to work designing this new interface while working on my computer science major. For everyone else, the history of computers is important for fixing the faulty metaphors of our current computer interfaces.
Anyway, I should get ready for relatives, and I seem to have lost my train of thought somewhere in this post. I hope you can see through this muddle to the point that seemed so clear and shining in my head only minutes ago.
Oh, right.
I forgot to mention that my last high school cross country season ended about a week and half ago. Neither of our boys’ teams did very well in the championship, but that makes sense: our really good runners graduated last year. Personally, I think I did well; I got a chance to run in the championship race for the first time, and gave a decent showing, I believe, for my fourth year of running. Anyway, it is over now; I am not a good enough runner to be on a competitive college team, so any running I do will be for the sake of fitness. I don’t have any regrets: running cross country is physically difficult, the simultaneously exhilarating and heartbreaking aspects of a cross country race have become too much for me, and I am glad to be done with those bizarre feelings that surround a cross country race.
Gmail themes?
So I hear that Gmail has got themes now. Lifehacker has more information, and pictures. I’m still waiting for my account to get this, and I have a sinking suspicion that I will be in one of the last groups of the roll out. Oh well.
Update:
Ok, now I have themes. Awesome.
It’s been a while…
…since I last blogged. I’ve had a long and busy term, trying to stay on top of my classes while getting through the arduous college process. Well, it is now exam week, and I’m almost done with the trimester. Then it is thanksgiving break, and I can use the time to finish those college essays. Once those applications are in, I’m basically done. By January, I will have to be done, and then I can get back to everything that is interesting. I’ll even be able to rant about politics again over at my other blog. In the mean time, I’m going to try to commit to light blogging (as opposed to none at all).
Linking things for fun and etc.
So, a KDE developer called out to people on planet KDE to put a link to a site of his for an SEO class. Here is the link: Abalastow Compendium. Yes, it is an odd phrase. Apparently, it had not hits on google before now, but the linked site should reach the top of the hits, or so kyle hopes. Wish him luck!
Ouch, My Arm!
I ran at the Westminister Invitational cross country race yesterday, and fell going downhill, after the first mile. Finished the race with scrapes all along right side (hand, elbow, side of chest, lower leg), bleeding. Understandably messed up my race.
On an unrelated note, I’ve been wondering about inverses of recursively defined functions. Hmm.
Woah. That went by fast.
I just realized I haven’t posted in a while, so I figured I might explain what has been going on. These weeks just shot by. It hasn’t been a very good passing, either. Had nasty cold since last wednesday. Well, might as well catalog the full experience.
- Classes have been hard. I’ve got three AP level classes: Latin, Physics, AB Calculus. All are interesting, but difficult classes.
- The training I did for cross country over the summer seems to have payed off. I’ve been running near the front, and I hope to have a good run on this coming Wednesday’s race. However…
- last Wednesday, I got hit by a nasty cold that has been going around campus. I haven’t been able to run for three days because of it.
- College stuff is still bugging me. However, my list is starting to resolve itself. I’m shooting to bring it down to a 10 college list, with the majority of them using the Common Application. I also need to study some chemistry for the SAT subject tests in October.
So that is what I’ve been up to. Obviously, I have had no time to do any sort of coding work, which sucks. Anyway, I’ve got to get to class.
Oh wow…
(Warning. Attempt by an INTJ to understand own feelings follows.)
…
So I am back at school. Classes begin on Monday. I have a swamp of college stuff I have to get done soon; that stuff is some really intense work. I’m running cross country again (and really feeling the soreness). I’m kind of waiting for more of my buddies to get back, and I’m bored. I want to get my coding projects done, but I’m not in the right state of mind that got me writing all that code last week. I need to get in touch with a bunch of people, but that just intimidates me. So, with all of this stress and worry, I feel happy, in a sort of crazy, excited way. Why?
…
Well, I should probably work on some backup stuff later, before I go to bed. Maybe that will help.
Test Driven Development (Conjure and Ruby. Flash?)
So. Conjure is coming along slowly. The stranger aspects of the template settings class are working now, according the the testing I have done. I have been trying to work in the test driven development workflow. I can see why it is a good idea, it just takes a bit of time to really get used to. The hard part has been forcing myself to write the test first every time. A mental shift like that is never easy.
Unit testing is easy in Ruby because of Test::Unit. I’m not sure that there is a similar system in Flash for such unit testing, and if not, I will probably develop one myself. Yes, I know that I should be working on an object information dumper for Jesse Freeman, but seriously, a unit testing system is probably better in the long run. And of course, I need to finish Conjure, because it will be awesome.
comments