F49 - Failure Feedback Forum
It's not clear to me from the above whether you expect the "fully specified subview structure" to work with Vlerq 4, but I'm finding it doesn't:
Failed assertion at src/column.c, line 76: got == type
Asview passes its arg to def, but it should really wrap it in a list. Fixed by defining asview as vopdef in Tcl again.
Imported
Whoops. Turns out that the example above has a quoting issue in v4, try:
ratcl::vopdef extend {v colname expr} {
view $v pair [view $v collect $expr | asview $colname]
}
view {a b} def {1 {2 3 4} 2 {3 4 5} 3 4} | \
extend {{c d}} {[view d def $(b)]} | ungroup c | dump
Note the extra level of quoting in extend.
Ah, wait! Of course: asview passes its arg to def, but it should really wrap it in a list since def expects a list of columns, whereas asview gets one.
You should be able to work around that with:
ratcl::vopdef extend {v colname expr} {
view $v pair [view [list $colname] def [view $v collect $expr]]
}
Bit more work than in v3 because asview was not coded in Tcl, but I've fixed it in darcs. The v4 version is in Tcl again and can now deal with more than one arg, as in v3.