I rather like the way it's doing right now. An index error usually means two very important things to me: 1. During development, it halts everything and I can analyze what I did wrong. 2. During production, unless I actually missed it during development, I am relatively sure that the data is wrong and not have it quietly generate a wrong Purchase Order or a wrong Invoice, etc.
:) -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Björn Helgason Sent: Sunday, March 08, 2009 3:29 AM To: Programming forum Subject: Re: [Jprogramming] The meaning of dyad 'from', ({) 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 ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
