From: Dave Thomas Date: 2000-06-13T18:41:06-05:00 Subject: [ruby-talk:03378] Re: at_exit Aleksi Niemel� writes: > Then code > > > def AtExit.runHandlers > > @@thingsToRun.reverse_each { |thing| thing.call } > > end > > works perfectly but wouldn't work when written as which is why I wrote it that way > def AtExit.runHandlers > @@names.each {|name, thingIndex| @@thingsToRun[thingIndex].call } > end > > as there's no @@thingsToRun[1]. rather than that way! However, you're right - there is a bug in delete. If you delete two things, and the second has an index greater tahn the first, then it isn't deleted properly. The fix is left as an exercise for the reader. Dave