Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interpreting version parameters #18

Open
ansharlubis opened this issue Aug 28, 2023 · 0 comments
Open

Interpreting version parameters #18

ansharlubis opened this issue Aug 28, 2023 · 0 comments

Comments

@ansharlubis
Copy link
Collaborator

ansharlubis commented Aug 28, 2023

  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.

@ansharlubis ansharlubis changed the title Interpreting version variables Interpreting version parameters Aug 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant