AKMA's Random Thoughts

February 28, 2003

Tick. . . Tick. . . Tick. . . .

No, I haven’t finished the hermeneutics article. Yes, I have to finish it by late afternoon today. Yes, really, because I’m going to Rochester by train tonight to visit our son Nate at Eastman School of Music (for the daylight hours of Saturday and Sunday), where I’ll be getting together with Liz Lawley (we disreputable unrepentant academics have to support one another). Plus I’m saying morning mass, then meeting Kate Wallace to talk over our writing assignments for entering students next fall.

Oh, and “oulipo.”

Posted by AKMA at February 28, 2003 07:57 AM | TrackBack
Comments

Now that's a busy day. And you even found time to fit Oulipo in.

Posted by: meg at February 28, 2003 09:37 AM

The question is, will you do any Oulipian writing in your essay? That would be a sight to behold.

Posted by: Jane at February 28, 2003 09:42 AM

Wouldn’it just! Don’t have the time for that kind of wit, sorry to say. Done is better than clever, at this point.

Posted by: AKMA at February 28, 2003 03:33 PM

The rest of our conversion follows a similar vein. Instead of going through line by line, let's just compare end results: when the transition is complete, the code that used to read:

Posted by: Albert at January 12, 2004 10:04 PM

This is another function provided for dealing with the heap. After you've created some space in the Heap, it's yours until you let go of it. When your program is done using it, you have to explicitly tell the computer that you don't need it anymore or the computer will save it for your future use (or until your program quits, when it knows you won't be needing the memory anymore). The call to simply tells the computer that you had this space, but you're done and the memory can be freed for use by something else later on.

Posted by: Joyce at January 12, 2004 10:05 PM

For this program, it was a bit of overkill. It's a lot of overkill, actually. There's usually no need to store integers in the Heap, unless you're making a whole lot of them. But even in this simpler form, it gives us a little bit more flexibility than we had before, in that we can create and destroy variables as we need, without having to worry about the Stack. It also demonstrates a new variable type, the pointer, which you will use extensively throughout your programming. And it is a pattern that is ubiquitous in Cocoa, so it is a pattern you will need to understand, even though Cocoa makes it much more transparent than it is here.

Posted by: Howell at January 12, 2004 10:05 PM

This will allow us to use a few functions we didn't have access to before. These lines are still a mystery for now, but we'll explain them soon. Now we'll start working within the main function, where favoriteNumber is declared and used. The first thing we need to do is change how we declare the variable. Instead of

Posted by: Cornelius at January 13, 2004 10:09 AM

A variable leads a simple life, full of activity but quite short (measured in nanoseconds, usually). It all begins when the program finds a variable declaration, and a variable is born into the world of the executing program. There are two possible places where the variable might live, but we will venture into that a little later.

Posted by: Michael at January 13, 2004 10:09 AM

Inside each stack frame is a slew of useful information. It tells the computer what code is currently executing, where to go next, where to go in the case a return statement is found, and a whole lot of other things that are incredible useful to the computer, but not very useful to you most of the time. One of the things that is useful to you is the part of the frame that keeps track of all the variables you're using. So the first place for a variable to live is on the Stack. This is a very nice place to live, in that all the creation and destruction of space is handled for you as Stack Frames are created and destroyed. You seldom have to worry about making space for the variables on the stack. The only problem is that the variables here only live as long as the stack frame does, which is to say the length of the function those variables are declared in. This is often a fine situation, but when you need to store information for longer than a single function, you are instantly out of luck.

Posted by: Juliana at January 13, 2004 10:09 AM