Apply a callback to an array: Difference between revisions

Added implementation for 'fe' language
(Added implementation for 'fe' language)
Line 1,328:
----------------------------------------
Press any key to continue...</pre>
 
=={{header|Fe}}==
<syntaxhighlight lang="clojure">
(= map (fn (f lst)
(let res (cons nil nil))
(let tail res)
(while lst
(setcdr tail (cons (f (car lst)) nil))
(= lst (cdr lst))
(= tail (cdr tail)))
(cdr res)))
 
(print (map (fn (x) (* x x)) '(1 2 3 4 5 6 7 8 9 10)))
</syntaxhighlight>
 
=={{header|Forth}}==
18

edits