You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(0-) (let PZ (prolog? (return Free)) \\ Free isn't derefed
(prolog? (receive PZ)
(unify PZ 1) \\ Should fail because PZ should not be a logic variable in this context
(return PZ)))
1
(1-) (shen.pvar? (prolog? (return Free)))
true
(2-) (symbol? (prolog? (return Free)))
false
It's more noticeable in larger code where the old pvar get's reclaimed before being used again:
"Exception in vector-ref: 19 is not a valid index for #(10 shen.-null- ...."
The text was updated successfully, but these errors were encountered:
@tizoc Not sure how SP handles this now, but I think the best choice is to either modify 'return' or create a variant which converts unbound pvars to normal variables with the same name (or some special 'dead' value). The full dereferencing which currently happens on return needs to traverse and re-build the whole term anyway so there would be no performance hit.
Making PVars reusable in different contexts is possible, but it adds extra constraints to the implementation which may have performance implications.
Anyway, the first option doesn't preclude the second, and is basically just a cut and paste job with minor modifications.
It's more noticeable in larger code where the old pvar get's reclaimed before being used again:
"Exception in vector-ref: 19 is not a valid index for #(10 shen.-null- ...."
The text was updated successfully, but these errors were encountered: