I disagreed with 'symbols' in 1 and I didn't understand 2:
>> At least: domain (new primitive) index transpose amend apply-at-rank
filter indices. From rank follows any rank-0 operation. Maybe: key
catenate shape reshape nub index-of tally reduce.
Please: when I was younger, I might have said 'What you say makes no
sense' to mean you were wrong; but after a long life of making mistakes
I mean no more than what I say: I don't get what you're saying. It
might be that I'm dense. There's no ego here, we're all trying to work
with difficult abstractions.
1. yes, and especially literal and boxed atoms and arrays.
yes, rectangular, as are all J arrays
2a. That's a good point. Since the key can be atomic or array, and can
be boxed, I'm not sure the default cases for (x { y) are germane.
b. I envisioned Dic , newitem as the idiom to add an item to Dic.
newitem would be an item of Dic.
Duplicate keys are interesting and important. There needs to be a
way to get the set of values associated with a key.
2c. The number of keys is surely of interest, as is the number of
distinct keys. There needs to be some way to query that, and ($ Dic)
seemed good for the number of keys; perhaps ($@~.) for the distinct keys
2e. This is a real issue. You say 'keys should not be ordered' but I am
not sure about that. This needs discussion.
Henry Rich
On 2/1/2022 12:16 AM, Elijah Stone wrote:
Can you clarify what you disagree with and what you don't understand?
1. A Dictionary is an array some of whose axes are indexed by
non-numeric value; that is, the index is not an integer.
1. I assume fractional and complex numbers are allowed too?
2. Is the array still rectangular? [proposed answer: yes]
a. ((<<x) { Dic)
Presumably x need not be double-boxed when it is atomic?
b. Dic , newitem
1. Should be newitem , Dic.
2. What is the format of newitem? Presumably it specifies both a key
and a value; hence, is it really Dic1 , Dic2? [proposed answer: yes]
3. If so, what do you do about duplicate keys? [proposed answer: take
them from the left argument]
c. $ Dic
What is the shape of a dictionary? [proposed answer: it is undefined]
e. ~. Dic (?)
I think not; keys should not be ordered.
-E
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
--
This email has been checked for viruses by AVG.
https://www.avg.com
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm