Changeset 37352 in project for release/5/bindings/tags/1.5
- Timestamp:
- 03/06/19 11:48:43 (23 months ago)
- Location:
- release/5/bindings/tags/1.5
- Files:
-
- 4 copied
Legend:
- Unmodified
- Added
- Removed
-
release/5/bindings/tags/1.5/bindings.egg
r37331 r37352 5 5 (test-dependencies simple-tests) 6 6 (author "Juergen Lorenz") 7 (version "1. 4")7 (version "1.5") 8 8 (components (extension bindings))) -
release/5/bindings/tags/1.5/bindings.scm
r37331 r37352 82 82 bind-case-lambda* bind-named bind-let bind-let* bind-letrec bindrec 83 83 bindable? bind-define bind-set! bind/cc bindings bind-seq-db 84 85 bind-pseudo-list?)84 bind-seq-ref bind-seq-tail bind-seq-null? bind-seq-exception 85 bind-pseudo-list? eos) 86 86 87 87 (import scheme 88 88 (only (chicken base) 89 89 case-lambda receive error assert define-inline 90 subvector chop print )90 subvector chop print gensym) 91 91 (only (chicken condition) condition-case) 92 92 (only (chicken fixnum) fx+ fx- fx= fx>=) … … 96 96 (only (chicken keyword) keyword?)) 97 97 98 ;;; needed in lazy-pairs 99 (define eos (gensym 'eos)) 100 98 101 ;;; exceptions 99 102 ;;; ---------- … … 111 114 112 115 ;;; (bind-seq-ref seq k) 113 ;;; --------------- 116 ;;; -------------------- 114 117 ;;; access to a sequence item 115 118 ;;; the second returned value is needed in bind-seq-null? … … 126 129 127 130 ;;; (bind-seq-tail seq k) 128 ;;; ---------------- 131 ;;; --------------------- 129 132 ;;; access to the tail of a sequence 130 133 (define (bind-seq-tail seq k) … … 138 141 139 142 ;;; (bind-seq-null? seq) 140 ;;; --------------- 143 ;;; -------------------- 141 144 ;;; tests for emptiness of a sequence 142 145 (define (bind-seq-null? seq) … … 144 147 (condition-case (bind-seq-ref seq 0) 145 148 ((exn) (values #t #t))) 146 (if out-of-bounds? #t #f))) 149 ;(if out-of-bounds? #t #f))) 150 (cond 151 ((eq? #t result) ; exn 152 (if out-of-bounds? #t #f)) 153 ((and (symbol? result) (eq? result eos)) ; gensym, lazy-list 154 #t) 155 (else #f) 156 ))) 157 147 158 148 159 ;;; (bind-seq-db type? ref: ref tail: tail) 149 ;;; --------------------------------- 160 ;;; --------------------------------------- 150 161 ;;; adds a new sequence type to the front of the database 151 162 ;;; (bind-seq-db) 152 ;;; -------- 163 ;;; ------------- 153 164 ;;; shows the sequence database 154 165 (define bind-seq-db … … 335 346 tails))) 336 347 ;((atom? item) ; literal 337 348 ((and (not (pair? item)) (not (null? item))) 338 349 (loop (+ k 1) 339 350 pairs … … 343 354 tails)) 344 355 ;((pair? item) 345 356 ((or (null? item) (pair? item)) 346 357 (receive (ps ls ts) 347 358 (destructure item `(,%bind-seq-ref ,seq ,k)) … … 407 418 ; (cons pat 408 419 ; (cons %seq body))))))))) 409 420 ,(apply list %bind-with %let pat %seq body)))))) 410 421 411 422 #|[
Note: See TracChangeset
for help on using the changeset viewer.