lisp 如何实现双循环

在使用lsp时第一个循环可以正常运行,第二个循环无法运行,最后的成果应该是类似干字的半边的图形
(defun c:cxx()
  (setq h (getreal "主管长="))
  (setq l (getreal "支管长="))
  (setq x (getint "支管数为:"))
  (setq y (getint "节点数为:"))
  (setq p0 (getpoint "输入起始点: "))
  (setq p1(polar p0 (* 0.5 pi) h))
  (command "line" p0 p1 )
  (repeat x 
    (command
      (setq p1(polar p1 (* 0.5 pi) h))
        
      )
    )
       (setq p3 (entget  p1))
       (setq p2(polar p3  (* 2 pi) l))
       (command "line" p3 p2) 
       (repeat y
         (command
            (setq p2 (polar p2 (* 2 pi) l))
      )
    )
  )