Skip to content
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

include seems to cache the file contents somehow #186

Open
AdrickTench opened this issue Nov 8, 2024 · 1 comment
Open

include seems to cache the file contents somehow #186

AdrickTench opened this issue Nov 8, 2024 · 1 comment
Labels
bug Issues that represent errors in the code
Milestone

Comments

@AdrickTench
Copy link
Collaborator

The test file output_load_tests.metta tests modifying and loading a file. At certain points include exhibit strange, incorrect behavior. For example, the include for the ;; update overwrites but does not clear section:

Info: File /home/atench/mettalog/metta-wam/tests/baseline_compat/hyperon-mettalog_sanity/output_load_tests.tmp is 40 bytes (4 lines)
 (bar 1)
 (bar 2)
 (bar 3)
 (bar 4)
 (bar 5)
 (bar 6)

The actual contents of the file at that point are

"(bar 5)"
"(bar 6)"
"(bar 3)"
"(bar 4)"

The print out even correctly indicates that the file is 4 lines, but somehow include behaves as if the file was

 (bar 1)
 (bar 2)
 (bar 3)
 (bar 4)
 (bar 5)
 (bar 6)

and loads all of that into the space.

@AdrickTench AdrickTench added the bug Issues that represent errors in the code label Nov 8, 2024
@TeamSPoon
Copy link
Collaborator

TeamSPoon commented Nov 11, 2024

would you PR the output_load_tests.metta (the test that will help reproduce this)

If needbe allow it to use a shell script to alter the .tmp (shell! "./....sh") to invoke the changes.. (you might already be doing this)

i have a feeling that we want the include script lets say it contained 1 - 2 .. then you change remove 1- 2 and add 3-6 .. that we dont want the old contents to get deleted .. (everytime include is called on the same file, we want to treat it as if it came from a whole new file)

but i think you still are running into a bug that it not noticing the change and getting any new content.

@TeamSPoon TeamSPoon added this to the Month 4 of 5 milestone Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issues that represent errors in the code
Projects
None yet
Development

No branches or pull requests

2 participants