Hello Bill;

I suspect the difference in difficulty is your familiarity with tacit use of J. I can only encourage you to learn about tacit.

Also I note that, between you and Geoff, there are two sets of results:

  3 (4 : 'x+i.>:y-x')7
3 4 5 6 7
  7 (4 : 'x+i.>:y-x')3
3 4 5 6 7
  7 (4 : 'x+i.>:y-x')3
9 8 7
  f =: [+i.@(0&>[EMAIL PROTECTED])~
  3 f 7
3 4 5 6
  7 f 3

  $ 7 f 3
0




bill lam wrote:
On Mon, 22 Sep 2008, Geoff Canyon wrote:

Some programming languages have built-in commands that give the integers from x to y. I thought that would be a nice thing to have in J, so I wrote this:

f =: [+i.@(0&>[EMAIL PROTECTED])~

Is that a reasonable way to go about it?

This thread is interesting in that imo the explicit solution is much
easier to understand and remember than the tacit form.  Assuming verb
composition is not needed, I rather just use the phrase x + i.>:y-x


--
------------------------------------------------------------------------
|\/| Randy A MacDonald       | APL: If you can say it, it's done.. (ram)
|/\| ramacd <at> nbnet.nb.ca |
|\ |                         | The only real problem with APL is that
BSc(Math) UNBF'83            | it is "still ahead of its time."
Sapere Aude                  |     - Morten Kromberg
Natural Born APL'er          |
-----------------------------------------------------(INTP)----{ gnat }-



----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to