I wanted to try and learn Lisp, but I very quickly gave up. I figured I\'d try again. I\'m looking at Problem 2 on Project Euler - finding the sum of all even Fibonacci numbers
;;; I try to write code as suggestion of @PESTO
(defun Fibo-Test (n / one_prior two_prior curr sum i)
(setq i 2) (setq one_prior 1 two_prior 1 )
(cond
((= n 0) (setq sum 0) )
((= n 1) (setq sum 1) )
((= n 2) (setq sum 1) )
(T
(while (and (< i n) (< sum (* 4 1e6)))
;;; convert to Real-num
(setq sum (+ (float one_prior) (float two_prior)))
(setq i (1+ i))
(setq curr sum)
(setq
one_prior two_prior
two_prior curr
)
) ; end while
) ; end cond(T)
) ; end cond
(princ (strcat "\nF(" (itoa i) ") = " (RTOS sum) " . "))
(princ)
) ; end function Fibo-Test