Say there is a function F. I want to pass a list of functions as an argument into function F.
Function F would go through each function in the list one by one and apply each one to two integers: x and y respectively.
For example, if the list = (plus, minus, plus, divide, times, plus) and x = 6
and y = 2
, the output would look like this:
8 4 8 3 12 8
How do I implement this in common Lisp?
There are many possibilities.
And so on.
The first two are readable, the third one is probably how a rookie in a first Lisp course would do it, the fourth one is still the rookie, after he heard about tail call optimization, the fifth one is written by an under cover Haskeller.