Name: Anonymous 2012-12-02 12:58
How do you do this shit /prog/?
Write a Scheme function evens-odds (using at least one abstract list function), which consumes a list of numbers lst and produces the difference between the sum of the odd numbers and the sum of the even numbers in the list lst. Some examples follow:
Note: You should use local function(s) only (in case of need).
Write a Scheme function evens-odds (using at least one abstract list function), which consumes a list of numbers lst and produces the difference between the sum of the odd numbers and the sum of the even numbers in the list lst. Some examples follow:
(evens-odds (list 1 2 3 4)) => -2
(evens-odds empty) => 0
(evens-odds (list 2 4 16)) => -22
(evens-odds (list 1 3 7 21 13)) => 45Note: You should use local function(s) only (in case of need).