Синтаксическая ошибка при табулировании функции - Lisp

Узнай цену своей работы

Формулировка задачи:

Добрый вечер У меня табулирование функции где здесь ошибка ?
(print "kol shagov N=")
(setq  n (read))
(setq  h (/ 0.5 n ))
 
(loop for x from 0.1 to 0.6 
      (      ((setq y (- x 8 ))  
        (print "x=")
         (print x) 
            (print "    y=")    
                (print y) 
                    (printline ""))
                        ( setq x (+ x h)) 
)
)
и почему while не распознает ?
(print "kol shagov N=")
(setq  n (read))
(setq  h (/ 0.5 n ))
(setq x 0.1)
( while (< x 0.6)
     ((setq y (- x 8 ))  
        (print "x=")
         (print x) 
            (print "    y=")    
                (print y) 
                    (printline ""))
                        ( setq x (+ x h))
)

Решение задачи: «Синтаксическая ошибка при табулировании функции»

textual
Листинг программы
(defun tab-fun (f a b n)
  (let ((x (+ a 0.0)) (h (divide (- b a) n)))
    (dotimes (i n 'ok)
      (prints " x=") (print x)
      (prints " y=") (printline (funcall f x))
      (setq x (+ x h))))) 
 
==> TAB-FUN
 
(tab-fun (lambda (x) (* x x)) 0 10 20) 
 
 x=0.0 y=0
 x=0.5 y=0.25
 x=1.0 y=1.0
 x=1.5 y=2.25
 x=2.0 y=4.0
 x=2.5 y=6.25
 x=3.0 y=9.0
 x=3.5 y=12.25
 x=4.0 y=16.0
 x=4.5 y=20.25
 x=5.0 y=25.0
 x=5.5 y=30.25
 x=6.0 y=36.0
 x=6.5 y=42.25
 x=7.0 y=49.0
 x=7.5 y=56.25
 x=8.0 y=64.0
 x=8.5 y=72.25
 x=9.0 y=81.0
 x=9.5 y=90.25
 
==> OK
 
(tab-fun 'sin 0 5 15)
 x=0.0 y=0.0
 x=0.333333333333333 y=0.327194696796152
 x=0.666666666666666 y=0.618369803069736
 x=0.999999999999999 y=0.841470984807896
 x=1.33333333333333 y=0.971937901363312
 x=1.66666666666666 y=0.995407957751766
 x=1.99999999999999 y=0.909297426825686
 x=2.33333333333332 y=0.723085881738334
 x=2.66666666666665 y=0.457272626635827
 x=2.99999999999998 y=0.141120008059887
 x=3.33333333333331 y=-0.190567962875462
 x=3.66666666666664 y=-0.501277048588322
 x=3.99999999999997 y=-0.756802495307909
 x=4.3333333333333 y=-0.92901450127075
 x=4.66666666666663 y=-0.998954917097927
 
==> OK

Оцени полезность:

12   голосов , оценка 3.917 из 5