Just like i. I should prefer not to include the upper bound.

   i.3
0 1 2
   i._3
2 1 0


R.E. Boss


-----Oorspronkelijk bericht-----
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Jose Mario Quintana
Verzonden: woensdag 24 september 2008 17:04
Aan: Programming forum
Onderwerp: Re: [Jprogramming] Integers from x to y

That is really neat!  If you still want to include the edge...

    3(<.+i.@(+ *)@-~)7
3 4 5 6 7
 
    7(<.+i.@(+ *)@-~)3
7 6 5 4 3




----- Original Message ----
From: R.E. Boss <[EMAIL PROTECTED]>
To: Programming forum <[email protected]>
Sent: Wednesday, September 24, 2008 4:24:10 AM
Subject: RE: [Jprogramming] Integers from x to y

Correction

  3(<[EMAIL PROTECTED])7
3 4 5 6
  7(<[EMAIL PROTECTED])3
6 5 4 3


R.E. Boss


-----Oorspronkelijk bericht-----
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens R.E. Boss
Verzonden: woensdag 24 september 2008 10:22
Aan: 'Programming forum'
Onderwerp: RE: [Jprogramming] Integers from x to y

More general

  3(<./[EMAIL PROTECTED])7
3 4 5 6
  7(<./[EMAIL PROTECTED])3
6 5 4 3


R.E. Boss


-----Oorspronkelijk bericht-----
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens R.E. Boss
Verzonden: woensdag 24 september 2008 10:15
Aan: 'Programming forum'
Onderwerp: RE: [Jprogramming] Integers from x to y

Most elegant is

  3 (-.~&i.) 7
3 4 5 6

Or if you want to include y 

  3 (-.~&i. >:) 7
3 4 5 6 7


R.E. Boss



-----Oorspronkelijk bericht-----
Van: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Namens Geoff Canyon
Verzonden: maandag 22 september 2008 9:19
Aan: Programming forum
Onderwerp: [Jprogramming] Integers from x to y

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?

regards,

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

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

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

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

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

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

Reply via email to