From e2e7c9ef98dcad52937bccfc596fd10c38e06980 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 17 Mar 2018 16:42:40 -0700 Subject: [PATCH] Streamline definition of record-type proxies. --- src/runtime/record.scm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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 -- 2.25.1