Monday, April 13, 2009

Metaprogramming: as tricky as it sounds

I've got my weird, functional style Mandelbrot Set computation working. I'm cheating a bit and still using looping in the actual plot point calculation, but if I wanted to go full recursive, I'd still be free to. Now I've set myself to the task of getting my actual metaprogramming solution working only to find that I've got further fish to fry.

Why on earth does define method toy with my scope and prevent me from accessing instance variables? If I just needed to track how many threads I'm running, that would be one thing. But I also need to know which threads they are so that I can also define a make_blocking method that will alter a method so that it will wait for all computation in that object to finish before moving on!

I guess, for now, I'll just make it block for *all* running threads and come back to this problem later. I'm nowhere near happy about it, though, and will definitely be coming back to it very soon.

No comments: