You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now we think of a worklogs tree with a single task as being a worklogs_node with a single child worklogs_leaf. But we could potentially end up with a situation where we have a tree that's just a worklogs_leaf. For example:
By calling new
By calling extract_worklogs pointing towards a worklogs_leaf
Some potential approaches:
We could potentially treat this as a special case that's effectively the same as a worklogs_node with a single child worklogs_leaf. We could give it the name as the description from the internal data frame. But then we'd have to program around this everywhere.
If the leaf doesn't contain any worklog entries then we won't be able to extract a name.
We could throw an error in this case
We could make the name of the worklogs be an argument to new and store it with the object. Since we don't really want users to call new directly this might not be a big deal. Furthermore, it might be convenient to store the name of the worklogs along with the object (presumably as duplicated information in lockstep with the names of the parents @children slot.
As a variant of (1) we could try to "fix" the situation whenever we encounter it and wrap worklofs_leaf in a worklogs_node. But if we've already programmed around the special case everywhere is this even helpful?
We could throw an error when we do encounter it.
We'd have to create top-level versions of functions to catch this case
Would this be annoying to the user?
The text was updated successfully, but these errors were encountered:
I've decided to make the name of the worklogs be an argument to new and store it with the object, and then program around this special case in all of the functions that operate on worklogs. I think this is the best solution since we can't stop people from using new, and that way we can always perform valid operations on a 'worklogs' object.
Right now we think of a worklogs tree with a single task as being a
worklogs_node
with a single childworklogs_leaf
. But we could potentially end up with a situation where we have a tree that's just aworklogs_leaf
. For example:new
extract_worklogs
pointing towards aworklogs_leaf
Some potential approaches:
worklogs_node
with a single childworklogs_leaf
. We could give it the name as the description from the internal data frame. But then we'd have to program around this everywhere.new
and store it with the object. Since we don't really want users to callnew
directly this might not be a big deal. Furthermore, it might be convenient to store the name of the worklogs along with the object (presumably as duplicated information in lockstep with the names of the parents@children
slot.worklofs_leaf
in aworklogs_node
. But if we've already programmed around the special case everywhere is this even helpful?The text was updated successfully, but these errors were encountered: