At 5:45 AM +0900 8/23/06, Phil Tomson wrote:
> I guess I'd be inclined to do it like:
>
>   count_neighbors(:have_cats?)
>
> and not use method_missing for this.
> method_missing is really quite nice,
> but if you over-use it, it can be very
> difficult to debug.

Why do I believe this? :-)

Anyway, it looks like you're suggesting that I
ask the node to run the count_neighbors method,
asking each of the neighbors to run :have_cats?

This is vaguely along the lines of one approach
I've been considering, where I would send only
method names, in some hierarchical arrangement,
to be executed by the appropriate objects.

If the methods don't have side effects, it could
be a bit like functional programming.  Also, by
restricting the availability of methods, I might
be able to achieve a sort of "sandbox" effect.

Speaking of which, is there a (reasonable) way to
limit the methods that are available within, say,
an eval?

-r
-- 
http://www.cfcl.com/rdm            Rich Morin
http://www.cfcl.com/rdm/resume     rdm / cfcl.com
http://www.cfcl.com/rdm/weblog     +1 650-873-7841

Technical editing and writing, programming, and web development