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