Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement Variable Length Lists with `elist` and `vlist` #29
Comments
|
For these, the S4 template would keep the actual template as an object. Will need to measure overhead of using S4. |
elist(Extensible List, could bexlisttoo) is an extensible list, where objects are accepted assuming that they have every element that is present in the template. This is supposed to mimic S4 objects where objects that inherit from another contain all the slots of the other. Some unresolved questions are whether the subset of elements must be first and in the same order as in the template, and whether named objects should be treated differently. In terms of implementation,elistwill probably produce and S4 object that will trigger special treatment.One question is how we do something like
structure(elist(...), attra, attrb)etc. as then the return value ofelistcan hardly be S4 as there could be conflicts between slots and attributes.vlist(Vector List) is a variable length list with the same template repeatedntimes. TBD whether we allow a repetitions argument, or whether people should use a normal list template for those.