Search found 1 match
- Thu Oct 20, 2016 2:37 pm
- Forum: Scheme
- Topic: how do I run this procedure?
- Replies: 1
- Views: 27953
how do I run this procedure?
I am new to Lisp and im trying to define a function. This is the code i managed to write: (define (func n) (lambda (n) (cond ((= n 0) 0) ;;If n=0, return 0 ((= n 1) 2) ;;If n=1, return 2 ((= n 2) 37) ;;If n=2, return 37 ((= n odd?) (+ (func (- n 3)) 1) ;;If n is odd, return f(n-3) + 1 (else (+ (func...