Merged
Conversation
Interpreter treats function call which has an error argument as an error. But for tuple it was not a case. This commit makes interpreter returning Error if any atom in the tuple returned error.
If the first member of a tuple ("operation") is an application which has
a BadType error then previously code returned empty result because both
tuple and function alternatives was not working. Old interpreter
returned NoValidAlternatives error in this case. After this commit code
returns a type error.
Necr0x0Der
approved these changes
Mar 5, 2025
Collaborator
Necr0x0Der
left a comment
There was a problem hiding this comment.
Thanks. I believe this is a more convenient way to handle errors. It may change how errors are pulled through agents in metta-motto, but in a positive way
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.
Return
Errorresult when one of the tuple members is evaluated to theError. PR fixed incompatibility between old interpreter and minimal MeTTa based interpreter which seems not to be reflected by tests.@Necr0x0Der adding you to review the test cases especially the d5_auto_types.metta scenario which now interprets further the results of the
collapseand returns(Error ...)instead of((Error ...)).