From: Chris Hanson Date: Sat, 17 Mar 2018 23:42:40 +0000 (-0700) Subject: Streamline definition of record-type proxies. X-Git-Tag: mit-scheme-pucked-x11-0.3.1~7^2~203 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=e2e7c9ef98dcad52937bccfc596fd10c38e06980;p=mit-scheme.git Streamline definition of record-type proxies. --- diff --git a/src/runtime/record.scm b/src/runtime/record.scm index 7fa99276f..c8fa6810b 100644 --- a/src/runtime/record.scm +++ b/src/runtime/record.scm @@ -231,8 +231,18 @@ USA. (set! %proxied-record-types (fixed-objects-item 'proxied-record-types)) unspecific)) -(define record-type-proxy:pathname (%index->record-type-proxy 0)) -(define record-type-proxy:host (%index->record-type-proxy 1)) +(let-syntax + ((enumerate-proxies + (sc-macro-transformer + (lambda (form use-env) + (syntax-check '(_ * symbol) form) + `(begin + ,@(map (lambda (name index) + `(define ,(symbol 'record-type-proxy: name) + (%index->record-type-proxy ,index))) + (cdr form) + (iota (length (cdr form))))))))) + (enumerate-proxies pathname host)) ;;;; Constructors