[#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: GOTO Kentaro <gotoken@...>
Date: 2002-07-25 19:53:44 UTC
List: ruby-core #252
At Fri, 26 Jul 2002 03:11:02 +0900,
nobu.nokada@softhome.net wrote:
> At Fri, 26 Jul 2002 02:55:28 +0900,
> Dave Thomas wrote:
> > Well, to me, a.true? would imply the same as a == true, which isn't
> > what it does. #to_b, however, implies a conversion to the mythical
> > Boolean type. :)
> 
> Hmmm, then a.t?.  It would be lispy...

Isn't it too hackish :) 

But `?' looks nice because the suffix suggests true-false valued.  As
Dave said, the prefix `to_' would implies conversion to a type.

I vote #truth?.  If someone asks `why not boolean' we can plead that
Boolean algebra is just one of characterizations but not synonym for
the truth value.

---------------------------------------------------------- Object#truth?
     obj.truth? -> true or false
------------------------------------------------------------------------
     Returns a truth-value for this object.  In Ruby, either false or
     nil is regarded as a negative condition.  Everything else is 
     positive one.  `true' is the representative of positive conditions.
        true.truth?       #=> true
        false.truth?      #=> false
        nil.truth?        #=> false
        "string".truth?   #=> true
        0.truth?          #=> true

And #falsity? for symmetry.

-------------------------------------------------------- Object#falsity?
     obj.falsity? -> true or false
------------------------------------------------------------------------
     nagation of Object#truth?. 

In This Thread