[#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,

Re: Possible strangeness in Numeric

From: matz@... (Yukihiro Matsumoto)
Date: 2004-03-08 04:20:25 UTC
List: ruby-core #2603
Hi,

In message "Re: Possible strangeness in Numeric"
    on 04/03/07, Mathieu Bouchard <matju@sympatico.ca> writes:

|Have you tried something like this?:
|
|class Numeric
|  def to_int
|    x=self.to_i
|    raise "not a representation of an integer" if x!=self
|    x
|  end
|end
|
|class Float; remove_method :to_int; end
|class Integer; remove_method :to_int; end
|
|So (2.5).to_int raises, but (2.0).to_int returns 2, and
|Rational(4,3).to_int raises, but Rational(6,3).to_int returns 2.

Very interesting idea.  I'm not sure whether this is what people (who
wants float values to integer arguments) want.  But still very
interesting.

|Complex(2.0,0.0).to_int, however, doesn't work, because Complex doesn't
|have a #to_f nor a #to_i at all. I am wondering what a good default #to_f
|for Complex would be. It wouldn't be modulus because then
|Complex(-2.0,0).to_f == +2.0, which would be really bad. Taking the real
|part sounds more reasonable. I don't really have any other ideas.

We can just raise TypeError Exception when number does not have to_i.

							matz.

In This Thread

Prev Next