I like the "levels of a tree" idea as it is a good graphic metaphor for nested arrays. My only quibble is calling a vector of simple atoms level 1 rather than 0.
On Wed, Jan 20, 2021 at 12:07 AM Hauke Rehr <[email protected]> wrote: > I’m stuck. I tried wrapping up my thoughts and failed. > Now I’ll just leave it as the stub it is. > > > Thanks, Raul, > > my first reaction was: > Why would anyone talk about them differently? > (an ignorant/arrogant reaction) > Then I thought > Looks like I just bought into everything I read when learning J. > > … and then I remembered how I am talking about J > I usually say something like > “In J, there’s a single compound data structure: > the arbitrarily dimensioned (rectangular; homogeneous) array” > > So that’s why for me there hasn’t been any hurdle > conceptually for I always thought of an array as > something by definition composite (though maybe > in edge cases containing less than two elements), > a container for other things. This is both about > the words “compound” and “structure”. Atoms are > by definition not structured (at least when viewed > as atoms; there may be structures /inside/ a box). > > And if we had more than this one compound data structure, > all of them would eventually come down to being built > from atoms. The problem arises in a language where there > is no different structure showing atoms to be the necessary > condition of the possibility of structures. And there isn’t > even a visible syntax for the most elementary kind of > array literal. It looks exactly like the syntax for an > atom literal. Even lisp distinguishes visibly between > a value and its singleton structure. And whenever you > have only this one compound structure, it will be able > to represent a list/1-D-array which may contain a single > element. And that might look like it’s nothing but an atom. > But it isn’t! > > > > What about Raul’s “arrays vs array contents” distinction? > Atoms are ontology, the matter (and thus may be contents). > Arrays are ideas, relationships between atoms. > > But there’s more to that distinction. > At its heart, I think, there is a double meaning: > We use the word “array” both for the structure and for the > “array of atoms” denoting the data assembled in that structure. > This actually holds for any kind of data structure. > (The sentence “This array of data is given in form of an array” > seems to be nonsensical. Now substitute “bunch” for the first > “array”. You couldn’t say “bunch” instead of the second one. > This is about grammar.) > And an array can never not be an array of (possibly 0) atoms. > > > > A user is always dealing with data represented in a structure. > So both with an array and its contents. She uses verbs like > |. dealing with the structure, and *: dealing with the contents. > But both can be called “working on an array”. Confusion galore. > > Having items entails being a structure. > It all comes down to this distinction. > Any array has items. Maybe their count is 0. > Still, that would be 0 items. > An item always either is a singleton (containing an atom) > or an array (containing items, and eventually atoms). > An atom never has items. It’s data, not structure. > > I’d tend to describe them simply this way: > The items of A are the things (compound or not) > A has been built from. It’s just like packing > and unpacking, like boxing and unboxing, in > multiple layers. You need to open the outermost > layer first. A 3 by 4 matrix is not built from > numbers, its rows are. And only after its rows > all have been built, the matrix could be built > /from them/. > > > > And a noun? To me, that’s on a completely different > language level. It’s not by chance that we use > grammar terms for telling verbs and nouns apart. > > If we actually had different kinds of composite > data structure other than arrays, they all would > qualify as nouns. The structure is the exact thing > the concept “noun” is meant to not care about. > Think about it: it doesn’t even care aroubt > the structured/ness/ of data (atom or structure). > [ > It’s rather like the equivalence class of all > (data and) data structures if you so will. > ] > > > > Am 20.01.21 um 03:43 schrieb Raul Miller: > > I had not spent enough time in nuvoc to notice this "atom is not an > > array" distinction. > > > > Even now, looking at https://code.jsoftware.com/wiki/Vocabulary/AET#, > > this distinction does not really leap out at me. > > > > Still... it might be useful to have a word for the thing which an > > array with no dimensions (or an array whose dimensions are all 1s) > > contains. (And, other arrays would also contain atoms, of course, > > unless they had a dimension which was zero). > > > > That said... since all atoms in J are contained in arrays, from a user > > perspective, this also seems like a non-issue. (Which, perhaps, is why > > that distinction did not leap out at me). > > > > But, also, the line "An atom is a noun with the rank of zero" seems to > > get at the user perspective (where we're talking about arrays rather > > than array contents). > > > > It seems to me that if we explicitly wanted to talk about array > > contents as distinct from arrays, we would emphasize that issue and > > instead say that atoms cannot have rank, or something like that? [I am > > not convinced that this is a good idea. Since it's more about > > implementation details than the interface the user works with, nuvoc > > probably isn't the place for it?] > > > > And, *that* said, I think what you're getting at is the clause in the > > definition of "array" which says that it has more than zero > > dimensions. So... as far as nuvoc's glossary is concerned, we need to > > say "noun" if we want to talk about things with zero or more > > dimensions. Kind of sneaky, for those of us used to using 'array' for > > that purpose. > > > > But this gets into a bit of a bind with the definition of 'item'. > > There, to stick to this usage, you would say, perhaps: "A sub-noun > > whose rank is one less than that of the noun". Otherwise, a noun of > > rank 1 could not have items. (But my rephrasing also feels awkward.) > > > > Anyways... something to think about? > > > > Thanks, > > > > -- > ---------------------- > mail written using NEO > neo-layout.org > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > -- Devon McCormick, CFA Quantitative Consultant ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
