ahoward <ahoward / fsl.noaa.gov> wrote:
> or more generally
> 
>  object and object.method
> 
> the ol 'call a method on object if object is not nil'
> 
> or even
> 
>  size = array && array.size || -1
> 
> which i do all the time.

Yes, but my point was, when doing this, I usually have either object
being an instance variable, or object being assigned shortly before I do
the call, or object being one of the args to the current method. 

In the first case, you wouldn't use @object as a block temp variable
anyway.

In the second, you'd have to call object = function_that_sets_object
within your current method in order to have any expectation of it having
a value. If you call it after the block, you're fine. If you call it
before the block, you'll be warned about shadowing.

In the third case, you'll be warned about shadowing.

martin