------art_32407_18354251.1197419525805
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Dec 11, 2007 7:10 PM, Ken Bloom <kbloom / gmail.com> wrote:

> On Tue, 11 Dec 2007 15:03:53 -0500, Andrew Stone wrote:
>
> > Note:  parts of this message were removed by the gateway to make it a
> > legal Usenet post.
> >
> >> 1) No such opposite-of-nil? method exists. If you want it, add it.
> >>
> >>
> > Thanks for actually answering my question.  Much appreciated.
> >
> > 2) In the particular example above (which I realize is just an
> >> example) you could write that as:
> >>
> >>  def should_this_by_done?
> >>    am_I_sure? unless !my_object || my_object.var.nil?
> >>  end
> >>
> >> But, of course, that just moves the negation.
> >>
> >>
> > Sure, I was just looking for a more readable construct.  Thanks again
> > for your reply.
>
> def should_this_be_done?
>  am_I_sure?  && my_object  && !my_object.var.nil?
> end
>
> Here's a more readable construct:
>
> def should_this_be_done?
>  am_I_sure?  and my_object and not my_object.var.nil?
> end
>
> You're not forced to program Ruby like it's C.
>
> --Ken
>
> --
> Ken (Chanoch) Bloom. PhD candidate. Linguistic Cognition Laboratory.
> Department of Computer Science. Illinois Institute of Technology.
> http://www.iit.edu/~kbloom1/ <http://www.iit.edu/%7Ekbloom1/>
>
>

:) very true Ken.  I come from Java land myself and I guess old habits die
hard.

thanks for the response,
andy
-- 
Andrew Stone

------art_32407_18354251.1197419525805--