param.scm 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. ;;; Ported from Scheme 48 1.9. See file COPYING for notices and license.
  2. ;;;
  3. ;;; Port Author: Andrew Whatson
  4. ;;;
  5. ;;; Original Authors: Richard Kelsey
  6. ;;;
  7. ;;; scheme48-1.9.2/ps-compiler/param.scm
  8. ;;;
  9. ;;; Parameterizing the compiler.
  10. (define-module (ps-compiler param)
  11. #:export (lookup-primop
  12. lookup-imported-variable
  13. type/unknown
  14. type-eq?
  15. lambda-node-type
  16. true-value
  17. false-value
  18. determine-lambda-protocol
  19. determine-continuation-protocol
  20. set-compiler-parameter!))
  21. (define lookup-primop 'unset-compiler-parameter)
  22. (define lookup-imported-variable 'unset-compiler-parameter)
  23. (define type/unknown 'unset-compiler-parameter)
  24. (define type-eq? 'unset-compiler-parameter)
  25. (define lambda-node-type 'unset-compiler-parameter)
  26. (define true-value 'unset-compiler-parameter)
  27. (define false-value 'unset-compiler-parameter)
  28. (define determine-lambda-protocol 'unset-compiler-parameter)
  29. (define determine-continuation-protocol 'unset-compiler-parameter)
  30. (define (set-compiler-parameter! name value)
  31. (case name
  32. ((lookup-primop)
  33. (set! lookup-primop value))
  34. ((lookup-imported-variable)
  35. (set! lookup-imported-variable value))
  36. ((type/unknown)
  37. (set! type/unknown value))
  38. ((type-eq?)
  39. (set! type-eq? value))
  40. ((lambda-node-type)
  41. (set! lambda-node-type value))
  42. ((true-value)
  43. (set! true-value value))
  44. ((false-value)
  45. (set! false-value value))
  46. ((determine-lambda-protocol)
  47. (set! determine-lambda-protocol value))
  48. ((determine-continuation-protocol)
  49. (set! determine-continuation-protocol value))
  50. (else
  51. (error "unknown compiler parameter ~S ~S" name value))))