In Copenhagen on APL90 there was a proposal for an error like this
(i. 7) { i. 5
+---------+-----------+-----------+
|0 1 2 3 4|index error|index error|
+---------+-----------+-----------+
Or something like it
2009/3/7 Bo Jacoby <[email protected]>
>
> To the very honored designers of J.
>
> The vocabulary states that: "If x is an integer in the range from -n=: #y
> to n-1 , then x{y selects item n|x from y ."
>
> Now my question is the following: What is the purpose of the restriction
> "in the range from -n=: #y to n-1"? Why not simply define: "If x is an
> integer, then x{y selects item (#y)|x from y ." ?
>
> This suggests a generalization of the present definition. Arrays are then
> addressed cyclically, and the distinction between zero-origin indexing and
> one-origin indexing disappears.
>
> For example:
>
> (i. 7) { i. 5 NB. Nobody prefers an error message to a result.
> |index error
> | (i.7) {i.5
>
> (i. 7) { i. 5 NB. My suggestion is the result (here faked).
> 0 1 2 3 4 0 1
>
> (_5+i. 7) { i. 5 NB. it works in an arbitrarily restricted interval
> 0 1 2 3 4 0 1
>
>
>
> Thank you.
>
> Bo Jacoby
>
>
>
>
> Trænger du til at se det store billede? Kelkoo giver dig gode tilbud
> på LCD TV! Se her http://dk.yahoo.com/r/pat/lcd
> ----------------------------------------------------------------------
> 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