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

Bugs (or asynchronicity?) in adding / querying atom in space #210

Open
vulecoff opened this issue Dec 5, 2024 · 0 comments
Open

Bugs (or asynchronicity?) in adding / querying atom in space #210

vulecoff opened this issue Dec 5, 2024 · 0 comments

Comments

@vulecoff
Copy link
Contributor

vulecoff commented Dec 5, 2024

There seems to be a bit of delay from adding atom into space to having it be visible for query. Is add-atom intended to be asynchronous?, if not this is a legitimate bug. Take the following program:


(Value 0)
(= (stress-space $x)
    (let* (
        ($last (- $x 1))
        (() (println! (Checking for $last)))
        ($added (collapse (match &self (Value $last) True)))
    ) (if (or (== $added ()) (> $x 2000))
        (Stopped At $last)
        (let* (
            (() (add-atom &self (Value $x)))
            ($next (+ $x 1))
        ) (stress-space $next))
    ))
)
!(stress-space 1)

This basically checks if the previous number is added. If not added then stops, otherwise adds the current number and continue. This should run up to the limit of 2000. Curiously the output stops at 71, [(Stopped At 71)]. However, if we go into repl right afterwards, we can verify that 71 does indeed exist with (match &self (Value 71) exists). This suggests there is a delay between add-atom in the second let* and match query in the first let*.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant