[#237] object.c ruby.h (fwd) — Robert Skarwecki <skaav@...>

Hello everybody,

42 messages 2002/07/24
[#239] Re: [PATCH] object.c ruby.h (fwd) — GOTO Kentaro <gotoken@...> 2002/07/24

At Thu, 25 Jul 2002 00:02:28 +0900,

[#240] Re: [PATCH] object.c ruby.h (fwd) — Dave Thomas <Dave@...> 2002/07/24

GOTO Kentaro <gotoken@notwork.org> writes:

[#246] Re: [PATCH] object.c ruby.h (fwd) — GOTO Kentaro <gotoken@...> 2002/07/25

At Thu, 25 Jul 2002 05:05:46 +0900,

[#247] Re: [PATCH] object.c ruby.h (fwd) — Dave Thomas <Dave@...> 2002/07/25

GOTO Kentaro <gotoken@notwork.org> writes:

[#248] Re: [PATCH] object.c ruby.h (fwd) — nobu.nokada@... 2002/07/25

Hi,

[#249] Re: [PATCH] object.c ruby.h (fwd) — Dave Thomas <Dave@...> 2002/07/25

nobu.nokada@softhome.net writes:

[#250] Re: [PATCH] object.c ruby.h (fwd) — nobu.nokada@... 2002/07/25

Hi,

[#252] Re: [PATCH] object.c ruby.h (fwd) — GOTO Kentaro <gotoken@...> 2002/07/25

At Fri, 26 Jul 2002 03:11:02 +0900,

[#253] Re: [PATCH] object.c ruby.h (fwd) — Dave Thomas <Dave@...> 2002/07/25

GOTO Kentaro <gotoken@notwork.org> writes:

Re: [PATCH] object.c ruby.h (fwd)

From: Dave Thomas <Dave@...>
Date: 2002-07-24 20:05:46 UTC
List: ruby-core #240
GOTO Kentaro <gotoken@notwork.org> writes:

>   * On test stage, we sometimes need is_a?(Boolean) test and `assert'
>     method of RUNIT::Assert tests if the value is really true/false.
>     Meanwhile, how often do we need Boolean class in run-time?

For what it's worth, I think this is an evil side of the assert
method. Ruby says nil and false are 'false', and everything else is
true. So, if I write a method that's designed to be used as

   if my_method then ...

I'd expect to be able to test it with an assert(), but currently I
can't without writing extra (and distracting) stuff.


I think adding Boolean to Ruby would be confusing, and I'm not sure I
see the need.

At the same time, I'm wondering if it would be possible to unify nil
and false, so that they were both the same object?


Cheers


Dave

In This Thread