ajrcastro

Alternate Tests

Apr 22nd, 2012
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scheme 0.41 KB | None | 0 0
  1. ;Uncomment the following to test
  2. ;1
  3. ; expect 1
  4.  
  5. ;'(1 2)
  6. ; expect (1 2)
  7.  
  8. ;'(1 2 . 3)
  9. ; expect (1 2 . 3)
  10.  
  11. ;(define x 3)
  12.  
  13. ;x
  14. ; expect 3
  15.  
  16. ;(+ 1 2)
  17. ; expect 3
  18.  
  19. ;(+ 1 (- 6 2))
  20. ; expect 5
  21.  
  22. ;(lambda (x) (+ 1 2))
  23.  
  24. ;(define f (lambda (x) (+ x 3)))
  25.  
  26. ;(f 3)
  27. ;expect 6
  28.  
  29. ;(define foo (x) (set! z x) (* z x))
  30.  
  31. ;foo
  32.  
  33. ;Evaluation.check_formals(Pair(Symbol('x'), Pair(Number(9), NULL)))
  34. ; expect Error
Advertisement
Add Comment
Please, Sign In to add comment