On Fri, Oct 21, 2011 at 9:08 AM, Viktor Cerovski <[email protected]> wrote: > Marshall Lochbaum-2 wrote: >> While that is an important property, your argument is a lot like >> saying that an empty list cannot be counted as a list because >> all other lists have a first element. >> > It's exactly the other way around. Empty list is still a list, no?
I think that that was his point. > and that is the monoidal zero wrt list appending. > There is, however, no an "empty number", neither in J nor > mathematically. That depends, of course -- 0 could be thought of as an empty number. The issue, of course, is that you are not using "empty" to refer to a quality of a number -- you are using it to refer to a quality of an array. > So it's not about some deficiency of J per se. It is perhaps more > related to a so-to-say natural property that appending two numbers > gives a list, not a number, while appending lists still gives a list; > appending two chars gives a string, while appending strings gives > string, etc. Here is how I would map those concepts from english into J and then back to english: A number is an array which has a shape whose product is 1 and a value whose fill element is 0. A character is an array which has a shape whose product is 1 and a value whose fill element is space. A string is an array which has a rank of 1 and a value whose fill element is space. > What I find problematic in J regarding arrays, appending and > similar operations is the fill. In some circumstances is useful, > for instance for shift, but I mostly see it as a difficult problem > that needs a better solution rather than a language feature. I am having trouble parsing this sentence. > I mostly agree, and I like the same things about J. I just can't see > number as a special kind of matrix, and, that said, I never once felt > that this clashes with programming in J, so to me numbers and > matrices are two different things that work together just fine in J. Following the above convention, for me a matrix is an array whose rank is 2 and whose fill element is 0. So some numbers are matrices, and some matrices are numbers, but neither can be said to always be an instance of the other. This, superficially at least, seems to agree with how you have phrased your point here. -- Raul ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
