That is pretty neat!
As they used to say in the APL implementations is that you do what you find
natural and then the implementors find out a way to make it run faster if
possible if needed.

2008/9/24 Randy MacDonald <[EMAIL PROTECTED]>

> Hello R.E..;
>
> Given that the comparison machinery of  Less(-.) is not really needed, I
> submit the following::
>
>  3(}.i.)7
> 3 4 5 6
>
> Unfortunately it presents the same space usage problems:
>
>   1000003 (}.i.)1000007  NB. makes two BIG lists and discards most of them.
>
>
> R.E. Boss wrote:
>
>> 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
>>
>>
>>
>
> --
> ------------------------------------------------------------------------
> |\/| 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
>



-- 
Björn Helgason, Verkfræðingur
Fugl&Fiskur ehf,
Þerneyjarsundi 23, Hraunborgum
Po Box 127,801 Selfoss ,
t-póst: [EMAIL PROTECTED]
gsm: +3546985532
Landslags og skrúðgarðagerð, gröfuþjónusta
http://groups.google.com/group/J-Programming


Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans

góður kennari getur stigið á tær án þess að glansinn fari af skónum
/|_ .-----------------------------------.
,' .\ / | Með léttri lund verður |
,--' _,' | Dagurinn í dag |
/ / | Enn betri en gærdagurinn |
( -. | `-----------------------------------'
| ) | (\_ _/)
(`-. '--.) (='.'=)
`. )----' (")_(")
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to