[#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: ext/syck problems

From: Tanaka Akira <akr@...17n.org>
Date: 2003-05-13 18:26:37 UTC
List: ruby-core #1031
In article <20030513123008.244C.USA@osb.att.ne.jp>,
  "U.Nakamura" <usa@osb.att.ne.jp> writes:

> ext/syck was imported to the repository, however, we can see
> some problems.

I found other problems.

* warnings for Object#id in Ruby 1.8.

% ./ruby -w -ryaml -e 'puts({}.to_yaml)' 
/tmp/z/lib/ruby/1.8/yaml/rubytypes.rb:47: warning: Object#id will be deprecated; use Object#object_id
--- {}

* ruby -Ku causes an error.

% ./ruby -Ku -ryaml -e 'puts "a".to_yaml'
/tmp/z/lib/ruby/1.8/yaml/encoding.rb:63:in `iconv': cannot convert nil into String (TypeError)
        from /tmp/z/lib/ruby/1.8/yaml/encoding.rb:63:in `internal_to_utf'
        from /tmp/z/lib/ruby/1.8/yaml/emitter.rb:285:in `end_object'
        from /tmp/z/lib/ruby/1.8/yaml/emitter.rb:326:in `quick_emit'
        from /tmp/z/lib/ruby/1.8/yaml/rubytypes.rb:255:in `to_yaml'
        from -e:1

* Japanese character may not round trip.

% ./ruby -Ke -ryaml -e 'puts "\xa1\xa1".to_yaml'|ruby -Ke -ryaml -e 'p YAML.load(STDIN)'|cat -v
""
% ./ruby -Ks -ryaml -e 'puts "\x81\x40".to_yaml'|ruby -Ks -ryaml -e 'p YAML.load(STDIN)'|cat -v
""

The problem is in decoding because the result of encoding is not empty
as:

% ./ruby -Ke -ryaml -e 'puts "\xa1\xa1".to_yaml'|cat -v
--- "M-cM-^@M-^@"
% ./ruby -Ks -ryaml -e 'puts "\x81\x40".to_yaml'|cat -v                                        
--- "M-cM-^@M-^@"

% ./ruby -v
ruby 1.8.0 (2003-05-13) [i686-linux]
-- 
Tanaka Akira

In This Thread