reinitializer.scm 640 B

1234567891011121314151617181920212223242526
  1. ; Copyright (c) 1993-2007 by Richard Kelsey and Jonathan Rees. See file COPYING.
  2. ; A record type whose only purpose is to run some code when we start up an
  3. ; image.
  4. (define-record-type reinitializer :reinitializer
  5. (make-reinitializer thunk)
  6. reinitializer?
  7. (thunk reinitializer-thunk))
  8. (define-record-discloser :reinitializer
  9. (lambda (r)
  10. (list 'reinitializer (reinitializer-thunk r))))
  11. (define-record-resumer :reinitializer
  12. (lambda (r)
  13. ((reinitializer-thunk r))))
  14. (define-syntax define-reinitializer
  15. (syntax-rules ()
  16. ((define-reinitializer name thunk)
  17. (define name
  18. (make-reinitializer thunk)))))