Pretty much an outsider here - it's a long time since I wrote any code in J or 
any other language. What occurs to me, as it often used to when I was actually 
programming, is that J (and APL) are much more language-like than all the 
others. Leaving aside the adoption of noun/verb/adverb etc terminology, 
superficial but nicely provocative, the characteristic of, I guess, all natural 
languages is that there are (a) genuinely different ways of saying 
(functionally identical) things, and (b) there are always genuinely novel 
expressions arising, in written or spoken form. This is not in my experience 
true of any programming 'languages' other than the J/APL family. All 
expressions seem to boil down to variations of the same set - variations only 
distinguished by superficial naming, and/or their application in the 'real' 
world. I always loved the thought that I (or more likely someone else) might 
someday discover a startlingly novel inner-product that actually addressed some 
problem, and constituted a genuine invention of thought. As a 
non-mathematician, I make way happily to those who would say all the distinct 
fundamental pathways through the expressiveness of J have been explored, or at 
least elaborated. However, it was that perceived richness that first drew me to 
the languages, and continues to be a unique and admirable quality for me.

-----Original Message-----
From: Chat [mailto:[email protected]] On Behalf Of Raul Miller
Sent: 15 October 2017 17:05
To: Chat forum <[email protected]>
Subject: [Jchat] redundancy in J

It's interesting to note how J includes a fair bit of redundancy

For example, we have - but we also have <: (which is -&1) and we have -. (which 
is 1&-). Why do we have these?

Primarily, for educational contexts. It can be useful when teaching people to 
have specific words for commonly used operations.

The underlying principle here, I think, is one of giving people multiple 
perspectives when relaying a concept. I think the hope is that at least some of 
it will "stick".

But, also, for example, using -. for logical negation segues easily into 
bayesian probability. There, we do not simply have 1 and 0 for true and false, 
but we have a whole range of probabilities in between.
We can keep using -. for logical negation (it becomes the probability of the 
event NOT happening), but we have to switch from *. to * for combing events.

If A and B are independent probability variables then A*B is the probability 
that both are true. Similarly, if A and B are logical variables, then A*B is 
true if and only if both A and B are true. We can use * for logical AND. But 
the corresponding OR statement would be *&.-.

And J does not define that "bayesian OR" as a primitive, perhaps in part to 
emphasize the need for understanding its derivation, perhaps in part because 
it's only 5 characters already to get the implementation and perhaps in part to 
emphasize the divide between probability and logic.

Anyways, without -. we would instead need *&.(1&-) which is just a bit more 
unwieldy (but which, ok, would still work).

Food for thought, perhaps...

Thanks,

--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to