PasteRack.org
Paste # 9084
2014-01-10 23:23:20

Fork as a new paste.

Paste viewed 316 times.


Embed:

  1. #lang racket
  2.  
  3. (module lib racket
  4. (provide print-connection)
  5.  
  6. (define dummy-connection 0)
  7. (define dbc (make-parameter dummy-connection))
  8.  
  9. (define (print-connection)
  10. (display (dbc)))
  11. )
  12.  
  13. (require 'lib)
  14.  
  15. (define mysql-connection 1)
  16. (define dbc (make-parameter mysql-connection))
  17.  
  18. (parameterize ([dbc mysql-connection])
  19.  
  20. (print-connection)) ; prints 0; I need 1

=>

0