mikeash.com: just this guy, you know?

NSBlog
"A failure in the hot air department"
RSS feed (full text feed) - Show Tag Cloud
Showing entries tagged "blocks". Full blog index.

by Mike AshTags: fridayqna blocks objectivec evil hack
Last time, I talked about my crazy hack that misuses the Objective-C message forwarding machinery to do block proxying. This allows writing code that interposes in front of an arbitrary block to intercept its arguments, manipulate its return value, etc. Today, I want to present an exanmple of using this hack which almost verges on the practical. Specifically, I'm going to discuss how to use it to build a generalized block memoization facility.

by Mike AshTags: fridayqna blocks objectivec evil hack
Here at Friday Q&A, I pride myself on occasionally taking my readers to places where normal people dare not tread. Today is one of those days. This is not a reader suggested topic, but today I want to talk about a fun hack I came up with that allows proxying block invocations in much the way that one can proxy Objective-C messages.

by Mike AshTags: fridayqna objectivec c++ blocks
Blocks are perhaps the most significant new language feature introduced by Apple in years, and I've written a lot about them before. The new C++ standard, C++0x, introduces lambdas, a similar feature. Today, I want to discuss the two features and how they are alike and how they differ, a topic suggested by David Dunham.

by Mike AshTags: fridayqna blocks trampoline libffi
It's a week late, but it's finally time for the latest edition of Friday Q&A. About a year ago, I wrote about converting blocks into function pointers by building code at runtime. This was an interesting exercise, but ultimately impractical due to various limitations. In the meantime, I wrote MABlockClosure, a more robust and usable way of doing the same thing, but I never posted about it. Landon Fuller suggest I discuss how it works, and so that is what I will talk about today.

by Mike AshTags: fridayqna blocks gcd
Welcome back to another Friday Q&A. This week I'm departing from my usual user-driven format to present a class I've written for what I'm calling "background timers", and discuss potential uses for it.

Blocks and GCD in Russian at 2010-06-29 15:22
by Mike AshTags: blocks gcd translation
Alexander Babaev has been kind enough to translate my series of posts on blocks and GCD into Russian for TouchDev.ru. So far he has posted two, Blocks in Objective-C and Intro to Grand Central Dispatch, Part I. Others in the series will be going up in the future. If you happen to speak Russian, check them out!

by Mike AshTags: objectivec continuation blocks
A couple of months ago I wrote about using Continuation Passing Style in Objective-C as an alternative technique for returning errors from methods. The major downside to that technique is that it integrates poorly with Cocoa, since Cocoa isn't written to use CPS. Jordan Breeding has spent the intervening time building up an impressive CPS adapter library which allows converting any Cocoa NSError ** call into CPS style with virtually no work. Source code and extensive examples are available, and I encourage you to check it out.

by Mike AshTags: fridayqna futures blocks
Welcome back to another thrilling edition of Friday Q&A. This week I want to extend my discussion from last week about futures, and talk about compound futures, an extension to the basic futures system that I developed previously.

by Mike AshTags: fridayqna futures blocks
Welcome back to another shiny edition of Friday Q&A. Guy English suggested taking a look at implementing futures in Objective-C using blocks, and for this week's post I'm going to talk about the futures implementation that I built.

by Mike AshTags: fridayqna blocks trampoline assembly evil
Welcome to another edition of Friday Q&A, where deep technical talk and complete insanity combine! This week, I'm going to take a quick break from my usual reader-driven format and talk about a little toy I built earlier in the week, an adapter between blocks and more traditional function-pointer-based callback systems.

by Mike AshTags: fridayqna blocks objectivec continuations errorhandling
The Earth has moved 6.9 degrees around the Sun since my last post, which means it's time for another edition of Friday Q&A. This 6.9-degree segment, Guy English has suggested that I talk about the use of continuation passing style to simplify error returns in Objective-C code.

by Mike AshTags: fridayqna blocks evil
It's Friday again, and that means another Friday Q&A. This week, Guy English proposed talking about a blocks-based object system, and that is what I will do. The system I've developed is a rudimentary system for doing object-oriented programming in pure C (plus blocks), and I'll discuss how it works and how to use it.

by Mike AshTags: fridayqna blocks
Welcome back to another edition of Friday Q&A. I'm back from my break and ready to bring you more programming goodies. This week I want to take Landon Fuller's suggestion to write a followup to my original Friday Q&A on blocks now that the design is finalized and code available for them.

Friday Q&A 2008-12-26 at 2008-12-26 17:19
by Mike AshTags: fridayqna blocks
Welcome to another Friday Q&A. This week I thought I would take fellow amoeboid Jeff Johnson's suggestion and talk about blocks in Objective-C.
Hosted at DigitalOcean.