how about:

``` ruby
def extensions
  @extensions ||=
    begin
      extensions = @extensions || []
      extensions += superclass.extensions if respond_to?(:superclass) && superclass.respond_to?(:extensions)
      extensions
    end
end
```

and the register_extension would just become:

``` ruby
```