title: How to use a variable for the key part of a map
body: <p>Let's say I have</p>
  
  <pre><code>def A = "abc"
  def X = "xyz"
  </code></pre>
  
  <p>how do I create a <code>Map</code> where, instead of </p>
  
  <pre><code>def map = [A:1, X:2]
  </code></pre>
  
  <p>I get instead the equivalent of writing</p>
  
  <pre><code>def map = [abc:1, xyz:2]
  </code></pre>
  
  <p>but can use a variables <code>A</code> and <code>X</code> for the key?</p>
  
  <p>P.S.:  Same question for the value part of the map.</p>