Skip to content

Interpreting version parameters #18

@ansharlubis

Description

@ansharlubis
  1. Associate version on a package basis

  2. Define requirements for version variables

public requirement Invertible {
  for class Point { Point inverse(); }
}

public class Line ver 1 «V,W requires Invertible» {
  public Point#V# p1;
  public Point#W# p2;
  public Line(Point#V# p1, Point#W# p2) {
    this.p1 = p1; this.p2 = p2;
  }
  public «Y» Line«V,Y» rotate() {
    return new Line«V,Y»(p1, p2Y»inverse());
  }
}

With requirements, checking can be done easily without having to infer constraints. Also, it can make it easier to understand.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions