Loris1123 / RbScheme

Scheme Interpreter written in Ruby
Other
1 stars 0 forks source link

Faculty not working #10

Closed Loris1123 closed 8 years ago

Loris1123 commented 8 years ago
(define (fac n)(if (eq? n 1) 1 (* n (fac (- n 1)))))

This is a working faculty function using recursion. When I enter this I get the error Invalid number of arguments for SchemeDefine. Need between 2 and 2. Got 5, which is obviously wrong.

Loris1123 commented 8 years ago

Faculty IS working. There is a syntax mistake in the upper statement. If I put a space between (fac n) and the follwing if-statement, everything is working:

(define (fac n)(if (eq? n 1) 1 (* n (fac (- n 1)))))

In Racket, the statement without the space is working. I will have to check where the reader is reading wrong.

Loris1123 commented 8 years ago

Accidently fixed in some commit... Probably 318e25055aeeb84359e9047b7e194d6abb0af3be