i´m a newbie in lisp , i try to programm a programm in lisp, that calculate binomial coefficient iterative (factorial) but NOT recursive. i´ve try everthing, global function, local function (factorial)), but my programm doesn´t work, for example when i command: (binom (7 4)), just got an error
SELECT ALL
(defun binom-coef(a b)
(if (or (< a b) (< b 0))
nil )
(flet fakul(n) ; factorial
(cond ((= n 0) 1)
(t (* n (fakul (- n 1))))))
(/ (fakul a) (* (fakul b) (fakul(- a b)))))
i´ve one more question, how to compile in emacs?
(i tried in buffer -> scatch -> (load "binom-coeff.el" but there´s only a error message...)
Many thanks, :)