Agreed on both counts. However, I was trying to deal with issues specific to } and also to provide some tools to make the different cases easy to recognize.
Of course it there's a name to the left of ~ you need to know whether that name is a noun or a verb, but whenever you're reading J code (or any code, or anything at all) and want to know what it does, you have to know what the name means, what it's value is. That's not specific to ~ at all. If it's clearer or (more directly to your point, I suspect) more comprehensive, we could say "when the [fully resolved] value to the left of ~ is a noun". My concern is if we put that in the fine print of our description of ~, we'd have to put it everywhere. Yuck. Regardless, I think the more relevant and immediately helpful point here is that noun arguments to ~ are _rare_. I think I've only seen two uses cases in the "wild": in J6 and earlier's generic wd_handler as a dispatch mechanism (basically parsing the output of wd'q', looking for verb names, and evoking them, because wd commands were actually implemented as independent, named verbs, rather than a single verb with a hard-to-maintain giant switch/case statement), and to delay, defer, or prevent immediate resolution of a name (e.g. to keep f. from inlining a larger public verb into a compact definition). Given the overall theme of "English Grammar" rather than "Computer Science" or "Mathematics" in the DoJ, I also think you're right that the name "reflexive" was selected for its linguistic rather than mathematical roots (though of corse the meaning in algebra is closely related - in fact, analogous - to the meaning in grammar), but I was trying to provide mnemonics, not origins. I wanted to make the different cases of ~ easy to distinguish and remember, rather than justify the naming convention. For that purpose, I thought drawing parallels to mirrors and copies (while still etymologically related) was more helpful than pointing out the analogs in English grammar for both "passive" and "reflexive" and leaving it up to the reader to remember which was which when the time came. In other words, I figured making 3 distinct categories would make the mnemonics work better (am I summoning something by name? No. Ok, am I making a mirror image or copy? No, ok, I must be doing that obscure sentence-diagramming thing, whatever it's called). -Dan PS: in retrospect, mirrors also swap left and right, so maybe a mirror isn't the least ambiguous analogy.... > On Mar 30, 2014, at 10:24 AM, lHenry Rich <[email protected]> wrote: > > When you say 'see a noun on its left' - yes, but it doesn't have to be a > quoted string; it can be a defined name. So name~ might be evoke, if name > turns out to be a noun. > > I think 'reflexive' refers to the linguistic use of the term rather than > having to do with reflection. Examples: > > I hurt myself. > Je m'appelle Henri. > Ich erinnere mich nicht daran. > > The noun appears in two places, as both the subject and object of the verb. > Just like verb~ y ! > > Henry Rich > >> On 3/30/2014 10:16 AM, Dan Bron wrote: >> You can tell immediately whether ~ is performing passive, reflexive , or >> evoke. >> >> Did you pass it a noun? Then it's evoke (this is very rare and very obvious: >> remember, as an adverb, ~'s argument is fixed at runtime, so you'd literally >> have to write or see a noun directly to the left of ~). >> >> You didn't pass it a noun? Ok, by definition, you passed it a verb. So ~ >> consumed that verb and produced a new verb. Did you pass that new verb one >> argument, or two arguments? >> >> If you passed the new verb one argument (aka "invoked the monad") then ~ >> will act in its reflexive capacity. If you passed the new verb two arguments >> (aka "invoked the monad") then ~ will act in its passive capacity. >> >> In other words, f~ ↔️ (] f ]) : (] f [) . That is, given a verb f, f~ will >> produce an ambivalent verb which will always invoke the dyadic valence of f >> (the monadic valence of f is thus ignored and therefore irrelevant). When f~ >> is invoked, the left argument to f will always be the right argument of f~ . >> >> Thus, the only difference between passive and reflexive is the right >> argument to f, which will be the left argument of f~ if it has one (ie if f~ >> was invoked dyadically) or the same old right argument as before if it >> doesn't (ie if f~ was invoked monadically and the only argument around to >> use is on the right). >> >> So ~ is hardly a demon from hell, because you know what you're getting when >> you invoke it. The incantations are simple and the consequences predictable. >> >> -Dan >> >> Ok, need a mnemonic? >> >> 'name'~ : evoke the name (call upon, summon up, conjure, recall) >> >> verb~ y : reflect the argument (mirror, create a perfect image, clone, put a >> mirror up so the verb sees two identical copies, etc) >> >> x verb~ y : use the passive voice (switch the ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
