[#3726] Fixnum#clone and Float#clone raise different exceptions — "David A. Black" <dblack@...>

Hi --

15 messages 2004/11/12
[#3749] Re: Fixnum#clone and Float#clone raise different exceptions — "David A. Black" <dblack@...> 2004/11/16

Hi --

[#3751] Re: Fixnum#clone and Float#clone raise different exceptions — Yukihiro Matsumoto <matz@...> 2004/11/16

Hi,

[#3752] Re: Fixnum#clone and Float#clone raise different exceptions — "David A. Black" <dblack@...> 2004/11/16

Hi --

[#3785] The latest 1.8.2 cvs prints parse error when starting extension compiling — Yukihiro Matsumoto <matz@...>

Hi,

13 messages 2004/11/23
[#3787] Re: The latest 1.8.2 cvs prints parse error when starting extension compiling — Johan Holmberg <holmberg@...> 2004/11/23

Re: Fixnum#clone and Float#clone raise different exceptions

From: "David A. Black" <dblack@...>
Date: 2004-11-25 11:55:53 UTC
List: ruby-core #3819
Hi --

On Wed, 17 Nov 2004, David A. Black wrote:

> Hi --
> 
> On Tue, 16 Nov 2004, Yukihiro Matsumoto wrote:
> 
> > Hi,
> > 
> > In message "Re: Fixnum#clone and Float#clone raise different exceptions"
> >     on Tue, 16 Nov 2004 21:12:30 +0900, "David A. Black" <dblack@wobblini.net> writes:
> > 
> > |Just replying to myself, in the hope of triggering response from Matz
> > |and others....  This glitch is actually looming fairly large in
> > |ActiveRecord's clone facility, which stumbles on Floats. 
> > 
> > Hmm, do you mean the fact that clone fails for Numbers etc?
> 
> No, I mean it fails in different ways.  Fixnum#clone gives a
> TypeError; Float#clone gives a NoMethodError.  

Following up, based on some examination of source and some chatting w/
Mauricio and others:

Floats are not immediate values, so they think they can be cloned.
However, there's no Float allocator, so when they try to clone, they
hit a NoMethodError.  

I think it would be good to have them respond with a TypeError, like
Fixnums, even though it would be for slightly different reasons.  

Does that sound good?


David

-- 
David A. Black
dblack@wobblini.net


In This Thread