On 22 Jul 2013, at 10:14, Francis Fish <[email protected]> wrote:

> with bus do
>   tell :turn_on
>   tell :add_leaves
> end
> 
> With the kettle/teapot listeners doing some pattern matching ... or you could 
> just use Erlang ;-)

What are people's thoughts on the fact that inside that block, self has been 
changed?

When first seeing code like this I thought "hey, that's really clean - nice".

Then I ran into all sorts of trouble with in a couple of projects that I'd used 
that invoked the pattern, and went off it rather quickly.

I recall Pragdave is of a similar view; he doesn't feel that redefining self 
inside a block is considered great practice. I'm not sure exactly where I came 
across his thoughts on it, but it was probably in one of these videos:

http://pragprog.com/screencasts/v-dtrubyom/the-ruby-object-model-and-metaprogramming

-- 
You received this message because you are subscribed to the Google Groups 
"NWRUG" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nwrug-members.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to