What happened to this site? And what's that frog about?

Ungroup on arbitrary subview column

F49 - Failure Feedback Forum 

Status: resolved Severity: failure Category: Vlerq Created: 2006-12-07 Updated: 2006-12-09

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

Summary

Asview passes its arg to def, but it should really wrap it in a list. Fixed by defining asview as vopdef in Tcl again.



2006-12-07 btheado

Imported

2006-12-09 jcw

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.

Add a comment:

Tip: add empty lines between paragraphs and indent lines to prevent reformatting.

Your name or initials:  

Powered by Mavrig