It doesn't take a scholarly knowledge of J to know that two different arrays can have the same display:
2+3 4 5 5 6 7 '5 6 7' 5 6 7 ,:'5 6 7' 5 6 7 ----- Original Message ----- From: Terrence Brannon <[EMAIL PROTECTED]> Date: Wednesday, April 4, 2007 2:30 pm Subject: Re: [Jgeneral] "J for C Programmers" - Controlling Verb Execution BySpecifying a Rank - please flesh out discussion - my attempt issupplied > Yes, without reading what you are saying too closely, my point was > that more than one thing can return the same printed representation > and without a scholarly knowledge of J, one might conclude one is > getting the same thing back. > > On 4/4/07, Dan Bron <[EMAIL PROTECTED]> wrote: > > >a lot of J must be taught - when the representation for an > empty list > > >and a rank-1 array of shape 0 are both blank lines... > > > > The display should be the same: a rank-1 array of shape ,0 > _is_ an empty list. If we use the narrower definition of list > given in http://www.jsoftware.com/help/dictionary/dicta.htm : > > > > 1120 77 qdoj 'dicta' NB. Section A: Nouns > > Arrays of ranks 0, 1, and 2 are > > also called atom, list, and table > > > > Then _only_ rank-1 arrays of shape ,0 are empty lists. If we > use the broader sense of list, as in "every array is a list of > items", then any array with 0 items an empty list. But then, not > all arrays with tally zero display the same way: > > > > < i. 0 > > ++ > > || > > ++ > > < i. 0 0 > > ++ > > ++ > > > > (the boxes just make obvious the difference in display) > > > > That is, empty rank-1 arrays display 1 blank line, empty not- > rank-1 arrays display 0 (blank) lines. Here, empty means "no > items", not "no atoms". Some arrays with items but no atoms (zero > volume) display blank lines: > > > > < i. 1 0 > > ++ > > || > > ++ > > > > The justification for this is that a rank-1 array is one line; > one line with no 0-cells is a blank line. A higher ranked array > has one line for each of its 1-cells. No 1-cells means no lines. > A higher ranked array with 1-cells but no 0-cells has 1 blank line > per 1-cell. ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
