(else
(ill-formed-syntax form))))))
+(define-syntax :circular-stream
+ (er-macro-transformer
+ (lambda (form rename compare)
+ compare ;ignore
+ (syntax-check '(KEYWORD EXPRESSION * EXPRESSION) form)
+ (let ((self (make-synthetic-identifier 'SELF)))
+ `(,(rename 'LETREC) ((,self (,(rename 'CONS-STREAM*)
+ ,@(cdr form)
+ ,self)))
+ ,self)))))
+
(define-syntax :cons-stream
(er-macro-transformer
(lambda (form rename compare)
(syntax-check '(KEYWORD EXPRESSION EXPRESSION) form)
`(,(rename 'CONS) ,(cadr form)
(,(rename 'DELAY) ,(caddr form))))))
+
+(define-syntax :cons-stream*
+ (er-macro-transformer
+ (lambda (form rename compare)
+ compare ;ignore
+ (cond ((syntax-match? '(EXPRESSION EXPRESSION) (cdr form))
+ `(,(rename 'CONS-STREAM) ,(cadr form) ,(caddr form)))
+ ((syntax-match? '(EXPRESSION * EXPRESSION) (cdr form))
+ `(,(rename 'CONS-STREAM) ,(cadr form)
+ (,(rename 'CONS-STREAM*) ,@(cddr form))))
+ (else
+ (ill-formed-syntax form))))))
\f
(define-syntax :define-integrable
(er-macro-transformer
(assert :assert)
(begin0 :begin0)
(case :case)
+ (circular-stream :circular-stream)
(cond :cond)
(cond-expand :cond-expand)
(cons-stream :cons-stream)
+ (cons-stream* :cons-stream*)
(define :define)
(define-integrable :define-integrable)
(define-record-type :define-record-type)