axoned icon indicating copy to clipboard operation
axoned copied to clipboard

🧠 Logic: ♻️ Refactor getLoadedSources to Avoid Reflection in file.go

Open coderabbitai[bot] opened this issue 1 year ago • 0 comments
trafficstars

There's a need to refactor the getLoadedSources function in x/logic/predicate/file.go to avoid using reflection when accessing the loaded field of the VM. This approach is brittle and relies on the internal structure of the VM, which is not ideal.

The issue was identified during the review of PR #501, specifically in the context of standardizing error handling across the x/logic/prolog and x/logic/predicate packages.

A method on the VM should be provided to access this information in a more robust manner.

For more context, see the comment chain in the PR:

  • PR URL: https://github.com/okp4/okp4d/pull/501
  • Comment URL: https://github.com/okp4/okp4d/pull/501#discussion_r1451455506

coderabbitai[bot] avatar Jan 13 '24 11:01 coderabbitai[bot]