>From 5038a5456fc0be471df92e590d5c788617302ad7 Mon Sep 17 00:00:00 2001 From: Peter Bex Date: Mon, 24 Sep 2012 21:09:15 +0200 Subject: [PATCH] Wrap remaining 'bare lambda' macro transformers in er-macro-transformer calls, to prevent future breakage when this deprecated feature is actually removed --- srfi-13.scm | 35 ++++++++++++++++++----------------- srfi-69.scm | 27 ++++++++++++++------------- tests/module-tests.scm | 5 +++-- 3 files changed, 35 insertions(+), 32 deletions(-) diff --git a/srfi-13.scm b/srfi-13.scm index 3dbc2ca..7b16153 100644 --- a/srfi-13.scm +++ b/srfi-13.scm @@ -150,23 +150,24 @@ . body) ) ) ) ) ) (define-syntax let-string-start+end - (lambda (form r c) - (##sys#check-syntax 'let-string-start+end form '(_ _ _ _ _ . _)) - (let ((s-e-r (cadr form)) - (proc (caddr form)) - (s-exp (cadddr form)) - (args-exp (car (cddddr form))) - (body (cdr (cddddr form))) - (%receive (r 'receive)) - (%string-parse-start+end (r 'string-parse-start+end)) - (%string-parse-final-start+end (r 'string-parse-final-start+end))) - (if (pair? (cddr s-e-r)) - `(,%receive (,(caddr s-e-r) ,(car s-e-r) ,(cadr s-e-r)) - (,%string-parse-start+end ,proc ,s-exp ,args-exp) - ,@body) - `(,%receive ,s-e-r - (,%string-parse-final-start+end ,proc ,s-exp ,args-exp) - ,@body) ) ))) + (er-macro-transformer + (lambda (form r c) + (##sys#check-syntax 'let-string-start+end form '(_ _ _ _ _ . _)) + (let ((s-e-r (cadr form)) + (proc (caddr form)) + (s-exp (cadddr form)) + (args-exp (car (cddddr form))) + (body (cdr (cddddr form))) + (%receive (r 'receive)) + (%string-parse-start+end (r 'string-parse-start+end)) + (%string-parse-final-start+end (r 'string-parse-final-start+end))) + (if (pair? (cddr s-e-r)) + `(,%receive (,(caddr s-e-r) ,(car s-e-r) ,(cadr s-e-r)) + (,%string-parse-start+end ,proc ,s-exp ,args-exp) + ,@body) + `(,%receive ,s-e-r + (,%string-parse-final-start+end ,proc ,s-exp ,args-exp) + ,@body) ) )))) ;;; Returns three values: rest start end diff --git a/srfi-69.scm b/srfi-69.scm index 9fba35e..a36ec89 100644 --- a/srfi-69.scm +++ b/srfi-69.scm @@ -125,19 +125,20 @@ (define-constant flonum-magic 331804471) (define-syntax $flonum-hash - (lambda (form r c) - (let ( (flo (cadr form)) - (_%subbyte (r '%subbyte)) - (_flonum-magic (r 'flonum-magic)) - (_fx+ (r 'fx+)) - (_fx* (r 'fx*)) - (_fxshl (r 'fxshl)) ) - `(,_fx* ,_flonum-magic - ,(let loop ( (idx (fx- (##sys#size 1.0) 1)) ) - (if (fx= 0 idx) - `(,_%subbyte ,flo 0) - `(,_fx+ (,_%subbyte ,flo ,idx) - (,_fxshl ,(loop (fx- idx 1)) 1)) ) ) ) ) ) ) + (er-macro-transformer + (lambda (form r c) + (let ( (flo (cadr form)) + (_%subbyte (r '%subbyte)) + (_flonum-magic (r 'flonum-magic)) + (_fx+ (r 'fx+)) + (_fx* (r 'fx*)) + (_fxshl (r 'fxshl)) ) + `(,_fx* ,_flonum-magic + ,(let loop ( (idx (fx- (##sys#size 1.0) 1)) ) + (if (fx= 0 idx) + `(,_%subbyte ,flo 0) + `(,_fx+ (,_%subbyte ,flo ,idx) + (,_fxshl ,(loop (fx- idx 1)) 1)) ) ) ) ) )) ) (define (##sys#number-hash-hook obj rnd) (*equal?-hash obj rnd) ) diff --git a/tests/module-tests.scm b/tests/module-tests.scm index 928046a..6d7bd1c 100644 --- a/tests/module-tests.scm +++ b/tests/module-tests.scm @@ -281,8 +281,9 @@ (module m29 * (import chicken scheme) (define-syntax m29-baz - (lambda _ - ''foo))) + (er-macro-transformer + (lambda _ + ''foo)))) (module m30 * (import chicken scheme) -- 1.7.9.1