Git Product home page Git Product logo

non-deterministic-source's People

Contributors

anubh-v avatar arsalan0c avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

non-deterministic-source's Issues

Add memory to REPL

Currently, the REPL has no memory, i.e names declared in an iteration of the loop are only accessible in the iteration in which they are declared. In subsequent iterations, an Unbound name error occurs when the name is accessed.

Having the ability to reference names declared in previous iterations will increase the ease with which more complex programs can be written.

names declared as `const` are mutable

To reproduce:
parse_and_eval("const f = 1; f = 3; f;");

Expected: An error message indicating we cannot mutate the value of f

Observed: Value of f becomes 3

This is not a bug, rather a limitation.
This mechanism did not exist in the evaluator that we started from

Support for all features in Source 3?

Currently, we lack support for:

  • Arrays (array creation via literal array syntax, array access and array assignment)
  • for / while loops
  • break and continue keywords

Need to decide if this in within scope

Tests: Add sample programs from SICP JS 4.3

This is required for baseline goals.
Do we include as many as we can / all programs in the textbook?

Here are some of the simpler programs:

  • is_element_of

  • an_integer_starting_from (present in existing tests)

  • an_integer_between

  • prime_sum_pair

  • a_pythagorean_triple_between

  • Logic puzzle on multiple dwellings (requires the distinct list function)

Extend try-again to return a value

Currently, a global variable final_result is used to capture the result of an amb statement. When try_again is invoked, final_result is updated with the new value while try_again returns undefined.

Having try_again return a value can provide a cleaner way of accessing the new value.

Keep track of errors

Currently, testing of functionality that involves errors is not feasible. This is due to the error function which aborts the program.
As such, instead of invoking error when needed, the following can be done:

Keep track of the error message in a global data structure.
Subsequently check the error messages stored in the data structure as part of the tests in order to verify the expected behaviour of the program.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.