It looks like we are working with a preliminary implementation whose
upgrade path got dropped on the floor:

http://www.jsoftware.com/help/user/previous504.htm

Speculating, and looking at dates at
http://www.jsoftware.com/help/release/contents.htm I'd guess that
implementation focus shifted to optimizations shortly before we lost
Ken Iverson and never shifted back. I imagine that the local
architectural changes might have left the sparse implementation in the
dust. (Optimizations tend to be like that.)

It's probably still doable, and once the fixes for memory management
seem stable it might even be worth doing.

That said, the boxed display issue is worth thinking about.

Formatting a box containing a boxed array could be handled by
formatting the array and then representing the resulting character
literal array inside the box border.

Formatting a sparse array containing boxes could be done in a separate
release sparse arrays of boxes prove to be too onerous. Basically, I
imagine though that this would involve a j sentence to glue the
formatted indices x to the formatted box display y (both rank 2 but x
only has a single item) something like this:
   ((#y){.x,.'|'),.y

That said, thinking through the implications: it might be that some
primitives would only work on sparse boxes if the sparse element is
a:, and that other primitives will work on any sparse element but that
their result might have other sparse elements.

Basically, it may be that the sparse array implementation may itself
always be sparse, even if it is made more complete than it currently
is. And I would absolutely expect that reasonable releases would
provide partial implementations (so as not to stall things for too
long).

(End of speculation.)

Thanks,

-- 
Raul


On Sat, Dec 23, 2017 at 8:35 AM, Vijay Lulla <[email protected]> wrote:
> Hi all,
> Why can't I box sparse arrays?  I was exploring sparse arrays after it came
> up on the mailing list and was surprised to get a nonce error when I tried
> to box a sparse error.  Using the example given on the dictionary entry for
> $. to demonstrate the issue:
>
>    ] d=: (?. 3 4$2) * ?. 3 4$100
>  0 56  0  6
> 85  0  0 96
>  0  0 33  0
>    ] s=: $. d
> 0 1 │ 56
> 0 3 │  6
> 1 0 │ 85
> 1 3 │ 96
> 2 2 │ 33
>    s ; d
> |nonce error
> |   s    ;d
>    <s
> |nonce error
> |       <s
>    <d
> ┌───────────┐
> │ 0 56  0  6│
> │85  0  0 96│
> │ 0  0 33  0│
> └───────────┘
>
> I could not find any mention of this nonce error in the dictionary.  Please
> let me know if I have overlooked something obvious.  And I am curious how
> Roger Stokes managed to box sparse arrays in his LJ book.
>
> Thanks,
> Vijay.
> ----------------------------------------------------------------------
> 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