;;; -*- Mode: Scheme -*- ;;;; Variant Record Types ;;; This code is written by Taylor Campbell and placed in the Public ;;; Domain. All warranties are disclaimed. ;;; This is compatible with TRC's analogous facility for Scheme48, at ;;; . ;;; ;;; This file relies on TRC's integer enumeration facility for MIT ;;; Scheme, at . ;;; This file also requires a patch to MIT Scheme's syntactic closures ;;; facility to fix a bug; evaluate this definition in the (RUNTIME ;;; SYNTACTIC-CLOSURES) environment: ;;; ;;; (define (syntactic-binding-theory environment name item history) ;;; (if (not (keyword-item? item)) ;;; (let ((history (item/history item))) ;;; (syntax-error history ;;; "Syntactic binding value must be a keyword:" ;;; (history/original-form history)))) ;;; (syntactic-environment/define environment name ;;; (item/new-history item #f)) ;;; (if (and (keyword-value-item? item) ;;; (syntactic-environment/top-level? environment)) ;;; (make-binding-item history ;;; ;** This was just NAME before. ;;; (rename-top-level-identifier name) ;;; item) ;;; (make-null-binding-item history))) ;;; ;;; Learn by example because I'm too lazy to document: ;;; ;;; (define-variant-type option