RosettaCodeData/Task/Repeat/XLISP/repeat.l

8 lines
155 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
(defun repeat (f n)
(f)
(if (> n 1)
(repeat f (- n 1)) ) )
;; an example to test it:
(repeat (lambda () (print '(hello rosetta code))) 5)