小编J O*_*tiz的帖子

如何在Loop for Common Lisp中正确编写这个条件?

(defun lista-n (a b c)   
  (loop repeat 10
        for x = (+ a c) then (+ x c)                            
                             (while (/= x a) 
                                    do (if (> x b) 
                                       (- x b))   ;then               
                             collect x))
Run Code Online (Sandbox Code Playgroud)

我是Common Lisp的新手,我需要知道哪个是这个Loop的正确语法.

我希望能够获得一个循环列表,如(lista-n 0 5 2)=>(0 2 4 1 3 5)

0到5之间的列表2.如果Number> 5则为Number - 5.

loops common-lisp while-loop

2
推荐指数
1
解决办法
177
查看次数

标签 统计

common-lisp ×1

loops ×1

while-loop ×1