I wrote: > The official documentation is light on atomic > representations (a.r.s), and aside from the > overview at [1] (referenced earlier), I believe > they're supposed to be "self-explanatory".
Joe Bogner responded: > The NuVoc entry on ` also covers it well: > http://www.jsoftware.com/jwiki/Vocabulary/backtick I think it's worth drawing a distinction, here. Atomic representations (a.r.s) and gerunds are intimately related, but not identical. The documentation for 5!:1 covers the former, and the NuVoc entry for tie discusses the latter. A gerund is an array of a.r.s. That is, the atoms of a gerund are atomic representations. Note that this definition includes a single, solitary, a.r. under "gerund" (just as "4" is still an "array" - because all nouns in J are arrays, singleton or compound). So, the real difference between a.r.s and gerunds is one of focus. When we say "atomic representation", we're focusing on the _value_ of the atoms: what a specific a.r. represents, how we might change it, and what it could do if we "woke it up", all without reference to the larger context. In contrast, when we speak of "gerunds", we're focusing on the _structure_ of the array, without reference to the specific values. So, for example, we often like to talk about how @. is a functional analog to case statements, because it takes a list of potential functions to call -- a gerund -- and evokes one based on characteristics of its input. We discuss this in the abstract, as we discuss case statements in the abstract, without reference to any specific list of functions or input. In contrast, the majority of this thread has been focused on the manipulation of a.r.s to produce different, related, a.r.s. For example, when we described how to extract the a.r. of y from the of a.r. y"_ by applying {.@>@:{: to the structure '"';y;<'0';_ . This effortless, seamless transition of focus from frame to contents and contents to frame is one of the hallmarks of J, and one of the joys of working with the language. In fact, I believe the APLs' true gift to the world -- and their most likely legacy, their impact on computer science -- is precisely that they endow the position of data with as much significance as its value. I really don't think it's a stretch to draw an analogy with the advancements in mathematics permitted by the improvement of positional notation over the Roman numeral system. So, just as we might talk about the number 12345 or the digits 1 2 3 4 5, we might talk about the gerund +`-`*`%`^ and the verbs + - * % ^ . For example, the 3rd digit of 12345 is 3 and the 3rd verb of +`-`*`%`^ is * . The magnitude of 12345 is 5 (# 1 2 3 4 5) and the length of +`-`*`%`^ is 5 (# +`-`*`%`^). We can add 1 to the number 12345 (12346) or the digits 1 2 3 4 5 (23456) or a colon to the a.r.s + - * % ^ (+:`-:`*:`%:`^:) or the gerund +`-`*`%`^ (+`-`*`%`^`(<':')). Etcetera. It's actually a fun exercise to look at the Vocabulary and identify which verbs are structure- vs value-oriented*. Unsurprisingly for an array language, there's a good mix of both. In contrast, such a balance would be very surprising for a scalar-oriented language. Though we can begin to see the dawn breaking: e.g. the Java SDK defines a large number of core classes, which are analogous to value-oriented verbs in J, but if you compare the number og methods each defines, you might notice some statistical aberrations in the Collection category. More explicitly: Java has a buttload of built-in array functions, because the market demands them. But, as a language, Java hasn't yet recognized that manipulation of collections, as opposed to values, is a fundamental activity in computer programming. Hence, it provides value-semantics as fundamental, first-class members of its specification (classes) and structure-semantics as an afterthought - second-class citizens (functions on those classes). The time is ripe for another civil rights movement. Arrays are not second-class citizens. Arrays of the world (oh, the irony) ... unite! -Dan * Hint: look at verb rank. By definition, rank-zero (scalar) verbs are value-focused, because they can't even *see* arrays, only values. In contrast, verbs with unbound (infinite) rank can see values, but generally don't care to look at them. For example, * - * % are rank 0, whereas # $ < {. are rank _ , and %. is rank 2 (a little bit of both). PS: For an example of the difference between atomic representations and gerunds, one must only look to the paper that introduced both. Note that "Gerunds and Representations" only spends a single paragraph defining what an a.r. is The atomic (boxed, canonical) representation of an object uniquely represents it ... .. and then spends the balance of the paper, 7+ pages, describing the use of _arrays_ of them: An array so constructed, a noun derived from verbs, is a gerund. Since gerunds are arrays, they can be manipulated by verbs. In the jargon of computer scientists, verbs in J are thereby "first class" objects. But that paper is from is from 1991, so if you're looking for something a little more recent, there was discussion of the difference between gerunds and a.r.s, in the "verb display" thread last year (hey, I said /more/ recent): http://www.jsoftware.com/pipermail/programming/2012-February/027253.html ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
