Skip to content

Conversation

@ronan-d
Copy link
Contributor

@ronan-d ronan-d commented Nov 13, 2025

No description provided.

This changes the example code in the assignments RFC. The new code is
more efficient since it removes a free+malloc pair per assignment, and
the new behavior would be much more difficult to achieve with Standard
Ada controlled types.
@ronan-d ronan-d requested a review from QuentinOchem November 13, 2025 14:23
begin
Free (To.A);
To.A := new Integer'(Self.A.all);
To.A.all := Self.A.all;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The intent here is to demonstrate cleanup of the destination as well as deep copy. Perhaps using a string access instead of an integer will be better, let me see how to rewrite the example for that.

@ronan-d
Copy link
Contributor Author

ronan-d commented Dec 2, 2025

I put a rationale for the change in the commit message, but I just realized that GitHub's UI makes it easy to miss.

@QuentinOchem
Copy link
Contributor

I put a rationale for the change in the commit message, but I just realized that GitHub's UI makes it easy to miss.

Interesting - so indeed we're trying to show two different things. Would you mind if I put your example in the rationale bit, so that we keep the description of cleanup in the general case?

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 this pull request may close these issues.

3 participants