I want to map a function, (lambda (x) (+ x 1)), to a dotted pair '(1 . 2), to get another dotted pair, '(2 . 3). I have tested the below code to no avail:
(defun mapdot (func coll)
((funcall func (car coll)) . (funcall func (cdr coll))))
ELISP> (mapdot (lambda (x) (+ x 1)) '(1 . 2))
*** Eval error *** Invalid function: (funcall func (car coll))
How can I achieve such behavior?