title: Is it possible to separately declare block parameters of an array element which is passed into a block for the inject method?
body: <p>Here is what I'm doing right now that currently works, but I feel is a bit lacking in syntactic sugar...</p>
  
  <pre><code>f = RGeo::Geos.factory
  coords = [ [1,1], [2,2], [1,3] ]
  points = coords.inject([]) {|points, coord| points &lt;&lt; f.point(coord[0], coord[1]); points }
  #=&gt; [#&lt;RGeo::Geos::CAPIPointImpl:0x3fff0950a508 "POINT (1.0 1.0)"&gt;, #&lt;RGeo::Geos::CAPIPointImpl:0x3fff0950a47c "POINT (2.0 2.0)"&gt;, #&lt;RGeo::Geos::CAPIPointImpl:0x3fff0950a454 "POINT (1.0 3.0)"&gt;] 
  </code></pre>
  
  <p>Here is what I would like to do:</p>
  
  <pre><code>points = coords.inject([]) {|points, x, y| points &lt;&lt; f.point(x,y); points }
  #=&gt; [nil, nil, nil]
  </code></pre>
  
  <p>Right now that is returning an array of three nil values. Is it possible to declare the array values of an element being passed into the inject block separately like it is possible with the each method?</p>
  
  <p>Side note:
  It's safe to use same variable name for the first inject block parameter (the "result" variable) and the variable on the left side of the equals sign, right? I'm thinking yes because this would just be a typical case of recursion. Please comment if you feel or know otherwise.</p>