From: Gavin Sinclair Date: 2004-08-26T23:43:54+09:00 Subject: Re: Pretty Printing more widely On Thursday, August 26, 2004, 9:44:29 PM, Hugh wrote: > My patch would allow > pp greetings > fp.pp greetings > to reflect the orthogonality of the other methods. > Whilst it was trivial for me to fix I had to delve into pp.rb to > find out that this was possible. > IO doesn't have the p method, but since pp is more readable, I > consider it more useful, and thus a stronger candidate for inclusion > in IO than p would be. I agree in spirit, but let me offer an alternative. #pp is conceptually similar to #p. #p doesn't exist in IO-like classes because it's simply a shortcut for 'puts X.inspect'. To keep the analogy between #p and #pp, why can't #pp be a shortcut for "puts X.something"? In 'extensions', I define Object#pp_s. It's not a great name, but it's a very handy thing to be able to access. IMO it should be standard (with a different name). Cheers, Gavin