I've put together a higher order function that in certain cases calls a function parameter, but it seems to have different effects depending on the function. I was able to reproduce the same behaviour just with a simple function:
(defn foo [f a b] (f a b))
For "normal" functions it works fine:
user=> (foo list 2 3)
(2 3)
user=> (foo cons 1 '(2 3))
(1 2 3)
user=> (foo println 2 3)
2 3
nil
But for operators, it does not, it just seems to return the last element:
user=> (foo '+ 2 3)
3
user=> (foo '* 2 3)
3
user=> (foo '- 2 3)
3
Why is this the case?
('+ {'+ 2})returns 2.