David:
> > Is there any way to manipulate the list of processes set to run at
> > execution by at_exit? 

Dave:
> Well, you could write your own. 
>      class AtExit
>        @@thingsToRun = []
>        @@names = {}
...
>        def AtExit.delete(name)
>          index = @@names[name]
>          if index
>            @@thingsToRun.delete_at(index)
>            @@names.delete(name)
>          end
>        end

Thanks for your efforts and good example of easy to read code. First I'd
like to ask what are those @@variables. Let me guess, class variables.
There's a mention at ToDo.

Now I might reveal my stupidity, but the second point is about the
functionality of the AtExit.delete. I haven't tested your code, just read
trough it, but I suspect this wouldn't work correctly (while it seems to
work). Let's assume 

@@thingsToRun = [lambda {print "foo\n"}, lambda {print "bar\n"}]   # and
@@names = { "foo" => 0, "bar" => 1 }

then we call AtExit.delete("foo"); And get:

@@thingsToRun = [lambda {print "bar\n"}]   # and
@@names = { "bar" => 1 }

Then code 

>        def AtExit.runHandlers
>          @@thingsToRun.reverse_each { |thing| thing.call }
>        end

works perfectly but wouldn't work when written as

  def AtExit.runHandlers
    @@names.each {|name, thingIndex| @@thingsToRun[thingIndex].call }
  end

as there's no @@thingsToRun[1].

	- Aleksi