Skip to content

Commit b4abe07

Browse files
committed
Lab5 updated exercises.
1 parent 37f4cee commit b4abe07

File tree

2 files changed

+228
-80
lines changed

2 files changed

+228
-80
lines changed

docs/src/lecture_06/hw.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Homework 6: Find variables
2-
Following the lab exercises, you may thing that metaprogramming is a fun little exercise. Let's challenge this notion in this homework, where *YOU* are being trusted with catching all the edge cases in a AST.
2+
Following the lab exercises, you may thing that metaprogramming is a fun little exercise. Let's challenge this notion in this homework, where *YOU* are being trusted with catching all the edge cases in an AST.
33

44
## How to submit?
55
Put the code of the compulsory task inside `hw.jl`. Zip only this file (not its parent folder) and upload it to BRUTE. Your file should not use any 3rd party dependency.
@@ -18,8 +18,8 @@ return a tuple of *unique sorted symbols* representing variables in an expressio
1818
(:x, :y, :z, :c)
1919
```
2020
Implement this in a function called `find_variables`. Note that there may be some edge cases that you may have to handle in a special way, such as
21-
- variable assignments
22-
- ignoring symbols representing function calls
21+
- variable assignments `r = x*x` should return `r` as well
22+
- ignoring symbols representing function calls such as `log`, `exp`, etc.
2323

2424
```@raw html
2525
</div></div>
@@ -40,8 +40,15 @@ Nothing to see here.
4040
<header class="admonition-header">Voluntary exercise</header>
4141
<div class="admonition-body">
4242
```
43-
Create a function that replaces each of `+`, `-`, `*` and `/` with the corresponding checked operation, which checks for overflow. E.g. `+` should be replaced by `Base.checked_add`.
43+
Create a function that replaces each of `+`, `-`, `*` and `/` with the respective checked operation, which checks for overflow. E.g. `+` should be replaced by `Base.checked_add`.
4444

4545
```@raw html
4646
</div></div>
47+
<details class = "solution-body" hidden>
48+
<summary class = "solution-header">Solution:</summary><p>
49+
```
50+
Not yet published.
51+
52+
```@raw html
53+
</p></details>
4754
```

0 commit comments

Comments
 (0)