On Sat, Aug 20, 2005 at 04:13:02AM +0000, Luke Palmer wrote:
: What is the resulting data structure in each of the following:
:
: -<< [1, 2]
[-1, -2]
: -<< [[1,2], [3,4]]
[[-1,-2], [-3,-4]]
This is assuming that AoA is treated as a two dimensional shape, of course.
One could imagine pointers to things that might or might not have the
right role to function as a subdimension, but the bias of hypers is
towards processing the leaves, not forcing the top level to (in this
case) numerify.
: -<< [[1,2], 3]
[[-1,-2], -3]
Basically, unaries don't have to worry about reconciling different shapes.
They just recurse as much as is "reasonable", whatever that is.
: [[1,2], 3] >>+<< [[4,5], 6]
[[5,7], 9]
: [1, 2, [3]] >>+<< [[4,5], 6]
Same as
[1 >>+<< [4,5], 8, [3] >>+<< ()]
which gives
[[5,6], 8, [3]]
I'd expect, maybe with a warning on 3 + undef, unless we default to
the identity value trait for + instead of undef.
Larry