[#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: Michal Rokos <m.rokos@...>
Date: 2002-07-26 15:23:52 UTC
List: ruby-core #262
On Thu, Jul 25, 2002 at 08:06:17PM +0900, GOTO Kentaro wrote:
> Something built-in to get truth value of each object may help explain
> the boolean aspect in Ruby.
> 
>   % ruby -e '
>   module Kernel
>     def truth() !!self end
>   end
> 
>   p nil.truth  
>   p false.truth
>   p :else.truth
> 
>   '
>   false
>   false
>   true 
>

	I think if the RTEST returns 0 for Qnil or Qfalse, so Qnil is
	the same as Qfalse. (nil is false)

	If I look at SmallTalk: they distinguish between nil and false
	and I feel that thier attitude is the right one.

	To get the same level of real-word-perception as SmallTalk has,
	it is needed to:
	(1)	* raise error if argument to RTEST isn't kind of Boolean
	(2)	* remove all #to_* and boolean (#&, #|) methods for nil.

Note (1): I know that if we do this all code will be broken and has to
be rewritten or corrected. And that's why this has no solution for 
Ruby 1.x (- hopefully in Rite?)

Note (2): Makes it sence to convert 'Nothing' (nil) to Float or
Integer??? I don't think so.

PS: nil is instance NillClass (in Ruby). Class name in SmallTalk is
'UndefinedObject' - personally: I think that using nil in this sence
(UndefinedObject) is the right perception of 'nil' term.
 
	But there are much more skilled SmallTalkers than I have - I'd
	like to hear their opinion...
	
		Michal

-- 
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Michal Rokos                         Czech Technical University, Prague
E-mail:m.rokos@sh.cvut.cz      ICQ:36118339      Jabber:majkl@jabber.cz
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

In This Thread