Fix import! to throw error when target file/library is not found#159
Open
ermijeremy wants to merge 1 commit into
Open
Fix import! to throw error when target file/library is not found#159ermijeremy wants to merge 1 commit into
ermijeremy wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Summary
This PR changes the import execution path so missing files/library targets raise a real Prolog exception instead of failing by backtracking to
false.Root Cause
import!previously swallowed all importer failures:Implementation Details
The change removes blanket exception swallowing and makes failure explicit.
import!now directly delegates toimporter_helper/2:resolution now follows:
Path)ensure_metta_ext/2->PathWithExtload_metta_file/3This yields standard SWI-Prolog error semantics and is catch-compatible.
For valid imports, behavior is unchanged:
path resolution
.mettaextension normalizationloading into the target space
Before
After
Validation