title: Is it possible for a macro to turn an identifier lowercase?
body: <p>Is it possible to generate a symbol or identifier in a Rust macro
  from a string? Or to perform string-like operations on a identifier?</p>
  
  <p>I wanted to generate a method given a symbol, but need to downcase it to
  obtain the method name.</p>
  
  <pre><code>get!(B);
  
  // should expand to
  
  fn b() -&gt; B {
      // method body
  }
  </code></pre>
  
  <p>It's easy to get close...</p>
  
  <pre><code>macro_rules! get {
      ($kind:ident, $method:ident)
          =&gt;
      {
          fn $method() -&gt; $kind {
             // method body
          }
      }
  }
  
  get!(B, b)
  </code></pre>
  
  <p>But dissatisfying.</p>