Hi--

On Thursday 09 December 2004 08:17 pm, David A. Black wrote:
| I would just as soon have things remain as they are (with the possible
| exception of making String#delete destructive; I think it's the only
| one that isn't).  But if Matz chooses to revisit this area, I would
| not want to see "compact" become a general-purpose method for removing
| elements.  [1,2,3,4].compact(3)  just doesn't communicate anything
| along the lines of [1,2,4].
|

I wouldn't say it doesn't communicate anything at all. Compact does make one 
think it will be getting smaller. But I take you point, yet isn't it kind of 
silly to have two methods such that one of them is just a very limited case 
of the other?

So I now find myself wondering how to delete just the first occurring element. 
I suppose it's:

  a = [1,2,2,3,3,2]
  a.delete_at(a.index(2))

A #delete and #delete_all would seem more appropriate. Nontheless, as you 
pointed out, its not quite the same as compact because of the return value. 
So if not compact then we need a new method, I guess, #remove. But like I 
said kind of a waste of namespace.

T.