From: Hal Fulton Date: 2004-05-25T11:04:06+09:00 Subject: Re: pp and (my) sstruct Tanaka Akira wrote: >>And if I remove the pp library and call p, it complains that >>pretty_print_inspect is not defined. How could this work without >>"require 'pp'"? > > If you don't require pp.rb, pp.rb cannot help you. > Define inspect yourself. My goal was to have a normal inspect that did not depend on pp.rb, but allow prettyprinting if pp.rb *was* used. I thought you meant there was some kind of magic going on. No magic here, I guess. I suppose I can do if defined? pp alias inspect pretty_print_inspect else def inspect # ... end end Is this acceptable, or is there a better way? Thank you, Hal