-
-
Save kEND/189657 to your computer and use it in GitHub Desktop.
Exercise 1.4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (a-plus-abs-b a b) | |
((if (> b 0) + -) a b) | |
b is evaluated to be greater than zero or not | |
based on that evaluation the + or - operator is selected | |
and used to add a and b if b is positive or subtract b from a if b is negative |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment