fork download
  1. (define (pair x y)
  2. (vector x y))
  3.  
  4. (define (fst v)
  5. (vector-ref v 0))
  6.  
  7. (define (snd v)
  8. (vector-ref v 1))
  9.  
  10. (define (f g p)
  11. (pair (g (fst p))
  12. (g (snd p))))
  13.  
  14. (define (show x)
  15. (with-output-to-string
  16. (lambda () (write x))))
  17.  
  18. (write (f show (pair 1 #\a)))
  19. (newline)
Success #stdin #stdout 0s 7268KB
stdin
Standard input is empty
stdout
#("1" "#\\a")