Hi - I was putting together an intro to the new dictionary addon, at the latest NYCJUG meeting - https://code.jsoftware.com/wiki/NYCJUG/2026-01-13#Populating_a_Dictionary - and ran into some problems.
I want to build a dictionary with extended integers as a key and the factors of that integer as the corresponding value. However, specifying ('keytype'; 'extended') did not allow me load my data. As a work-around, I specified both key and value as type "boxed" and was able to populate the dictionary but retrieval failed. I also converted the numbers to characters as boxed numbers did not appear to work.
Most puzzlingly, it did not fail for every case so I must have done something right, or at least half-right. Here's how to reproduce the issue:
]nums=. 1+10^i.5x
2 11 101 1001 10001
]factors=. q:&.>nums
+-+--+---+-------+------+
|2|11|101|7 11 13|73 137|
+-+--+---+-------+------+
params=: 'tree',&< ('keytype'; 'boxed') ,: ('valuetype'; 'boxed')
prms=: params conew 'jdictionary'
(":&.>nums) put__prms ":&.>factors NB. Populate
get__prms <":0{nums
+-+
|2|
+-+
get__prms <":1{nums
+--+
|11|
+--+
get__prms <":2{nums
+---+
|101|
+---+
get__prms <":3{nums
|index error: get__prms
|get__prms[0]
13!:19''
get__prms <":4{nums
|index error: get__prms
|get__prms[0]
13!:19''
get__prms <":1{nums NB. make sure this still works
+--+
|11|
+--+
Even more interestingly, when I did this same exercise with nums=. 1+10^i.10x, only the gets for 1 & 2 worked - 0 failed.
Please let me know what you think.
Devon McCormick