Michele Riva
Sep 6, 2021

--

You can declare an impure function by adding a `?` ad the end of the function name!

For example:

```

-- pure factorial

factorial 1 -> 1

factorial x -> x * factorial(x - 1)

-- impure factorial

factorial? (x) -> {

let mut result : Int

for n in [1..x] -> {

result *= n

}

}

```

--

--

No responses yet