-
Notifications
You must be signed in to change notification settings - Fork 0
/
lazy.scm
43 lines (29 loc) · 824 Bytes
/
lazy.scm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
;; The features implemented in lazy.lisp is available in Gauche as
;; util.stream. Here we only show the correspondence.
(use util.stream)
;; macro: lazy expr ...
;; == stream-delay (begin expr ...)
;; macro: lazy-cons a d
;; == stream-cons a d
;; function: lazy-car x
;; == stream-car x
;; function: lazy-cdr x
;; == stream-cdr x
;; function: lazy-nil
;; == (^[] stream-null)
;; function: lazy-null x
;; == stream-null? x
;; function: make-lazy lst
;; == list->stream lst
;; function: take n s
;; == stream->list (stream-take s n)
;; function: take-all s
;; == stream->list s
;; function: lazy-mapcar fun s
;; == stream-map fun s
;; function: lazy-mapcan fun s
;; == stream-concatenate (stream-map fun s)
;; function: lazy-find-if fun s
;; == stream-find fun s
;; function: lazy-nth n s
;; == stream-ref s n