[#2529] concerns about Proc,lambda,block — "David A. Black" <dblack@...>

Hi --

39 messages 2004/03/01
[#2531] Re: concerns about Proc,lambda,block — ts <decoux@...> 2004/03/01

>>>>> "D" == David A Black <dblack@wobblini.net> writes:

[#2533] Re: concerns about Proc,lambda,block — "David A. Black" <dblack@...> 2004/03/01

Hi --

[#2537] Re: concerns about Proc,lambda,block — matz@... (Yukihiro Matsumoto) 2004/03/01

Hi,

[#2542] Re: concerns about Proc,lambda,block — Mathieu Bouchard <matju@...> 2004/03/02

[#2545] Re: concerns about Proc,lambda,block — matz@... (Yukihiro Matsumoto) 2004/03/02

Hi,

[#2550] Re: concerns about Proc,lambda,block — Mauricio Fern疣dez <batsman.geo@...> 2004/03/03

On Wed, Mar 03, 2004 at 07:51:10AM +0900, Yukihiro Matsumoto wrote:

[#2703] Proposed patch to add SSL support to net/pop.rb — Daniel Hobe <daniel@...>

This patch adds support to Net::POP for doing POP over SSL. Modeled on how

19 messages 2004/03/27
[#2704] Re: Proposed patch to add SSL support to net/pop.rb — Daniel Hobe <daniel@...> 2004/03/27

This is v2 of the patch. Cleaned up a bit and added some more docs.

[#2707] Re: Proposed patch to add SSL support to net/pop.rb — Daniel Hobe <daniel@...> 2004/03/28

v3 of the patch:

[#2721] Re: Proposed patch to add SSL support to net/pop.rb — Minero Aoki <aamine@...> 2004/03/30

Hi,

Possible strangeness in Numeric

From: Dave Thomas <dave@...>
Date: 2004-03-06 03:17:58 UTC
List: ruby-core #2599
To my surprise, Numeric defaults to implementing to_int by calling 
to_i. This means that, for example,

    (1.2).to_int  => 1

I don't think this is correct, as a Float is not a representation of an 
Integer, and so can't really stand in where an integer would. But 
having Float respond to to_int by rounding itself down implies that 
Floats are usable as Integers.

     obj = IO.new(3.14159)

That just doesn't seem right.

Clearly Float needs to support to_i, but to have all the Numeric 
objects (including Float and Rational) support to_int is (I believe) a 
violation of the intention of the to_xxx methods.

I suggest that the to_int implementation should be moved from Numeric 
to Integer.

Cheers

Dave


In This Thread

Prev Next