Skip to content

Return error from tuple#866

Merged
Necr0x0Der merged 4 commits intotrueagi-io:mainfrom
vsbogd:return-error-from-tuple
Mar 5, 2025
Merged

Return error from tuple#866
Necr0x0Der merged 4 commits intotrueagi-io:mainfrom
vsbogd:return-error-from-tuple

Conversation

@vsbogd
Copy link
Collaborator

@vsbogd vsbogd commented Mar 4, 2025

Return Error result when one of the tuple members is evaluated to the Error. 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 collapse and returns (Error ...) instead of ((Error ...)).

vsbogd added 2 commits March 4, 2025 17:09
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.
@vsbogd vsbogd requested a review from Necr0x0Der March 4, 2025 15:06
Copy link
Collaborator

@Necr0x0Der Necr0x0Der left a comment

Choose a reason for hiding this comment

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

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

@Necr0x0Der Necr0x0Der merged commit 3a685c3 into trueagi-io:main Mar 5, 2025
2 checks passed
@vsbogd vsbogd deleted the return-error-from-tuple branch April 15, 2025 13:27
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.

2 participants