-
Notifications
You must be signed in to change notification settings - Fork 55
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
Need accessor for loaded module's space, within MeTTa #466
Comments
The issue is that running the script manually initializes the environment using the default An updated version of the test is here: https://github.com/luketpeterson/hyperon-experimental/blob/b504aeb1de476c13d0f9fbf4e9d7112088cca939/python/tests/scripts/f1_imports.metta But this modified test fails in the test environment. Harking back to the discussion here: #450 (comment) , the deeper issue is that some aspects of this test are testing an incidental behavior (arbitrary detail of the implementation) rather than a fundamental behavior (something a user can depend on). In my opinion, a better test would bind a name to the loaded module, and then make sure that module was successfully loaded into the space by retrieving it by name, rather than taking for granted that the space would contain exactly N atoms and that the ith atom in a |
Thanks Luke, my description is incorrect. I was confused by the fact the test fails in minimal MeTTa on a different line than it fails when I run it using REPL. Thus you are right that it is an issue of the test itself. |
This test tests a certain behavior. If this behavior is changed, this is detected by the test. Whether it is incidental or fundamental, the change apparently breaks some compatibility. Some users are already surprised that |
init.metta is a user-customizable part of the environment. Any MeTTa code the user would like to run automatically upon the creation of a runner can go there. The idea is that it will also provide hooks for initializing things like the module search paths and other environment-specific settings, as well as running any setup code the user might want for their application. init.metta was loaded as a module to keep the config Space separate from the top-level &self space, but that cuts both ways as the user may want to load directly into &self. #467 changes init.metta to run in the runner's top-level space, rather than to treat it as a module. Independently of that, #468 adds the "module-space" accessor operation to the stdlib, in order to access the space of a loaded module. (I didn't add it to stdlib2, although it could be easily migrated) Ideally we can agree on a good way to test module loading without encouraging users to rely on the specific order of atoms returned by |
I thing we can close this issue, given the implementation of the Do you agree @vsbogd? |
Just to confirm my understanding:
Thus I think we can close it but I would suggest adding a word about this stdlib's dependency what is it exactly. |
Right. corelib and stdlib are separate modules. corelib is the rust stdlib. stdlib is the Python stdlib.
Yes. As long as you're running under Python. The comment at the top of |
When I run
f1_imports.metta
manually I get the following error:!get-atoms(&self)
returns[GroundingSpace-0x55abbf778a08, GroundingSpace-0x55abbf8c9f58]
while&self
isGroundingSpace-0x55abbf7ab278
thus&self
contains imported modules atomspaces which is expected but doesn't contain&self
.The text was updated successfully, but these errors were encountered: