-
Notifications
You must be signed in to change notification settings - Fork 57
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
Stop evaluation of expressions with variables as operations #473
Conversation
This is fast fix without pragma! because at the moment pragma! value is not reachable from the interpreter. More elegant fix could be implemented in minimal MeTTa.
I'm ok with it if it works for @ngeiswei |
i wonder how pln was blocked by matching first variable in an expression |
also if the first variable can't be matched we can modify a program by adding dummy symbol: (= (croaks Fritz) True) (= (_ croaks Fritz) True) So does this change actually changes anything? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about adding a compile-time macro around that code? That way we can postpone the decision of whether to make it the default behavior and give ourselves more time to experiment with/without.
It is easy to do and I can do it. Do you suggest turn old or new behaviour by default? Anyway I don't think it is a one way ticket and I consider this fix as a fast fix to unblock the PLN. As a proper fix I would like to add some method of control such matching in a MeTTa not event pragma, but custom |
I don't mind either way, as long as the flag is mentioned in the README.md. Maybe old behavior could be the default to minimize disruption for now.
👍 |
…tions Feature is on by default but can be switched off.
@ngeiswei , I added switch. @luketpeterson , could you please take a look to ensure REPL also has this feature turned on by default. I believe it is true, but I would ask you to double check. |
Because the feature is a default in the top-level lib's Cargo.toml, all downstream dependencies (including repl) get the feature without any explicit change. Disabling a default feature is another story, however. Disagreement on that has been going for 7 years and shows no sign of getting any better. rust-lang/cargo#3126 I don't fully understand the rationale for providing this as a compile-time feature at all. It seems like we should find one behavior that works in all cases, and make whatever changes are needed to the interpreter so that is possible. |
It's a hotfix for the blocker right now. That's the rationale. |
I am not questioning the change itself. You, Vitaly, & Nil have more clarity there. My observation was that, by making the feature a library default, the set of downstream clients who will get the old behavior is likely to be the empty set. So I wasn't clear on the value of using the Cargo feature mechanism. But not a big deal if it's temporary. |
Well, @ngeiswei requested this to be a compile time feature and he is the main user of the change, so I believe he will use it to unblock his work. |
@ngeiswei , are you ok with current state of the PR? |
The set might not be empty cause I might be in it :-) I'd rather have an easy way to switch on/off in case I need to. I'm happy with the state of the PR. |
Ok, I am considering it as an approve :-) |
This is fast fix for #242 to unblock PLN work. This code doesn't use
pragma!
because at the momentpragma!
settings are not reachable from the interpreter. More elegant fixes described in the issue could be implemented after migration to the minimal MeTTa.