From: Jason Nordwick Date: 2006-09-14T23:38:04+09:00 Subject: Re: arbitrary indexes I don't believe I said anything of the sort. Of course I don't believe that going from value_at to [] would make my code faster, just that it would make it more compact. We started using Ruby for some moderately heavy numerics, and I haven't been able to be as concise (or productive) as I wish (or thought from what others told me). This doesn't necessarily reflect poorly on Ruby in its entirely, just I think we found a problem domain in the dead spot of the language. -j Gavin Kistner wrote: > From: Jason Nordwick [mailto:jason@adapt.com] >> Oh course. That's (now) blindingly obvious. I don't think there is much I >> can do to prevent all the value_at calls. I can't really lay out my arrays >> differently to get better continuity, and I seem to be using value_at >> almost every line where there is a decent amount of computation. Overall, >> arbitrary indexing seems far more useful than range based indexing using >> the [start,len] notation. After all, there is already start../...stop >> notation. Too bad I guess. > > It sounds to me like you're saying "Man, my program is slow because of all the #values_at method calls that I'm doing. I wish that I could use [1,3,5] to do what I want, because indexing like that would be faster." > > What you may not realize is that a[x] is itself a method call (the "[]" method) as is a[x] = 1 (the "[]=" method). So, there wouldn't be any inherent speed gain in changing arrays to do what you want them too. > > If you already realized this, sorry for the noise. >