F139 - Failure Feedback Forum
The following crashes for me:
view a def {1 2 3 4} | pair [view b def {1 2}] | get
Having this caught as an error would be helpful.
Thanks for catching this. I've however fixed it slightly differently: the result size gets adjusted to the minimum size of the input views.
You can therefore now also do things like "view $v pair 3", as alternative for the "first" vop.
Imported
The reason this failed is interesting, in a way: the "pair" operator is very different from all other operators, in that it constructs a view which does not add an extra layer of indirection (making it very efficient). Views are internally collections of columns: "pair" basically concatenates its two input collections into a new one. When the input views have different row counts, that caused the result to be a mix of different column sizes, which leads to all sorts of bad things. I now check view sizes, and apply the "first" operator on either side to end up with properly matched columns if necessary. Several tests added to verify all cases.
(it's not as easy to throw an error at this point, the "minimum of both" semantics were easier to implement)
Thanks for the fix. I like your solution of adjusting the size.