Tuesday, 14 December 2010

I-o, I-o, It’s Back To Work I Go

It’s been a while since I last had the chance to do a bit more learning, but I’m back with it so lets see how day 2 of Io goes.

The chapter started off with standard control flow stuff in the form of conditionals and loops, stuff that I would probably have expected to see in day 1 really. Nothing too remarkable here, and it quickly moved into creating custom operators which was pleasant, but I’m not sure how useful that is on a day to day basis. I can’t remember ever feeling a need to so much as override an operator in .net, let alone create a new one.

Next up was more about message passing. Io is all about messages, to the point that pretty much anything that isn’t a comment or a comma is a message. This allows you to create control structures in code that would typically need to be keywords implemented by the language creators. Messages are only evaluated when they are specifically required rather than the typical evaluate the parameters, push the values on the stack and call the method approach that typifies most languages. That has a quite a nice functional feel, and no need to start a call with “() => “

The chapter ends with a section on reflection. The supplied code here worked fine for me when run in a file, but trying to get it to work in the interactive mode was a non-starter sadly. Of course I spent a while trying to enter and run it before going the file route, so yet again I spent more time mucking around trying to get things to work with Io rather than learning about it. By the time I arrived at the self study page I’d pretty much decided that I was going to leave it off.

Still, the book continues to be engaging even if this language keeps throwing up obstacles to using it cleanly. I particularly enjoyed sending messages to princessButtercup, and the ambiguous animal noises.

No comments:

Post a Comment