Guest User

Untitled

a guest
Dec 14th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. (define (checkType . x)
  2. (cond
  3. [(vector? x) (display "x is a vector")]
  4. [(list? x) (display "x is a list")]
  5. [#t (newline)]
  6. ))
  7.  
  8. > (checkType (make-vector 3 #(1 2 3)))
  9. x is a list
  10.  
  11. > (checkType (make-vector 3 #(1 2 3)))
  12. x is a list
  13.  
  14. > (vector? (make-vector 3 #(1 2 3)))
  15. #t
  16.  
  17. > (list? (make-vector 3 #(1 2 3)))
  18. #f
Add Comment
Please, Sign In to add comment