-
Notifications
You must be signed in to change notification settings - Fork 59
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
Fix unique #785
Fix unique #785
Conversation
Remove internal interpreter call and fix type to interpret arguments before passing to the operation.
Rename old implementations to ...-atom, add MeTTa implementations of union, intersection, unique and subtraction with non-deterministic input and output.
@ngeiswei could you please check if it what you needed? |
Works like a charm, thanks! |
Unfortunately I spoke too fast :-(, it does not work in my case, but it is a complex one, I want to simplify it a bunch before pasting it here. But to give you an idea, the following !(unique (bc &kb
(fromNumber 5)
(: $prg (-> (: $x (SongIn "English")) (SongIn "Chinese"))))) does not work, while the following
does. Meaning that I need to explicitly collapse the results, then call I am not sure if it is a bug or a feature, I can still use that, but of course it is not as elegant as just calling |
Please find a simplified example (= (f) a)
(= (f) a)
!(unique (f))
!(let $y (collapse (f)) (unique (superpose $y))) |
Thanks @ngeiswei. Seems like it is a bug which prevented me to implement it last time. |
This is better than nothing, I can still use it by collapsing and superposing, so I approve merging if that's the best we can get for now. |
Well, I think we can merge it, because it is better then previous state. Then I will think how to fix it properly and raise another PR. |
Btw, @ngeiswei , the following code works:
|
Fixes #760
Also removes interpreter from the functions implementations.