Guest User

Untitled

a guest
May 18th, 2013
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.84 KB | None | 0 0
  1. (* 3 4)                 ; equivalent to pseudo-code *(3, 4).
  2.                         ; Symbol '*' is a function
  3.                         ; 3 and 4 are its parameters.
  4.                         ; Returns 12.
  5. (times-two 5)           ; returns 10
  6. (3 4)                   ; error: 3 is not a function
  7. (times-two)              ; error, times-two expects one parameter
  8. (times-two 3 4)          ; error, times-two expects one parameter
  9. (set + -)               ; sets symbol '+' to be equal to whatever symbol '-'
  10.                         ; equals to, which is a minus function
  11. (+ 5 4)                 ; returns 1 since symbol '+' is now equal
  12.                         ; to the minus function
  13. (* 3 (* 2 2))           ; multiplies 3 by the second parameter
  14.                         ; (which is a function call that returns 4).
  15.                         ; Returns 12.
Advertisement
Add Comment
Please, Sign In to add comment