diff --git a/lib/scheme/base.sld b/lib/scheme/base.sld index 9046c826..34b2fe37 100644 --- a/lib/scheme/base.sld +++ b/lib/scheme/base.sld @@ -1,6 +1,8 @@ (define-library (scheme base) - (import (except (chibi) equal?) + (import (rename (except (chibi) equal?) + (let-syntax let-syntax/splicing) + (letrec-syntax letrec-syntax/splicing)) (rename (chibi equiv) (equiv? equal?)) (only (chibi string) string-map string-for-each) (chibi io) diff --git a/lib/scheme/misc-macros.scm b/lib/scheme/misc-macros.scm index aaddccc4..6f371fb1 100644 --- a/lib/scheme/misc-macros.scm +++ b/lib/scheme/misc-macros.scm @@ -1,4 +1,14 @@ +(define-syntax let-syntax + (syntax-rules () + ((let-syntax . x) + (let () (let-syntax/splicing . x))))) + +(define-syntax letrec-syntax + (syntax-rules () + ((letrec-syntax . x) + (let () (letrec-syntax/splicing . x))))) + (define-syntax when (syntax-rules () ((when test . body) diff --git a/tests/r7rs-tests.scm b/tests/r7rs-tests.scm index 66e1df38..513dab09 100644 --- a/tests/r7rs-tests.scm +++ b/tests/r7rs-tests.scm @@ -492,6 +492,13 @@ (test 'ok (let ((=> #f)) (cond (#t => 'ok)))) +(let () + (define x 1) + (let-syntax () + (define x 2) + #f) + (test 1 x)) + (test-end) (test-begin "5 Program structure")