From 3d5d6361c0c810d42307ca7819d5afc501f97633 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 25 Jul 2020 18:30:06 -0600 Subject: [PATCH] unbreak "record.ms" Support nested `include`s. original commit: 2ace5779126179a0624010d338c3e7b3a91896f4 --- mats/record.ms | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mats/record.ms b/mats/record.ms index dbfb1a6e72..c6acf9e8c9 100644 --- a/mats/record.ms +++ b/mats/record.ms @@ -728,10 +728,14 @@ (mat foreign-data (begin (module ($fd-unaligned-integers $fd-unaligned-floats) + (import (rename (only (chezscheme) include) [include orig-include])) (define-syntax define-constant (syntax-rules (machine-type) [(_ machine-type y) (begin)] [(_ x y) (define x y)])) + (define-syntax define-constant-default + (syntax-rules (machine-type) + [(_ x y) (begin)])) (define-syntax features (syntax-rules () [(_ x ...) (begin)])) @@ -751,7 +755,12 @@ ... [else (syntax-error const (format "unhandled value ~s" (constant const)))])])) - (include "../s/machine.def") + (define-syntax include + (lambda (stx) + (syntax-case stx () + [(k path) + #`(#,(datum->syntax #'k 'orig-include) #,(format "../s/~a" (datum path)))]))) + (include "machine.def") ; all this work for two constants: (define $fd-unaligned-integers (constant unaligned-integers)) (define $fd-unaligned-floats (constant unaligned-floats)))