[#1094] Re: [ruby-cvs] ruby, ruby/lib: * eval.c (ev_const_defined, ev_const_get), variable.c — Dave Thomas <dave@...>

> * eval.c (rb_mod_autoload, rb_mod_autoload_p): new method;

12 messages 2003/05/29
[#1095] Re: [ruby-cvs] ruby, ruby/lib: * eval.c (ev_const_defined, ev_const_get), variable.c — nobu.nokada@... 2003/05/29

Hi,

Re: YAML problem

From: matz@... (Yukihiro Matsumoto)
Date: 2003-05-22 08:09:59 UTC
List: ruby-core #1070
Hi,

In message "Re: YAML problem"
    on 03/05/22, why the lucky stiff <ruby-core@whytheluckystiff.net> writes:

|I've changed it to raise an ArgumentError, as marshal does with
|its parse errors.  In what case do I raise an ArgumentError and in what
|case do I throw a TypeError?  What is the logic?  For now, I follow
|http://rrr.jin.gr.jp/rwiki?cmd=view;name=Marshal%3A%3AUT-Result.

I've believed I had a logic in choosing TypeError and ArgumentError,
but as I review the source, I found there's no logic, just arbitrary
choice.

In 1.8.0, I try to make them consistent.  Basically, all errors caused
by marshaling/unmarshaling object type raise TypeError, any other
errors raise ArgumentError.

							matz.

In This Thread