template.scm 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. ; -*- Mode: Scheme; Syntax: Scheme; Package: Scheme; -*-
  2. ; Copyright (c) 1993-2008 by Richard Kelsey and Jonathan Rees. See file COPYING.
  3. ; Somewhat redundant with vm/istruct.scm. Fix this some day.
  4. ; Templates
  5. ; Templates are made only by the compiler.
  6. ;(define make-template make-vector)
  7. ;(define (template? obj)
  8. ; (and (vector? obj)
  9. ; (>= (vector-length obj) template-overhead)
  10. ; (code-vector? (template-code obj))
  11. ; ))
  12. ;(define template-length vector-length)
  13. ;(define template-ref vector-ref)
  14. ;(define template-set! vector-set!)
  15. (define template-overhead 4)
  16. (define (template-code tem) (template-ref tem 0))
  17. (define (template-byte-code tem) (template-ref tem 1))
  18. (define (template-info tem) (template-ref tem 2))
  19. (define (template-package-id tem) (template-ref tem 3))
  20. (define (set-template-code! tem cv) (template-set! tem 0 cv))
  21. (define (set-template-byte-code! tem cv) (template-set! tem 1 cv))
  22. (define (set-template-info! tem info) (template-set! tem 2 info))
  23. (define (set-template-package-id! tem id) (template-set! tem 3 id))