title: Getting object instance by string name in scala
body: <p>I need the object (or "singleton object" or "companion object"... anything but the class) defined by a string name.  In other words, if I have:</p>
  
  <pre><code>package myPackage
  object myObject
  </code></pre>
  
  <p>...then is there anything like this:</p>
  
  <pre><code>GetSingletonObjectByName("myPackage.myObject") match {
    case instance: myPackage.myObject =&gt; "instance is what I wanted"
  }
  </code></pre>