I'm having trouble understanding the approach I need to take to fold over a list of functions and invoke them all with a particular argument.
Here is what I as assumed would work. I've tried various variations on it, using eval
etc. Any pointers?
(mapcar (lambda (fn) (fn 'utf-8))
(list #'set-terminal-coding-system
#'set-keyboard-coding-system
#'prefer-coding-system))
When I run this I just get "Symbol's function definition is void: fn".
EDIT | Ok, so this works, but it seems odd to need to use apply
when the above example passes the functions with the #'function-name
synax.
(mapcar (lambda (fn) (apply fn '(utf-8)))
'(set-terminal-coding-system
set-keyboard-coding-system
prefer-coding-system))