orangeduck/BuildYourOwnLisp

Arity of operators

ajaymonga opened this issue · 1 comments

Last example in ch 7 [- (* 10 10) (+ 1 1 1)] should be malformed as it supplies 3 arguments to binary + operator. Current Grammar does not enforce the arity. Is this intentional?

Yes this is intentional. If you supply three or more numbers to any of the operators it will apply that operator to all three. This is also the same in many other lisps. Thanks.