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

How to use the Protection annotation(s) #3622

Open
henrikt-ma opened this issue Dec 6, 2024 · 1 comment · May be fixed by #3629
Open

How to use the Protection annotation(s) #3622

henrikt-ma opened this issue Dec 6, 2024 · 1 comment · May be fixed by #3629
Assignees

Comments

@henrikt-ma
Copy link
Collaborator

henrikt-ma commented Dec 6, 2024

The presentation of the Protection-annotation at

doesn't fit the usual pattern of notation for annotations. How is one supposed to use the Protection record which doesn't have any declared members?

Should look like this, meaning that Protection has a single member called Authorization, but no member called License?

package MyLicense
  annotation(
    Protection(
      Authorization(
        libraryKey = "asdfsadf");
        license = {License(id = {"12345"})};
     )));
end MyLicense;

If so, would it be wrong to use it in the following form?

    Protection(
      Authorization = Authorization(

I must say that I also find it very confusing that there appears to be three different annotation record thingies called Protection, and it doesn't get less confusing when two of them contain their own License record… Does one of the Protection records have a member called License, but the others not?

@henrikt-ma henrikt-ma changed the title How to use the Protection annotation How to use the Protection annotation(s) Dec 6, 2024
@henrikt-ma
Copy link
Collaborator Author

henrikt-ma commented Dec 6, 2024

I think there could be a way out of at least some of the confusion here, if we made a distinction between the names of the pseudo record types and the instances of these records. I believe that this clarification could be made without any differences to what actual use of the annotations would look like.

For example, couldn't we do it like this, with all three Protection records merged into one?

record LicenseFileLicense
  /*literal*/ constant String licensee…
  …
end LicenseFileLicense;

record AuthorizationLicense
  /*literal*/ constant String licensor…
  …
end AuthorizationLicense;

record Authorization
  /*literal*/ constant AuthorizationLicense license[:]
end Authorization;

record Protection
  /*literal*/ constant Access access;
  …
  /*literal*/ constant Authorization Authorization;
  …
  /*literal*/ constant LicenseFileLicense License;
end Protection;

@HansOlsson HansOlsson linked a pull request Dec 17, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants