RosettaCodeData/Task/Apply-a-callback-to-an-array/ACL2/apply-a-callback-to-an-array.acl2

9 lines
164 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
(defun apply-to-each (xs)
(if (endp xs)
nil
(cons (fn-to-apply (first xs))
(sq-each (rest xs)))))
(defun fn-to-apply (x)
(* x x))