From: Hugh Sasse Staff Elec Eng Date: 2004-12-02T01:59:31+09:00 Subject: Re: to_s, inspect, etc. On Thu, 2 Dec 2004, Hal Fulton wrote: > Charles Mills wrote: >> On Nov 30, 2004, at 8:15 PM, trans. (T. Onoma) wrote: >> >>> Indeed. I like the idea that #inspect produce a string that will produce >>> an >>> equivalent object when passed through #eval. This already works for >>> literal >>> forms like Array. >>> >> >> like: >> my_instance.inspect #=> "MyClass.new(10,11,12,'ducks')" >> >> not sure if I like that ;) > > It's an interesting idea, but I wouldn't favor using #inspect > for that. I'd like something like this. It would mean one could marshal data in a readable form, and not have the Pythonesque whitespace issues that YAML brings. YAML is very good for many things, but if other people (whose background is unknown) need to edit the data, you can bet one of them will not notice the whitespace subtleties, and break something. I'd like something with the conciseness of ruby or YAML, but with a more robust format. I don't see how one could create self-referential structures this way though, or have an array with more than one occurrance of exactly the same object. I don't want to ask for pointers in Ruby! > > > Hal > Hugh >