0

I am trying to set up a part of this function because there are multiple parts to the equation. I keep getting the error of application: not a procedureand the equation looks like this and it supposed to be translated into a scheme function. My function currently looks like this:

((and (> m 0) (> n 0) ack(- m 1) (ack(m (- n 1)))))

1 Answers1

1

In Lispy languages parentheses are always meaningful and you can have neither too few nor too many.

In your case you start with a double open parenthesis ((and ... meaning you want to perform and and then call the resulting function. You probably want to remove one outer pair of parentheses.

Secondly, in Lisp you call functions with (fun arg1 arg2 ...) syntax, not fun (arg1 arg2 ...), so your ack(- m 1) (ack(m (- n 1)) bit should probably be (ack (- m 1) (ack m (- n 1))).

hkBst
  • 2,818
  • 10
  • 29