From: dblack@... Date: 2006-05-13T21:31:33+09:00 Subject: Re: boolean affectation shortcut ---2049402039-1743833061-1147523490=:12192 Content-Type: MULTIPART/MIXED; BOUNDARY="-2049402039-1743833061-1147523490=:12192" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---2049402039-1743833061-1147523490=:12192 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Hi -- On Sat, 13 May 2006, Pe=C3=B1a, Botp wrote: > fr 13: > # You can' t because only methods can end with ? > > i think he is asking, why not? of course, we know it is not > currently possible, but variable names with "?" may enhance > readability. > > consider, > > x? =3D method_that_determines_some_status > > .... > > if x? > .... > > end > > by just looking at the name, we are pretty sure that x? is a boolean > (just like is_xx? methods return bools). > > wc is better than, > > if x > ... > end > > whether x is a variable or method.. > > it's just an added character where one may happily use or not. But > maybe i am missing something deeper.. To me, this: x? =3D true reads as: set "is x?" to true =2E.. that is, setting the question, rather than the answer. David --=20 David A. Black (dblack@wobblini.net) * Ruby Power and Light, LLC (http://www.rubypowerandlight.com) > Ruby and Rails consultancy and training * Author of "Ruby for Rails" from Manning Publications! > http://www.manning.com/black ---2049402039-1743833061-1147523490=:12192-- ---2049402039-1743833061-1147523490=:12192--