function factorial(n) {
  if (eq(n, 1)) {
    1
  } else {
    times(n, factorial(minus(n, 1)))
  }
}

print(factorial(4))