From: Andrew Backer Date: 2005-10-05T13:41:47+09:00 Subject: Re: Monitoring total memory usage? Wow, quick responses ;) No, i don't know about PP. I am just accustomed to having serious output formatting control in fortran, c & derivitives, etc. for printing ints, floats, hex, padding, ... Its probably here, I just don't know where it is. I just extend the class for each individual program. I wrote the resize so I don't have to worry about what arrays I pass into the function. resize(n,def) just .clear's it and stuffs a bunch of 'def' in to up to size n. I haven't yet writting large ruby programs, so no experience worrying about things. Array *index* wrapping is useful in some cases (fibonacci numbers with no extra assignments). However, most of the time when I accidentially go past the lower bounds I would like to know since a[x-1] wasn't intended to set the value at a[9], but since x was zero it did. nums = [1,2,3] # nums[-1] = 3 mums[2] = 3, nums[-2] = 2, etc def calc_fib(n) a = [0,1,0] for i in 2..n k = i%3 a[k] = a[k-1] + a[k-2] end return a[n%3] end