Skip to content

Instantly share code, notes, and snippets.

@kEND
Forked from redsquirrel/gist:189193
Created September 20, 2009 01:22
Show Gist options
  • Save kEND/189657 to your computer and use it in GitHub Desktop.
Save kEND/189657 to your computer and use it in GitHub Desktop.
Exercise 1.4
(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