Michel Fortin Here

Thoughts about computers, language, and society by a learned programmer who likes Macs and typography.

On My Weblog

Petition

I got an impression of déjà vu when I found this petition about MPAA bribery on the White House’s website (via Slashdot).

What’s important

When drafting a law, just like when writing a computer program, we should always keep in mind how it can be abused and what are the consequences of those abuses. Because sooner or later, it will. Usually sooner than later.

Introducing MFIndexSetForeach

Index sets can be a little annoying in Objective-C. Unlike arrays, sets and dictionaries, you can’t iterate over them using a straightforward for (a in b) loop. That’s because unlike other Objective-C containers, index sets contains integers, not objects. Now, since Mac OS X 10.6 you can use a block to iterate over an index set, but this isn’t always ideal: breaking out of the loop is more complicated, and returning from the block doesn’t return from the outer function. So what can we do better?

Copyright © Michel Fortin
2002-2011