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

The design of cage is bad #3057

Closed
maxonfjvipon opened this issue Apr 5, 2024 · 1 comment · Fixed by #3074
Closed

The design of cage is bad #3057

maxonfjvipon opened this issue Apr 5, 2024 · 1 comment · Fixed by #3074

Comments

@maxonfjvipon
Copy link
Member

maxonfjvipon commented Apr 5, 2024

Current implementation of cage.new does all the magic inside #put() method which is not good:

@Override
public void put(final Phi phi) {
    if (this.forma == null) {
        this.forma = phi.forma();
    } else if (!this.forma.equals(phi.forma())) {
        throw new ExFailure(
            "Can't write an object formed by %s because object formed by %s was saved before",
            phi.forma(),
            this.forma
        );
    }
    if (this.locator == null) {
        synchronized (EOcage$EOnew.LOCATOR) {
            this.locator = EOcage$EOnew.LOCATOR.incrementAndGet();
        }
    }
    EOcage$EOnew.CAGES.put(this.locator, phi);
}

We need to find a way to move it to the #lambda() method.

cage should look something like malloc or memory:

[object] > cage
  @.new > new
  [] > @ /encaged # magic is in the lambda here
  [it] > encaged
    $ > new
    it > @
    [object] > encage /true # encage new object

Then we can use it like:

(cage obj).new > cge
cge.it # retrieve object from cage
cge.encage new-obj # encage new object
Copy link

github-actions bot commented Apr 5, 2024

@maxonfjvipon thanks for the report, but here some unclear moments:

  • The bug report lacks a clear and concise summary of the problem. The author should start the report with a brief summary that gives a quick overview of the issue.
  • The report does not provide any context or steps to reproduce the bug. The author should include information such as the environment in which the bug occurred, steps to reproduce the bug, and the expected versus actual results.
  • The report does not provide any details about the impact of the bug. The author should include information on how this bug affects the functionality of the software, or the severity of the issue.

Please fix the bug report in order it to get resolved faster.
Analyzed with gpt-4

maxonfjvipon added a commit to maxonfjvipon/eo that referenced this issue Apr 10, 2024
maxonfjvipon added a commit to maxonfjvipon/eo that referenced this issue Apr 10, 2024
maxonfjvipon added a commit to maxonfjvipon/eo that referenced this issue Apr 10, 2024
maxonfjvipon added a commit to maxonfjvipon/eo that referenced this issue Apr 10, 2024
maxonfjvipon added a commit to maxonfjvipon/eo that referenced this issue Apr 10, 2024
maxonfjvipon added a commit to maxonfjvipon/eo that referenced this issue Apr 10, 2024
maxonfjvipon added a commit to maxonfjvipon/eo that referenced this issue Apr 10, 2024
maxonfjvipon added a commit to maxonfjvipon/eo that referenced this issue Apr 10, 2024
maxonfjvipon added a commit to maxonfjvipon/eo that referenced this issue Apr 10, 2024
maxonfjvipon added a commit to maxonfjvipon/eo that referenced this issue Apr 10, 2024
maxonfjvipon added a commit to maxonfjvipon/eo that referenced this issue Apr 10, 2024
maxonfjvipon added a commit to maxonfjvipon/eo that referenced this issue Apr 10, 2024
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.

1 participant