title: Making a range verb in J
body: <p>J is a fantastic programming language that I have decided to learn. As a simple exercise, I decided to emulate a range. There is a builtin function <code>i.</code> that creates a range <code>0..i-1</code>. Using some math, I have that this is the range between <code>a</code> and <code>b</code>:</p>
  
  <pre><code> a + i. (b - a - 1)
  </code></pre>
  
  <p><em>Success!</em> I thought. Now, the "simple" task of converting to a verb is set before me. This is my problem now. I have <code>a</code> (the left argument) being called on both sides of the verb <code>+</code>. I thought of using evoke, but I am not sure as how to make it work.</p>
  
  <p>So my question stands: How do I convert an expression of the form <code>a f (a g b)</code> or, more specifically, <code>a f (a g b h c)</code> (and similar forms) to a pure verb? I don't want to use explicit arguments, for what's the fun in that? ;)</p>
  
  <p><strong>EDIT</strong> My solution is as thus:</p>
  
  <pre><code>range =: [(+i.)&gt;:@-~
  </code></pre>