-
Notifications
You must be signed in to change notification settings - Fork 17
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
Case as replacement for cond #37
Comments
Yes,
|
Well, question was for general case and example was just to demonstrate my question. In general It could be needed to check several different conditions. Anyway, thanks for the answer. |
I agree this approach is too verbose for many different conditions. You can also right your own case implementation:
But pay attention that |
Yes,
but it doesn't. This difference should be explained in a tutorial. |
Another funny was would be to write:
It seemingly works, but the difference with normal |
BTW, my guess is that in @vsbogd implementation
will at least screen out evaluation of the tail if |
Yes, unfortunately it is inevitable with current |
I've got some question regarding possibility to replace scheme's
cond
with metta'scase
. Is it possible? I've tried to write simple check function to see if my idea works:But apparently it doesn't work since, as i understand case, it will check not if $x larger than $y but instead if
(== $x (> $x $y))
(expression equality). Is there some way to write this code using case in current metta state? Or only consequent if's are usable in that case? @vsbogd @Necr0x0DerThe text was updated successfully, but these errors were encountered: