Skip to content

REPL: add variant option #549

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

Merged
merged 24 commits into from
May 4, 2020
Merged

Conversation

arsalan0c
Copy link
Member

@arsalan0c arsalan0c commented Apr 16, 2020

This PR adds an option to the REPL for specifying a variant.

It also defines the supported chapter and variant combinations and uses it to check if the chapter and variant values passed to the REPL are valid.

Resolves #582

@arsalan0c arsalan0c requested a review from martin-henz April 16, 2020 15:09
@coveralls
Copy link

coveralls commented Apr 16, 2020

Pull Request Test Coverage Report for Build 3274

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.002%) to 83.517%

Totals Coverage Status
Change from base Build 3273: 0.002%
Covered Lines: 6467
Relevant Lines: 7458

💛 - Coveralls

@martin-henz martin-henz changed the title REPL: add variant option [WIP] REPL: add variant option Apr 17, 2020
@martin-henz martin-henz requested review from openorclose and removed request for martin-henz April 17, 2020 05:41
@martin-henz
Copy link
Member

Someone needs to clean this up. We should have:

  -c, --chapter=CHAPTER set the Source chapter number (i.e., 1-4) (default: 1)
  -v, --variant=..., one of default, lazy, non-det, interpreter, stepper
  -h, --help            display this help
  -e, --eval            don't show REPL, only display output of evaluation```
So lazy, interpreter and subst can all be wrapped in variant. We shouldn't entertain all the possible combinations. It's already complicated enough.

arsalan0c and others added 17 commits April 28, 2020 13:14
* fix bug: yield new array for array expression
* add user friendly REPL message
Adds the ambR operator which functions similarly to amb
but makes choices randomly instead of sequentially.

Also adds landing page and library documentation for
the operator, and adds this operator into the specs.
This PR adds support for while loops, including break,
continue and return statements in the loop body.

It also tweaks the scheduler so that stackoverflow errors
are captured and displayed to the user.

Co-authored-by: anubh-v <[email protected]>
This PR adds support for for loops, including break,
continue and return statements in the loop body.
Co-authored-by: Anubhav <[email protected]>
* Remove unhelpful comment

* Fix spelling in comment
@arsalan0c arsalan0c changed the title [WIP] REPL: add variant option REPL: add variant option May 2, 2020
@arsalan0c arsalan0c changed the title REPL: add variant option [WIP] REPL: add variant option May 2, 2020
@arsalan0c arsalan0c changed the title [WIP] REPL: add variant option REPL: add variant option May 2, 2020
@martin-henz martin-henz merged commit 01f7c81 into source-academy:master May 4, 2020
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

Successfully merging this pull request may close these issues.

Chapter and variant combinations are undefined
4 participants