------art_7224_6946399.1140402222112
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On 2/19/06, Mark James <mrj / bigpond.net.au> wrote:
>
> I was under the impression that the if modifier and the
> if statememt were equivalent, but for the following code
> calling A.test raises an exception, while calling A.test2
> succeeds. This is with Ruby 1.8.4.
>
> class A
>    def A.test
>      a if a=1
>    end
>
>    def A.test2
>      if a=1
>        a
>      end
>    end
> end
>
>
Do you really want 'if a = 1' there, and not 'if a == 1'?

--
Garance Alistair Drosehn     =             drosihn / gmail.com
Senior Systems Programmer
Rensselaer Polytechnic Institute;             Troy, NY;  USA

------art_7224_6946399.1140402222112--