From: daz Date: 2004-03-15T00:59:36+09:00 Subject: Re: Kernel#y Ara.T.Howard wrote: > On Sun, 14 Mar 2004, Joel VanderWerf wrote: > > > > > Two suggestions for Kernel#y: > > > > 1. Make it private, like Kernel#p. > > > > 2. Let it take multiple args, like Kernel#p, something like: > > > > irb> y 1,2,3 > > --- 1 > > --- 2 > > --- 3 > > => nil > > > > Anyone see any sense in these? > > > > I could add > > > > 3. Tell everyone about it because it's very useful :-) > > do tell. 'y' for yaml? > # Create a bunch of stuff: ahash = {:a => 1, 'BB' => 2, 7 => 'seven', 'd' => 10} astring = RUBY_VERSION + ' ' + RELEASE_DATE afloat = Math::PI anarray = ['c', 111, Exception.new('Oops')] # Bunch it more: anarray.push(ahash).push(astring).push(afloat) p anarray # for comparison puts '.'*107, '' # See what yaml's y shows require 'yaml' # <-------------------------# y anarray ["c", 111, #, {"BB"=>2, "d"=>10, 7=>"seven", :a=>1}, "1.8.0 2003-08-30", 3.14159265358979] ............................................................................................................ --- - c - 111 - !ruby/exception:Exception message: Oops - BB: 2 d: 10 7: seven !ruby/sym a: 1 - 1.8.0 2003-08-30 - 3.14159265358979 daz