Skip to contents

Process check-in

Minor stuff I’m just doing. Bigger changes I get Davis to review. No semantic changes without discussion in issues

Changes

  • Non S7 classes
    • as_class() centralises all handling of classes (base types, S3, S4, and S7)
    • Strings now only refer to base types (previously used for S3 + S7 class in parent frame) new_class( parent = "function")
    • Numeric, atomic, and vector “types” as S7 unions.
      • Should we provide some wrappers to base unions and consider if we could get rid of string representation altogether? (e.g. base_atomic)
    • New s3_class() to define S3 classes.
    • S4 unions converted to S7 unions
  • Method registration
    • Clarify difference between registration and dispatch. Will flow into refactoring of C code in near future.
    • Dispatch is base/S3/S4/S7 class with S7 generic.
    • Registration is base/S3/S4/S7 class with S7 generic AND S7 class with S3/S4 generic.
    • All combinations now tested.
    • Thorough refactoring of method registration
  • Method dispatch
    • In generic, signature -> dispatch_args.
    • Simplified evaluation and restricted dispatch args (probably too much, but we relax as needed)
    • Should we provide a default dispatch argument name? x
  • Validation
    • Validate types, then call validator()
    • Also call validator() for all super classes
    • New props<- for multi-assignment. Only validates at end.
  • General QoL improvements to print() and str() methods

Next up

  • Refactor method dispatch
  • Defaults for properties, to get to point where constructor() without any argument usually works
  • Dispatch on Missing/Any
  • Coercion (cast())
  • Eliminate next_method() (up_cast())
  • Documentation

Discussion