aboutsummaryrefslogtreecommitdiff
path: root/module/srfi
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-03-01 02:55:27 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-03-01 02:55:27 +0100
commitcbf0cf6f61bbe3cd4a80b48ca3fa3135106e371e (patch)
treec47e0574a1270fd745beb2bf1dd83d2628dd9003 /module/srfi
parentAdd unit test for days-in-interval. (diff)
downloadcalp-cbf0cf6f61bbe3cd4a80b48ca3fa3135106e371e.tar.gz
calp-cbf0cf6f61bbe3cd4a80b48ca3fa3135106e371e.tar.xz
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.
Diffstat (limited to 'module/srfi')
-rw-r--r--module/srfi/srfi-41/util.scm38
1 files changed, 1 insertions, 37 deletions
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))