Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (* 3 4) ; equivalent to pseudo-code *(3, 4).
- ; Symbol '*' is a function
- ; 3 and 4 are its parameters.
- ; Returns 12.
- (times-two 5) ; returns 10
- (3 4) ; error: 3 is not a function
- (times-two) ; error, times-two expects one parameter
- (times-two 3 4) ; error, times-two expects one parameter
- (set + -) ; sets symbol '+' to be equal to whatever symbol '-'
- ; equals to, which is a minus function
- (+ 5 4) ; returns 1 since symbol '+' is now equal
- ; to the minus function
- (* 3 (* 2 2)) ; multiplies 3 by the second parameter
- ; (which is a function call that returns 4).
- ; Returns 12.
Advertisement
Add Comment
Please, Sign In to add comment