Let's say I'd like to create an info page which lists various items such
as:
  - disk space
  - current heap size used by urweb
  - memory allocated by embedded ruby interpreter (doesn't exist yet)

How would to design a such an interface which allows multiple libraries
to add their own pieces of information?

In Scala it would be easy:

  object ListOfInformationProviders {
    val list: ListBuilder()
    def add(provider){ list.add(provide0 }
    def allKeys() = {
      ... query all providers and return map or such
    }
  }

  external ruby code doesn't have to change core code:

  object RubyInformationProviders {
    ListOfInformationProviders.add(this); // register self as information 
provider
  }

Is there a way to model this in Ur as well?

Marc Weber

_______________________________________________
Ur mailing list
[email protected]
http://www.impredicative.com/cgi-bin/mailman/listinfo/ur

Reply via email to