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.
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
Add cond link #2066
Add cond link #2066
Changes from 9 commits
cf9b228
243162b
96156e7
8db9fd3
d271c1f
c5c91c6
af817f5
4fb3479
3c0b651
9261486
331ac00
43bce1e
4284d8c
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Instead of this check, and the checks below, it would be better to check if the even atoms are evaluatable, and the odd ones are executable.
nameserver().isA(type, EVALUATABLE_LINK)
andnameserver.isA(type, EXECUTABLE_LINK)
The EVALUATABLE_LINK type already exists, and "does the right thing"; the EXECUTABLE_LINK does not yet exist) (I started adding it a few weeks ago, but did not finish. Perhaps you can add it, in a separate pull req?)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.
This is not wrong, but there is now a new and better way of doing this: call
exps[i]->execute(scratch)
.This generic
execute()
method is brand new, introduced just a week ago, and it is meant to resolve multiple issues with calling the instantiator directly.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.
Hi @linas, In case of eager execution the expressions in the CondLink might have been already executed right? such as an ArithmeticLink might have been already reduced to a NumberNode and calling execute on that NumberNode should throw the "Not Executable" exception in Atom.h? or am I missing something?
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.
Yes, for eager evaluation, the arguments will already have been reduced. There should not be any exceptions as a result, as the reduction is (meant to be) performed only once, not twice.
Lay evaluation would be better; it almost works; there's some open issue saying "must finish this work. Anyway, toe CondLink code looks OK to me.
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.
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 Nil says. Your editor seems to forget to inert a newline.