Changeset 39677 in project
- Timestamp:
- 03/12/21 16:48:38 (6 weeks ago)
- Location:
- release/5/srfi-45/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
release/5/srfi-45/trunk/srfi-45.egg
r39675 r39677 2 2 3 3 ((synopsis "SRFI-45: Primitives for Expressing Iterative Lazy Algorithms") 4 (version "4.0. 2")4 (version "4.0.3") 5 5 (category lang-exts) 6 6 (author "André van Tonder, for Chicken 4 by Kon Lovett, for Chicken 5 by [[Sergey Goldgaber]]") 7 7 (maintainer "Kon Lovett") 8 8 (dependencies check-errors) 9 (test-dependencies test)10 9 (license "BSD") 11 10 (components -
release/5/srfi-45/trunk/tests/run.scm
r39670 r39677 6 6 7 7 (define EGG-NAME "srfi-45") 8 9 ;! no -strict-types 4 srfi-45 ! 10 ;no -disable-interrupts or -no-lambda-info 11 (define *csc-options* "-inline-global -local -inline \ 12 -specialize -optimize-leaf-routines -clustering -lfa2 \ 13 -no-trace -unsafe") 8 ;rebinding by tests 9 (define *csc-remv-options* '(-strict-types)) 14 10 15 11 ;chicken-install invokes as "<csi> -s run.scm <eggnam> <eggdir>" … … 23 19 (import (only (chicken irregex) irregex irregex-match?)) 24 20 21 (define (remq obj ls) 22 (let loop ((curr ls) (prev '())) 23 (cond 24 ((null? curr) 25 ls ) 26 ((eq? obj (car curr)) 27 (if (null? prev) 28 (cdr ls) 29 (begin 30 (set-cdr! prev (cdr curr)) 31 ls ) ) ) 32 (else 33 (loop (cdr curr) curr) ) ) ) ) 34 35 (define (remqs os ls) 36 (let loop ((ls ls) (os os)) 37 (cond 38 ((null? os) 39 ls ) 40 (else 41 (loop (remq (car os) ls) (cdr os)) ) ) ) ) 42 25 43 (define *args* (argv)) 26 44 … … 32 50 (error 'run "cannot determine egg-name") ) ) ) 33 51 52 (define (as-csc-options ls) 53 (apply string-append (intersperse (map symbol->string ls) " ")) ) 54 34 55 (define *current-directory* (cond-expand (unix "./") (else #f))) 35 56 (define *egg* (egg-name *args*)) 57 58 ;no -disable-interrupts or -no-lambda-info 59 (define *csc-init-options* '(-inline-global -local -inline 60 -specialize -optimize-leaf-routines -clustering -lfa2 61 -no-trace -unsafe -strict-types)) 62 63 (define *csc-options* (as-csc-options (remqs *csc-remv-options* *csc-init-options*))) 36 64 37 65 (define *test-files-rx* (irregex '(: (+ graph) #\- "test" #\. "scm"))) -
release/5/srfi-45/trunk/tests/srfi-45-test.scm
r39675 r39677 17 17 (begin 18 18 (print "+++ Bounded Space Test: (force " '?expr ") +++") 19 ( force ?expr) ) ) ) )19 (time (force ?expr)) ) ) ) ) 20 20 21 21 (define-syntax -bounded-space … … 33 33 (print "+++ Should print 'hi 1 +++") 34 34 35 (time 35 36 (define r (r5rs:delay (begin (display 'hi) (display #\space) 1))) 36 37 (define s (lazy r)) 37 38 (define t (lazy s)) 38 39 (print (force t)) 40 ) 39 41 40 42 ;========================================================================= … … 43 45 (print "+++ Should print '(1 2 3) +++") 44 46 47 (time 45 48 (define r (delay (values 1 2 3))) 46 49 (define s (lazy r)) 47 50 (define t (lazy s)) 48 51 (print (receive (force t))) 52 ) 49 53 50 54 ;========================================================================= … … 55 59 (define s (delay (begin (print 'hello) 1))) 56 60 61 (time 57 62 (force s) 58 63 (force s) 64 ) 59 65 60 66 ;========================================================================= … … 63 69 (print "+++ Should print 'bonjour once +++") 64 70 71 (time 65 72 (let ((s (delay (begin (print 'bonjour) 2)))) 66 73 (+ (force s) (force s))) 74 ) 67 75 68 76 ;========================================================================= … … 75 83 (define t (lazy s)) 76 84 85 (time 77 86 (force t) 78 87 (force r) 88 ) 79 89 80 90 ;========================================================================= … … 94 104 (define s (ones)) 95 105 106 (time 96 107 (car (force (stream-drop s 4))) 97 108 (car (force (stream-drop s 4))) 109 ) 98 110 99 111 ;========================================================================= … … 109 121 (force p))))) 110 122 (define x 5) 123 124 (time 111 125 (print (force p)) 112 126 (set! x 10) 113 127 (print (force p)) 114 128 ) 115 129 116 130 ;========================================================================= … … 126 140 (force f)))))) 127 141 142 (time 128 143 (print (force f)) 144 ) 129 145 130 146 ;========================================================================= … … 147 163 (define p (cadr q)) 148 164 165 (time 149 166 (print (get-count)) 150 167 (print (force p)) 151 168 (print (get-count)) 169 ) 152 170 153 171 ;=========================================================================
Note: See TracChangeset
for help on using the changeset viewer.