Skip to content
This repository has been archived by the owner on Apr 21, 2019. It is now read-only.

fixing getFromRefOfRun issue #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

jaymelbe
Copy link
Contributor

The method stored the previous value once but then forgot it which led to a problem for the 3rd call to it with the same record.

@sjmackenzie
Copy link

would you mind adding a test case to this commit. I'd like to see exactly what the problem is, otherwise we risk introducing bugs. in future please commit a test case, this is standard operating procedure. thanks for the PR!

@jaymelbe
Copy link
Contributor Author

As I keep saying, you just need to call the method 3 times with the same parameters:
getFromRefOrRun(pbeer(id:2087747 port:))
getFromRefOrRun pbeer(id:2087747 port:))
getFromRefOrRun(pbeer(id:2087747 port:))

The first time.. it returns .. which corresponds to a distributed port, which is stored (bound to OldVal)
The second time.. it works .. which corresponds to the same distributed port, that was stored .. but this port is then forgotten (OldVal is not bound anymore)
The third time.. it returns _ while it should return .. because the OldVal is not bound anymore

The solution is to set NewVal = OldVal when coming back with a known value.

@sjmackenzie
Copy link

indeed, the point of this requested test case is to add it to a test suite that is compiled and run independently of beernet.it will be added to mozart2 oz's canonical test suite so that in future this bug does not surface should someone happen to make a one liner change. this is standard operating procedure and good coding practice. Also we want to make sure your bug fix is indeed a fix, nothing speaks louder than executable code independent of beernet. It also saves us time.

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

Successfully merging this pull request may close these issues.

2 participants