# Eval using Fold error

**URL:** <https://discuss.ocaml.org/t/eval-using-fold-error/6855>\
**Category:** Learning\
**Created:** [November 26, 2020, 6:28pm UTC](https://discuss.ocaml.org/t/eval-using-fold-error/6855 "2020-11-26T18:28:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![am3303](https://avatars.discourse-cdn.com/v4/letter/a/eb8c5e/32.png) [@am3303](https://discuss.ocaml.org/u/am3303)\
**Post date:** [November 26, 2020, 6:28pm UTC](https://discuss.ocaml.org/t/eval-using-fold-error/6855/1 "2020-11-26T18:28:01Z")

</div>

```auto
type exp = Zero | Var of string
type env = (string * int) list

```

---

<div class="post-metadata">

**Author:** ![pveber](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/pveber/32/44_2.png) [@pveber](https://discuss.ocaml.org/u/pveber)\
**Post date:** [November 26, 2020, 7:21pm UTC](https://discuss.ocaml.org/t/eval-using-fold-error/6855/2 "2020-11-26T19:21:20Z")

</div>

The value `zero` in the definition of `eval` is not defined. Since `eval` returns an `int`, why not replace `zero` by `0`?

Hope that helps!
