Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions src/pattern-matching/exercise.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,17 @@ the course. An expression can be "boxed" with `Box::new` as seen in the tests.
To evaluate a boxed expression, use the deref operator (`*`) to "unbox" it:
`eval(*boxed_expr)`.

Copy and paste the code into the Rust playground, and begin implementing `eval`.
The final product should pass the tests. It may be helpful to use `todo!()` and
get the tests to pass one-by-one. You can also skip a test temporarily with
`#[ignore]`:
Create a new Cargo library project with

```sh
cargo new --lib evaluator
```

Copy and paste the code below into a the `src/lib.rs` file.

Then begin implementing `eval`. Use `cargo test` to ensure that the final
library passes the tests. It may be helpful to use `todo!()` and get the tests
to pass one-by-one. You can also skip a test temporarily with `#[ignore]`:

```none
#[test]
Expand Down
Loading