On Sat, Aug 24, 2002 at 09:47:14PM +0900, David Garamond wrote: > ts wrote: > >>>>>>"D" == David Garamond <davegaramond / icqmail.com> writes: > >>>>> > > > >D> def foo(self, x, y): > >D> if __debug__: > >D> self.__doc__x = "...some longish string..." > >D> self.__doc__y = "...some also longish string..." > >D> self.__doc_spec1__ = "...yet another string..." > >D> ... > >D> ... > > > > Well, I've perhaps not understood but you can write (like previously > > said) > >pigeon% ruby -e 'if $DEBUG; a = "a long string"; p a; end' > >pigeon% > > > >pigeon% ruby -de 'if $DEBUG; a = "a long string"; p a; end' > >"a long string" > >pigeon% > > but "a long string" still gets allocated by ruby. i want optimize _away_ > the debug portion, so ruby doesn't consider it exist at all. You could place all your debug strings in a separate file and do this: require 'dbg-strings.rb' if $DEBUG - alan -- Alan Chen Digikata LLC http://digikata.com