Greetings,
I suppose my examples were meant to show that my box and unbox function as I hoped, and that they functioned consistently with all data configurations. I wasn't intending to point out the benefits. I suppose I thought that might be clear from my earlier emails. In response to you, however, I will now try to demonstrate the differences and explain why I like mine better.
I use nested arrays to contain groups of related data - like structures in C. In C, the programmer can determine the level of nesting and the structure of the data they wish to maintain. One structure can be nested in anyway, and to any depth, as defined by the programmer. Except for pointers, data items don't get defined at one level and than magically appear at another place in the defined structure. You can predict how things will be represented.
The fact that APL2 is defined such that ⊂ and ⊃ are defined such that they don't add or subtract levels of nesting means that I get different data representations based on different data. The best example is I ask a user to enter a name. The code operates differently depending on whether the user enter a single character or multiple characters.
Let me give an example that was I problem I had that sparked this whole thing. I wanted to write a function that had a right hand argument that could either be a single item (a key) or two items (a key and a value). I wanted to use the first item if two were passed, and the single item if a single item was passed. So, the user could pass me a key, or a key value nested array pair. Let's see what they look like:
'key' 'value'
┌→────────────┐
│┌→──┐ ┌→────┐│
││key│ │value││
│└───┘ └─────┘│
└∊────────────┘
'key'
┌→──┐
│key│
└───┘
≡'key' 'value'
┌─┐
│2│
└─┘
≡'key'
┌─┐
│1│
└─┘
Cool, I can tell if the user passed in a key value pair, or just a key. But wait:
'k' 'v'
┌→─┐
│kv│
└──┘
'kv'
┌→─┐
│kv│
└──┘
≡'k' 'v'
┌─┐
│1│
└─┘
≡'kv'
┌─┐
│1│
└─┘
Look at that! I can't tell the difference between 'kv' single key, or the key value pair 'k' 'v' !!
Now, I've already shown that my box/unbox can pack and unpack or group and ungroup arbitrary arrays like ⊂ ⊃. Let's see if my box/unbox have the same problem as ⊂ ⊃.
≡(box 'k'),box 'v'
┌─┐
│3│
└─┘
≡'kv'
┌─┐
│1│
└─┘
Ahh. My box/unbox can group/ungroup like ⊂ and ⊃, but I can now tell which it is! I can tell the difference between two independent characters, and a single character vector!!
Also, since my box/unbox will box/unbox anything (i.e. including scalars), my program controls levels of nesting - not my data!
Does that answer your question?
Blake