-
Notifications
You must be signed in to change notification settings - Fork 174
Enable "display" standard library function #139
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
Conversation
Any instance of createContext() has been given the appropriate parameter. As a result, the context has a property that corresponds to the location it is in (externalContext === 'assessment' or 'playground')
timed does not work as of yet, as the initial implementation does not work in the first place.
- This does not care about context, and runs the same as map or filter. I think this should be changed in the future. Unfortunately, I had little reference as all implementations of `timed` failed when I tried them (sourceacademy2). - To make this run, I disabled redux-persist. I shall add what happened into the tracked issue. To get this to run, checkout createStore.ts and index.tsx from a commit prior to adding the cache (from master). - I will move timed back into the "infinity" chapter after getting it to work. - Logging does not work as of now.
We should find a way to type the action payloads to catch erros like these (where we are forced to pass things as untyped objects)
Missed out a todo there (but its coming up in the next commit)
038a71f
to
5607191
Compare
Pull Request Test Coverage Report for Build 115
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interpreter no longer evaluates asynchronously.
const f = (i) => i < 3 ? 0 : f(i-1) + f(i-2);
const delay = () => f(13); // increase value for longer delay
function iter(i) {
delay();
display(i);
return i === 0 ? 0 : iter(i-1);
}
iter(15);
Interesting. The handleConsoleLog actions seem to run before the render method is called, causing the state to be correct but the stop button and display output not rendering till the very end. Really weird, good catch! |
I've confirmed this to be a bug present previously, even in the master branch. I've opened up an issue (#142). |
Features
display
andtimed
workexternalContext
. In this case, it is aWorkspaceLocation
.Issues fixed
Caveat
display
andtimed
do not work unlessredux-persist
is turned off. This is related to redux-persist stores extra parts of the state #138 , where it attempts to stores the Context (when it is not supposed to), or something related to the workspace, and hence throw an error on trying to serialise an object with a circular structure. Once redux-persist stores extra parts of the state #138 is resolved, the functions will work.