AKMA's Random Thoughts

October 26, 2003

Dreams Within Dreams

Frank Paynter pointed to this blogpost that I’d missed on Andrea’s ARJLog. The story ends with my allegedly saying, “It is improper squid etiquette to eat garlic with a fork.”

I read that to Margaret last night, and we relished the runaway absurdity of it all. Then last night, Margaret dreamt that we went to communion, where there was widespread murmuring about the communion bread, because it was supposed to have been marinated in cooked garlic, but it had been prepared with raw garlic instead. (She knew, because she went to investigate and took a bite out of one of the pieces of garlic, so she could tell from its consistency that it was raw. She sampled the garlic — but not with a fork, since she knew that just wasn’t done.)

Posted by AKMA at October 26, 2003 07:05 PM | TrackBack
Comments

I don't know if they had garlic bread in the upper room that night, but I love the idea of using for it communion.

Posted by: fp at October 26, 2003 07:31 PM

Well, that would explain the early church liturgical practice of having the kiss of peace precede communion.

Posted by: Jane Ellen at October 26, 2003 10:13 PM

Ooh! Cadavre exquis dreams! I like it!

Posted by: ARJ at October 27, 2003 01:24 AM

Being able to understand that basic idea opens up a vast amount of power that can be used and abused, and we're going to look at a few of the better ways to deal with it in this article.

Posted by: Josias at January 12, 2004 08:59 PM

But variables get one benefit people do not

Posted by: Matthew at January 12, 2004 08:59 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: Evan at January 12, 2004 08:59 PM

That gives us a pretty good starting point to understand a lot more about variables, and that's what we'll be examining next lesson. Those new variable types I promised last lesson will finally make an appearance, and we'll examine a few concepts that we'll use to organize our data into more meaningful structures, a sort of precursor to the objects that Cocoa works with. And we'll delve a little bit more into the fun things we can do by looking at those ever-present bits in a few new ways.

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

Note first that favoriteNumbers type changed. Instead of our familiar int, we're now using int*. The asterisk here is an operator, which is often called the "star operator". You will remember that we also use an asterisk as a sign for multiplication. The positioning of the asterisk changes its meaning. This operator effectively means "this is a pointer". Here it says that favoriteNumber will be not an int but a pointer to an int. And instead of simply going on to say what we're putting in that int, we have to take an extra step and create the space, which is what does. This function takes an argument that specifies how much space you need and then returns a pointer to that space. We've passed it the result of another function, , which we pass int, a type. In reality, is a macro, but for now we don't have to care: all we need to know is that it tells us the size of whatever we gave it, in this case an int. So when is done, it gives us an address in the heap where we can put an integer. It is important to remember that the data is stored in the heap, while the address of that data is stored in a pointer on the stack.

Posted by: Dionisius at January 13, 2004 09:29 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: Tristram at January 13, 2004 09:29 AM