From cbf0cf6f61bbe3cd4a80b48ca3fa3135106e371e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hugo=20H=C3=B6rnquist?= Date: Tue, 1 Mar 2022 02:55:27 +0100 Subject: Remove with-stream macro. It was an extra (rather complicated) macro to support, which had 2 unresolved TODO:s, and made the resulting code hard to read since it wasn't immediately apparent which procedures where replaced by their stream counterparts. The only using code was rewritten using a threading macro, which is way more readable. --- module/srfi/srfi-41/util.scm | 38 +------------------------------------- 1 file changed, 1 insertion(+), 37 deletions(-) (limited to 'module/srfi/srfi-41') diff --git a/module/srfi/srfi-41/util.scm b/module/srfi/srfi-41/util.scm index 7c062003..9a172e2d 100644 --- a/module/srfi/srfi-41/util.scm +++ b/module/srfi/srfi-41/util.scm @@ -3,7 +3,7 @@ #:use-module (srfi srfi-41) #:use-module ((ice-9 sandbox) :select (call-with-time-limit)) #:use-module (hnh util) ; let*, find-min - #:export (stream-car+cdr interleave-streams with-streams + #:export (stream-car+cdr interleave-streams stream-timeslice-limit)) (define (stream-car+cdr stream) @@ -132,39 +132,3 @@ (stream-timeslice-limit (stream-cdr strm) timeslice))) (lambda _ stream-null))) -;; Evaluates @var{body} in a context where most list fundamentals are -;; replaced by stream alternatives. -;; commented defifinitions are items which could be included, but for -;; one reason or another isn't. -;; TODO Possibly give access to list-primitives under a list- prefix. -;; TODO since this macro is inhygienic it requires that (srfi srfi-41) -;; is included at the point of use. -(define-macro (with-streams . body) - `(let-syntax - ((cons (identifier-syntax stream-cons)) - (null? (identifier-syntax stream-null?)) - (pair? (identifier-syntax stream-pair?)) - (car (identifier-syntax stream-car)) - (cdr (identifier-syntax stream-cdr)) - ;; stream-lambda - ;; define-stream - (append (identifier-syntax stream-append)) - (concat (identifier-syntax stream-concat)) - ;; (const stream-constant) - (drop (identifier-syntax stream-drop)) - (drop-while (identifier-syntax stream-drop-while)) - (filter (identifier-syntax stream-filter)) - (fold (identifier-syntax stream-fold)) - (for-each (identifier-syntax stream-for-each)) - (length (identifier-syntax stream-length)) - ;; stream-let - (map (identifier-syntax stream-map)) - ;; stream-match - ;; stream-range - ;; stream-ref - (reverse (identifier-syntax stream-reverse)) - ;; stream-scan - (take (identifier-syntax stream-take)) - (take-while (identifier-syntax stream-take-while)) - (zip (identifier-syntax stream-zip))) - ,@body)) -- cgit v1.2.3