From: Matt Armstrong Date: 2001-07-20T14:53:30+09:00 Subject: [ruby-talk:18175] Re: Debugging minimalism for newbies (Re: Re: An exercise in minimalism) ts writes: >>>>>> "A" == A Bull in the China Shop of Life writes: > >>> n=$*[0].to_f/2 >>> (0-n..n).each{|x|puts" "*x.abs+"#"*(2*(n-x.abs))} > > [...] > >A> Is there any way to step through this one substatement at a time? When run >A> through the Ruby debugger the debugger wants to treat this as like 2 >A> logical lines which doesn't help :) > > You can always ask ruby to know what it do > > pigeon% cat b.rb > require 'iis' > puts dump > n=$*[0].to_f/2 > (0-n..n).each{|x|puts" "*x.abs+"#"*(2*(n-x.abs))} > pigeon% > > pigeon% ruby b.rb 8 > require("iis") > puts(dump) > n = $*[0].to_f / 2 > (0 - n .. n).each do |x| > puts((" " * x.abs) + ("#" * (2 * (n - x.abs)))) > end Where do you get iis? squeaker% ruby -v ruby 1.6.4 (2001-06-04) [i686-linux] squeaker% cat b.rb require 'iis' puts dump n=$*[0].to_f/2 (0-n..n).each{|x|puts" "*x.abs+"#"*(2*(n-x.abs))} squeaker% ruby b.rb 8 b.rb:1:in `require': No such file to load -- iis (LoadError) from b.rb:1