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

2015-02-20 00:35:01 -05:00
(defun apply-to-each (xs)
2013-04-10 14:58:50 -07:00
(if (endp xs)
nil
2015-02-20 00:35:01 -05:00
(cons (fn-to-apply (first xs))
2013-04-10 14:58:50 -07:00
(sq-each (rest xs)))))
2015-02-20 00:35:01 -05:00
(defun fn-to-apply (x)
(* x x))