transform4.scm 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. ;;; Ported from Scheme 48 1.9. See file COPYING for notices and license.
  2. ;;;
  3. ;;; Port Author: Andrew Whatson
  4. ;;;
  5. ;;; Original Authors: Mike Sperber
  6. ;;;
  7. ;;; scheme48-1.9.2/scheme/rts/low-syntax.scm
  8. ;;;
  9. ;;; Low-level support for different kinds of syntax transformers
  10. ;;;
  11. ;;; We just use a vector with a tag in slot 0. (Can't be a pair,
  12. ;;; because syntax transformers may be pairs of transformer and aux
  13. ;;; names.)
  14. ;;;
  15. ;;; 4-argument version of explicit-renaming transformers
  16. ;;; (expression name? rename compare)
  17. (define-module (prescheme bcomp transform4)
  18. #:export (make-explicit-renaming-transformer/4
  19. explicit-renaming-transformer/4?
  20. explicit-renaming-transformer/4-proc))
  21. (define (make-explicit-renaming-transformer/4 proc)
  22. (vector 'explicit-renaming-transformer/4 proc))
  23. (define (explicit-renaming-transformer/4? thing)
  24. (and (vector? thing)
  25. (= 2 (vector-length thing))
  26. (eq? 'explicit-renaming-transformer/4 (vector-ref thing 0))))
  27. (define (explicit-renaming-transformer/4-proc thing)
  28. (vector-ref thing 1))